Refactor BlockLayoutEncoder APIs for std430.
This splits HLSL SSBO access into two steps.
First we compute a mapping from the collected SSBO variable names to
TField pointers. Then during tree traversal we use a block encoding
visitor class that uses the shader names to store BlockMemberInfo
structures for the structures and variables. Each nested structure
is traversed separately so that the BlockMemberInfo offsets are
relative to the structure start rather than the enclosing block. The
array stride for a structure is the size of the struct after all the
alignment is included.
This gives the correct results for the SSBO access chain in the HLSL
code. It also will allow us to use the same encoding and visiting logic
for SSBOs on the API side.
Bug: angleproject:3024
Change-Id: I42b1db0e7547782ae77fe5f64a797f803f203f45
Reviewed-on: https://chromium-review.googlesource.com/c/1352731
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
diff --git a/src/libANGLE/renderer/d3d/ProgramD3D.cpp b/src/libANGLE/renderer/d3d/ProgramD3D.cpp
index e2f60fc..c9c46de 100644
--- a/src/libANGLE/renderer/d3d/ProgramD3D.cpp
+++ b/src/libANGLE/renderer/d3d/ProgramD3D.cpp
@@ -210,7 +210,7 @@
sh::GetInterfaceBlockInfo(interfaceBlock.fields, interfaceBlock.fieldPrefix(), encoder,
&mBlockLayout);
- return encoder->getBlockSize();
+ return encoder->getCurrentOffset();
}
bool InterfaceBlockInfo::getBlockSize(const std::string &name,