Commit 70e057a4 by John Kessenich

Merge branch GitHub 'master' into GitLab master

parents 3863412e 863aa667
...@@ -2954,7 +2954,7 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv:: ...@@ -2954,7 +2954,7 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
spv::Op opCode = spv::OpNop; spv::Op opCode = spv::OpNop;
int libCall = -1; int libCall = -1;
int consumedOperands = operands.size(); size_t consumedOperands = operands.size();
spv::Id typeId0 = 0; spv::Id typeId0 = 0;
if (consumedOperands > 0) if (consumedOperands > 0)
typeId0 = builder.getTypeId(operands[0]); typeId0 = builder.getTypeId(operands[0]);
......
...@@ -1365,7 +1365,7 @@ Id Builder::createTextureQueryCall(Op opCode, const TextureParameters& parameter ...@@ -1365,7 +1365,7 @@ Id Builder::createTextureQueryCall(Op opCode, const TextureParameters& parameter
case OpImageQuerySize: case OpImageQuerySize:
case OpImageQuerySizeLod: case OpImageQuerySizeLod:
{ {
int numComponents; int numComponents = 0;
switch (getTypeDimensionality(getImageType(parameters.sampler))) { switch (getTypeDimensionality(getImageType(parameters.sampler))) {
case Dim1D: case Dim1D:
case DimBuffer: case DimBuffer:
......
...@@ -85,7 +85,7 @@ Uniform block reflection: ...@@ -85,7 +85,7 @@ Uniform block reflection:
nameless: offset -1, type ffffffff, size 496, index -1 nameless: offset -1, type ffffffff, size 496, index -1
named: offset -1, type ffffffff, size 304, index -1 named: offset -1, type ffffffff, size 304, index -1
c_nameless: offset -1, type ffffffff, size 112, index -1 c_nameless: offset -1, type ffffffff, size 112, index -1
nested: offset -1, type ffffffff, size 28, index -1 nested: offset -1, type ffffffff, size 32, index -1
abl[0]: offset -1, type ffffffff, size 4, index -1 abl[0]: offset -1, type ffffffff, size 4, index -1
abl[1]: offset -1, type ffffffff, size 4, index -1 abl[1]: offset -1, type ffffffff, size 4, index -1
abl[2]: offset -1, type ffffffff, size 4, index -1 abl[2]: offset -1, type ffffffff, size 4, index -1
......
...@@ -309,7 +309,7 @@ struct str_hash ...@@ -309,7 +309,7 @@ struct str_hash
unsigned long hash = 5381; unsigned long hash = 5381;
int c; int c;
while ((c = *str++)) while ((c = *str++) != 0)
hash = ((hash << 5) + hash) + c; hash = ((hash << 5) + hash) + c;
return hash; return hash;
......
...@@ -959,6 +959,11 @@ int TIntermediate::getBaseAlignment(const TType& type, int& size, int& stride, b ...@@ -959,6 +959,11 @@ int TIntermediate::getBaseAlignment(const TType& type, int& size, int& stride, b
size += memberSize; size += memberSize;
} }
// The structure may have padding at the end; the base offset of
// the member following the sub-structure is rounded up to the next
// multiple of the base alignment of the structure.
RoundToPow2(size, maxAlignment);
return maxAlignment; return maxAlignment;
} }
...@@ -982,7 +987,7 @@ int TIntermediate::getBaseAlignment(const TType& type, int& size, int& stride, b ...@@ -982,7 +987,7 @@ int TIntermediate::getBaseAlignment(const TType& type, int& size, int& stride, b
// rules 5 and 7 // rules 5 and 7
if (type.isMatrix()) { if (type.isMatrix()) {
// rule 5: deref to row, not to column, meaning the size of vector is num columns instead of num rows // rule 5: deref to row, not to column, meaning the size of vector is num columns instead of num rows
TType derefType(type, 0, type.getQualifier().layoutMatrix == ElmRowMajor); TType derefType(type, 0, rowMajor);
alignment = getBaseAlignment(derefType, size, dummyStride, std140, rowMajor); alignment = getBaseAlignment(derefType, size, dummyStride, std140, rowMajor);
if (std140) if (std140)
......
...@@ -195,7 +195,7 @@ int TPpContext::ReadToken(TokenStream *pTok, TPpToken *ppToken) ...@@ -195,7 +195,7 @@ int TPpContext::ReadToken(TokenStream *pTok, TPpToken *ppToken)
case PpAtomConstUint: case PpAtomConstUint:
len = 0; len = 0;
ch = lReadByte(pTok); ch = lReadByte(pTok);
while (ch != 0) { while (ch != 0 && ch != EndOfInput) {
if (len < MaxTokenLength) { if (len < MaxTokenLength) {
tokenText[len] = (char)ch; tokenText[len] = (char)ch;
len++; len++;
...@@ -215,12 +215,10 @@ int TPpContext::ReadToken(TokenStream *pTok, TPpToken *ppToken) ...@@ -215,12 +215,10 @@ int TPpContext::ReadToken(TokenStream *pTok, TPpToken *ppToken)
break; break;
case PpAtomConstFloat: case PpAtomConstFloat:
case PpAtomConstDouble: case PpAtomConstDouble:
strcpy(ppToken->name, tokenText);
ppToken->dval = atof(ppToken->name); ppToken->dval = atof(ppToken->name);
break; break;
case PpAtomConstInt: case PpAtomConstInt:
case PpAtomConstUint: case PpAtomConstUint:
strcpy(ppToken->name, tokenText);
if (len > 0 && tokenText[0] == '0') { if (len > 0 && tokenText[0] == '0') {
if (len > 1 && (tokenText[1] == 'x' || tokenText[1] == 'X')) if (len > 1 && (tokenText[1] == 'x' || tokenText[1] == 'X'))
ppToken->ival = strtol(ppToken->name, 0, 16); ppToken->ival = strtol(ppToken->name, 0, 16);
......
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