Unverified Commit e08ed0cc by John Kessenich Committed by GitHub

Merge pull request #1190 from jfmarquis/hlsl-store-type-propagation

HLSL: Fix possibly incorrect type conversion in Store2-3-4
parents 848a0ccb 3f0aff8e
......@@ -18,13 +18,13 @@ local_size = (256, 1, 1)
0:6 Constant:
0:6 2 (const int)
0:? Construct vec2 ( temp 2-component vector of uint)
0:6 indirect index ( temp float)
0:6 indirect index ( temp uint)
0:6 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint)
0:6 'buffer' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data})
0:6 Constant:
0:6 0 (const uint)
0:6 'byteAddrTemp' ( temp int)
0:6 indirect index ( temp float)
0:6 indirect index ( temp uint)
0:6 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint)
0:6 'buffer' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data})
0:6 Constant:
......@@ -87,13 +87,13 @@ local_size = (256, 1, 1)
0:6 Constant:
0:6 2 (const int)
0:? Construct vec2 ( temp 2-component vector of uint)
0:6 indirect index ( temp float)
0:6 indirect index ( temp uint)
0:6 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint)
0:6 'buffer' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data})
0:6 Constant:
0:6 0 (const uint)
0:6 'byteAddrTemp' ( temp int)
0:6 indirect index ( temp float)
0:6 indirect index ( temp uint)
0:6 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint)
0:6 'buffer' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data})
0:6 Constant:
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -3302,7 +3302,13 @@ void HlslParseContext::decomposeStructBufferMethods(const TSourceLoc& loc, TInte
const TOperator idxOp = (offsetIdx->getQualifier().storage == EvqConst) ? EOpIndexDirect
: EOpIndexIndirect;
vec = intermediate.growAggregate(vec, intermediate.addIndex(idxOp, argArray, offsetIdx, loc));
TIntermTyped* indexVal = intermediate.addIndex(idxOp, argArray, offsetIdx, loc);
TType derefType(argArray->getType(), 0);
derefType.getQualifier().makeTemporary();
indexVal->setType(derefType);
vec = intermediate.growAggregate(vec, indexVal);
}
vec->setType(TType(argArray->getBasicType(), EvqTemporary, size));
......@@ -3366,8 +3372,14 @@ void HlslParseContext::decomposeStructBufferMethods(const TSourceLoc& loc, TInte
const TType derefType(argArray->getType(), 0);
lValue->setType(derefType);
TIntermTyped* rValue = (size == 1) ? argValue :
intermediate.addIndex(EOpIndexDirect, argValue, idxConst, loc);
TIntermTyped* rValue;
if (size == 1) {
rValue = argValue;
} else {
rValue = intermediate.addIndex(EOpIndexDirect, argValue, idxConst, loc);
const TType indexType(argValue->getType(), 0);
rValue->setType(indexType);
}
TIntermTyped* assign = intermediate.addAssign(EOpAssign, lValue, rValue, loc);
......
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