KalebDark / angleproject

Automatically exported from code.google.com/p/angleproject
Other
0 stars 0 forks source link

Application using a texture both a read-only depth/stencil and shader resource #894

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

I have an application which uses at the same time a texture as a shader 
resource and a framebuffer depth attachement with depth write disabled.

According to GL ES spec, this is a rendering feedback loop and the behaviour is 
undefined:
https://www.opengl.org/wiki/Framebuffer_Object#Feedback_Loops

On most hardware, this is fine as long as depth write are disabled.
In ANGLE, this does not work because DirectX doesn’t allow this behaviour 
unless the depth/stencil view has been created as read-only.

I wrote a patch which tries to handle this app behaviour by using a read-only 
depth/stencil view in d3d11 when depth write are disabled and the texture is 
also bound as a shader resource.

Is this something which could be merged into ANGLE even though it is an 
undefined behaviour?

Thanks

Original issue reported on code.google.com by Gregory....@imgtec.com on 23 Jan 2015 at 3:26

GoogleCodeExporter commented 9 years ago
We considered allowing this when we were dealing with the feedback loops in the 
past but decided against it because we didn't want anyone relying on this 
unspecified behavior. 

With our D3D9 backend, it was possible to bind the current color buffer as a 
sampler to read and write simultaneously but a lot of WebGL samples stopped 
working when our D3D11 backend became more popular because users started 
relying on the feedback loop working.  We had the WebGL spec amended and it now 
generates an error in this case. If possible, we'd like to keep the behaviour 
consistent between our renderers.

Original comment by geofflang@chromium.org on 23 Jan 2015 at 3:41

GoogleCodeExporter commented 9 years ago
Ok, thanks for the clarification.

Original comment by Gregory....@imgtec.com on 23 Jan 2015 at 3:44

GoogleCodeExporter commented 9 years ago

Original comment by geofflang@chromium.org on 3 Feb 2015 at 4:55