mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-23 07:12:46 +01:00
Merge pull request #1131 from bunnei/impl-tex3d-texcube
gl_shader_decompiler: Implement TextureCube/Texture3D for TEX/TEXS.
This commit is contained in:
commit
e33452f7e8
2 changed files with 21 additions and 2 deletions
|
@ -477,7 +477,9 @@ union Instruction {
|
|||
if (texture_info >= 12 && texture_info <= 13)
|
||||
return TextureType::TextureCube;
|
||||
|
||||
UNIMPLEMENTED();
|
||||
LOG_CRITICAL(HW_GPU, "Unhandled texture_info: {}",
|
||||
static_cast<u32>(texture_info.Value()));
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
bool IsArrayTexture() const {
|
||||
|
@ -523,7 +525,9 @@ union Instruction {
|
|||
return TextureType::Texture3D;
|
||||
}
|
||||
|
||||
UNIMPLEMENTED();
|
||||
LOG_CRITICAL(HW_GPU, "Unhandled texture_info: {}",
|
||||
static_cast<u32>(texture_info.Value()));
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
bool IsArrayTexture() const {
|
||||
|
|
|
@ -1568,6 +1568,14 @@ private:
|
|||
coord = "vec3 coords = vec3(" + x + ", " + y + ", " + z + ");";
|
||||
break;
|
||||
}
|
||||
case Tegra::Shader::TextureType::TextureCube: {
|
||||
std::string x = regs.GetRegisterAsFloat(instr.gpr8);
|
||||
std::string y = regs.GetRegisterAsFloat(instr.gpr8.Value() + 1);
|
||||
std::string z = regs.GetRegisterAsFloat(instr.gpr8.Value() + 2);
|
||||
ASSERT(instr.gpr20.Value() == Register::ZeroIndex);
|
||||
coord = "vec3 coords = vec3(" + x + ", " + y + ", " + z + ");";
|
||||
break;
|
||||
}
|
||||
default:
|
||||
LOG_CRITICAL(HW_GPU, "Unhandled texture type {}",
|
||||
static_cast<u32>(instr.tex.texture_type.Value()));
|
||||
|
@ -1613,6 +1621,13 @@ private:
|
|||
}
|
||||
break;
|
||||
}
|
||||
case Tegra::Shader::TextureType::Texture3D: {
|
||||
std::string x = regs.GetRegisterAsFloat(instr.gpr8);
|
||||
std::string y = regs.GetRegisterAsFloat(instr.gpr20);
|
||||
std::string z = regs.GetRegisterAsFloat(instr.gpr20.Value() + 1);
|
||||
coord = "vec3 coords = vec3(" + x + ", " + y + ", " + z + ");";
|
||||
break;
|
||||
}
|
||||
case Tegra::Shader::TextureType::TextureCube: {
|
||||
std::string x = regs.GetRegisterAsFloat(instr.gpr8);
|
||||
std::string y = regs.GetRegisterAsFloat(instr.gpr8.Value() + 1);
|
||||
|
|
Loading…
Reference in a new issue