Commit 834e8b77 by Jamie Madill

Move ShaderVariables to common shared source.

Also move the block layout encoding utilities to the common folder. The combined changes allow us to include the shader and block code into both libGLESv2 and the translator separately. This in turn fixes the Chromium component build, where we were calling internal translator functions directly from libGLESv2. BUG=angle:568 Change-Id: Ibcfa2c936a7c737ad515c10bd24061ff39ee5747 Reviewed-on: https://chromium-review.googlesource.com/192891Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 8cc03bf7
......@@ -127,6 +127,8 @@
<ClInclude Include="..\..\src\common\version.h"/>
<ClInclude Include="..\..\src\common\utilities.h"/>
<ClInclude Include="..\..\src\common\angleutils.h"/>
<ClInclude Include="..\..\src\common\shadervars.h"/>
<ClInclude Include="..\..\src\common\blocklayout.h"/>
<ClInclude Include="..\..\include\KHR\khrplatform.h"/>
<ClInclude Include="..\..\include\GLSLANG\ShaderLang.h"/>
<ClInclude Include="..\..\include\GLES2\gl2.h"/>
......@@ -150,6 +152,8 @@
<ClCompile Include="..\..\src\common\debug.cpp"/>
<ClCompile Include="..\..\src\common\event_tracer.cpp"/>
<ClCompile Include="..\..\src\common\utilities.cpp"/>
<ClCompile Include="..\..\src\common\shadervars.cpp"/>
<ClCompile Include="..\..\src\common\blocklayout.cpp"/>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\src\libEGL\libEGL.rc"/>
......
......@@ -102,9 +102,21 @@
<ClCompile Include="..\..\src\common\utilities.cpp">
<Filter>src\common</Filter>
</ClCompile>
<ClCompile Include="..\..\src\common\shadervars.cpp">
<Filter>src\common</Filter>
</ClCompile>
<ClInclude Include="..\..\src\common\angleutils.h">
<Filter>src\common</Filter>
</ClInclude>
<ClInclude Include="..\..\src\common\shadervars.h">
<Filter>src\common</Filter>
</ClInclude>
<ClInclude Include="..\..\src\common\blocklayout.h">
<Filter>src\common</Filter>
</ClInclude>
<ClCompile Include="..\..\src\common\blocklayout.cpp">
<Filter>src\common</Filter>
</ClCompile>
<ClInclude Include="..\..\include\KHR\khrplatform.h">
<Filter>include\KHR</Filter>
</ClInclude>
......
......@@ -117,11 +117,13 @@
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\third_party\compiler\ArrayBoundsClamper.h"/>
<ClInclude Include="..\..\src\common\shadervars.h"/>
<ClInclude Include="..\..\src\common\RefCountObject.h"/>
<ClInclude Include="..\..\src\common\mathutil.h"/>
<ClInclude Include="..\..\src\common\event_tracer.h"/>
<ClInclude Include="..\..\src\common\debug.h"/>
<ClInclude Include="..\..\src\common\version.h"/>
<ClInclude Include="..\..\src\common\blocklayout.h"/>
<ClInclude Include="..\..\src\common\utilities.h"/>
<ClInclude Include="..\..\src\common\angleutils.h"/>
<ClInclude Include="..\..\src\compiler\translator\BaseTypes.h"/>
......@@ -133,16 +135,15 @@
<ClInclude Include="..\..\src\compiler\translator\FlagStd140Structs.h"/>
<ClInclude Include="..\..\src\compiler\translator\length_limits.h"/>
<ClInclude Include="..\..\src\compiler\translator\PoolAlloc.h"/>
<ClInclude Include="..\..\src\compiler\translator\DetectDiscontinuity.h"/>
<ClInclude Include="..\..\src\compiler\translator\BuiltInFunctionEmulator.h"/>
<ClInclude Include="..\..\src\compiler\translator\DetectDiscontinuity.h"/>
<ClInclude Include="..\..\src\compiler\translator\ValidateOutputs.h"/>
<ClInclude Include="..\..\src\compiler\translator\UnfoldShortCircuit.h"/>
<ClInclude Include="..\..\src\compiler\translator\TranslatorGLSL.h"/>
<ClInclude Include="..\..\src\compiler\translator\InitializeDll.h"/>
<ClInclude Include="..\..\src\compiler\translator\SymbolTable.h"/>
<ClInclude Include="..\..\src\compiler\translator\InitializeGlobals.h"/>
<ClInclude Include="..\..\src\compiler\translator\osinclude.h"/>
<ClInclude Include="..\..\src\compiler\translator\Initialize.h"/>
<ClInclude Include="..\..\src\compiler\translator\HLSLLayoutEncoder.h"/>
<ClInclude Include="..\..\src\compiler\translator\QualifierAlive.h"/>
<ClInclude Include="..\..\src\compiler\translator\ConstantUnion.h"/>
<ClInclude Include="..\..\src\compiler\translator\ParseContext.h"/>
......@@ -152,13 +153,12 @@
<ClInclude Include="..\..\src\compiler\translator\DirectiveHandler.h"/>
<ClInclude Include="..\..\src\compiler\translator\NodeSearch.h"/>
<ClInclude Include="..\..\src\compiler\translator\TranslatorESSL.h"/>
<ClInclude Include="..\..\src\compiler\translator\SymbolTable.h"/>
<ClInclude Include="..\..\src\compiler\translator\InitializeDll.h"/>
<ClInclude Include="..\..\src\compiler\translator\InitializeVariables.h"/>
<ClInclude Include="..\..\src\compiler\translator\localintermediate.h"/>
<ClInclude Include="..\..\src\compiler\translator\ShHandle.h"/>
<ClInclude Include="..\..\src\compiler\translator\OutputGLSLBase.h"/>
<ClInclude Include="..\..\src\compiler\translator\ForLoopUnroll.h"/>
<ClInclude Include="..\..\src\compiler\translator\ShaderVariable.h"/>
<ClInclude Include="..\..\src\compiler\translator\Pragma.h"/>
<ClInclude Include="..\..\src\compiler\translator\intermediate.h"/>
<ClInclude Include="..\..\src\compiler\translator\TranslatorHLSL.h"/>
......@@ -175,7 +175,6 @@
<ClInclude Include="..\..\src\compiler\translator\SearchSymbol.h"/>
<ClInclude Include="..\..\src\compiler\translator\OutputHLSL.h"/>
<ClInclude Include="..\..\src\compiler\translator\InitializeParseContext.h"/>
<ClInclude Include="..\..\src\compiler\translator\BlockLayoutEncoder.h"/>
<ClInclude Include="..\..\src\compiler\translator\VariableInfo.h"/>
<ClInclude Include="..\..\src\compiler\translator\LoopInfo.h"/>
<ClInclude Include="..\..\src\compiler\translator\glslang_tab.h"/>
......@@ -205,7 +204,8 @@
<ClCompile Include="..\..\src\common\RefCountObject.cpp"/>
<ClCompile Include="..\..\src\common\mathutil.cpp"/>
<ClCompile Include="..\..\src\common\debug.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\HLSLLayoutEncoder.cpp"/>
<ClCompile Include="..\..\src\common\shadervars.cpp"/>
<ClCompile Include="..\..\src\common\blocklayout.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\InfoSink.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\OutputESSL.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\ValidateLimitations.cpp"/>
......@@ -214,13 +214,11 @@
<ClCompile Include="..\..\src\compiler\translator\OutputGLSL.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\TranslatorHLSL.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\OutputGLSLBase.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\ShaderVariable.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\ParseContext.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\RemoveTree.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\InitializeVariables.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\InitializeDll.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\PoolAlloc.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\BlockLayoutEncoder.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\ossource_win.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\RewriteElseBlocks.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\Diagnostics.cpp"/>
......@@ -230,6 +228,7 @@
<ClCompile Include="..\..\src\compiler\translator\ValidateOutputs.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\TranslatorESSL.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\VariablePacker.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\DirectiveHandler.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\parseConst.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\VersionGLSL.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\DetectCallDepth.cpp"/>
......@@ -244,7 +243,6 @@
<ClCompile Include="..\..\src\compiler\translator\UnfoldShortCircuitAST.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\TranslatorGLSL.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\SymbolTable.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\DirectiveHandler.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\FlagStd140Structs.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\LoopInfo.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\OutputHLSL.cpp"/>
......
......@@ -57,6 +57,9 @@
<ClInclude Include="..\..\src\third_party\compiler\ArrayBoundsClamper.h">
<Filter>src\third_party\compiler</Filter>
</ClInclude>
<ClInclude Include="..\..\src\common\shadervars.h">
<Filter>src\common</Filter>
</ClInclude>
<ClInclude Include="..\..\src\common\RefCountObject.h">
<Filter>src\common</Filter>
</ClInclude>
......@@ -87,18 +90,24 @@
<ClInclude Include="..\..\src\common\version.h">
<Filter>src\common</Filter>
</ClInclude>
<ClInclude Include="..\..\src\common\blocklayout.h">
<Filter>src\common</Filter>
</ClInclude>
<ClInclude Include="..\..\src\common\utilities.h">
<Filter>src\common</Filter>
</ClInclude>
<ClCompile Include="..\..\src\common\shadervars.cpp">
<Filter>src\common</Filter>
</ClCompile>
<ClCompile Include="..\..\src\common\blocklayout.cpp">
<Filter>src\common</Filter>
</ClCompile>
<ClInclude Include="..\..\src\common\angleutils.h">
<Filter>src\common</Filter>
</ClInclude>
<ClInclude Include="..\..\src\compiler\translator\BaseTypes.h">
<Filter>src\compiler\translator</Filter>
</ClInclude>
<ClCompile Include="..\..\src\compiler\translator\HLSLLayoutEncoder.cpp">
<Filter>src\compiler\translator</Filter>
</ClCompile>
<ClCompile Include="..\..\src\compiler\translator\InfoSink.cpp">
<Filter>src\compiler\translator</Filter>
</ClCompile>
......@@ -147,15 +156,12 @@
<ClInclude Include="..\..\src\compiler\translator\PoolAlloc.h">
<Filter>src\compiler\translator</Filter>
</ClInclude>
<ClInclude Include="..\..\src\compiler\translator\DetectDiscontinuity.h">
<Filter>src\compiler\translator</Filter>
</ClInclude>
<ClInclude Include="..\..\src\compiler\translator\BuiltInFunctionEmulator.h">
<Filter>src\compiler\translator</Filter>
</ClInclude>
<ClCompile Include="..\..\src\compiler\translator\ShaderVariable.cpp">
<ClInclude Include="..\..\src\compiler\translator\DetectDiscontinuity.h">
<Filter>src\compiler\translator</Filter>
</ClCompile>
</ClInclude>
<ClCompile Include="..\..\src\compiler\translator\ParseContext.cpp">
<Filter>src\compiler\translator</Filter>
</ClCompile>
......@@ -174,7 +180,7 @@
<ClInclude Include="..\..\src\compiler\translator\TranslatorGLSL.h">
<Filter>src\compiler\translator</Filter>
</ClInclude>
<ClInclude Include="..\..\src\compiler\translator\InitializeDll.h">
<ClInclude Include="..\..\src\compiler\translator\SymbolTable.h">
<Filter>src\compiler\translator</Filter>
</ClInclude>
<ClCompile Include="..\..\src\compiler\translator\InitializeDll.cpp">
......@@ -186,9 +192,6 @@
<ClInclude Include="..\..\src\compiler\translator\InitializeGlobals.h">
<Filter>src\compiler\translator</Filter>
</ClInclude>
<ClCompile Include="..\..\src\compiler\translator\BlockLayoutEncoder.cpp">
<Filter>src\compiler\translator</Filter>
</ClCompile>
<ClInclude Include="..\..\src\compiler\translator\osinclude.h">
<Filter>src\compiler\translator</Filter>
</ClInclude>
......@@ -198,9 +201,6 @@
<ClCompile Include="..\..\src\compiler\translator\ossource_win.cpp">
<Filter>src\compiler\translator</Filter>
</ClCompile>
<ClInclude Include="..\..\src\compiler\translator\HLSLLayoutEncoder.h">
<Filter>src\compiler\translator</Filter>
</ClInclude>
<ClInclude Include="..\..\src\compiler\translator\QualifierAlive.h">
<Filter>src\compiler\translator</Filter>
</ClInclude>
......@@ -249,7 +249,7 @@
<ClCompile Include="..\..\src\compiler\translator\TranslatorESSL.cpp">
<Filter>src\compiler\translator</Filter>
</ClCompile>
<ClInclude Include="..\..\src\compiler\translator\SymbolTable.h">
<ClInclude Include="..\..\src\compiler\translator\InitializeDll.h">
<Filter>src\compiler\translator</Filter>
</ClInclude>
<ClInclude Include="..\..\src\compiler\translator\InitializeVariables.h">
......@@ -267,9 +267,6 @@
<ClInclude Include="..\..\src\compiler\translator\ForLoopUnroll.h">
<Filter>src\compiler\translator</Filter>
</ClInclude>
<ClInclude Include="..\..\src\compiler\translator\ShaderVariable.h">
<Filter>src\compiler\translator</Filter>
</ClInclude>
<ClInclude Include="..\..\src\compiler\translator\Pragma.h">
<Filter>src\compiler\translator</Filter>
</ClInclude>
......@@ -282,6 +279,9 @@
<ClInclude Include="..\..\src\compiler\translator\TranslatorHLSL.h">
<Filter>src\compiler\translator</Filter>
</ClInclude>
<ClCompile Include="..\..\src\compiler\translator\DirectiveHandler.cpp">
<Filter>src\compiler\translator</Filter>
</ClCompile>
<ClInclude Include="..\..\src\compiler\translator\OutputESSL.h">
<Filter>src\compiler\translator</Filter>
</ClInclude>
......@@ -369,12 +369,6 @@
<ClInclude Include="..\..\src\compiler\translator\InitializeParseContext.h">
<Filter>src\compiler\translator</Filter>
</ClInclude>
<ClCompile Include="..\..\src\compiler\translator\DirectiveHandler.cpp">
<Filter>src\compiler\translator</Filter>
</ClCompile>
<ClInclude Include="..\..\src\compiler\translator\BlockLayoutEncoder.h">
<Filter>src\compiler\translator</Filter>
</ClInclude>
<ClInclude Include="..\..\src\compiler\translator\VariableInfo.h">
<Filter>src\compiler\translator</Filter>
</ClInclude>
......
......@@ -117,11 +117,13 @@
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\third_party\compiler\ArrayBoundsClamper.h"/>
<ClInclude Include="..\..\src\common\shadervars.h"/>
<ClInclude Include="..\..\src\common\RefCountObject.h"/>
<ClInclude Include="..\..\src\common\mathutil.h"/>
<ClInclude Include="..\..\src\common\event_tracer.h"/>
<ClInclude Include="..\..\src\common\debug.h"/>
<ClInclude Include="..\..\src\common\version.h"/>
<ClInclude Include="..\..\src\common\blocklayout.h"/>
<ClInclude Include="..\..\src\common\utilities.h"/>
<ClInclude Include="..\..\src\common\angleutils.h"/>
<ClInclude Include="..\..\src\compiler\translator\BaseTypes.h"/>
......@@ -133,16 +135,15 @@
<ClInclude Include="..\..\src\compiler\translator\FlagStd140Structs.h"/>
<ClInclude Include="..\..\src\compiler\translator\length_limits.h"/>
<ClInclude Include="..\..\src\compiler\translator\PoolAlloc.h"/>
<ClInclude Include="..\..\src\compiler\translator\DetectDiscontinuity.h"/>
<ClInclude Include="..\..\src\compiler\translator\BuiltInFunctionEmulator.h"/>
<ClInclude Include="..\..\src\compiler\translator\DetectDiscontinuity.h"/>
<ClInclude Include="..\..\src\compiler\translator\ValidateOutputs.h"/>
<ClInclude Include="..\..\src\compiler\translator\UnfoldShortCircuit.h"/>
<ClInclude Include="..\..\src\compiler\translator\TranslatorGLSL.h"/>
<ClInclude Include="..\..\src\compiler\translator\InitializeDll.h"/>
<ClInclude Include="..\..\src\compiler\translator\SymbolTable.h"/>
<ClInclude Include="..\..\src\compiler\translator\InitializeGlobals.h"/>
<ClInclude Include="..\..\src\compiler\translator\osinclude.h"/>
<ClInclude Include="..\..\src\compiler\translator\Initialize.h"/>
<ClInclude Include="..\..\src\compiler\translator\HLSLLayoutEncoder.h"/>
<ClInclude Include="..\..\src\compiler\translator\QualifierAlive.h"/>
<ClInclude Include="..\..\src\compiler\translator\ConstantUnion.h"/>
<ClInclude Include="..\..\src\compiler\translator\ParseContext.h"/>
......@@ -152,13 +153,12 @@
<ClInclude Include="..\..\src\compiler\translator\DirectiveHandler.h"/>
<ClInclude Include="..\..\src\compiler\translator\NodeSearch.h"/>
<ClInclude Include="..\..\src\compiler\translator\TranslatorESSL.h"/>
<ClInclude Include="..\..\src\compiler\translator\SymbolTable.h"/>
<ClInclude Include="..\..\src\compiler\translator\InitializeDll.h"/>
<ClInclude Include="..\..\src\compiler\translator\InitializeVariables.h"/>
<ClInclude Include="..\..\src\compiler\translator\localintermediate.h"/>
<ClInclude Include="..\..\src\compiler\translator\ShHandle.h"/>
<ClInclude Include="..\..\src\compiler\translator\OutputGLSLBase.h"/>
<ClInclude Include="..\..\src\compiler\translator\ForLoopUnroll.h"/>
<ClInclude Include="..\..\src\compiler\translator\ShaderVariable.h"/>
<ClInclude Include="..\..\src\compiler\translator\Pragma.h"/>
<ClInclude Include="..\..\src\compiler\translator\intermediate.h"/>
<ClInclude Include="..\..\src\compiler\translator\TranslatorHLSL.h"/>
......@@ -175,7 +175,6 @@
<ClInclude Include="..\..\src\compiler\translator\SearchSymbol.h"/>
<ClInclude Include="..\..\src\compiler\translator\OutputHLSL.h"/>
<ClInclude Include="..\..\src\compiler\translator\InitializeParseContext.h"/>
<ClInclude Include="..\..\src\compiler\translator\BlockLayoutEncoder.h"/>
<ClInclude Include="..\..\src\compiler\translator\VariableInfo.h"/>
<ClInclude Include="..\..\src\compiler\translator\LoopInfo.h"/>
<ClInclude Include="..\..\src\compiler\translator\glslang_tab.h"/>
......@@ -205,7 +204,8 @@
<ClCompile Include="..\..\src\common\RefCountObject.cpp"/>
<ClCompile Include="..\..\src\common\mathutil.cpp"/>
<ClCompile Include="..\..\src\common\debug.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\HLSLLayoutEncoder.cpp"/>
<ClCompile Include="..\..\src\common\shadervars.cpp"/>
<ClCompile Include="..\..\src\common\blocklayout.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\InfoSink.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\OutputESSL.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\ValidateLimitations.cpp"/>
......@@ -214,13 +214,11 @@
<ClCompile Include="..\..\src\compiler\translator\OutputGLSL.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\TranslatorHLSL.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\OutputGLSLBase.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\ShaderVariable.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\ParseContext.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\RemoveTree.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\InitializeVariables.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\InitializeDll.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\PoolAlloc.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\BlockLayoutEncoder.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\ossource_win.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\RewriteElseBlocks.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\Diagnostics.cpp"/>
......@@ -230,6 +228,7 @@
<ClCompile Include="..\..\src\compiler\translator\ValidateOutputs.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\TranslatorESSL.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\VariablePacker.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\DirectiveHandler.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\parseConst.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\VersionGLSL.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\DetectCallDepth.cpp"/>
......@@ -244,7 +243,6 @@
<ClCompile Include="..\..\src\compiler\translator\UnfoldShortCircuitAST.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\TranslatorGLSL.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\SymbolTable.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\DirectiveHandler.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\FlagStd140Structs.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\LoopInfo.cpp"/>
<ClCompile Include="..\..\src\compiler\translator\OutputHLSL.cpp"/>
......
......@@ -57,6 +57,9 @@
<ClInclude Include="..\..\src\third_party\compiler\ArrayBoundsClamper.h">
<Filter>src\third_party\compiler</Filter>
</ClInclude>
<ClInclude Include="..\..\src\common\shadervars.h">
<Filter>src\common</Filter>
</ClInclude>
<ClInclude Include="..\..\src\common\RefCountObject.h">
<Filter>src\common</Filter>
</ClInclude>
......@@ -87,18 +90,24 @@
<ClInclude Include="..\..\src\common\version.h">
<Filter>src\common</Filter>
</ClInclude>
<ClInclude Include="..\..\src\common\blocklayout.h">
<Filter>src\common</Filter>
</ClInclude>
<ClInclude Include="..\..\src\common\utilities.h">
<Filter>src\common</Filter>
</ClInclude>
<ClCompile Include="..\..\src\common\shadervars.cpp">
<Filter>src\common</Filter>
</ClCompile>
<ClCompile Include="..\..\src\common\blocklayout.cpp">
<Filter>src\common</Filter>
</ClCompile>
<ClInclude Include="..\..\src\common\angleutils.h">
<Filter>src\common</Filter>
</ClInclude>
<ClInclude Include="..\..\src\compiler\translator\BaseTypes.h">
<Filter>src\compiler\translator</Filter>
</ClInclude>
<ClCompile Include="..\..\src\compiler\translator\HLSLLayoutEncoder.cpp">
<Filter>src\compiler\translator</Filter>
</ClCompile>
<ClCompile Include="..\..\src\compiler\translator\InfoSink.cpp">
<Filter>src\compiler\translator</Filter>
</ClCompile>
......@@ -147,15 +156,12 @@
<ClInclude Include="..\..\src\compiler\translator\PoolAlloc.h">
<Filter>src\compiler\translator</Filter>
</ClInclude>
<ClInclude Include="..\..\src\compiler\translator\DetectDiscontinuity.h">
<Filter>src\compiler\translator</Filter>
</ClInclude>
<ClInclude Include="..\..\src\compiler\translator\BuiltInFunctionEmulator.h">
<Filter>src\compiler\translator</Filter>
</ClInclude>
<ClCompile Include="..\..\src\compiler\translator\ShaderVariable.cpp">
<ClInclude Include="..\..\src\compiler\translator\DetectDiscontinuity.h">
<Filter>src\compiler\translator</Filter>
</ClCompile>
</ClInclude>
<ClCompile Include="..\..\src\compiler\translator\ParseContext.cpp">
<Filter>src\compiler\translator</Filter>
</ClCompile>
......@@ -174,7 +180,7 @@
<ClInclude Include="..\..\src\compiler\translator\TranslatorGLSL.h">
<Filter>src\compiler\translator</Filter>
</ClInclude>
<ClInclude Include="..\..\src\compiler\translator\InitializeDll.h">
<ClInclude Include="..\..\src\compiler\translator\SymbolTable.h">
<Filter>src\compiler\translator</Filter>
</ClInclude>
<ClCompile Include="..\..\src\compiler\translator\InitializeDll.cpp">
......@@ -186,9 +192,6 @@
<ClInclude Include="..\..\src\compiler\translator\InitializeGlobals.h">
<Filter>src\compiler\translator</Filter>
</ClInclude>
<ClCompile Include="..\..\src\compiler\translator\BlockLayoutEncoder.cpp">
<Filter>src\compiler\translator</Filter>
</ClCompile>
<ClInclude Include="..\..\src\compiler\translator\osinclude.h">
<Filter>src\compiler\translator</Filter>
</ClInclude>
......@@ -198,9 +201,6 @@
<ClCompile Include="..\..\src\compiler\translator\ossource_win.cpp">
<Filter>src\compiler\translator</Filter>
</ClCompile>
<ClInclude Include="..\..\src\compiler\translator\HLSLLayoutEncoder.h">
<Filter>src\compiler\translator</Filter>
</ClInclude>
<ClInclude Include="..\..\src\compiler\translator\QualifierAlive.h">
<Filter>src\compiler\translator</Filter>
</ClInclude>
......@@ -249,7 +249,7 @@
<ClCompile Include="..\..\src\compiler\translator\TranslatorESSL.cpp">
<Filter>src\compiler\translator</Filter>
</ClCompile>
<ClInclude Include="..\..\src\compiler\translator\SymbolTable.h">
<ClInclude Include="..\..\src\compiler\translator\InitializeDll.h">
<Filter>src\compiler\translator</Filter>
</ClInclude>
<ClInclude Include="..\..\src\compiler\translator\InitializeVariables.h">
......@@ -267,9 +267,6 @@
<ClInclude Include="..\..\src\compiler\translator\ForLoopUnroll.h">
<Filter>src\compiler\translator</Filter>
</ClInclude>
<ClInclude Include="..\..\src\compiler\translator\ShaderVariable.h">
<Filter>src\compiler\translator</Filter>
</ClInclude>
<ClInclude Include="..\..\src\compiler\translator\Pragma.h">
<Filter>src\compiler\translator</Filter>
</ClInclude>
......@@ -282,6 +279,9 @@
<ClInclude Include="..\..\src\compiler\translator\TranslatorHLSL.h">
<Filter>src\compiler\translator</Filter>
</ClInclude>
<ClCompile Include="..\..\src\compiler\translator\DirectiveHandler.cpp">
<Filter>src\compiler\translator</Filter>
</ClCompile>
<ClInclude Include="..\..\src\compiler\translator\OutputESSL.h">
<Filter>src\compiler\translator</Filter>
</ClInclude>
......@@ -369,12 +369,6 @@
<ClInclude Include="..\..\src\compiler\translator\InitializeParseContext.h">
<Filter>src\compiler\translator</Filter>
</ClInclude>
<ClCompile Include="..\..\src\compiler\translator\DirectiveHandler.cpp">
<Filter>src\compiler\translator</Filter>
</ClCompile>
<ClInclude Include="..\..\src\compiler\translator\BlockLayoutEncoder.h">
<Filter>src\compiler\translator</Filter>
</ClInclude>
<ClInclude Include="..\..\src\compiler\translator\VariableInfo.h">
<Filter>src\compiler\translator</Filter>
</ClInclude>
......
//
// Copyright (c) 2013 The ANGLE Project Authors. All rights reserved.
// Copyright (c) 2013-2014 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// blocklayout.cpp:
// Implementation for block layout classes and methods.
//
#include "compiler/translator/BlockLayoutEncoder.h"
#include "compiler/translator/ShaderVariable.h"
#include "common/blocklayout.h"
#include "common/shadervars.h"
#include "common/mathutil.h"
#include "common/utilities.h"
namespace sh
namespace gl
{
BlockLayoutEncoder::BlockLayoutEncoder(std::vector<BlockMemberInfo> *blockInfoOut)
......@@ -152,4 +155,151 @@ void Std140BlockEncoder::advanceOffset(GLenum type, unsigned int arraySize, bool
}
}
HLSLBlockEncoder::HLSLBlockEncoder(std::vector<BlockMemberInfo> *blockInfoOut)
: BlockLayoutEncoder(blockInfoOut)
{
}
void HLSLBlockEncoder::enterAggregateType()
{
nextRegister();
}
void HLSLBlockEncoder::exitAggregateType()
{
}
void HLSLBlockEncoder::getBlockLayoutInfo(GLenum type, unsigned int arraySize, bool isRowMajorMatrix, int *arrayStrideOut, int *matrixStrideOut)
{
// We assume we are only dealing with 4 byte components (no doubles or half-words currently)
ASSERT(gl::UniformComponentSize(gl::UniformComponentType(type)) == BytesPerComponent);
int matrixStride = 0;
int arrayStride = 0;
if (gl::IsMatrixType(type))
{
nextRegister();
matrixStride = ComponentsPerRegister;
if (arraySize > 0)
{
const int numRegisters = gl::MatrixRegisterCount(type, isRowMajorMatrix);
arrayStride = ComponentsPerRegister * numRegisters;
}
}
else if (arraySize > 0)
{
nextRegister();
arrayStride = ComponentsPerRegister;
}
else
{
int numComponents = gl::UniformComponentCount(type);
if ((numComponents + (mCurrentOffset % ComponentsPerRegister)) > ComponentsPerRegister)
{
nextRegister();
}
}
*matrixStrideOut = matrixStride;
*arrayStrideOut = arrayStride;
}
void HLSLBlockEncoder::advanceOffset(GLenum type, unsigned int arraySize, bool isRowMajorMatrix, int arrayStride, int matrixStride)
{
if (arraySize > 0)
{
mCurrentOffset += arrayStride * (arraySize - 1);
}
if (gl::IsMatrixType(type))
{
ASSERT(matrixStride == ComponentsPerRegister);
const int numRegisters = gl::MatrixRegisterCount(type, isRowMajorMatrix);
const int numComponents = gl::MatrixComponentCount(type, isRowMajorMatrix);
mCurrentOffset += ComponentsPerRegister * (numRegisters - 1);
mCurrentOffset += numComponents;
}
else
{
mCurrentOffset += gl::UniformComponentCount(type);
}
}
void HLSLVariableGetRegisterInfo(unsigned int baseRegisterIndex, gl::Uniform *variable, HLSLBlockEncoder *encoder, const std::vector<gl::BlockMemberInfo> &blockInfo)
{
// because this method computes offsets (element indexes) instead of any total sizes,
// we can ignore the array size of the variable
if (variable->isStruct())
{
encoder->enterAggregateType();
for (size_t fieldIndex = 0; fieldIndex < variable->fields.size(); fieldIndex++)
{
HLSLVariableGetRegisterInfo(baseRegisterIndex, &variable->fields[fieldIndex], encoder, blockInfo);
}
encoder->exitAggregateType();
}
else
{
encoder->encodeType(variable->type, variable->arraySize, false);
const size_t registerBytes = (encoder->BytesPerComponent * encoder->ComponentsPerRegister);
variable->registerIndex = baseRegisterIndex + (blockInfo.back().offset / registerBytes);
variable->elementIndex = (blockInfo.back().offset % registerBytes) / sizeof(float);
}
}
void HLSLVariableGetRegisterInfo(unsigned int baseRegisterIndex, gl::Uniform *variable)
{
std::vector<BlockMemberInfo> blockInfo;
HLSLBlockEncoder encoder(&blockInfo);
HLSLVariableGetRegisterInfo(baseRegisterIndex, variable, &encoder, blockInfo);
}
template <class ShaderVarType>
void HLSLVariableRegisterCount(const ShaderVarType &variable, HLSLBlockEncoder *encoder)
{
if (variable.isStruct())
{
for (size_t arrayElement = 0; arrayElement < variable.elementCount(); arrayElement++)
{
encoder->enterAggregateType();
for (size_t fieldIndex = 0; fieldIndex < variable.fields.size(); fieldIndex++)
{
HLSLVariableRegisterCount(variable.fields[fieldIndex], encoder);
}
encoder->exitAggregateType();
}
}
else
{
// We operate only on varyings and uniforms, which do not have matrix layout qualifiers
encoder->encodeType(variable.type, variable.arraySize, false);
}
}
unsigned int HLSLVariableRegisterCount(const Varying &variable)
{
HLSLBlockEncoder encoder(NULL);
HLSLVariableRegisterCount(variable, &encoder);
const size_t registerBytes = (encoder.BytesPerComponent * encoder.ComponentsPerRegister);
return static_cast<unsigned int>(rx::roundUp<size_t>(encoder.getBlockSize(), registerBytes) / registerBytes);
}
unsigned int HLSLVariableRegisterCount(const Uniform &variable)
{
HLSLBlockEncoder encoder(NULL);
HLSLVariableRegisterCount(variable, &encoder);
const size_t registerBytes = (encoder.BytesPerComponent * encoder.ComponentsPerRegister);
return static_cast<unsigned int>(rx::roundUp<size_t>(encoder.getBlockSize(), registerBytes) / registerBytes);
}
}
//
// Copyright (c) 2013 The ANGLE Project Authors. All rights reserved.
// Copyright (c) 2013-2014 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// blocklayout.h:
// Methods and classes related to uniform layout and packing in GLSL and HLSL.
//
#ifndef TRANSLATOR_COMMON_BLOCKLAYOUTENCODER_H_
#define TRANSLATOR_COMMON_BLOCKLAYOUTENCODER_H_
#ifndef COMMON_BLOCKLAYOUT_H_
#define COMMON_BLOCKLAYOUT_H_
#include <vector>
#define GL_APICALL
#include <GLES3/gl3.h>
#include <GLES2/gl2.h>
namespace sh
namespace gl
{
struct ShaderVariable;
struct InterfaceBlockField;
struct BlockMemberInfo;
struct Uniform;
struct Varying;
class BlockLayoutEncoder
{
......@@ -61,6 +66,31 @@ class Std140BlockEncoder : public BlockLayoutEncoder
virtual void advanceOffset(GLenum type, unsigned int arraySize, bool isRowMajorMatrix, int arrayStride, int matrixStride);
};
// Block layout packed according to the default D3D11 register packing rules
// See http://msdn.microsoft.com/en-us/library/windows/desktop/bb509632(v=vs.85).aspx
class HLSLBlockEncoder : public BlockLayoutEncoder
{
public:
HLSLBlockEncoder(std::vector<BlockMemberInfo> *blockInfoOut);
virtual void enterAggregateType();
virtual void exitAggregateType();
protected:
virtual void getBlockLayoutInfo(GLenum type, unsigned int arraySize, bool isRowMajorMatrix, int *arrayStrideOut, int *matrixStrideOut);
virtual void advanceOffset(GLenum type, unsigned int arraySize, bool isRowMajorMatrix, int arrayStride, int matrixStride);
};
// This method assigns values to the variable's "registerIndex" and "elementIndex" fields.
// "elementIndex" is only used for structures.
void HLSLVariableGetRegisterInfo(unsigned int baseRegisterIndex, Uniform *variable);
// This method returns the number of used registers for a ShaderVariable. It is dependent on the HLSLBlockEncoder
// class to count the number of used registers in a struct (which are individually packed according to the same rules).
unsigned int HLSLVariableRegisterCount(const Varying &variable);
unsigned int HLSLVariableRegisterCount(const Uniform &variable);
}
#endif // TRANSLATOR_COMMON_BLOCKLAYOUTENCODER_H_
#endif // COMMON_BLOCKLAYOUT_H_
//
// Copyright (c) 2013 The ANGLE Project Authors. All rights reserved.
// Copyright (c) 2013-2014 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// shadervars.cpp:
// Implementation for GL shader variable member functions.
//
#include "compiler/translator/ShaderVariable.h"
#include "common/shadervars.h"
namespace sh
namespace gl
{
ShaderVariable::ShaderVariable(GLenum typeIn, GLenum precisionIn, const char *nameIn, unsigned int arraySizeIn)
......
//
// Copyright (c) 2013 The ANGLE Project Authors. All rights reserved.
// Copyright (c) 2013-2014 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// shadervars.h:
// Types to represent GL variables (varyings, uniforms, etc)
//
#ifndef COMPILER_SHADERVARIABLE_H_
#define COMPILER_SHADERVARIABLE_H_
#ifndef COMMON_SHADERVARIABLE_H_
#define COMMON_SHADERVARIABLE_H_
#include <string>
#include <vector>
......@@ -15,7 +18,7 @@
#include <GLES3/gl3.h>
#include <GLES2/gl2.h>
namespace sh
namespace gl
{
enum InterpolationType
......@@ -119,8 +122,6 @@ struct InterfaceBlock
unsigned int registerIndex;
};
typedef std::vector<InterfaceBlock> ActiveInterfaceBlocks;
}
#endif // COMPILER_SHADERVARIABLE_H_
#endif // COMMON_SHADERVARIABLE_H_
//
// Copyright (c) 2013 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#include "compiler/translator/HLSLLayoutEncoder.h"
#include "compiler/translator/ShaderVariable.h"
#include "common/mathutil.h"
#include "common/utilities.h"
namespace sh
{
HLSLBlockEncoder::HLSLBlockEncoder(std::vector<BlockMemberInfo> *blockInfoOut)
: BlockLayoutEncoder(blockInfoOut)
{
}
void HLSLBlockEncoder::enterAggregateType()
{
nextRegister();
}
void HLSLBlockEncoder::exitAggregateType()
{
}
void HLSLBlockEncoder::getBlockLayoutInfo(GLenum type, unsigned int arraySize, bool isRowMajorMatrix, int *arrayStrideOut, int *matrixStrideOut)
{
// We assume we are only dealing with 4 byte components (no doubles or half-words currently)
ASSERT(gl::UniformComponentSize(gl::UniformComponentType(type)) == BytesPerComponent);
int matrixStride = 0;
int arrayStride = 0;
if (gl::IsMatrixType(type))
{
nextRegister();
matrixStride = ComponentsPerRegister;
if (arraySize > 0)
{
const int numRegisters = gl::MatrixRegisterCount(type, isRowMajorMatrix);
arrayStride = ComponentsPerRegister * numRegisters;
}
}
else if (arraySize > 0)
{
nextRegister();
arrayStride = ComponentsPerRegister;
}
else
{
int numComponents = gl::UniformComponentCount(type);
if ((numComponents + (mCurrentOffset % ComponentsPerRegister)) > ComponentsPerRegister)
{
nextRegister();
}
}
*matrixStrideOut = matrixStride;
*arrayStrideOut = arrayStride;
}
void HLSLBlockEncoder::advanceOffset(GLenum type, unsigned int arraySize, bool isRowMajorMatrix, int arrayStride, int matrixStride)
{
if (arraySize > 0)
{
mCurrentOffset += arrayStride * (arraySize - 1);
}
if (gl::IsMatrixType(type))
{
ASSERT(matrixStride == ComponentsPerRegister);
const int numRegisters = gl::MatrixRegisterCount(type, isRowMajorMatrix);
const int numComponents = gl::MatrixComponentCount(type, isRowMajorMatrix);
mCurrentOffset += ComponentsPerRegister * (numRegisters - 1);
mCurrentOffset += numComponents;
}
else
{
mCurrentOffset += gl::UniformComponentCount(type);
}
}
void HLSLVariableGetRegisterInfo(unsigned int baseRegisterIndex, Uniform *variable, HLSLBlockEncoder *encoder, const std::vector<BlockMemberInfo> &blockInfo)
{
// because this method computes offsets (element indexes) instead of any total sizes,
// we can ignore the array size of the variable
if (variable->isStruct())
{
encoder->enterAggregateType();
for (size_t fieldIndex = 0; fieldIndex < variable->fields.size(); fieldIndex++)
{
HLSLVariableGetRegisterInfo(baseRegisterIndex, &variable->fields[fieldIndex], encoder, blockInfo);
}
encoder->exitAggregateType();
}
else
{
encoder->encodeType(variable->type, variable->arraySize, false);
const size_t registerBytes = (encoder->BytesPerComponent * encoder->ComponentsPerRegister);
variable->registerIndex = baseRegisterIndex + (blockInfo.back().offset / registerBytes);
variable->elementIndex = (blockInfo.back().offset % registerBytes) / sizeof(float);
}
}
void HLSLVariableGetRegisterInfo(unsigned int baseRegisterIndex, Uniform *variable)
{
std::vector<BlockMemberInfo> blockInfo;
HLSLBlockEncoder encoder(&blockInfo);
HLSLVariableGetRegisterInfo(baseRegisterIndex, variable, &encoder, blockInfo);
}
template <class ShaderVarType>
void HLSLVariableRegisterCount(const ShaderVarType &variable, HLSLBlockEncoder *encoder)
{
if (variable.isStruct())
{
for (size_t arrayElement = 0; arrayElement < variable.elementCount(); arrayElement++)
{
encoder->enterAggregateType();
for (size_t fieldIndex = 0; fieldIndex < variable.fields.size(); fieldIndex++)
{
HLSLVariableRegisterCount(variable.fields[fieldIndex], encoder);
}
encoder->exitAggregateType();
}
}
else
{
// We operate only on varyings and uniforms, which do not have matrix layout qualifiers
encoder->encodeType(variable.type, variable.arraySize, false);
}
}
unsigned int HLSLVariableRegisterCount(const Varying &variable)
{
HLSLBlockEncoder encoder(NULL);
HLSLVariableRegisterCount(variable, &encoder);
const size_t registerBytes = (encoder.BytesPerComponent * encoder.ComponentsPerRegister);
return static_cast<unsigned int>(rx::roundUp<size_t>(encoder.getBlockSize(), registerBytes) / registerBytes);
}
unsigned int HLSLVariableRegisterCount(const Uniform &variable)
{
HLSLBlockEncoder encoder(NULL);
HLSLVariableRegisterCount(variable, &encoder);
const size_t registerBytes = (encoder.BytesPerComponent * encoder.ComponentsPerRegister);
return static_cast<unsigned int>(rx::roundUp<size_t>(encoder.getBlockSize(), registerBytes) / registerBytes);
}
}
//
// Copyright (c) 2013 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#ifndef TRANSLATOR_HLSL_HLSLLAYOUTENCODER_H_
#define TRANSLATOR_HLSL_HLSLLAYOUTENCODER_H_
#include "compiler/translator/BlockLayoutEncoder.h"
namespace sh
{
struct Varying;
struct Uniform;
// Block layout packed according to the default D3D11 register packing rules
// See http://msdn.microsoft.com/en-us/library/windows/desktop/bb509632(v=vs.85).aspx
class HLSLBlockEncoder : public BlockLayoutEncoder
{
public:
HLSLBlockEncoder(std::vector<BlockMemberInfo> *blockInfoOut);
virtual void enterAggregateType();
virtual void exitAggregateType();
protected:
virtual void getBlockLayoutInfo(GLenum type, unsigned int arraySize, bool isRowMajorMatrix, int *arrayStrideOut, int *matrixStrideOut);
virtual void advanceOffset(GLenum type, unsigned int arraySize, bool isRowMajorMatrix, int arrayStride, int matrixStride);
};
// This method assigns values to the variable's "registerIndex" and "elementIndex" fields.
// "elementIndex" is only used for structures.
void HLSLVariableGetRegisterInfo(unsigned int baseRegisterIndex, Uniform *variable);
// This method returns the number of used registers for a ShaderVariable. It is dependent on the HLSLBlockEncoder
// class to count the number of used registers in a struct (which are individually packed according to the same rules).
unsigned int HLSLVariableRegisterCount(const Varying &variable);
unsigned int HLSLVariableRegisterCount(const Uniform &variable);
}
#endif // TRANSLATOR_HLSL_HLSLLAYOUTENCODER_H_
......@@ -17,7 +17,7 @@
#include "compiler/translator/intermediate.h"
#include "compiler/translator/ParseContext.h"
#include "compiler/translator/ShaderVariable.h"
#include "common/shadervars.h"
namespace sh
{
......@@ -32,11 +32,11 @@ class OutputHLSL : public TIntermTraverser
void output();
TInfoSinkBase &getBodyStream();
const std::vector<Uniform> &getUniforms();
const ActiveInterfaceBlocks &getInterfaceBlocks() const;
const std::vector<Attribute> &getOutputVariables() const;
const std::vector<Attribute> &getAttributes() const;
const std::vector<Varying> &getVaryings() const;
const std::vector<gl::Uniform> &getUniforms();
const std::vector<gl::InterfaceBlock> &getInterfaceBlocks() const;
const std::vector<gl::Attribute> &getOutputVariables() const;
const std::vector<gl::Attribute> &getAttributes() const;
const std::vector<gl::Varying> &getVaryings() const;
TString typeString(const TType &type);
TString textureString(const TType &type);
......@@ -184,10 +184,10 @@ class OutputHLSL : public TIntermTraverser
TString registerString(TIntermSymbol *operand);
int samplerRegister(TIntermSymbol *sampler);
int uniformRegister(TIntermSymbol *uniform);
void declareInterfaceBlockField(const TType &type, const TString &name, std::vector<InterfaceBlockField>& output);
Uniform declareUniformToList(const TType &type, const TString &name, int registerIndex, std::vector<Uniform>& output);
void declareInterfaceBlockField(const TType &type, const TString &name, std::vector<gl::InterfaceBlockField>& output);
gl::Uniform declareUniformToList(const TType &type, const TString &name, int registerIndex, std::vector<gl::Uniform>& output);
void declareUniform(const TType &type, const TString &name, int index);
void declareVaryingToList(const TType &type, TQualifier baseTypeQualifier, const TString &name, std::vector<Varying>& fieldsOut);
void declareVaryingToList(const TType &type, TQualifier baseTypeQualifier, const TString &name, std::vector<gl::Varying>& fieldsOut);
// Returns the uniform's register index
int declareUniformAndAssignRegister(const TType &type, const TString &name);
......@@ -210,11 +210,11 @@ class OutputHLSL : public TIntermTraverser
static bool isVaryingOut(TQualifier qualifier);
static bool isVarying(TQualifier qualifier);
std::vector<Uniform> mActiveUniforms;
ActiveInterfaceBlocks mActiveInterfaceBlocks;
std::vector<Attribute> mActiveOutputVariables;
std::vector<Attribute> mActiveAttributes;
std::vector<Varying> mActiveVaryings;
std::vector<gl::Uniform> mActiveUniforms;
std::vector<gl::InterfaceBlock> mActiveInterfaceBlocks;
std::vector<gl::Attribute> mActiveOutputVariables;
std::vector<gl::Attribute> mActiveAttributes;
std::vector<gl::Varying> mActiveVaryings;
std::map<TString, int> mStd140StructElementIndexes;
std::map<TIntermTyped*, TString> mFlaggedStructMappedNames;
std::map<TIntermTyped*, TString> mFlaggedStructOriginalNames;
......
......@@ -8,27 +8,27 @@
#define COMPILER_TRANSLATORHLSL_H_
#include "compiler/translator/ShHandle.h"
#include "compiler/translator/ShaderVariable.h"
#include "common/shadervars.h"
class TranslatorHLSL : public TCompiler {
public:
TranslatorHLSL(ShShaderType type, ShShaderSpec spec, ShShaderOutput output);
virtual TranslatorHLSL *getAsTranslatorHLSL() { return this; }
const std::vector<sh::Uniform> &getUniforms() { return mActiveUniforms; }
const sh::ActiveInterfaceBlocks &getInterfaceBlocks() const { return mActiveInterfaceBlocks; }
const std::vector<sh::Attribute> &getOutputVariables() { return mActiveOutputVariables; }
const std::vector<sh::Attribute> &getAttributes() { return mActiveAttributes; }
const std::vector<sh::Varying> &getVaryings() { return mActiveVaryings; }
const std::vector<gl::Uniform> &getUniforms() { return mActiveUniforms; }
const std::vector<gl::InterfaceBlock> &getInterfaceBlocks() const { return mActiveInterfaceBlocks; }
const std::vector<gl::Attribute> &getOutputVariables() { return mActiveOutputVariables; }
const std::vector<gl::Attribute> &getAttributes() { return mActiveAttributes; }
const std::vector<gl::Varying> &getVaryings() { return mActiveVaryings; }
protected:
virtual void translate(TIntermNode* root);
std::vector<sh::Uniform> mActiveUniforms;
sh::ActiveInterfaceBlocks mActiveInterfaceBlocks;
std::vector<sh::Attribute> mActiveOutputVariables;
std::vector<sh::Attribute> mActiveAttributes;
std::vector<sh::Varying> mActiveVaryings;
std::vector<gl::Uniform> mActiveUniforms;
std::vector<gl::InterfaceBlock> mActiveInterfaceBlocks;
std::vector<gl::Attribute> mActiveOutputVariables;
std::vector<gl::Attribute> mActiveAttributes;
std::vector<gl::Varying> mActiveVaryings;
ShShaderOutput mOutputType;
};
......
......@@ -11,12 +11,6 @@
#include "common/angleutils.h"
namespace sh
{
struct ShaderVariable;
struct Attribute;
}
namespace rx
{
class Renderer;
......@@ -32,23 +26,25 @@ struct VariableLocation;
struct LinkedVarying;
class VertexAttribute;
struct VertexFormat;
struct ShaderVariable;
struct Attribute;
class DynamicHLSL
{
public:
explicit DynamicHLSL(rx::Renderer *const renderer);
int packVaryings(InfoLog &infoLog, const sh::ShaderVariable *packing[][4], FragmentShader *fragmentShader,
int packVaryings(InfoLog &infoLog, const ShaderVariable *packing[][4], FragmentShader *fragmentShader,
VertexShader *vertexShader, const std::vector<std::string>& transformFeedbackVaryings);
std::string generateInputLayoutHLSL(const VertexFormat inputLayout[], const sh::Attribute shaderAttributes[]) const;
bool generateShaderLinkHLSL(InfoLog &infoLog, int registers, const sh::ShaderVariable *packing[][4],
std::string generateInputLayoutHLSL(const VertexFormat inputLayout[], const Attribute shaderAttributes[]) const;
bool generateShaderLinkHLSL(InfoLog &infoLog, int registers, const ShaderVariable *packing[][4],
std::string& pixelHLSL, std::string& vertexHLSL,
FragmentShader *fragmentShader, VertexShader *vertexShader,
const std::vector<std::string>& transformFeedbackVaryings,
std::vector<LinkedVarying> *linkedVaryings,
std::map<int, VariableLocation> *programOutputVars) const;
std::string generateGeometryShaderHLSL(int registers, const sh::ShaderVariable *packing[][4], FragmentShader *fragmentShader, VertexShader *vertexShader) const;
std::string generateGeometryShaderHLSL(int registers, const ShaderVariable *packing[][4], FragmentShader *fragmentShader, VertexShader *vertexShader) const;
static const std::string VERTEX_ATTRIBUTE_STUB_STRING;
......@@ -60,12 +56,12 @@ class DynamicHLSL
std::string generateVaryingHLSL(VertexShader *shader, const std::string &varyingSemantic,
std::vector<LinkedVarying> *linkedVaryings) const;
void defineOutputVariables(FragmentShader *fragmentShader, std::map<int, VariableLocation> *programOutputVars) const;
std::string generatePointSpriteHLSL(int registers, const sh::ShaderVariable *packing[][4], FragmentShader *fragmentShader, VertexShader *vertexShader) const;
std::string generatePointSpriteHLSL(int registers, const ShaderVariable *packing[][4], FragmentShader *fragmentShader, VertexShader *vertexShader) const;
// Prepend an underscore
static std::string decorateVariable(const std::string &name);
std::string generateAttributeConversionHLSL(const VertexFormat &vertexFormat, const sh::ShaderVariable &shaderAttrib) const;
std::string generateAttributeConversionHLSL(const VertexFormat &vertexFormat, const ShaderVariable &shaderAttrib) const;
};
// Utility method shared between ProgramBinary and DynamicHLSL
......
......@@ -84,7 +84,7 @@ class ProgramBinary : public RefCountObject
~ProgramBinary();
rx::ShaderExecutable *getPixelExecutable() const;
rx::ShaderExecutable *getVertexExecutableForInputLayout(const VertexFormat inputLayout[gl::MAX_VERTEX_ATTRIBS]);
rx::ShaderExecutable *getVertexExecutableForInputLayout(const VertexFormat inputLayout[MAX_VERTEX_ATTRIBS]);
rx::ShaderExecutable *getGeometryExecutable() const;
GLuint getAttributeLocation(const char *name);
......@@ -128,7 +128,7 @@ class ProgramBinary : public RefCountObject
void dirtyAllUniforms();
void applyUniforms();
bool applyUniformBuffers(const std::vector<gl::Buffer*> boundBuffers);
bool applyUniformBuffers(const std::vector<Buffer*> boundBuffers);
bool load(InfoLog &infoLog, const void *binary, GLsizei length);
bool save(void* binary, GLsizei bufSize, GLsizei *length);
......@@ -167,9 +167,9 @@ class ProgramBinary : public RefCountObject
int getShaderVersion() const;
void initAttributesByLayout();
void sortAttributesByLayout(rx::TranslatedAttribute attributes[gl::MAX_VERTEX_ATTRIBS], int sortedSemanticIndices[MAX_VERTEX_ATTRIBS]) const;
void sortAttributesByLayout(rx::TranslatedAttribute attributes[MAX_VERTEX_ATTRIBS], int sortedSemanticIndices[MAX_VERTEX_ATTRIBS]) const;
const UniformArray &getUniforms() const { return mUniforms; }
const std::vector<LinkedUniform*> &getUniforms() const { return mUniforms; }
const rx::UniformStorage &getVertexUniformStorage() const { return *mVertexUniformStorage; }
const rx::UniformStorage &getFragmentUniformStorage() const { return *mFragmentUniformStorage; }
......@@ -179,25 +179,25 @@ class ProgramBinary : public RefCountObject
bool linkVaryings(InfoLog &infoLog, FragmentShader *fragmentShader, VertexShader *vertexShader);
bool linkAttributes(InfoLog &infoLog, const AttributeBindings &attributeBindings, FragmentShader *fragmentShader, VertexShader *vertexShader);
typedef sh::BlockMemberInfoArray::const_iterator BlockInfoItr;
typedef BlockMemberInfoArray::const_iterator BlockInfoItr;
template <class ShaderVarType>
bool linkValidateFields(InfoLog &infoLog, const std::string &varName, const ShaderVarType &vertexVar, const ShaderVarType &fragmentVar);
bool linkValidateVariablesBase(InfoLog &infoLog, const std::string &variableName, const sh::ShaderVariable &vertexVariable, const sh::ShaderVariable &fragmentVariable, bool validatePrecision);
bool linkValidateVariables(InfoLog &infoLog, const std::string &uniformName, const sh::Uniform &vertexUniform, const sh::Uniform &fragmentUniform);
bool linkValidateVariables(InfoLog &infoLog, const std::string &varyingName, const sh::Varying &vertexVarying, const sh::Varying &fragmentVarying);
bool linkValidateVariables(InfoLog &infoLog, const std::string &uniformName, const sh::InterfaceBlockField &vertexUniform, const sh::InterfaceBlockField &fragmentUniform);
bool linkUniforms(InfoLog &infoLog, const std::vector<sh::Uniform> &vertexUniforms, const std::vector<sh::Uniform> &fragmentUniforms);
bool defineUniform(GLenum shader, const sh::Uniform &constant, InfoLog &infoLog);
bool areMatchingInterfaceBlocks(InfoLog &infoLog, const sh::InterfaceBlock &vertexInterfaceBlock, const sh::InterfaceBlock &fragmentInterfaceBlock);
bool linkUniformBlocks(InfoLog &infoLog, const sh::ActiveInterfaceBlocks &vertexUniformBlocks, const sh::ActiveInterfaceBlocks &fragmentUniformBlocks);
bool linkValidateVariablesBase(InfoLog &infoLog, const std::string &variableName, const ShaderVariable &vertexVariable, const ShaderVariable &fragmentVariable, bool validatePrecision);
bool linkValidateVariables(InfoLog &infoLog, const std::string &uniformName, const Uniform &vertexUniform, const Uniform &fragmentUniform);
bool linkValidateVariables(InfoLog &infoLog, const std::string &varyingName, const Varying &vertexVarying, const Varying &fragmentVarying);
bool linkValidateVariables(InfoLog &infoLog, const std::string &uniformName, const InterfaceBlockField &vertexUniform, const InterfaceBlockField &fragmentUniform);
bool linkUniforms(InfoLog &infoLog, const std::vector<Uniform> &vertexUniforms, const std::vector<Uniform> &fragmentUniforms);
bool defineUniform(GLenum shader, const Uniform &constant, InfoLog &infoLog);
bool areMatchingInterfaceBlocks(InfoLog &infoLog, const InterfaceBlock &vertexInterfaceBlock, const InterfaceBlock &fragmentInterfaceBlock);
bool linkUniformBlocks(InfoLog &infoLog, const std::vector<InterfaceBlock> &vertexUniformBlocks, const std::vector<InterfaceBlock> &fragmentUniformBlocks);
bool gatherTransformFeedbackLinkedVaryings(InfoLog &infoLog, const std::vector<LinkedVarying> &linkedVaryings,
const std::vector<std::string> &transformFeedbackVaryingNames,
GLenum transformFeedbackBufferMode,
std::vector<LinkedVarying> *outTransformFeedbackLinkedVaryings) const;
void defineUniformBlockMembers(const std::vector<sh::InterfaceBlockField> &fields, const std::string &prefix, int blockIndex, BlockInfoItr *blockInfoItr, std::vector<unsigned int> *blockUniformIndexes);
bool defineUniformBlock(InfoLog &infoLog, GLenum shader, const sh::InterfaceBlock &interfaceBlock);
void defineUniformBlockMembers(const std::vector<InterfaceBlockField> &fields, const std::string &prefix, int blockIndex, BlockInfoItr *blockInfoItr, std::vector<unsigned int> *blockUniformIndexes);
bool defineUniformBlock(InfoLog &infoLog, GLenum shader, const InterfaceBlock &interfaceBlock);
bool assignUniformBlockRegister(InfoLog &infoLog, UniformBlock *uniformBlock, GLenum shader, unsigned int registerIndex);
void defineOutputVariables(FragmentShader *fragmentShader);
void initializeUniformStorage();
......@@ -217,17 +217,17 @@ class ProgramBinary : public RefCountObject
{
public:
VertexExecutable(rx::Renderer *const renderer,
const VertexFormat inputLayout[gl::MAX_VERTEX_ATTRIBS],
const VertexFormat inputLayout[MAX_VERTEX_ATTRIBS],
rx::ShaderExecutable *shaderExecutable);
~VertexExecutable();
bool matchesInputLayout(const VertexFormat attributes[gl::MAX_VERTEX_ATTRIBS]) const;
bool matchesInputLayout(const VertexFormat attributes[MAX_VERTEX_ATTRIBS]) const;
const VertexFormat *inputs() const { return mInputs; }
rx::ShaderExecutable *shaderExecutable() const { return mShaderExecutable; }
private:
VertexFormat mInputs[gl::MAX_VERTEX_ATTRIBS];
VertexFormat mInputs[MAX_VERTEX_ATTRIBS];
rx::ShaderExecutable *mShaderExecutable;
};
......@@ -240,8 +240,8 @@ class ProgramBinary : public RefCountObject
rx::ShaderExecutable *mGeometryExecutable;
rx::ShaderExecutable *mPixelExecutable;
sh::Attribute mLinkedAttribute[MAX_VERTEX_ATTRIBS];
sh::Attribute mShaderAttributes[MAX_VERTEX_ATTRIBS];
Attribute mLinkedAttribute[MAX_VERTEX_ATTRIBS];
Attribute mShaderAttributes[MAX_VERTEX_ATTRIBS];
int mSemanticIndex[MAX_VERTEX_ATTRIBS];
int mAttributesByLayout[MAX_VERTEX_ATTRIBS];
......@@ -264,8 +264,8 @@ class ProgramBinary : public RefCountObject
bool mUsesPointSize;
int mShaderVersion;
UniformArray mUniforms;
UniformBlockArray mUniformBlocks;
std::vector<LinkedUniform*> mUniforms;
std::vector<UniformBlock*> mUniformBlocks;
std::vector<VariableLocation> mUniformIndex;
std::map<int, VariableLocation> mOutputVariables;
rx::UniformStorage *mVertexUniformStorage;
......
......@@ -115,17 +115,17 @@ void Shader::getTranslatedSource(GLsizei bufSize, GLsizei *length, char *buffer)
getSourceImpl(mHlsl, bufSize, length, buffer);
}
const std::vector<sh::Uniform> &Shader::getUniforms() const
const std::vector<Uniform> &Shader::getUniforms() const
{
return mActiveUniforms;
}
const sh::ActiveInterfaceBlocks &Shader::getInterfaceBlocks() const
const std::vector<InterfaceBlock> &Shader::getInterfaceBlocks() const
{
return mActiveInterfaceBlocks;
}
std::vector<sh::Varying> &Shader::getVaryings()
std::vector<Varying> &Shader::getVaryings()
{
return mVaryings;
}
......@@ -225,7 +225,7 @@ void Shader::parseVaryings(void *compiler)
{
if (!mHlsl.empty())
{
std::vector<sh::Varying> *activeVaryings;
std::vector<Varying> *activeVaryings;
ShGetInfoPointer(compiler, SH_ACTIVE_VARYINGS_ARRAY, reinterpret_cast<void**>(&activeVaryings));
mVaryings = *activeVaryings;
......@@ -357,11 +357,11 @@ void Shader::compileToHLSL(void *compiler)
void *activeUniforms;
ShGetInfoPointer(compiler, SH_ACTIVE_UNIFORMS_ARRAY, &activeUniforms);
mActiveUniforms = *(std::vector<sh::Uniform>*)activeUniforms;
mActiveUniforms = *(std::vector<Uniform>*)activeUniforms;
void *activeInterfaceBlocks;
ShGetInfoPointer(compiler, SH_ACTIVE_INTERFACE_BLOCKS_ARRAY, &activeInterfaceBlocks);
mActiveInterfaceBlocks = *(sh::ActiveInterfaceBlocks*)activeInterfaceBlocks;
mActiveInterfaceBlocks = *(std::vector<InterfaceBlock>*)activeInterfaceBlocks;
}
else
{
......@@ -440,7 +440,7 @@ static const GLenum varyingPriorityList[] =
};
// true if varying x has a higher priority in packing than y
bool Shader::compareVarying(const sh::ShaderVariable &x, const sh::ShaderVariable &y)
bool Shader::compareVarying(const ShaderVariable &x, const ShaderVariable &y)
{
if (x.type == y.type)
{
......@@ -511,7 +511,7 @@ int VertexShader::getSemanticIndex(const std::string &attributeName)
int semanticIndex = 0;
for (unsigned int attributeIndex = 0; attributeIndex < mActiveAttributes.size(); attributeIndex++)
{
const sh::ShaderVariable &attribute = mActiveAttributes[attributeIndex];
const ShaderVariable &attribute = mActiveAttributes[attributeIndex];
if (attribute.name == attributeName)
{
......@@ -532,7 +532,7 @@ void VertexShader::parseAttributes()
{
void *activeAttributes;
ShGetInfoPointer(mVertexCompiler, SH_ACTIVE_ATTRIBUTES_ARRAY, &activeAttributes);
mActiveAttributes = *(std::vector<sh::Attribute>*)activeAttributes;
mActiveAttributes = *(std::vector<Attribute>*)activeAttributes;
}
}
......@@ -563,7 +563,7 @@ void FragmentShader::compile()
{
void *activeOutputVariables;
ShGetInfoPointer(mFragmentCompiler, SH_ACTIVE_OUTPUT_VARIABLES_ARRAY, &activeOutputVariables);
mActiveOutputVariables = *(std::vector<sh::Attribute>*)activeOutputVariables;
mActiveOutputVariables = *(std::vector<Attribute>*)activeOutputVariables;
}
}
......@@ -574,7 +574,7 @@ void FragmentShader::uncompile()
mActiveOutputVariables.clear();
}
const std::vector<sh::Attribute> &FragmentShader::getOutputVariables() const
const std::vector<Attribute> &FragmentShader::getOutputVariables() const
{
return mActiveOutputVariables;
}
......
......@@ -19,7 +19,7 @@
#include <list>
#include <vector>
#include "compiler/translator/ShaderVariable.h"
#include "common/shadervars.h"
#include "common/angleutils.h"
#include "libGLESv2/angletypes.h"
......@@ -52,9 +52,9 @@ class Shader
void getSource(GLsizei bufSize, GLsizei *length, char *buffer) const;
int getTranslatedSourceLength() const;
void getTranslatedSource(GLsizei bufSize, GLsizei *length, char *buffer) const;
const std::vector<sh::Uniform> &getUniforms() const;
const sh::ActiveInterfaceBlocks &getInterfaceBlocks() const;
std::vector<sh::Varying> &getVaryings();
const std::vector<Uniform> &getUniforms() const;
const std::vector<InterfaceBlock> &getInterfaceBlocks() const;
std::vector<Varying> &getVaryings();
virtual void compile() = 0;
virtual void uncompile();
......@@ -82,11 +82,11 @@ class Shader
void getSourceImpl(const std::string &source, GLsizei bufSize, GLsizei *length, char *buffer) const;
static bool compareVarying(const sh::ShaderVariable &x, const sh::ShaderVariable &y);
static bool compareVarying(const ShaderVariable &x, const ShaderVariable &y);
const rx::Renderer *const mRenderer;
std::vector<sh::Varying> mVaryings;
std::vector<Varying> mVaryings;
bool mUsesMultipleRenderTargets;
bool mUsesFragColor;
......@@ -116,8 +116,8 @@ class Shader
std::string mSource;
std::string mHlsl;
std::string mInfoLog;
std::vector<sh::Uniform> mActiveUniforms;
sh::ActiveInterfaceBlocks mActiveInterfaceBlocks;
std::vector<Uniform> mActiveUniforms;
std::vector<InterfaceBlock> mActiveInterfaceBlocks;
ResourceManager *mResourceManager;
};
......@@ -136,14 +136,14 @@ class VertexShader : public Shader
virtual void uncompile();
int getSemanticIndex(const std::string &attributeName);
const std::vector<sh::Attribute> &activeAttributes() const { return mActiveAttributes; }
const std::vector<Attribute> &activeAttributes() const { return mActiveAttributes; }
private:
DISALLOW_COPY_AND_ASSIGN(VertexShader);
void parseAttributes();
std::vector<sh::Attribute> mActiveAttributes;
std::vector<Attribute> mActiveAttributes;
};
class FragmentShader : public Shader
......@@ -156,12 +156,12 @@ class FragmentShader : public Shader
virtual GLenum getType();
virtual void compile();
virtual void uncompile();
const std::vector<sh::Attribute> &getOutputVariables() const;
const std::vector<Attribute> &getOutputVariables() const;
private:
DISALLOW_COPY_AND_ASSIGN(FragmentShader);
std::vector<sh::Attribute> mActiveOutputVariables;
std::vector<Attribute> mActiveOutputVariables;
};
}
......
......@@ -12,7 +12,8 @@
namespace gl
{
Uniform::Uniform(GLenum type, GLenum precision, const std::string &name, unsigned int arraySize, const int blockIndex, const sh::BlockMemberInfo &blockInfo)
LinkedUniform::LinkedUniform(GLenum type, GLenum precision, const std::string &name, unsigned int arraySize,
const int blockIndex, const BlockMemberInfo &blockInfo)
: type(type),
precision(precision),
name(name),
......@@ -37,45 +38,45 @@ Uniform::Uniform(GLenum type, GLenum precision, const std::string &name, unsigne
}
}
Uniform::~Uniform()
LinkedUniform::~LinkedUniform()
{
delete[] data;
}
bool Uniform::isArray() const
bool LinkedUniform::isArray() const
{
return arraySize > 0;
}
unsigned int Uniform::elementCount() const
unsigned int LinkedUniform::elementCount() const
{
return arraySize > 0 ? arraySize : 1;
}
bool Uniform::isReferencedByVertexShader() const
bool LinkedUniform::isReferencedByVertexShader() const
{
return vsRegisterIndex != GL_INVALID_INDEX;
}
bool Uniform::isReferencedByFragmentShader() const
bool LinkedUniform::isReferencedByFragmentShader() const
{
return psRegisterIndex != GL_INVALID_INDEX;
}
bool Uniform::isInDefaultBlock() const
bool LinkedUniform::isInDefaultBlock() const
{
return blockIndex == -1;
}
size_t Uniform::dataSize() const
size_t LinkedUniform::dataSize() const
{
ASSERT(type != GL_STRUCT_ANGLEX);
return UniformInternalSize(type) * elementCount();
}
bool Uniform::isSampler() const
bool LinkedUniform::isSampler() const
{
return gl::IsSampler(type);
return IsSampler(type);
}
UniformBlock::UniformBlock(const std::string &name, unsigned int elementIndex, unsigned int dataSize)
......
......@@ -16,17 +16,17 @@
#include "common/debug.h"
#include "angletypes.h"
#include "compiler/translator/ShaderVariable.h"
#include "common/shadervars.h"
namespace gl
{
// Helper struct representing a single shader uniform
struct Uniform
struct LinkedUniform
{
Uniform(GLenum type, GLenum precision, const std::string &name, unsigned int arraySize, const int blockIndex, const sh::BlockMemberInfo &blockInfo);
LinkedUniform(GLenum type, GLenum precision, const std::string &name, unsigned int arraySize, const int blockIndex, const BlockMemberInfo &blockInfo);
~Uniform();
~LinkedUniform();
bool isArray() const;
unsigned int elementCount() const;
......@@ -41,7 +41,7 @@ struct Uniform
const std::string name;
const unsigned int arraySize;
const int blockIndex;
const sh::BlockMemberInfo blockInfo;
const BlockMemberInfo blockInfo;
unsigned char *data;
bool dirty;
......@@ -55,8 +55,6 @@ struct Uniform
unsigned int registerElement;
};
typedef std::vector<Uniform*> UniformArray;
// Helper struct representing a single shader uniform block
struct UniformBlock
{
......@@ -77,8 +75,6 @@ struct UniformBlock
unsigned int vsRegisterIndex;
};
typedef std::vector<UniformBlock*> UniformBlockArray;
}
#endif // LIBGLESV2_UNIFORM_H_
......@@ -1574,7 +1574,7 @@ void Renderer11::applyShaders(gl::ProgramBinary *programBinary, bool rasterizerD
void Renderer11::applyUniforms(const gl::ProgramBinary &programBinary)
{
const gl::UniformArray &uniformArray = programBinary.getUniforms();
const std::vector<gl::LinkedUniform*> &uniformArray = programBinary.getUniforms();
unsigned int totalRegisterCountVS = 0;
unsigned int totalRegisterCountPS = 0;
......@@ -1584,7 +1584,7 @@ void Renderer11::applyUniforms(const gl::ProgramBinary &programBinary)
for (size_t uniformIndex = 0; uniformIndex < uniformArray.size(); uniformIndex++)
{
const gl::Uniform &uniform = *uniformArray[uniformIndex];
const gl::LinkedUniform &uniform = *uniformArray[uniformIndex];
if (uniform.isReferencedByVertexShader() && !uniform.isSampler())
{
......@@ -1628,7 +1628,7 @@ void Renderer11::applyUniforms(const gl::ProgramBinary &programBinary)
for (size_t uniformIndex = 0; uniformIndex < uniformArray.size(); uniformIndex++)
{
gl::Uniform *uniform = uniformArray[uniformIndex];
gl::LinkedUniform *uniform = uniformArray[uniformIndex];
if (!uniform->isSampler())
{
......
......@@ -1768,11 +1768,11 @@ void Renderer9::applyShaders(gl::ProgramBinary *programBinary, bool rasterizerDi
void Renderer9::applyUniforms(const gl::ProgramBinary &programBinary)
{
const gl::UniformArray &uniformArray = programBinary.getUniforms();
const std::vector<gl::LinkedUniform*> &uniformArray = programBinary.getUniforms();
for (size_t uniformIndex = 0; uniformIndex < uniformArray.size(); uniformIndex++)
{
gl::Uniform *targetUniform = uniformArray[uniformIndex];
gl::LinkedUniform *targetUniform = uniformArray[uniformIndex];
if (targetUniform->dirty)
{
......@@ -1820,7 +1820,7 @@ void Renderer9::applyUniforms(const gl::ProgramBinary &programBinary)
}
}
void Renderer9::applyUniformnfv(gl::Uniform *targetUniform, const GLfloat *v)
void Renderer9::applyUniformnfv(gl::LinkedUniform *targetUniform, const GLfloat *v)
{
if (targetUniform->isReferencedByFragmentShader())
{
......@@ -1833,7 +1833,7 @@ void Renderer9::applyUniformnfv(gl::Uniform *targetUniform, const GLfloat *v)
}
}
void Renderer9::applyUniformniv(gl::Uniform *targetUniform, const GLint *v)
void Renderer9::applyUniformniv(gl::LinkedUniform *targetUniform, const GLint *v)
{
ASSERT(targetUniform->registerCount <= MAX_VERTEX_CONSTANT_VECTORS_D3D9);
GLfloat vector[MAX_VERTEX_CONSTANT_VECTORS_D3D9][4];
......@@ -1849,7 +1849,7 @@ void Renderer9::applyUniformniv(gl::Uniform *targetUniform, const GLint *v)
applyUniformnfv(targetUniform, (GLfloat*)vector);
}
void Renderer9::applyUniformnbv(gl::Uniform *targetUniform, const GLint *v)
void Renderer9::applyUniformnbv(gl::LinkedUniform *targetUniform, const GLint *v)
{
ASSERT(targetUniform->registerCount <= MAX_VERTEX_CONSTANT_VECTORS_D3D9);
GLfloat vector[MAX_VERTEX_CONSTANT_VECTORS_D3D9][4];
......
......@@ -241,9 +241,9 @@ class Renderer9 : public Renderer
void deinitialize();
void applyUniformnfv(gl::Uniform *targetUniform, const GLfloat *v);
void applyUniformniv(gl::Uniform *targetUniform, const GLint *v);
void applyUniformnbv(gl::Uniform *targetUniform, const GLint *v);
void applyUniformnfv(gl::LinkedUniform *targetUniform, const GLfloat *v);
void applyUniformniv(gl::LinkedUniform *targetUniform, const GLint *v);
void applyUniformnbv(gl::LinkedUniform *targetUniform, const GLint *v);
void drawLineLoop(GLsizei count, GLenum type, const GLvoid *indices, int minIndex, gl::Buffer *elementArrayBuffer);
void drawIndexedPoints(GLsizei count, GLenum type, const GLvoid *indices, int minIndex, gl::Buffer *elementArrayBuffer);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment