SpirvShader: Fix incorrect use of getPointer() with GetPointerToData()
Unlike getPointer() with just returns the raw pointer, GetPointerToData() derefs the buffer data for DescriptorSets.
Test: dEQP-VK.spirv_assembly.instruction.compute.opcopymemory.struct
Change-Id: I5d8d6139952673a2680f9e05f2f64785198b0797
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/31110
Tested-by: Ben Clayton <bclayton@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
diff --git a/src/Pipeline/SpirvShader.cpp b/src/Pipeline/SpirvShader.cpp
index 6d17256..b7519f8 100644
--- a/src/Pipeline/SpirvShader.cpp
+++ b/src/Pipeline/SpirvShader.cpp
@@ -2637,7 +2637,7 @@
case spv::StorageClassFunction:
{
bool interleavedByLane = IsStorageInterleavedByLane(objectTy.storageClass);
- auto ptr = routine->getPointer(resultId);
+ auto ptr = GetPointerToData(resultId, 0, routine);
GenericValue initialValue(this, routine, initializerId);
VisitMemoryObject(resultId, [&](uint32_t i, uint32_t offset)
{
@@ -5562,8 +5562,8 @@
bool dstInterleavedByLane = IsStorageInterleavedByLane(dstPtrTy.storageClass);
bool srcInterleavedByLane = IsStorageInterleavedByLane(srcPtrTy.storageClass);
- auto dstPtr = state->routine->getPointer(dstPtrId);
- auto srcPtr = state->routine->getPointer(srcPtrId);
+ auto dstPtr = GetPointerToData(dstPtrId, 0, state->routine);
+ auto srcPtr = GetPointerToData(srcPtrId, 0, state->routine);
std::unordered_map<uint32_t, uint32_t> srcOffsets;