thanpv-lifortevn / 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

GoogleCodeExporter commented 9 years ago
Hi,

I would like to implement UBO offsets for D3D11.
As Jamie said, we can split the GL buffer into multiple constant buffers.

In the class Buffer11, there is already a list of multiple BufferStorage11 to 
accommodate multiple usages. I can try to implement a read-only list of 
subranges for constant buffers in the same way. Since constant buffers are 
read-only, this seems straightforward to implement to me.

Original comment by Gregory....@imgtec.com on 23 Mar 2015 at 4:42

GoogleCodeExporter commented 9 years ago
Hey Gregory, we should use the new 11.1 APIs as a first line of attack. I can't 
quote numbers but there are a lot of D3D11 users who can use the 11.1 device we 
create in Renderer11. Does that sound reasonable? I think after that we could 
follow up with a more emulative approach for older configurations.

Original comment by jmad...@chromium.org on 23 Mar 2015 at 4:48

GoogleCodeExporter commented 9 years ago
https://chromium-review.googlesource.com/#/c/261874

Original comment by Gregory....@imgtec.com on 23 Mar 2015 at 7:56

GoogleCodeExporter commented 9 years ago
Project  : angle/angle
Branch   : master
Author   : Gregoire Payen de La Garanderie <Gregory.Payen@imgtec.com>
Committer: Geoff Lang <geofflang@chromium.org>
Commit   : 7159ea6778eb73c233736cc2fa59ae9177b75e4b

Code-Review  0 : Gregoire Payen de La Garanderie, Jamie Madill
Code-Review  +2: Geoff Lang
Verified     0 : Gregoire Payen de La Garanderie, Jamie Madill
Verified     +1: Geoff Lang
Commit Queue   : Chumped
Change-Id      : Icfc90ed64cf94b1bab2d4cc93a8fb5e11b28d666
Reviewed-at    : https://chromium-review.googlesource.com/261874

Add UBO offset support for D3D11.1.

Also fixes the uniform count upper limit in glGetActiveUniformsiv.

BUG=angleproject:507

src/libANGLE/Program.cpp
src/libANGLE/Program.h
src/libANGLE/State.cpp
src/libANGLE/State.h
src/libANGLE/renderer/ProgramImpl.h
src/libANGLE/renderer/d3d/ProgramD3D.cpp
src/libANGLE/renderer/d3d/ProgramD3D.h
src/libANGLE/renderer/d3d/RendererD3D.cpp
src/libANGLE/renderer/d3d/RendererD3D.h
src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp
src/libANGLE/renderer/d3d/d3d11/Renderer11.h
src/libANGLE/renderer/d3d/d3d11/renderer11_utils.cpp
src/libANGLE/renderer/d3d/d3d11/renderer11_utils.h
src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp
src/libANGLE/renderer/d3d/d3d9/Renderer9.h
src/libANGLE/renderer/gl/ProgramGL.cpp
src/libANGLE/renderer/gl/ProgramGL.h
src/libGLESv2/entry_points_gles_3_0.cpp
src/tests/angle_end2end_tests.gypi
src/tests/end2end_tests/UniformBufferTest.cpp
util/testfixturetypes.h

Original comment by bugdro...@chromium.org on 30 Mar 2015 at 7:50

GoogleCodeExporter commented 9 years ago
Project  : angle/angle
Branch   : master
Author   : Gregoire Payen de La Garanderie <Gregory.Payen@imgtec.com>
Committer: Geoff Lang <geofflang@chromium.org>
Commit   : 381f969315c0c70bacf183e58de7194f42486112

Code-Review  0 : Gregoire Payen de La Garanderie
Code-Review  +1: Jamie Madill
Code-Review  +2: Geoff Lang
Verified     0 : Geoff Lang, Jamie Madill
Verified     +1: Gregoire Payen de La Garanderie
Commit Queue   : Chumped
Change-Id      : I263b14df41d4e45a67304c1d145646398721cf0a
Reviewed-at    : https://chromium-review.googlesource.com/263412

Add UBO offset support for D3D11.1.

Also fixes the uniform count upper limit in glGetActiveUniformsiv,
as well as an assert hit with used but unbound uniform buffer.

BUG=angleproject:507
BUG=angleproject:962

src/libANGLE/Program.cpp
src/libANGLE/Program.h
src/libANGLE/State.cpp
src/libANGLE/State.h
src/libANGLE/renderer/ProgramImpl.h
src/libANGLE/renderer/d3d/ProgramD3D.cpp
src/libANGLE/renderer/d3d/ProgramD3D.h
src/libANGLE/renderer/d3d/RendererD3D.cpp
src/libANGLE/renderer/d3d/RendererD3D.h
src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp
src/libANGLE/renderer/d3d/d3d11/Renderer11.h
src/libANGLE/renderer/d3d/d3d11/renderer11_utils.cpp
src/libANGLE/renderer/d3d/d3d11/renderer11_utils.h
src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp
src/libANGLE/renderer/d3d/d3d9/Renderer9.h
src/libANGLE/renderer/gl/ProgramGL.cpp
src/libANGLE/renderer/gl/ProgramGL.h
src/libANGLE/validationES.cpp
src/libGLESv2/entry_points_gles_3_0.cpp
src/tests/angle_end2end_tests.gypi
src/tests/end2end_tests/UniformBufferTest.cpp
util/testfixturetypes.h

Original comment by bugdro...@chromium.org on 1 Apr 2015 at 5:34

GoogleCodeExporter commented 9 years ago
Project  : angle/angle
Branch   : master
Author   : Gregoire Payen de La Garanderie <Gregory.Payen@imgtec.com>
Committer: Geoff Lang <geofflang@chromium.org>
Commit   : 68694e994103e8d2c0fbef76506cf90fbf7f70d5

Code-Review  0 : Gregoire Payen de La Garanderie
Code-Review  +2: Geoff Lang
Verified     0 : Geoff Lang
Verified     +1: Gregoire Payen de La Garanderie
Commit Queue   : Chumped
Change-Id      : I096fe1c9b4f0f398f3a638cd8311278987dfb7dc
Reviewed-at    : https://chromium-review.googlesource.com/263404

Add UBO offset support for D3D11.1.

Also fixes the uniform count upper limit in glGetActiveUniformsiv,
as well as an assert hit with used but unbound uniform buffer.

BUG=angleproject:507
BUG=angleproject:962

src/libANGLE/Program.cpp
src/libANGLE/Program.h
src/libANGLE/State.cpp
src/libANGLE/State.h
src/libANGLE/renderer/ProgramImpl.h
src/libANGLE/renderer/d3d/ProgramD3D.cpp
src/libANGLE/renderer/d3d/ProgramD3D.h
src/libANGLE/renderer/d3d/RendererD3D.cpp
src/libANGLE/renderer/d3d/RendererD3D.h
src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp
src/libANGLE/renderer/d3d/d3d11/Renderer11.h
src/libANGLE/renderer/d3d/d3d11/renderer11_utils.cpp
src/libANGLE/renderer/d3d/d3d11/renderer11_utils.h
src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp
src/libANGLE/renderer/d3d/d3d9/Renderer9.h
src/libANGLE/renderer/gl/ProgramGL.cpp
src/libANGLE/renderer/gl/ProgramGL.h
src/libANGLE/validationES.cpp
src/libGLESv2/entry_points_gles_3_0.cpp
src/tests/angle_end2end_tests.gypi
src/tests/end2end_tests/UniformBufferTest.cpp
util/testfixturetypes.h

Original comment by bugdro...@chromium.org on 1 Apr 2015 at 6:53