Can a shader render to a texture, and at the same time read from the texture it writes to? Effectively, that shader would write to the texture in place. What about consistency of such data? Is there any synchronization?
Related:
- https://webgl2fundamentals.org/webgl/lessons/webgl-gpgpu.html
- https://webgl2fundamentals.org/webgl/lessons/webgl-framebuffers.html
- https://webgl2fundamentals.org/webgl/lessons/webgl-render-to-texture.html
- Fast textures ping-pong implementation on WebGL
1
In most shader programming contexts, including graphics APIs like OpenGL and DirectX, it is generally not allowed to read from and write to the same texture within a shader. This restriction is primarily due to hardware limitations and the way GPUs are designed to optimize memory access and parallel execution This is mostly because of stuff like Memory Conflicts.
pwn.guide is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.