OpenGL: Why do square textures take less memory -


question: why same amount of pixels take dramatically less video memory if stored in square texture in long rectangular texture?

example: i'm creating 360 4x16384 size textures glteximage2d command. internal format gl_rgba. video memory: 1328 mb.

if i'm creating 360 256x256 textures same data, memory usage less 100mb.

using integrated intel hd4000 gpu.

it's not texture being rectangular. it's 1 of dimensions being extremely small.

in order select texels textures in optimal fashion, hardware employ what's known swizzling. general idea restructure bytes in texture pixels neighbor each other in 2 dimensions neighbors in memory too. doing requires texture of minimum size in both dimensions.

now, texture filtering hardware can ignore minimum size , fetch pixels within texture's actual size is. storage still there, taking space no useful purpose.

given you're seeing, there's chance intel's swizzling hardware has base minimum size of 32 or 64 pixels.

in opengl, there's not can detect incongruity other you've done here.


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -