summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2018-08-20 22:15:18 -0400
committerGravatar GitHub2018-08-20 22:15:18 -0400
commite33452f7e8c80c8eb6e4704af6b53f7fb7aa596d (patch)
treed679cafd3f06525d2f0995d8fb8dedcd0d0234c1 /src
parentMerge pull request #1106 from Subv/multiple_rendertargets (diff)
parentshader_bytecode: Replace some UNIMPLEMENTED logs. (diff)
downloadyuzu-e33452f7e8c80c8eb6e4704af6b53f7fb7aa596d.tar.gz
yuzu-e33452f7e8c80c8eb6e4704af6b53f7fb7aa596d.tar.xz
yuzu-e33452f7e8c80c8eb6e4704af6b53f7fb7aa596d.zip
Merge pull request #1131 from bunnei/impl-tex3d-texcube
gl_shader_decompiler: Implement TextureCube/Texture3D for TEX/TEXS.
Diffstat (limited to 'src')
-rw-r--r--src/video_core/engines/shader_bytecode.h8
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp15
2 files changed, 21 insertions, 2 deletions
diff --git a/src/video_core/engines/shader_bytecode.h b/src/video_core/engines/shader_bytecode.h
index 3ba6fe614..875b90359 100644
--- a/src/video_core/engines/shader_bytecode.h
+++ b/src/video_core/engines/shader_bytecode.h
@@ -477,7 +477,9 @@ union Instruction {
477 if (texture_info >= 12 && texture_info <= 13) 477 if (texture_info >= 12 && texture_info <= 13)
478 return TextureType::TextureCube; 478 return TextureType::TextureCube;
479 479
480 UNIMPLEMENTED(); 480 LOG_CRITICAL(HW_GPU, "Unhandled texture_info: {}",
481 static_cast<u32>(texture_info.Value()));
482 UNREACHABLE();
481 } 483 }
482 484
483 bool IsArrayTexture() const { 485 bool IsArrayTexture() const {
@@ -523,7 +525,9 @@ union Instruction {
523 return TextureType::Texture3D; 525 return TextureType::Texture3D;
524 } 526 }
525 527
526 UNIMPLEMENTED(); 528 LOG_CRITICAL(HW_GPU, "Unhandled texture_info: {}",
529 static_cast<u32>(texture_info.Value()));
530 UNREACHABLE();
527 } 531 }
528 532
529 bool IsArrayTexture() const { 533 bool IsArrayTexture() const {
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
index 214a5fa9a..6fb663bbc 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -1568,6 +1568,14 @@ private:
1568 coord = "vec3 coords = vec3(" + x + ", " + y + ", " + z + ");"; 1568 coord = "vec3 coords = vec3(" + x + ", " + y + ", " + z + ");";
1569 break; 1569 break;
1570 } 1570 }
1571 case Tegra::Shader::TextureType::TextureCube: {
1572 std::string x = regs.GetRegisterAsFloat(instr.gpr8);
1573 std::string y = regs.GetRegisterAsFloat(instr.gpr8.Value() + 1);
1574 std::string z = regs.GetRegisterAsFloat(instr.gpr8.Value() + 2);
1575 ASSERT(instr.gpr20.Value() == Register::ZeroIndex);
1576 coord = "vec3 coords = vec3(" + x + ", " + y + ", " + z + ");";
1577 break;
1578 }
1571 default: 1579 default:
1572 LOG_CRITICAL(HW_GPU, "Unhandled texture type {}", 1580 LOG_CRITICAL(HW_GPU, "Unhandled texture type {}",
1573 static_cast<u32>(instr.tex.texture_type.Value())); 1581 static_cast<u32>(instr.tex.texture_type.Value()));
@@ -1613,6 +1621,13 @@ private:
1613 } 1621 }
1614 break; 1622 break;
1615 } 1623 }
1624 case Tegra::Shader::TextureType::Texture3D: {
1625 std::string x = regs.GetRegisterAsFloat(instr.gpr8);
1626 std::string y = regs.GetRegisterAsFloat(instr.gpr20);
1627 std::string z = regs.GetRegisterAsFloat(instr.gpr20.Value() + 1);
1628 coord = "vec3 coords = vec3(" + x + ", " + y + ", " + z + ");";
1629 break;
1630 }
1616 case Tegra::Shader::TextureType::TextureCube: { 1631 case Tegra::Shader::TextureType::TextureCube: {
1617 std::string x = regs.GetRegisterAsFloat(instr.gpr8); 1632 std::string x = regs.GetRegisterAsFloat(instr.gpr8);
1618 std::string y = regs.GetRegisterAsFloat(instr.gpr8.Value() + 1); 1633 std::string y = regs.GetRegisterAsFloat(instr.gpr8.Value() + 1);