diff --git a/hw/amdgpu/shader/src/ConverterContext.cpp b/hw/amdgpu/shader/src/ConverterContext.cpp index 7c4cf3c12..efecb7be8 100644 --- a/hw/amdgpu/shader/src/ConverterContext.cpp +++ b/hw/amdgpu/shader/src/ConverterContext.cpp @@ -44,12 +44,13 @@ spirv::PointerType ConverterContext::getStructPointerType(spv::StorageClass storageClass, spirv::StructType structType) { StructTypeEntry *entry = nullptr; - for (auto &structType : mStructTypes) { - if (structType.id != structType.id) { + for (auto &type : mStructTypes) { + if (type.id != structType) { continue; } - entry = &structType; + entry = &type; + break; } if (entry == nullptr) {