Add padding to nested structs packed with standard layout, to address HLSL's more liberal packing rules.
TRAC #23327
Signed-off-by: Geoff Lang
Signed-off-by: Shannon Woods
Authored-by: Jamie Madill
diff --git a/src/compiler/OutputHLSL.h b/src/compiler/OutputHLSL.h
index baa4675..b097410 100644
--- a/src/compiler/OutputHLSL.h
+++ b/src/compiler/OutputHLSL.h
@@ -198,7 +198,7 @@
TString interfaceBlockStructString(const TType &interfaceBlockType);
TString interfaceBlockString(const TType &interfaceBlockType, unsigned int registerIndex, unsigned int arrayIndex);
TString std140PrePaddingString(const TType &type, int *elementIndex);
- TString std140PostPaddingString(const TType &type);
+ TString std140PostPaddingString(const TType &type, bool useHLSLRowMajorPacking);
static GLenum glVariableType(const TType &type);
static GLenum glVariablePrecision(const TType &type);
@@ -210,6 +210,7 @@
ActiveInterfaceBlocks mActiveInterfaceBlocks;
ActiveShaderVariables mActiveOutputVariables;
ActiveShaderVariables mActiveAttributes;
+ std::map<TString, int> mStd140StructElementIndexes;
};
}