diff options
| author | 2020-01-05 18:36:21 -0400 | |
|---|---|---|
| committer | 2020-01-24 16:43:31 -0400 | |
| commit | 037ea431ceb93e93274fdcf9fb724819639d04fd (patch) | |
| tree | 7357dac5799959d2dc7dbe78346cb8cbd1a5400b /src/video_core/shader/decode | |
| parent | Shader_IR: Setup Indexed Samplers on the IR (diff) | |
| download | yuzu-037ea431ceb93e93274fdcf9fb724819639d04fd.tar.gz yuzu-037ea431ceb93e93274fdcf9fb724819639d04fd.tar.xz yuzu-037ea431ceb93e93274fdcf9fb724819639d04fd.zip | |
Shader_IR: deduce size of indexed samplers
Diffstat (limited to 'src/video_core/shader/decode')
| -rw-r--r-- | src/video_core/shader/decode/texture.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/video_core/shader/decode/texture.cpp b/src/video_core/shader/decode/texture.cpp index 886650d9e..e7c38f5d6 100644 --- a/src/video_core/shader/decode/texture.cpp +++ b/src/video_core/shader/decode/texture.cpp | |||
| @@ -383,7 +383,7 @@ const Sampler* ShaderIR::GetSampler(const Tegra::Shader::Sampler& sampler, | |||
| 383 | // Otherwise create a new mapping for this sampler | 383 | // Otherwise create a new mapping for this sampler |
| 384 | const auto next_index = static_cast<u32>(used_samplers.size()); | 384 | const auto next_index = static_cast<u32>(used_samplers.size()); |
| 385 | return &used_samplers.emplace_back(next_index, offset, info.type, info.is_array, info.is_shadow, | 385 | return &used_samplers.emplace_back(next_index, offset, info.type, info.is_array, info.is_shadow, |
| 386 | info.is_buffer); | 386 | info.is_buffer, false); |
| 387 | } | 387 | } |
| 388 | 388 | ||
| 389 | const Sampler* ShaderIR::GetBindlessSampler(Tegra::Shader::Register reg, | 389 | const Sampler* ShaderIR::GetBindlessSampler(Tegra::Shader::Register reg, |
| @@ -417,7 +417,7 @@ const Sampler* ShaderIR::GetBindlessSampler(Tegra::Shader::Register reg, | |||
| 417 | // Otherwise create a new mapping for this sampler | 417 | // Otherwise create a new mapping for this sampler |
| 418 | const auto next_index = static_cast<u32>(used_samplers.size()); | 418 | const auto next_index = static_cast<u32>(used_samplers.size()); |
| 419 | return &used_samplers.emplace_back(next_index, offset, buffer, info.type, info.is_array, | 419 | return &used_samplers.emplace_back(next_index, offset, buffer, info.type, info.is_array, |
| 420 | info.is_shadow, info.is_buffer); | 420 | info.is_shadow, info.is_buffer, false); |
| 421 | } else if (const auto array_sampler_info = | 421 | } else if (const auto array_sampler_info = |
| 422 | std::get_if<ArraySamplerNode>(&*tracked_sampler_info)) { | 422 | std::get_if<ArraySamplerNode>(&*tracked_sampler_info)) { |
| 423 | const u32 base_offset = array_sampler_info->GetBaseOffset() / 4; | 423 | const u32 base_offset = array_sampler_info->GetBaseOffset() / 4; |
| @@ -430,14 +430,15 @@ const Sampler* ShaderIR::GetBindlessSampler(Tegra::Shader::Register reg, | |||
| 430 | if (it != used_samplers.end()) { | 430 | if (it != used_samplers.end()) { |
| 431 | ASSERT(!it->IsBindless() && it->GetType() == info.type && | 431 | ASSERT(!it->IsBindless() && it->GetType() == info.type && |
| 432 | it->IsArray() == info.is_array && it->IsShadow() == info.is_shadow && | 432 | it->IsArray() == info.is_array && it->IsShadow() == info.is_shadow && |
| 433 | it->IsBuffer() == info.is_buffer); | 433 | it->IsBuffer() == info.is_buffer && it->IsIndexed()); |
| 434 | return &*it; | 434 | return &*it; |
| 435 | } | 435 | } |
| 436 | 436 | ||
| 437 | uses_indexed_samplers = true; | ||
| 437 | // Otherwise create a new mapping for this sampler | 438 | // Otherwise create a new mapping for this sampler |
| 438 | const auto next_index = static_cast<u32>(used_samplers.size()); | 439 | const auto next_index = static_cast<u32>(used_samplers.size()); |
| 439 | return &used_samplers.emplace_back(next_index, base_offset, info.type, info.is_array, | 440 | return &used_samplers.emplace_back(next_index, base_offset, info.type, info.is_array, |
| 440 | info.is_shadow, info.is_buffer); | 441 | info.is_shadow, info.is_buffer, true); |
| 441 | } | 442 | } |
| 442 | return nullptr; | 443 | return nullptr; |
| 443 | } | 444 | } |