shader_recompiler: Sample images using correct result type. (#1068)

This commit is contained in:
squidbus 2024-09-25 04:20:28 -07:00 committed by GitHub
parent 11c155d0f1
commit 45e206e248
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 33 additions and 15 deletions

View file

@ -532,6 +532,8 @@ Id ImageType(EmitContext& ctx, const ImageResource& desc, Id sampled_type) {
void EmitContext::DefineImagesAndSamplers() {
for (const auto& image_desc : info.images) {
const bool is_integer = image_desc.nfmt == AmdGpu::NumberFormat::Uint ||
image_desc.nfmt == AmdGpu::NumberFormat::Sint;
const VectorIds& data_types = GetAttributeType(*this, image_desc.nfmt);
const Id sampled_type = data_types[1];
const Id image_type{ImageType(*this, image_desc, sampled_type)};
@ -547,6 +549,7 @@ void EmitContext::DefineImagesAndSamplers() {
.sampled_type = image_desc.is_storage ? sampled_type : TypeSampledImage(image_type),
.pointer_type = pointer_type,
.image_type = image_type,
.is_integer = is_integer,
.is_storage = image_desc.is_storage,
});
interfaces.push_back(id);