diff --git a/SPIRV/GlslangToSpv.cpp b/SPIRV/GlslangToSpv.cpp index 745dd7f2..07556366 100755 --- a/SPIRV/GlslangToSpv.cpp +++ b/SPIRV/GlslangToSpv.cpp @@ -7482,7 +7482,7 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv:: id = builder.createCompositeExtract(mulOp, typeId, 0); for (int i = 1; i < componentCount; ++i) { builder.setPrecision(id, precision); - id = builder.createBinOp(spv::OpIAdd, typeId, id, builder.createCompositeExtract(operands[0], typeId, i)); + id = builder.createBinOp(spv::OpIAdd, typeId, id, builder.createCompositeExtract(mulOp, typeId, i)); } } else { switch (consumedOperands) { diff --git a/Test/baseResults/hlsl.int.dot.frag.out b/Test/baseResults/hlsl.int.dot.frag.out index a691836f..7ea22a14 100644 --- a/Test/baseResults/hlsl.int.dot.frag.out +++ b/Test/baseResults/hlsl.int.dot.frag.out @@ -295,7 +295,7 @@ gl_FragCoord origin is upper left 39: 17(ivec2) Load 19(i3) 40: 17(ivec2) IMul 38 39 41: 11(int) CompositeExtract 40 0 - 42: 11(int) CompositeExtract 38 1 + 42: 11(int) CompositeExtract 40 1 43: 11(int) IAdd 41 42 44: 17(ivec2) CompositeConstruct 43 43 Store 19(i3) 44 @@ -303,9 +303,9 @@ gl_FragCoord origin is upper left 46: 22(ivec3) Load 24(i4) 47: 22(ivec3) IMul 45 46 48: 11(int) CompositeExtract 47 0 - 49: 11(int) CompositeExtract 45 1 + 49: 11(int) CompositeExtract 47 1 50: 11(int) IAdd 48 49 - 51: 11(int) CompositeExtract 45 2 + 51: 11(int) CompositeExtract 47 2 52: 11(int) IAdd 50 51 53: 22(ivec3) CompositeConstruct 52 52 52 Store 24(i4) 53 @@ -313,11 +313,11 @@ gl_FragCoord origin is upper left 55: 27(ivec4) Load 29(i5) 56: 27(ivec4) IMul 54 55 57: 11(int) CompositeExtract 56 0 - 58: 11(int) CompositeExtract 54 1 + 58: 11(int) CompositeExtract 56 1 59: 11(int) IAdd 57 58 - 60: 11(int) CompositeExtract 54 2 + 60: 11(int) CompositeExtract 56 2 61: 11(int) IAdd 59 60 - 62: 11(int) CompositeExtract 54 3 + 62: 11(int) CompositeExtract 56 3 63: 11(int) IAdd 61 62 64: 27(ivec4) CompositeConstruct 63 63 63 63 Store 29(i5) 64