diff options
| author | 2018-08-20 21:49:47 -0400 | |
|---|---|---|
| committer | 2018-08-20 21:49:47 -0400 | |
| commit | ea99819f37bd4dffc6f9c0e30689ab05e82bec49 (patch) | |
| tree | ddc5ebded147c57cfe7776e186569b8f600afaf2 /src | |
| parent | Merge pull request #1122 from lioncash/acc (diff) | |
| parent | Shaders: Fixed the coords in TEX with Texture2D. (diff) | |
| download | yuzu-ea99819f37bd4dffc6f9c0e30689ab05e82bec49.tar.gz yuzu-ea99819f37bd4dffc6f9c0e30689ab05e82bec49.tar.xz yuzu-ea99819f37bd4dffc6f9c0e30689ab05e82bec49.zip | |
Merge pull request #1130 from Subv/tex_2d
Shaders: Fixed texture coordinates in TEX with Texture2D
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index ac6ccfec7..b7b3fbc17 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp | |||
| @@ -1514,7 +1514,7 @@ private: | |||
| 1514 | switch (instr.tex.texture_type) { | 1514 | switch (instr.tex.texture_type) { |
| 1515 | case Tegra::Shader::TextureType::Texture2D: { | 1515 | case Tegra::Shader::TextureType::Texture2D: { |
| 1516 | std::string x = regs.GetRegisterAsFloat(instr.gpr8); | 1516 | std::string x = regs.GetRegisterAsFloat(instr.gpr8); |
| 1517 | std::string y = regs.GetRegisterAsFloat(instr.gpr20); | 1517 | std::string y = regs.GetRegisterAsFloat(instr.gpr8.Value() + 1); |
| 1518 | coord = "vec2 coords = vec2(" + x + ", " + y + ");"; | 1518 | coord = "vec2 coords = vec2(" + x + ", " + y + ");"; |
| 1519 | break; | 1519 | break; |
| 1520 | } | 1520 | } |
| @@ -1526,7 +1526,9 @@ private: | |||
| 1526 | break; | 1526 | break; |
| 1527 | } | 1527 | } |
| 1528 | default: | 1528 | default: |
| 1529 | UNIMPLEMENTED(); | 1529 | LOG_CRITICAL(HW_GPU, "Unhandled texture type {}", |
| 1530 | static_cast<u32>(instr.tex.texture_type.Value())); | ||
| 1531 | UNREACHABLE(); | ||
| 1530 | } | 1532 | } |
| 1531 | 1533 | ||
| 1532 | const std::string sampler = | 1534 | const std::string sampler = |
| @@ -1576,7 +1578,9 @@ private: | |||
| 1576 | break; | 1578 | break; |
| 1577 | } | 1579 | } |
| 1578 | default: | 1580 | default: |
| 1579 | UNIMPLEMENTED(); | 1581 | LOG_CRITICAL(HW_GPU, "Unhandled texture type {}", |
| 1582 | static_cast<u32>(instr.texs.GetTextureType())); | ||
| 1583 | UNREACHABLE(); | ||
| 1580 | } | 1584 | } |
| 1581 | const std::string sampler = GetSampler(instr.sampler, instr.texs.GetTextureType(), | 1585 | const std::string sampler = GetSampler(instr.sampler, instr.texs.GetTextureType(), |
| 1582 | instr.texs.IsArrayTexture()); | 1586 | instr.texs.IsArrayTexture()); |
| @@ -1593,7 +1597,8 @@ private: | |||
| 1593 | switch (instr.tlds.GetTextureType()) { | 1597 | switch (instr.tlds.GetTextureType()) { |
| 1594 | case Tegra::Shader::TextureType::Texture2D: { | 1598 | case Tegra::Shader::TextureType::Texture2D: { |
| 1595 | if (instr.tlds.IsArrayTexture()) { | 1599 | if (instr.tlds.IsArrayTexture()) { |
| 1596 | UNIMPLEMENTED(); | 1600 | LOG_CRITICAL(HW_GPU, "Unhandled 2d array texture"); |
| 1601 | UNREACHABLE(); | ||
| 1597 | } else { | 1602 | } else { |
| 1598 | std::string x = regs.GetRegisterAsInteger(instr.gpr8); | 1603 | std::string x = regs.GetRegisterAsInteger(instr.gpr8); |
| 1599 | std::string y = regs.GetRegisterAsInteger(instr.gpr20); | 1604 | std::string y = regs.GetRegisterAsInteger(instr.gpr20); |
| @@ -1602,7 +1607,9 @@ private: | |||
| 1602 | break; | 1607 | break; |
| 1603 | } | 1608 | } |
| 1604 | default: | 1609 | default: |
| 1605 | UNIMPLEMENTED(); | 1610 | LOG_CRITICAL(HW_GPU, "Unhandled texture type {}", |
| 1611 | static_cast<u32>(instr.tlds.GetTextureType())); | ||
| 1612 | UNREACHABLE(); | ||
| 1606 | } | 1613 | } |
| 1607 | const std::string sampler = GetSampler(instr.sampler, instr.tlds.GetTextureType(), | 1614 | const std::string sampler = GetSampler(instr.sampler, instr.tlds.GetTextureType(), |
| 1608 | instr.tlds.IsArrayTexture()); | 1615 | instr.tlds.IsArrayTexture()); |
| @@ -1623,7 +1630,9 @@ private: | |||
| 1623 | break; | 1630 | break; |
| 1624 | } | 1631 | } |
| 1625 | default: | 1632 | default: |
| 1626 | UNIMPLEMENTED(); | 1633 | LOG_CRITICAL(HW_GPU, "Unhandled texture type {}", |
| 1634 | static_cast<u32>(instr.tld4.texture_type.Value())); | ||
| 1635 | UNREACHABLE(); | ||
| 1627 | } | 1636 | } |
| 1628 | 1637 | ||
| 1629 | const std::string sampler = | 1638 | const std::string sampler = |