Sampler allocation fix Because samplers can be stored within structures, register allocation of entire structures within the samplers registers was pushing sampler indices outside of the allowed limit. In order to solve this, sampler registers now exclusively contain samplers, and utility functions to compute sampler only type size were added to make this possible. Bug chromium:797264 Change-Id: Ic5a6f09665c39661944444cd736547bce4dff2ab Reviewed-on: https://swiftshader-review.googlesource.com/15728 Tested-by: Alexis Hétu <sugoi@google.com> Reviewed-by: Nicolas Capens <nicolascapens@google.com>
diff --git a/src/OpenGL/compiler/OutputASM.h b/src/OpenGL/compiler/OutputASM.h index 584e0d9..72bf974 100644 --- a/src/OpenGL/compiler/OutputASM.h +++ b/src/OpenGL/compiler/OutputASM.h
@@ -305,10 +305,10 @@ int lookup(VariableArray &list, TIntermTyped *variable); int lookup(VariableArray &list, TInterfaceBlock *block); int blockMemberLookup(const TType &type, const TString &name, int registerIndex); - int allocate(VariableArray &list, TIntermTyped *variable); + int allocate(VariableArray &list, TIntermTyped *variable, bool samplersOnly = false); void free(VariableArray &list, TIntermTyped *variable); - void declareUniform(const TType &type, const TString &name, int registerIndex, int blockId = -1, BlockLayoutEncoder* encoder = nullptr); + void declareUniform(const TType &type, const TString &name, int registerIndex, bool samplersOnly, int blockId = -1, BlockLayoutEncoder* encoder = nullptr); GLenum glVariableType(const TType &type); GLenum glVariablePrecision(const TType &type);