diff options
| author | 2019-10-20 04:03:33 -0300 | |
|---|---|---|
| committer | 2019-10-28 00:23:42 -0300 | |
| commit | fa31e5b86854f98d7db10bf55cc485bd1368b559 (patch) | |
| tree | bd54dc3e15103e7e32ad04072fc38c81819c3672 /src/video_core | |
| parent | video_core/textures: Remove unused index entry in FullTextureInfo (diff) | |
| download | yuzu-fa31e5b86854f98d7db10bf55cc485bd1368b559.tar.gz yuzu-fa31e5b86854f98d7db10bf55cc485bd1368b559.tar.xz yuzu-fa31e5b86854f98d7db10bf55cc485bd1368b559.zip | |
maxwell_3d/kepler_compute: Remove unused arguments in GetTexture
Diffstat (limited to 'src/video_core')
| -rw-r--r-- | src/video_core/engines/kepler_compute.cpp | 12 | ||||
| -rw-r--r-- | src/video_core/engines/kepler_compute.h | 7 | ||||
| -rw-r--r-- | src/video_core/engines/maxwell_3d.cpp | 21 | ||||
| -rw-r--r-- | src/video_core/engines/maxwell_3d.h | 5 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 12 |
5 files changed, 20 insertions, 37 deletions
diff --git a/src/video_core/engines/kepler_compute.cpp b/src/video_core/engines/kepler_compute.cpp index 91adef360..3a39aeabe 100644 --- a/src/video_core/engines/kepler_compute.cpp +++ b/src/video_core/engines/kepler_compute.cpp | |||
| @@ -50,7 +50,7 @@ void KeplerCompute::CallMethod(const GPU::MethodCall& method_call) { | |||
| 50 | } | 50 | } |
| 51 | } | 51 | } |
| 52 | 52 | ||
| 53 | Tegra::Texture::FullTextureInfo KeplerCompute::GetTexture(std::size_t offset) const { | 53 | Texture::FullTextureInfo KeplerCompute::GetTexture(std::size_t offset) const { |
| 54 | const std::bitset<8> cbuf_mask = launch_description.const_buffer_enable_mask.Value(); | 54 | const std::bitset<8> cbuf_mask = launch_description.const_buffer_enable_mask.Value(); |
| 55 | ASSERT(cbuf_mask[regs.tex_cb_index]); | 55 | ASSERT(cbuf_mask[regs.tex_cb_index]); |
| 56 | 56 | ||
| @@ -61,13 +61,11 @@ Tegra::Texture::FullTextureInfo KeplerCompute::GetTexture(std::size_t offset) co | |||
| 61 | ASSERT(address < texinfo.Address() + texinfo.size); | 61 | ASSERT(address < texinfo.Address() + texinfo.size); |
| 62 | 62 | ||
| 63 | const Texture::TextureHandle tex_handle{memory_manager.Read<u32>(address)}; | 63 | const Texture::TextureHandle tex_handle{memory_manager.Read<u32>(address)}; |
| 64 | return GetTextureInfo(tex_handle, offset); | 64 | return GetTextureInfo(tex_handle); |
| 65 | } | 65 | } |
| 66 | 66 | ||
| 67 | Texture::FullTextureInfo KeplerCompute::GetTextureInfo(const Texture::TextureHandle tex_handle, | 67 | Texture::FullTextureInfo KeplerCompute::GetTextureInfo(Texture::TextureHandle tex_handle) const { |
| 68 | std::size_t offset) const { | 68 | return Texture::FullTextureInfo{GetTICEntry(tex_handle.tic_id), GetTSCEntry(tex_handle.tsc_id)}; |
| 69 | return Texture::FullTextureInfo{static_cast<u32>(offset), GetTICEntry(tex_handle.tic_id), | ||
| 70 | GetTSCEntry(tex_handle.tsc_id)}; | ||
| 71 | } | 69 | } |
| 72 | 70 | ||
| 73 | u32 KeplerCompute::AccessConstBuffer32(ShaderType stage, u64 const_buffer, u64 offset) const { | 71 | u32 KeplerCompute::AccessConstBuffer32(ShaderType stage, u64 const_buffer, u64 offset) const { |
| @@ -89,7 +87,7 @@ SamplerDescriptor KeplerCompute::AccessBindlessSampler(ShaderType stage, u64 con | |||
| 89 | const GPUVAddr tex_info_address = tex_info_buffer.Address() + offset; | 87 | const GPUVAddr tex_info_address = tex_info_buffer.Address() + offset; |
| 90 | 88 | ||
| 91 | const Texture::TextureHandle tex_handle{memory_manager.Read<u32>(tex_info_address)}; | 89 | const Texture::TextureHandle tex_handle{memory_manager.Read<u32>(tex_info_address)}; |
| 92 | const Texture::FullTextureInfo tex_info = GetTextureInfo(tex_handle, offset); | 90 | const Texture::FullTextureInfo tex_info = GetTextureInfo(tex_handle); |
| 93 | SamplerDescriptor result = SamplerDescriptor::FromTicTexture(tex_info.tic.texture_type.Value()); | 91 | SamplerDescriptor result = SamplerDescriptor::FromTicTexture(tex_info.tic.texture_type.Value()); |
| 94 | result.is_shadow.Assign(tex_info.tsc.depth_compare_enabled.Value()); | 92 | result.is_shadow.Assign(tex_info.tsc.depth_compare_enabled.Value()); |
| 95 | return result; | 93 | return result; |
diff --git a/src/video_core/engines/kepler_compute.h b/src/video_core/engines/kepler_compute.h index 8e7182727..b185c98c7 100644 --- a/src/video_core/engines/kepler_compute.h +++ b/src/video_core/engines/kepler_compute.h | |||
| @@ -196,11 +196,10 @@ public: | |||
| 196 | /// Write the value to the register identified by method. | 196 | /// Write the value to the register identified by method. |
| 197 | void CallMethod(const GPU::MethodCall& method_call); | 197 | void CallMethod(const GPU::MethodCall& method_call); |
| 198 | 198 | ||
| 199 | Tegra::Texture::FullTextureInfo GetTexture(std::size_t offset) const; | 199 | Texture::FullTextureInfo GetTexture(std::size_t offset) const; |
| 200 | 200 | ||
| 201 | /// Given a Texture Handle, returns the TSC and TIC entries. | 201 | /// Given a texture handle, returns the TSC and TIC entries. |
| 202 | Texture::FullTextureInfo GetTextureInfo(const Texture::TextureHandle tex_handle, | 202 | Texture::FullTextureInfo GetTextureInfo(Texture::TextureHandle tex_handle) const; |
| 203 | std::size_t offset) const; | ||
| 204 | 203 | ||
| 205 | u32 AccessConstBuffer32(ShaderType stage, u64 const_buffer, u64 offset) const override; | 204 | u32 AccessConstBuffer32(ShaderType stage, u64 const_buffer, u64 offset) const override; |
| 206 | 205 | ||
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp index 7a97efe57..2bed6cb38 100644 --- a/src/video_core/engines/maxwell_3d.cpp +++ b/src/video_core/engines/maxwell_3d.cpp | |||
| @@ -760,21 +760,8 @@ Texture::TSCEntry Maxwell3D::GetTSCEntry(u32 tsc_index) const { | |||
| 760 | return tsc_entry; | 760 | return tsc_entry; |
| 761 | } | 761 | } |
| 762 | 762 | ||
| 763 | Texture::FullTextureInfo Maxwell3D::GetTextureInfo(const Texture::TextureHandle tex_handle, | 763 | Texture::FullTextureInfo Maxwell3D::GetTextureInfo(Texture::TextureHandle tex_handle) const { |
| 764 | std::size_t offset) const { | 764 | return Texture::FullTextureInfo{GetTICEntry(tex_handle.tic_id), GetTSCEntry(tex_handle.tsc_id)}; |
| 765 | Texture::FullTextureInfo tex_info{}; | ||
| 766 | |||
| 767 | // Load the TIC data. | ||
| 768 | auto tic_entry = GetTICEntry(tex_handle.tic_id); | ||
| 769 | // TODO(Subv): Workaround for BitField's move constructor being deleted. | ||
| 770 | std::memcpy(&tex_info.tic, &tic_entry, sizeof(tic_entry)); | ||
| 771 | |||
| 772 | // Load the TSC data | ||
| 773 | auto tsc_entry = GetTSCEntry(tex_handle.tsc_id); | ||
| 774 | // TODO(Subv): Workaround for BitField's move constructor being deleted. | ||
| 775 | std::memcpy(&tex_info.tsc, &tsc_entry, sizeof(tsc_entry)); | ||
| 776 | |||
| 777 | return tex_info; | ||
| 778 | } | 765 | } |
| 779 | 766 | ||
| 780 | Texture::FullTextureInfo Maxwell3D::GetStageTexture(Regs::ShaderStage stage, | 767 | Texture::FullTextureInfo Maxwell3D::GetStageTexture(Regs::ShaderStage stage, |
| @@ -790,7 +777,7 @@ Texture::FullTextureInfo Maxwell3D::GetStageTexture(Regs::ShaderStage stage, | |||
| 790 | 777 | ||
| 791 | const Texture::TextureHandle tex_handle{memory_manager.Read<u32>(tex_info_address)}; | 778 | const Texture::TextureHandle tex_handle{memory_manager.Read<u32>(tex_info_address)}; |
| 792 | 779 | ||
| 793 | return GetTextureInfo(tex_handle, offset); | 780 | return GetTextureInfo(tex_handle); |
| 794 | } | 781 | } |
| 795 | 782 | ||
| 796 | u32 Maxwell3D::GetRegisterValue(u32 method) const { | 783 | u32 Maxwell3D::GetRegisterValue(u32 method) const { |
| @@ -827,7 +814,7 @@ SamplerDescriptor Maxwell3D::AccessBindlessSampler(ShaderType stage, u64 const_b | |||
| 827 | const GPUVAddr tex_info_address = tex_info_buffer.address + offset; | 814 | const GPUVAddr tex_info_address = tex_info_buffer.address + offset; |
| 828 | 815 | ||
| 829 | const Texture::TextureHandle tex_handle{memory_manager.Read<u32>(tex_info_address)}; | 816 | const Texture::TextureHandle tex_handle{memory_manager.Read<u32>(tex_info_address)}; |
| 830 | const Texture::FullTextureInfo tex_info = GetTextureInfo(tex_handle, offset); | 817 | const Texture::FullTextureInfo tex_info = GetTextureInfo(tex_handle); |
| 831 | SamplerDescriptor result = SamplerDescriptor::FromTicTexture(tex_info.tic.texture_type.Value()); | 818 | SamplerDescriptor result = SamplerDescriptor::FromTicTexture(tex_info.tic.texture_type.Value()); |
| 832 | result.is_shadow.Assign(tex_info.tsc.depth_compare_enabled.Value()); | 819 | result.is_shadow.Assign(tex_info.tsc.depth_compare_enabled.Value()); |
| 833 | return result; | 820 | return result; |
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h index 666313e46..8cc842684 100644 --- a/src/video_core/engines/maxwell_3d.h +++ b/src/video_core/engines/maxwell_3d.h | |||
| @@ -1250,9 +1250,8 @@ public: | |||
| 1250 | 1250 | ||
| 1251 | void FlushMMEInlineDraw(); | 1251 | void FlushMMEInlineDraw(); |
| 1252 | 1252 | ||
| 1253 | /// Given a Texture Handle, returns the TSC and TIC entries. | 1253 | /// Given a texture handle, returns the TSC and TIC entries. |
| 1254 | Texture::FullTextureInfo GetTextureInfo(const Texture::TextureHandle tex_handle, | 1254 | Texture::FullTextureInfo GetTextureInfo(Texture::TextureHandle tex_handle) const; |
| 1255 | std::size_t offset) const; | ||
| 1256 | 1255 | ||
| 1257 | /// Returns the texture information for a specific texture in a specific shader stage. | 1256 | /// Returns the texture information for a specific texture in a specific shader stage. |
| 1258 | Texture::FullTextureInfo GetStageTexture(Regs::ShaderStage stage, std::size_t offset) const; | 1257 | Texture::FullTextureInfo GetStageTexture(Regs::ShaderStage stage, std::size_t offset) const; |
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 9431d64ac..43032e9a7 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp | |||
| @@ -969,7 +969,7 @@ TextureBufferUsage RasterizerOpenGL::SetupDrawTextures(Maxwell::ShaderStage stag | |||
| 969 | 969 | ||
| 970 | for (u32 bindpoint = 0; bindpoint < entries.size(); ++bindpoint) { | 970 | for (u32 bindpoint = 0; bindpoint < entries.size(); ++bindpoint) { |
| 971 | const auto& entry = entries[bindpoint]; | 971 | const auto& entry = entries[bindpoint]; |
| 972 | const auto texture = [&]() { | 972 | const auto texture = [&] { |
| 973 | if (!entry.IsBindless()) { | 973 | if (!entry.IsBindless()) { |
| 974 | return maxwell3d.GetStageTexture(stage, entry.GetOffset()); | 974 | return maxwell3d.GetStageTexture(stage, entry.GetOffset()); |
| 975 | } | 975 | } |
| @@ -977,7 +977,7 @@ TextureBufferUsage RasterizerOpenGL::SetupDrawTextures(Maxwell::ShaderStage stag | |||
| 977 | Tegra::Texture::TextureHandle tex_handle; | 977 | Tegra::Texture::TextureHandle tex_handle; |
| 978 | Tegra::Engines::ShaderType shader_type = static_cast<Tegra::Engines::ShaderType>(stage); | 978 | Tegra::Engines::ShaderType shader_type = static_cast<Tegra::Engines::ShaderType>(stage); |
| 979 | tex_handle.raw = maxwell3d.AccessConstBuffer32(shader_type, cbuf.first, cbuf.second); | 979 | tex_handle.raw = maxwell3d.AccessConstBuffer32(shader_type, cbuf.first, cbuf.second); |
| 980 | return maxwell3d.GetTextureInfo(tex_handle, entry.GetOffset()); | 980 | return maxwell3d.GetTextureInfo(tex_handle); |
| 981 | }(); | 981 | }(); |
| 982 | 982 | ||
| 983 | if (SetupTexture(base_bindings.sampler + bindpoint, texture, entry)) { | 983 | if (SetupTexture(base_bindings.sampler + bindpoint, texture, entry)) { |
| @@ -1000,7 +1000,7 @@ TextureBufferUsage RasterizerOpenGL::SetupComputeTextures(const Shader& kernel) | |||
| 1000 | 1000 | ||
| 1001 | for (u32 bindpoint = 0; bindpoint < entries.size(); ++bindpoint) { | 1001 | for (u32 bindpoint = 0; bindpoint < entries.size(); ++bindpoint) { |
| 1002 | const auto& entry = entries[bindpoint]; | 1002 | const auto& entry = entries[bindpoint]; |
| 1003 | const auto texture = [&]() { | 1003 | const auto texture = [&] { |
| 1004 | if (!entry.IsBindless()) { | 1004 | if (!entry.IsBindless()) { |
| 1005 | return compute.GetTexture(entry.GetOffset()); | 1005 | return compute.GetTexture(entry.GetOffset()); |
| 1006 | } | 1006 | } |
| @@ -1008,7 +1008,7 @@ TextureBufferUsage RasterizerOpenGL::SetupComputeTextures(const Shader& kernel) | |||
| 1008 | Tegra::Texture::TextureHandle tex_handle; | 1008 | Tegra::Texture::TextureHandle tex_handle; |
| 1009 | tex_handle.raw = compute.AccessConstBuffer32(Tegra::Engines::ShaderType::Compute, | 1009 | tex_handle.raw = compute.AccessConstBuffer32(Tegra::Engines::ShaderType::Compute, |
| 1010 | cbuf.first, cbuf.second); | 1010 | cbuf.first, cbuf.second); |
| 1011 | return compute.GetTextureInfo(tex_handle, entry.GetOffset()); | 1011 | return compute.GetTextureInfo(tex_handle); |
| 1012 | }(); | 1012 | }(); |
| 1013 | 1013 | ||
| 1014 | if (SetupTexture(bindpoint, texture, entry)) { | 1014 | if (SetupTexture(bindpoint, texture, entry)) { |
| @@ -1046,7 +1046,7 @@ void RasterizerOpenGL::SetupComputeImages(const Shader& shader) { | |||
| 1046 | const auto& entries = shader->GetShaderEntries().images; | 1046 | const auto& entries = shader->GetShaderEntries().images; |
| 1047 | for (u32 bindpoint = 0; bindpoint < entries.size(); ++bindpoint) { | 1047 | for (u32 bindpoint = 0; bindpoint < entries.size(); ++bindpoint) { |
| 1048 | const auto& entry = entries[bindpoint]; | 1048 | const auto& entry = entries[bindpoint]; |
| 1049 | const auto tic = [&]() { | 1049 | const auto tic = [&] { |
| 1050 | if (!entry.IsBindless()) { | 1050 | if (!entry.IsBindless()) { |
| 1051 | return compute.GetTexture(entry.GetOffset()).tic; | 1051 | return compute.GetTexture(entry.GetOffset()).tic; |
| 1052 | } | 1052 | } |
| @@ -1054,7 +1054,7 @@ void RasterizerOpenGL::SetupComputeImages(const Shader& shader) { | |||
| 1054 | Tegra::Texture::TextureHandle tex_handle; | 1054 | Tegra::Texture::TextureHandle tex_handle; |
| 1055 | tex_handle.raw = compute.AccessConstBuffer32(Tegra::Engines::ShaderType::Compute, | 1055 | tex_handle.raw = compute.AccessConstBuffer32(Tegra::Engines::ShaderType::Compute, |
| 1056 | cbuf.first, cbuf.second); | 1056 | cbuf.first, cbuf.second); |
| 1057 | return compute.GetTextureInfo(tex_handle, entry.GetOffset()).tic; | 1057 | return compute.GetTextureInfo(tex_handle).tic; |
| 1058 | }(); | 1058 | }(); |
| 1059 | SetupImage(bindpoint, tic, entry); | 1059 | SetupImage(bindpoint, tic, entry); |
| 1060 | } | 1060 | } |