Compute shader not modifying 3d texture

前端 未结 1 1107
春和景丽
春和景丽 2021-01-04 22:00

I want to move the initialization of my 3D texture from the CPU to the GPU. As a test, I wrote a shader to set all voxels to a constant value, but the texture is not modifie

相关标签:
1条回答
  • 2021-01-04 22:28

    Ugh. So apparently a 3D texture has to be bound as layered, otherwise the shader isn't able to modify any uvw coordinate with w>0.

    glBindImageTexture(0, volume_tid, 0, /*layered=*/GL_TRUE, 0, GL_READ_WRITE, GL_R8);
    

    does the trick.

    0 讨论(0)
提交回复
热议问题