Commit fe1dd4bd by Chris Forbes

Carry decorations down type tree in WalkExplicitLayoutAccessChain

Bug: b/128690261 Bug: b/128872954 Test: dEQP-VK.*push_constant* Test: dEQP-VK.glsl.* Test: dEQP-VK.spirv_assembly.* Change-Id: I0f8d103288777cd03347b32366ed5c5606e38b8d Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27588 Presubmit-Ready: Chris Forbes <chrisforbes@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Tested-by: 's avatarChris Forbes <chrisforbes@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
parent a30de542
...@@ -751,6 +751,8 @@ namespace sw ...@@ -751,6 +751,8 @@ namespace sw
SIMD::Int dynamicOffset = SIMD::Int(0); SIMD::Int dynamicOffset = SIMD::Int(0);
auto &baseObject = getObject(id); auto &baseObject = getObject(id);
Type::ID typeId = getType(baseObject.type).element; Type::ID typeId = getType(baseObject.type).element;
Decorations d{};
ApplyDecorationsForId(&d, baseObject.type);
// The <base> operand is an intermediate value itself, ie produced by a previous OpAccessChain. // The <base> operand is an intermediate value itself, ie produced by a previous OpAccessChain.
// Start with its offset and build from there. // Start with its offset and build from there.
...@@ -767,7 +769,6 @@ namespace sw ...@@ -767,7 +769,6 @@ namespace sw
case spv::OpTypeStruct: case spv::OpTypeStruct:
{ {
int memberIndex = GetConstantInt(indexIds[i]); int memberIndex = GetConstantInt(indexIds[i]);
Decorations d{};
ApplyDecorationsForIdMember(&d, typeId, memberIndex); ApplyDecorationsForIdMember(&d, typeId, memberIndex);
ASSERT(d.HasOffset); ASSERT(d.HasOffset);
constantOffset += d.Offset / sizeof(float); constantOffset += d.Offset / sizeof(float);
...@@ -778,7 +779,6 @@ namespace sw ...@@ -778,7 +779,6 @@ namespace sw
case spv::OpTypeRuntimeArray: case spv::OpTypeRuntimeArray:
{ {
// TODO: b/127950082: Check bounds. // TODO: b/127950082: Check bounds.
Decorations d{};
ApplyDecorationsForId(&d, typeId); ApplyDecorationsForId(&d, typeId);
ASSERT(d.HasArrayStride); ASSERT(d.HasArrayStride);
auto & obj = getObject(indexIds[i]); auto & obj = getObject(indexIds[i]);
...@@ -792,7 +792,6 @@ namespace sw ...@@ -792,7 +792,6 @@ namespace sw
case spv::OpTypeMatrix: case spv::OpTypeMatrix:
{ {
// TODO: b/127950082: Check bounds. // TODO: b/127950082: Check bounds.
Decorations d{};
ApplyDecorationsForId(&d, typeId); ApplyDecorationsForId(&d, typeId);
ASSERT(d.HasMatrixStride); ASSERT(d.HasMatrixStride);
auto & obj = getObject(indexIds[i]); auto & obj = getObject(indexIds[i]);
......
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