diff options
| author | 2020-06-13 13:48:27 -0400 | |
|---|---|---|
| committer | 2020-06-13 13:48:27 -0400 | |
| commit | c2ea1e1bcb88f8e307e54cf588829a516b40258e (patch) | |
| tree | 3975cb756ef9d289cc13f3f6dc2a302dacc2c758 /src/video_core/engines | |
| parent | Merge pull request #3986 from ReinUsesLisp/shader-cache (diff) | |
| parent | shader/texture: Join separate image and sampler pairs offline (diff) | |
| download | yuzu-c2ea1e1bcb88f8e307e54cf588829a516b40258e.tar.gz yuzu-c2ea1e1bcb88f8e307e54cf588829a516b40258e.tar.xz yuzu-c2ea1e1bcb88f8e307e54cf588829a516b40258e.zip | |
Merge pull request #4049 from ReinUsesLisp/separate-samplers
shader/texture: Join separate image and sampler pairs offline
Diffstat (limited to 'src/video_core/engines')
| -rw-r--r-- | src/video_core/engines/const_buffer_engine_interface.h | 1 | ||||
| -rw-r--r-- | src/video_core/engines/kepler_compute.cpp | 5 | ||||
| -rw-r--r-- | src/video_core/engines/kepler_compute.h | 2 | ||||
| -rw-r--r-- | src/video_core/engines/maxwell_3d.cpp | 5 | ||||
| -rw-r--r-- | src/video_core/engines/maxwell_3d.h | 2 |
5 files changed, 13 insertions, 2 deletions
diff --git a/src/video_core/engines/const_buffer_engine_interface.h b/src/video_core/engines/const_buffer_engine_interface.h index ebe139504..f46e81bb7 100644 --- a/src/video_core/engines/const_buffer_engine_interface.h +++ b/src/video_core/engines/const_buffer_engine_interface.h | |||
| @@ -93,6 +93,7 @@ public: | |||
| 93 | virtual SamplerDescriptor AccessBoundSampler(ShaderType stage, u64 offset) const = 0; | 93 | virtual SamplerDescriptor AccessBoundSampler(ShaderType stage, u64 offset) const = 0; |
| 94 | virtual SamplerDescriptor AccessBindlessSampler(ShaderType stage, u64 const_buffer, | 94 | virtual SamplerDescriptor AccessBindlessSampler(ShaderType stage, u64 const_buffer, |
| 95 | u64 offset) const = 0; | 95 | u64 offset) const = 0; |
| 96 | virtual SamplerDescriptor AccessSampler(u32 handle) const = 0; | ||
| 96 | virtual u32 GetBoundBuffer() const = 0; | 97 | virtual u32 GetBoundBuffer() const = 0; |
| 97 | 98 | ||
| 98 | virtual VideoCore::GuestDriverProfile& AccessGuestDriverProfile() = 0; | 99 | virtual VideoCore::GuestDriverProfile& AccessGuestDriverProfile() = 0; |
diff --git a/src/video_core/engines/kepler_compute.cpp b/src/video_core/engines/kepler_compute.cpp index f6237fc6a..a82b06a38 100644 --- a/src/video_core/engines/kepler_compute.cpp +++ b/src/video_core/engines/kepler_compute.cpp | |||
| @@ -92,8 +92,11 @@ SamplerDescriptor KeplerCompute::AccessBindlessSampler(ShaderType stage, u64 con | |||
| 92 | ASSERT(stage == ShaderType::Compute); | 92 | ASSERT(stage == ShaderType::Compute); |
| 93 | const auto& tex_info_buffer = launch_description.const_buffer_config[const_buffer]; | 93 | const auto& tex_info_buffer = launch_description.const_buffer_config[const_buffer]; |
| 94 | const GPUVAddr tex_info_address = tex_info_buffer.Address() + offset; | 94 | const GPUVAddr tex_info_address = tex_info_buffer.Address() + offset; |
| 95 | return AccessSampler(memory_manager.Read<u32>(tex_info_address)); | ||
| 96 | } | ||
| 95 | 97 | ||
| 96 | const Texture::TextureHandle tex_handle{memory_manager.Read<u32>(tex_info_address)}; | 98 | SamplerDescriptor KeplerCompute::AccessSampler(u32 handle) const { |
| 99 | const Texture::TextureHandle tex_handle{handle}; | ||
| 97 | const Texture::FullTextureInfo tex_info = GetTextureInfo(tex_handle); | 100 | const Texture::FullTextureInfo tex_info = GetTextureInfo(tex_handle); |
| 98 | SamplerDescriptor result = SamplerDescriptor::FromTIC(tex_info.tic); | 101 | SamplerDescriptor result = SamplerDescriptor::FromTIC(tex_info.tic); |
| 99 | result.is_shadow.Assign(tex_info.tsc.depth_compare_enabled.Value()); | 102 | result.is_shadow.Assign(tex_info.tsc.depth_compare_enabled.Value()); |
diff --git a/src/video_core/engines/kepler_compute.h b/src/video_core/engines/kepler_compute.h index 18ceedfaf..b7f668d88 100644 --- a/src/video_core/engines/kepler_compute.h +++ b/src/video_core/engines/kepler_compute.h | |||
| @@ -219,6 +219,8 @@ public: | |||
| 219 | SamplerDescriptor AccessBindlessSampler(ShaderType stage, u64 const_buffer, | 219 | SamplerDescriptor AccessBindlessSampler(ShaderType stage, u64 const_buffer, |
| 220 | u64 offset) const override; | 220 | u64 offset) const override; |
| 221 | 221 | ||
| 222 | SamplerDescriptor AccessSampler(u32 handle) const override; | ||
| 223 | |||
| 222 | u32 GetBoundBuffer() const override { | 224 | u32 GetBoundBuffer() const override { |
| 223 | return regs.tex_cb_index; | 225 | return regs.tex_cb_index; |
| 224 | } | 226 | } |
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp index e46b153f9..ea3c8a963 100644 --- a/src/video_core/engines/maxwell_3d.cpp +++ b/src/video_core/engines/maxwell_3d.cpp | |||
| @@ -740,8 +740,11 @@ SamplerDescriptor Maxwell3D::AccessBindlessSampler(ShaderType stage, u64 const_b | |||
| 740 | const auto& shader = state.shader_stages[static_cast<std::size_t>(stage)]; | 740 | const auto& shader = state.shader_stages[static_cast<std::size_t>(stage)]; |
| 741 | const auto& tex_info_buffer = shader.const_buffers[const_buffer]; | 741 | const auto& tex_info_buffer = shader.const_buffers[const_buffer]; |
| 742 | const GPUVAddr tex_info_address = tex_info_buffer.address + offset; | 742 | const GPUVAddr tex_info_address = tex_info_buffer.address + offset; |
| 743 | return AccessSampler(memory_manager.Read<u32>(tex_info_address)); | ||
| 744 | } | ||
| 743 | 745 | ||
| 744 | const Texture::TextureHandle tex_handle{memory_manager.Read<u32>(tex_info_address)}; | 746 | SamplerDescriptor Maxwell3D::AccessSampler(u32 handle) const { |
| 747 | const Texture::TextureHandle tex_handle{handle}; | ||
| 745 | const Texture::FullTextureInfo tex_info = GetTextureInfo(tex_handle); | 748 | const Texture::FullTextureInfo tex_info = GetTextureInfo(tex_handle); |
| 746 | SamplerDescriptor result = SamplerDescriptor::FromTIC(tex_info.tic); | 749 | SamplerDescriptor result = SamplerDescriptor::FromTIC(tex_info.tic); |
| 747 | result.is_shadow.Assign(tex_info.tsc.depth_compare_enabled.Value()); | 750 | result.is_shadow.Assign(tex_info.tsc.depth_compare_enabled.Value()); |
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h index 79fc9bbea..d5fe25065 100644 --- a/src/video_core/engines/maxwell_3d.h +++ b/src/video_core/engines/maxwell_3d.h | |||
| @@ -1404,6 +1404,8 @@ public: | |||
| 1404 | SamplerDescriptor AccessBindlessSampler(ShaderType stage, u64 const_buffer, | 1404 | SamplerDescriptor AccessBindlessSampler(ShaderType stage, u64 const_buffer, |
| 1405 | u64 offset) const override; | 1405 | u64 offset) const override; |
| 1406 | 1406 | ||
| 1407 | SamplerDescriptor AccessSampler(u32 handle) const override; | ||
| 1408 | |||
| 1407 | u32 GetBoundBuffer() const override { | 1409 | u32 GetBoundBuffer() const override { |
| 1408 | return regs.tex_cb_index; | 1410 | return regs.tex_cb_index; |
| 1409 | } | 1411 | } |