summaryrefslogtreecommitdiff
path: root/src/video_core
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/engines/maxwell_3d.cpp39
-rw-r--r--src/video_core/engines/maxwell_3d.h3
2 files changed, 0 insertions, 42 deletions
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp
index 514ed93fa..e36f4dac5 100644
--- a/src/video_core/engines/maxwell_3d.cpp
+++ b/src/video_core/engines/maxwell_3d.cpp
@@ -760,45 +760,6 @@ Texture::TSCEntry Maxwell3D::GetTSCEntry(u32 tsc_index) const {
760 return tsc_entry; 760 return tsc_entry;
761} 761}
762 762
763std::vector<Texture::FullTextureInfo> Maxwell3D::GetStageTextures(Regs::ShaderStage stage) const {
764 std::vector<Texture::FullTextureInfo> textures;
765
766 auto& fragment_shader = state.shader_stages[static_cast<std::size_t>(stage)];
767 auto& tex_info_buffer = fragment_shader.const_buffers[regs.tex_cb_index];
768 ASSERT(tex_info_buffer.enabled && tex_info_buffer.address != 0);
769
770 GPUVAddr tex_info_buffer_end = tex_info_buffer.address + tex_info_buffer.size;
771
772 // Offset into the texture constbuffer where the texture info begins.
773 static constexpr std::size_t TextureInfoOffset = 0x20;
774
775 for (GPUVAddr current_texture = tex_info_buffer.address + TextureInfoOffset;
776 current_texture < tex_info_buffer_end; current_texture += sizeof(Texture::TextureHandle)) {
777
778 const Texture::TextureHandle tex_handle{memory_manager.Read<u32>(current_texture)};
779
780 Texture::FullTextureInfo tex_info{};
781 // TODO(Subv): Use the shader to determine which textures are actually accessed.
782 tex_info.index =
783 static_cast<u32>(current_texture - tex_info_buffer.address - TextureInfoOffset) /
784 sizeof(Texture::TextureHandle);
785
786 // Load the TIC data.
787 auto tic_entry = GetTICEntry(tex_handle.tic_id);
788 // TODO(Subv): Workaround for BitField's move constructor being deleted.
789 std::memcpy(&tex_info.tic, &tic_entry, sizeof(tic_entry));
790
791 // Load the TSC data
792 auto tsc_entry = GetTSCEntry(tex_handle.tsc_id);
793 // TODO(Subv): Workaround for BitField's move constructor being deleted.
794 std::memcpy(&tex_info.tsc, &tsc_entry, sizeof(tsc_entry));
795
796 textures.push_back(tex_info);
797 }
798
799 return textures;
800}
801
802Texture::FullTextureInfo Maxwell3D::GetTextureInfo(const Texture::TextureHandle tex_handle, 763Texture::FullTextureInfo Maxwell3D::GetTextureInfo(const Texture::TextureHandle tex_handle,
803 std::size_t offset) const { 764 std::size_t offset) const {
804 Texture::FullTextureInfo tex_info{}; 765 Texture::FullTextureInfo tex_info{};
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h
index 987ad77b2..666313e46 100644
--- a/src/video_core/engines/maxwell_3d.h
+++ b/src/video_core/engines/maxwell_3d.h
@@ -1254,9 +1254,6 @@ public:
1254 Texture::FullTextureInfo GetTextureInfo(const Texture::TextureHandle tex_handle, 1254 Texture::FullTextureInfo GetTextureInfo(const Texture::TextureHandle tex_handle,
1255 std::size_t offset) const; 1255 std::size_t offset) const;
1256 1256
1257 /// Returns a list of enabled textures for the specified shader stage.
1258 std::vector<Texture::FullTextureInfo> GetStageTextures(Regs::ShaderStage stage) const;
1259
1260 /// Returns the texture information for a specific texture in a specific shader stage. 1257 /// Returns the texture information for a specific texture in a specific shader stage.
1261 Texture::FullTextureInfo GetStageTexture(Regs::ShaderStage stage, std::size_t offset) const; 1258 Texture::FullTextureInfo GetStageTexture(Regs::ShaderStage stage, std::size_t offset) const;
1262 1259