Fix register packing for structs in d3d9.
Fixes WebGL test misc/shader-with-array-of-structs-uniform
BUG=angle:656
Change-Id: If79a19db4d40bab9110422f7876de32e7f85e506
Reviewed-on: https://chromium-review.googlesource.com/200620
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nicolas Capens <nicolascapens@chromium.org>
diff --git a/src/compiler/translator/OutputHLSL.cpp b/src/compiler/translator/OutputHLSL.cpp
index d747ddd..2d7818b 100644
--- a/src/compiler/translator/OutputHLSL.cpp
+++ b/src/compiler/translator/OutputHLSL.cpp
@@ -483,7 +483,7 @@
case gl::BLOCKLAYOUT_SHARED:
case gl::BLOCKLAYOUT_PACKED:
{
- gl::HLSLBlockEncoder hlslEncoder(&interfaceBlock->blockInfo);
+ gl::HLSLBlockEncoder hlslEncoder(&interfaceBlock->blockInfo, gl::HLSLBlockEncoder::ENCODE_PACKED);
hlslEncoder.encodeInterfaceBlockFields(interfaceBlock->fields);
interfaceBlock->dataSize = hlslEncoder.getBlockSize();
}
@@ -3940,7 +3940,7 @@
}
// assign register offset information -- this will override the information in any sub-structures.
- HLSLVariableGetRegisterInfo(registerIndex, &structUniform);
+ HLSLVariableGetRegisterInfo(registerIndex, &structUniform, mOutputType);
output.push_back(structUniform);
@@ -4008,11 +4008,11 @@
if (IsSampler(type.getBasicType()))
{
- mSamplerRegister += gl::HLSLVariableRegisterCount(uniform);
+ mSamplerRegister += gl::HLSLVariableRegisterCount(uniform, mOutputType);
}
else
{
- mUniformRegister += gl::HLSLVariableRegisterCount(uniform);
+ mUniformRegister += gl::HLSLVariableRegisterCount(uniform, mOutputType);
}
return registerIndex;