Commit b29ba330 by John Kessenich

Fix bug of accidentally overriding initial layout location with 0, which does…

Fix bug of accidentally overriding initial layout location with 0, which does not mean no location. Added in/out structure tests. git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22120 e7fa87d3-cd2b-0410-9028-fcbf551c1848
parent 211cba24
...@@ -38,6 +38,16 @@ struct s { ...@@ -38,6 +38,16 @@ struct s {
out s badout; // ERROR out s badout; // ERROR
struct S2 {
vec3 c;
float f;
};
in S2 s2;
out vec3 sc;
out float sf;
void main() void main()
{ {
float f; float f;
...@@ -74,6 +84,9 @@ void main() ...@@ -74,6 +84,9 @@ void main()
f += gl_FragCoord.y; f += gl_FragCoord.y;
gl_FragDepth = f; gl_FragDepth = f;
sc = s2.c;
sf = s2.f;
} }
float imageBuffer; // ERROR, reserved float imageBuffer; // ERROR, reserved
......
...@@ -9,6 +9,13 @@ varying vec2 v2; // ERROR ...@@ -9,6 +9,13 @@ varying vec2 v2; // ERROR
in vec4 bad[10]; // ERROR in vec4 bad[10]; // ERROR
struct S {
vec3 c;
float f;
};
out S s;
void main() void main()
{ {
int id = gl_VertexID + gl_InstanceID; int id = gl_VertexID + gl_InstanceID;
...@@ -34,6 +41,9 @@ void main() ...@@ -34,6 +41,9 @@ void main()
gl_Position = m44[2]; gl_Position = m44[2];
gl_PointSize = v2.y; gl_PointSize = v2.y;
s.c = v3;
s.f = dm;
#ifdef GL_ES #ifdef GL_ES
#error GL_ES is set #error GL_ES is set
#else #else
......
...@@ -687,6 +687,7 @@ public: ...@@ -687,6 +687,7 @@ public:
const char* getStorageQualifierString() const { return ::getStorageQualifierString(qualifier.storage); } const char* getStorageQualifierString() const { return ::getStorageQualifierString(qualifier.storage); }
const char* getPrecisionQualifierString() const { return ::getPrecisionQualifierString(qualifier.precision); } const char* getPrecisionQualifierString() const { return ::getPrecisionQualifierString(qualifier.precision); }
TTypeList* getStruct() { return structure; } TTypeList* getStruct() { return structure; }
TTypeList* getStruct() const { return structure; }
int getObjectSize() const int getObjectSize() const
{ {
...@@ -705,7 +706,6 @@ public: ...@@ -705,7 +706,6 @@ public:
return totalSize; return totalSize;
} }
TTypeList* getStruct() const { return structure; }
TString& getMangledName() TString& getMangledName()
{ {
if (!mangled) { if (!mangled) {
......
...@@ -84,13 +84,10 @@ TParseContext::TParseContext(TSymbolTable& symt, TIntermediate& interm, int v, E ...@@ -84,13 +84,10 @@ TParseContext::TParseContext(TSymbolTable& symt, TIntermediate& interm, int v, E
globalUniformDefaults.clear(); globalUniformDefaults.clear();
globalUniformDefaults.layoutMatrix = ElmColumnMajor; globalUniformDefaults.layoutMatrix = ElmColumnMajor;
globalUniformDefaults.layoutPacking = ElpShared; globalUniformDefaults.layoutPacking = ElpShared;
globalUniformDefaults.layoutSlotLocation = 0;
globalInputDefaults.clear(); globalInputDefaults.clear();
globalInputDefaults.layoutSlotLocation = 0;
globalOutputDefaults.clear(); globalOutputDefaults.clear();
globalOutputDefaults.layoutSlotLocation = 0;
} }
// Get code that is not part of a shared symbol table, specific to this shader // Get code that is not part of a shared symbol table, specific to this shader
......
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