HLSL: fix type on clip/cull index result
While adding geometry stage support for clip/cull, it transpired that the existing clip/cull support was not setting the type of the result of indexing into the clup/cull variable. That's a defect independent of the geometry support, so to simplify the geometry PR, this is addressed separately. It doesn't appear to change the generated SPIR-V, but that's probably down to something else tolerating a bad input.
This commit is contained in:
@@ -2412,9 +2412,15 @@ TIntermAggregate* HlslParseContext::assignClipCullDistance(const TSourceLoc& loc
|
||||
// Loop through every component of every element of the internal, and copy to or from the matching external.
|
||||
for (int internalArrayPos = 0; internalArrayPos < internalNodeArraySize; ++internalArrayPos) {
|
||||
for (int internalComponent = 0; internalComponent < internalNodeVectorSize; ++internalComponent) {
|
||||
TIntermTyped* clipCullMember = clipCullSym;
|
||||
|
||||
// array member to read from / write to:
|
||||
TIntermTyped* clipCullMember = intermediate.addIndex(EOpIndexDirect, clipCullSym,
|
||||
intermediate.addConstantUnion(clipCullArrayPos++, loc), loc);
|
||||
{
|
||||
const TType derefType(clipCullMember->getType(), 0);
|
||||
clipCullMember = intermediate.addIndex(EOpIndexDirect, clipCullMember,
|
||||
intermediate.addConstantUnion(clipCullArrayPos++, loc), loc);
|
||||
clipCullMember->setType(derefType);
|
||||
}
|
||||
|
||||
TIntermTyped* internalMember = internalNode;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user