Fixed my previous fixes.

This commit is contained in:
Patrick 2024-06-26 18:21:58 +02:00
parent c622ed7f86
commit 06aba7dee9
2 changed files with 12 additions and 10 deletions

View File

@ -4880,7 +4880,7 @@ void TGlslangToSpvTraverser::decorateStructType(const glslang::TType& type,
std::vector<spv::Decoration> memory; std::vector<spv::Decoration> memory;
TranslateMemoryDecoration(memberQualifier, memory, glslangIntermediate->usingVulkanMemoryModel()); TranslateMemoryDecoration(memberQualifier, memory, glslangIntermediate->usingVulkanMemoryModel());
// BEGIN @MEWIN - 2024-06-26 - Fixed shadowing warning. // BEGIN @MEWIN - 2024-06-26 - Fixed shadowing warning.
for (unsigned int j = 0; i < memory.size(); ++j) for (unsigned int j = 0; j < memory.size(); ++j)
builder.addMemberDecoration(spvType, member, memory[j]); builder.addMemberDecoration(spvType, member, memory[j]);
// END @MEWIN // END @MEWIN
} }

View File

@ -8363,13 +8363,15 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T
break; break;
case EbtInt16: case EbtInt16:
switch (node->getType().getBasicType()) { switch (node->getType().getBasicType()) {
case EbtFloat: op = EOpConvFloatToInt16; break; // BEGIN @MEWIN - 2024-06-26 - Fixed shadowing warning.
case EbtFloat16: op = EOpConvFloat16ToInt16; break; case EbtFloat: nodeOp = EOpConvFloatToInt16; break;
case EbtUint8: op = EOpConvUint8ToInt16; break; case EbtFloat16: nodeOp = EOpConvFloat16ToInt16; break;
case EbtInt8: op = EOpConvInt8ToInt16; break; case EbtUint8: nodeOp = EOpConvUint8ToInt16; break;
case EbtUint16: op = EOpConvUint16ToInt16; break; case EbtInt8: nodeOp = EOpConvInt8ToInt16; break;
case EbtInt: op = EOpConvIntToInt16; break; case EbtUint16: nodeOp = EOpConvUint16ToInt16; break;
case EbtUint: op = EOpConvUintToInt16; break; case EbtInt: nodeOp = EOpConvIntToInt16; break;
case EbtUint: nodeOp = EOpConvUintToInt16; break;
// END @MEWIN
default: assert(0); default: assert(0);
} }
break; break;
@ -8445,10 +8447,10 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T
break; break;
} }
node = intermediate.addUnaryNode(op, node, node->getLoc(), type); node = intermediate.addUnaryNode(nodeOp, node, node->getLoc(), type);
// If it's a (non-specialization) constant, it must be folded. // If it's a (non-specialization) constant, it must be folded.
if (node->getAsUnaryNode()->getOperand()->getAsConstantUnion()) if (node->getAsUnaryNode()->getOperand()->getAsConstantUnion())
return node->getAsUnaryNode()->getOperand()->getAsConstantUnion()->fold(op, node->getType()); return node->getAsUnaryNode()->getOperand()->getAsConstantUnion()->fold(nodeOp, node->getType());
} }
return node; return node;