pombreda / angleproject

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

Fix remaining issues with ES3 UBO support #507

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
UBOs still have a few issues for complete support:

 * inactive UBO members should be pruned from the active uniforms list
 * there's an open ticket on Khronos to see if we must support uniform buffer binding offsets
 * there's also an issue relating to if certain types of UBO are always considered active and are reporting in the active buffers list

shannon: sending to you, send back when you have more info.

Original issue reported on code.google.com by jmad...@chromium.org on 31 Oct 2013 at 3:35

GoogleCodeExporter commented 9 years ago
UBO offset bindings have been clarified as required on 3.1; whether this 
restriction will be applied to 3.0 is still a pending question.

Original comment by shannonw...@chromium.org on 16 Jun 2014 at 10:57

GoogleCodeExporter commented 9 years ago
The restriction is expected to be applied back to 3.0; see new language 
published in the 3.1 specification (Table 20.46, p397): 
http://www.khronos.org/registry/gles/specs/3.1/es_spec_3.1.withchanges.pdf

Original comment by shannonw...@chromium.org on 26 Jun 2014 at 3:16

GoogleCodeExporter commented 9 years ago
Fixing offsets is a reasonable amount of work for our current UBO 
implementation.

We currently use a pretty direct mapping from GL Buffers to D3D11 Constant 
Buffers. We use methods such as PSSetConstantBuffers to expose the constant 
buffers to the shader.

See 
http://msdn.microsoft.com/en-us/library/windows/desktop/ff476470(v=vs.85).aspx

There isn't a parameter for an offset until D3D 11.1:

http://msdn.microsoft.com/en-us/library/windows/desktop/hh404649(v=vs.85).aspx

Using D3D11.1 is certainly an option on Windows 7 and 8. Without D3D11.1, we'd 
have to use a less direct mapping from GL Buffers to D3D11 Constant Buffers, 
with a bit of magic/virtualization.

Some thoughts: One GL buffer could be split into several constant buffers. Or, 
we could map the buffer as a shader resource, and inside the shader decode the 
offsets. Or, we could prohibit the offsets in WebGL and simply report an error 
in ANGLE until we have time to re-investigate, as we do for other features we 
don't easily support.

Original comment by jmad...@chromium.org on 26 Jun 2014 at 3:45