Parse OpImageRead and OpImageWrite into an ImageInstruction
This change unifies the parsing of instructions which access images or
texel buffers, into the ImageInstruction class. Specifically it removes
the custom parsing of OpImageRead and OpImageWrite instructions.
Bug: b/203730083
Change-Id: Ie5927710318ffb75a3a78ccfc1a94e1a5920632c
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/59368
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
diff --git a/src/Pipeline/SpirvShader.cpp b/src/Pipeline/SpirvShader.cpp
index f4d1d3f..2666ef5 100644
--- a/src/Pipeline/SpirvShader.cpp
+++ b/src/Pipeline/SpirvShader.cpp
@@ -1991,7 +1991,7 @@
case spv::OpImageDrefGather:
case spv::OpImageFetch:
case spv::OpImageQueryLod:
- return EmitImageSample(insn, state);
+ return EmitImageSample(ImageInstruction(insn, *this), state);
case spv::OpImageQuerySizeLod:
return EmitImageQuerySizeLod(insn, state);
@@ -2006,10 +2006,10 @@
return EmitImageQuerySamples(insn, state);
case spv::OpImageRead:
- return EmitImageRead(insn, state);
+ return EmitImageRead(ImageInstruction(insn, *this), state);
case spv::OpImageWrite:
- return EmitImageWrite(insn, state);
+ return EmitImageWrite(ImageInstruction(insn, *this), state);
case spv::OpImageTexelPointer:
return EmitImageTexelPointer(insn, state);