From: Chris Forbes Date: Tue, 19 Mar 2019 16:06:19 +0000 (-0700) Subject: Carry decorations down type tree in WalkExplicitLayoutAccessChain X-Git-Tag: android-x86-9.0-r1~116 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=fe1dd4bd781da99626f124b7e05ae356fb04d4b7;p=android-x86%2Fexternal-swiftshader.git 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 Reviewed-by: Nicolas Capens Tested-by: Chris Forbes Kokoro-Presubmit: kokoro --- diff --git a/src/Pipeline/SpirvShader.cpp b/src/Pipeline/SpirvShader.cpp index 46a8fd532..f348c03cc 100644 --- a/src/Pipeline/SpirvShader.cpp +++ b/src/Pipeline/SpirvShader.cpp @@ -751,6 +751,8 @@ namespace sw SIMD::Int dynamicOffset = SIMD::Int(0); auto &baseObject = getObject(id); Type::ID typeId = getType(baseObject.type).element; + Decorations d{}; + ApplyDecorationsForId(&d, baseObject.type); // The operand is an intermediate value itself, ie produced by a previous OpAccessChain. // Start with its offset and build from there. @@ -767,7 +769,6 @@ namespace sw case spv::OpTypeStruct: { int memberIndex = GetConstantInt(indexIds[i]); - Decorations d{}; ApplyDecorationsForIdMember(&d, typeId, memberIndex); ASSERT(d.HasOffset); constantOffset += d.Offset / sizeof(float); @@ -778,7 +779,6 @@ namespace sw case spv::OpTypeRuntimeArray: { // TODO: b/127950082: Check bounds. - Decorations d{}; ApplyDecorationsForId(&d, typeId); ASSERT(d.HasArrayStride); auto & obj = getObject(indexIds[i]); @@ -792,7 +792,6 @@ namespace sw case spv::OpTypeMatrix: { // TODO: b/127950082: Check bounds. - Decorations d{}; ApplyDecorationsForId(&d, typeId); ASSERT(d.HasMatrixStride); auto & obj = getObject(indexIds[i]);