diff --git a/hw/amdgpu/shader/include/amdgpu/shader/ConverterContext.hpp b/hw/amdgpu/shader/include/amdgpu/shader/ConverterContext.hpp index 3313e7e08..ea2986be1 100644 --- a/hw/amdgpu/shader/include/amdgpu/shader/ConverterContext.hpp +++ b/hw/amdgpu/shader/include/amdgpu/shader/ConverterContext.hpp @@ -137,6 +137,9 @@ public: spirv::UIntType getUInt64Type() { return spirv::cast(getType(TypeId::UInt64)); } + spirv::UIntType getUInt8Type() { + return spirv::cast(getType(TypeId::UInt8)); + } spirv::VectorOfType getUint32x2Type() { return spirv::cast>( diff --git a/hw/amdgpu/shader/src/Fragment.cpp b/hw/amdgpu/shader/src/Fragment.cpp index 907f5a2c9..e55e7e7e0 100644 --- a/hw/amdgpu/shader/src/Fragment.cpp +++ b/hw/amdgpu/shader/src/Fragment.cpp @@ -5312,6 +5312,9 @@ spirv::Value Fragment::createBitcast(spirv::Type to, spirv::Type from, return value; } + if (from == context->getUInt8Type()) + value = builder.createUConvert(to, spirv::cast(value)); + if (from == context->getFloat32Type()) { if (auto origValue = context->findFloat32Value(value)) { if (to == context->getUInt32Type()) {