shader_recompiler: Fix some image view type issues. (#2118)

This commit is contained in:
squidbus 2025-01-10 12:35:03 -08:00 committed by GitHub
parent 562ed2a025
commit e656093d85
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 30 additions and 22 deletions

View file

@ -773,7 +773,7 @@ spv::ImageFormat GetFormat(const AmdGpu::Image& image) {
Id ImageType(EmitContext& ctx, const ImageResource& desc, Id sampled_type) {
const auto image = desc.GetSharp(ctx.info);
const auto format = desc.is_atomic ? GetFormat(image) : spv::ImageFormat::Unknown;
const auto type = image.GetBoundType(desc.is_array);
const auto type = image.GetViewType(desc.is_array);
const u32 sampled = desc.is_written ? 2 : 1;
switch (type) {
case AmdGpu::ImageType::Color1D:
@ -814,7 +814,7 @@ void EmitContext::DefineImagesAndSamplers() {
.sampled_type = is_storage ? sampled_type : TypeSampledImage(image_type),
.pointer_type = pointer_type,
.image_type = image_type,
.bound_type = sharp.GetBoundType(image_desc.is_array),
.view_type = sharp.GetViewType(image_desc.is_array),
.is_integer = is_integer,
.is_storage = is_storage,
});