Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
textureSize是一个方便的函数,可以在着色器中获取纹理尺寸,而无需将它们作为制服手动传递。
图像单元是否有类似的 API ?
是的,它在 OpenGL 4.3 中:
imageSize()
ARB_shader_image_size
例子:
layout(rgba32f) uniform image2D myImage; ... ivec2 size = imageSize(myImage);