diff options
| author | 2019-01-22 00:57:30 -0300 | |
|---|---|---|
| committer | 2019-02-03 04:58:24 -0300 | |
| commit | 390721a561c2995d2a444b5697869476b48ba6c1 (patch) | |
| tree | 3f5802701e8352d90bf2f728002d9d60e20dfb35 /src | |
| parent | memory_manager: Check for reserved page status (diff) | |
| download | yuzu-390721a561c2995d2a444b5697869476b48ba6c1.tar.gz yuzu-390721a561c2995d2a444b5697869476b48ba6c1.tar.xz yuzu-390721a561c2995d2a444b5697869476b48ba6c1.zip | |
maxwell_3d: Allow texture handles with TIC id zero
Also remove "enabled" field from Tegra::Texture::FullTextureInfo because
it would become unused.
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/engines/maxwell_3d.cpp | 23 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 4 | ||||
| -rw-r--r-- | src/video_core/textures/texture.h | 1 |
3 files changed, 7 insertions, 21 deletions
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp index a388b3944..cda9b0da5 100644 --- a/src/video_core/engines/maxwell_3d.cpp +++ b/src/video_core/engines/maxwell_3d.cpp | |||
| @@ -462,13 +462,9 @@ std::vector<Texture::FullTextureInfo> Maxwell3D::GetStageTextures(Regs::ShaderSt | |||
| 462 | sizeof(Texture::TextureHandle); | 462 | sizeof(Texture::TextureHandle); |
| 463 | 463 | ||
| 464 | // Load the TIC data. | 464 | // Load the TIC data. |
| 465 | if (tex_handle.tic_id != 0) { | 465 | auto tic_entry = GetTICEntry(tex_handle.tic_id); |
| 466 | tex_info.enabled = true; | 466 | // TODO(Subv): Workaround for BitField's move constructor being deleted. |
| 467 | 467 | std::memcpy(&tex_info.tic, &tic_entry, sizeof(tic_entry)); | |
| 468 | auto tic_entry = GetTICEntry(tex_handle.tic_id); | ||
| 469 | // TODO(Subv): Workaround for BitField's move constructor being deleted. | ||
| 470 | std::memcpy(&tex_info.tic, &tic_entry, sizeof(tic_entry)); | ||
| 471 | } | ||
| 472 | 468 | ||
| 473 | // Load the TSC data | 469 | // Load the TSC data |
| 474 | if (tex_handle.tsc_id != 0) { | 470 | if (tex_handle.tsc_id != 0) { |
| @@ -477,8 +473,7 @@ std::vector<Texture::FullTextureInfo> Maxwell3D::GetStageTextures(Regs::ShaderSt | |||
| 477 | std::memcpy(&tex_info.tsc, &tsc_entry, sizeof(tsc_entry)); | 473 | std::memcpy(&tex_info.tsc, &tsc_entry, sizeof(tsc_entry)); |
| 478 | } | 474 | } |
| 479 | 475 | ||
| 480 | if (tex_info.enabled) | 476 | textures.push_back(tex_info); |
| 481 | textures.push_back(tex_info); | ||
| 482 | } | 477 | } |
| 483 | 478 | ||
| 484 | return textures; | 479 | return textures; |
| @@ -501,13 +496,9 @@ Texture::FullTextureInfo Maxwell3D::GetStageTexture(Regs::ShaderStage stage, | |||
| 501 | tex_info.index = static_cast<u32>(offset); | 496 | tex_info.index = static_cast<u32>(offset); |
| 502 | 497 | ||
| 503 | // Load the TIC data. | 498 | // Load the TIC data. |
| 504 | if (tex_handle.tic_id != 0) { | 499 | auto tic_entry = GetTICEntry(tex_handle.tic_id); |
| 505 | tex_info.enabled = true; | 500 | // TODO(Subv): Workaround for BitField's move constructor being deleted. |
| 506 | 501 | std::memcpy(&tex_info.tic, &tic_entry, sizeof(tic_entry)); | |
| 507 | auto tic_entry = GetTICEntry(tex_handle.tic_id); | ||
| 508 | // TODO(Subv): Workaround for BitField's move constructor being deleted. | ||
| 509 | std::memcpy(&tex_info.tic, &tic_entry, sizeof(tic_entry)); | ||
| 510 | } | ||
| 511 | 502 | ||
| 512 | // Load the TSC data | 503 | // Load the TSC data |
| 513 | if (tex_handle.tsc_id != 0) { | 504 | if (tex_handle.tsc_id != 0) { |
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 9f7c837d6..585709fe5 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp | |||
| @@ -1008,10 +1008,6 @@ void RasterizerOpenGL::SetupTextures(Maxwell::ShaderStage stage, const Shader& s | |||
| 1008 | auto& unit = state.texture_units[current_bindpoint]; | 1008 | auto& unit = state.texture_units[current_bindpoint]; |
| 1009 | 1009 | ||
| 1010 | const auto texture = maxwell3d.GetStageTexture(entry.GetStage(), entry.GetOffset()); | 1010 | const auto texture = maxwell3d.GetStageTexture(entry.GetStage(), entry.GetOffset()); |
| 1011 | if (!texture.enabled) { | ||
| 1012 | unit.texture = 0; | ||
| 1013 | continue; | ||
| 1014 | } | ||
| 1015 | 1011 | ||
| 1016 | texture_samplers[current_bindpoint].SyncWithConfig(texture.tsc); | 1012 | texture_samplers[current_bindpoint].SyncWithConfig(texture.tsc); |
| 1017 | 1013 | ||
diff --git a/src/video_core/textures/texture.h b/src/video_core/textures/texture.h index e7c78bee2..3f3cff652 100644 --- a/src/video_core/textures/texture.h +++ b/src/video_core/textures/texture.h | |||
| @@ -317,7 +317,6 @@ struct FullTextureInfo { | |||
| 317 | u32 index; | 317 | u32 index; |
| 318 | TICEntry tic; | 318 | TICEntry tic; |
| 319 | TSCEntry tsc; | 319 | TSCEntry tsc; |
| 320 | bool enabled; | ||
| 321 | }; | 320 | }; |
| 322 | 321 | ||
| 323 | /// Returns the number of bytes per pixel of the input texture format. | 322 | /// Returns the number of bytes per pixel of the input texture format. |