mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-04 14:02:45 +01:00
shader_recompiler: skip sampler for buffer textures (#11435)
This commit is contained in:
parent
8fb9f78e83
commit
eb4ddb2868
3 changed files with 2 additions and 6 deletions
|
@ -204,9 +204,7 @@ Id TextureImage(EmitContext& ctx, IR::TextureInstInfo info, const IR::Value& ind
|
||||||
if (def.count > 1) {
|
if (def.count > 1) {
|
||||||
throw NotImplementedException("Indirect texture sample");
|
throw NotImplementedException("Indirect texture sample");
|
||||||
}
|
}
|
||||||
const Id sampler_id{def.id};
|
return ctx.OpLoad(ctx.image_buffer_type, def.id);
|
||||||
const Id id{ctx.OpLoad(ctx.sampled_texture_buffer_type, sampler_id)};
|
|
||||||
return ctx.OpImage(ctx.image_buffer_type, id);
|
|
||||||
} else {
|
} else {
|
||||||
const TextureDefinition& def{ctx.textures.at(info.descriptor_index)};
|
const TextureDefinition& def{ctx.textures.at(info.descriptor_index)};
|
||||||
if (def.count > 1) {
|
if (def.count > 1) {
|
||||||
|
|
|
@ -1247,9 +1247,8 @@ void EmitContext::DefineTextureBuffers(const Info& info, u32& binding) {
|
||||||
}
|
}
|
||||||
const spv::ImageFormat format{spv::ImageFormat::Unknown};
|
const spv::ImageFormat format{spv::ImageFormat::Unknown};
|
||||||
image_buffer_type = TypeImage(F32[1], spv::Dim::Buffer, 0U, false, false, 1, format);
|
image_buffer_type = TypeImage(F32[1], spv::Dim::Buffer, 0U, false, false, 1, format);
|
||||||
sampled_texture_buffer_type = TypeSampledImage(image_buffer_type);
|
|
||||||
|
|
||||||
const Id type{TypePointer(spv::StorageClass::UniformConstant, sampled_texture_buffer_type)};
|
const Id type{TypePointer(spv::StorageClass::UniformConstant, image_buffer_type)};
|
||||||
texture_buffers.reserve(info.texture_buffer_descriptors.size());
|
texture_buffers.reserve(info.texture_buffer_descriptors.size());
|
||||||
for (const TextureBufferDescriptor& desc : info.texture_buffer_descriptors) {
|
for (const TextureBufferDescriptor& desc : info.texture_buffer_descriptors) {
|
||||||
if (desc.count != 1) {
|
if (desc.count != 1) {
|
||||||
|
|
|
@ -206,7 +206,6 @@ public:
|
||||||
Id output_u32{};
|
Id output_u32{};
|
||||||
|
|
||||||
Id image_buffer_type{};
|
Id image_buffer_type{};
|
||||||
Id sampled_texture_buffer_type{};
|
|
||||||
Id image_u32{};
|
Id image_u32{};
|
||||||
|
|
||||||
std::array<UniformDefinitions, Info::MAX_CBUFS> cbufs{};
|
std::array<UniformDefinitions, Info::MAX_CBUFS> cbufs{};
|
||||||
|
|
Loading…
Reference in a new issue