mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-13 10:18:40 +12:00
rsx/fp/gl: Minor fixes (#2823)
* rsx/fp: expand glsl unpack instructions to vec4 * rsx/fp: Ignore BRK outside LOOP/REP * fix string compare typo
This commit is contained in:
parent
e6d55a6692
commit
d5df4a4616
2 changed files with 9 additions and 6 deletions
|
@ -585,9 +585,9 @@ bool FragmentProgramDecompiler::handle_tex_srb(u32 opcode)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
case RSX_FP_OPCODE_UP2: SetDst("unpackSnorm2x16(uint($0.x))"); return true; // TODO: More testing (Sonic The Hedgehog (NPUB-30442/NPEB-00478))
|
case RSX_FP_OPCODE_UP2: SetDst("unpackSnorm2x16(uint($0.x)).xyxy"); return true; // TODO: More testing (Sonic The Hedgehog (NPUB-30442/NPEB-00478))
|
||||||
case RSX_FP_OPCODE_UP4: SetDst("unpackSnorm4x8(uint($0.x))"); return true; // TODO: More testing (Sonic The Hedgehog (NPUB-30442/NPEB-00478))
|
case RSX_FP_OPCODE_UP4: SetDst("unpackSnorm4x8(uint($0.x))"); return true; // TODO: More testing (Sonic The Hedgehog (NPUB-30442/NPEB-00478))
|
||||||
case RSX_FP_OPCODE_UP16: SetDst("unpackHalf2x16(uint($0.x))"); return true;
|
case RSX_FP_OPCODE_UP16: SetDst("unpackHalf2x16(uint($0.x)).xyxy"); return true;
|
||||||
case RSX_FP_OPCODE_UPB: SetDst("(unpackUnorm4x8(uint($0.x)) * 255.)"); return true;
|
case RSX_FP_OPCODE_UPB: SetDst("(unpackUnorm4x8(uint($0.x)) * 255.)"); return true;
|
||||||
case RSX_FP_OPCODE_UPG: LOG_ERROR(RSX, "Unimplemented TEX_SRB instruction: UPG"); return true;
|
case RSX_FP_OPCODE_UPG: LOG_ERROR(RSX, "Unimplemented TEX_SRB instruction: UPG"); return true;
|
||||||
}
|
}
|
||||||
|
@ -648,7 +648,10 @@ std::string FragmentProgramDecompiler::Decompile()
|
||||||
{
|
{
|
||||||
switch (opcode)
|
switch (opcode)
|
||||||
{
|
{
|
||||||
case RSX_FP_OPCODE_BRK: AddFlowOp("break"); break;
|
case RSX_FP_OPCODE_BRK:
|
||||||
|
if (m_loop_count) AddFlowOp("break");
|
||||||
|
else LOG_ERROR(RSX, "BRK opcode found outside of a loop");
|
||||||
|
break;
|
||||||
case RSX_FP_OPCODE_CAL: LOG_ERROR(RSX, "Unimplemented SIP instruction: CAL"); break;
|
case RSX_FP_OPCODE_CAL: LOG_ERROR(RSX, "Unimplemented SIP instruction: CAL"); break;
|
||||||
case RSX_FP_OPCODE_FENCT: forced_unit = FORCE_SCT; break;
|
case RSX_FP_OPCODE_FENCT: forced_unit = FORCE_SCT; break;
|
||||||
case RSX_FP_OPCODE_FENCB: forced_unit = FORCE_SCB; break;
|
case RSX_FP_OPCODE_FENCB: forced_unit = FORCE_SCB; break;
|
||||||
|
@ -663,7 +666,7 @@ std::string FragmentProgramDecompiler::Decompile()
|
||||||
case RSX_FP_OPCODE_LOOP:
|
case RSX_FP_OPCODE_LOOP:
|
||||||
if (!src0.exec_if_eq && !src0.exec_if_gr && !src0.exec_if_lt)
|
if (!src0.exec_if_eq && !src0.exec_if_gr && !src0.exec_if_lt)
|
||||||
{
|
{
|
||||||
AddCode(fmt::format("$ifcond for(int i%u = %u; i%u < %u; i%u += %u) {} //-> %u //LOOP",
|
AddCode(fmt::format("//$ifcond for(int i%u = %u; i%u < %u; i%u += %u) {} //-> %u //LOOP",
|
||||||
m_loop_count, src1.init_counter, m_loop_count, src1.end_counter, m_loop_count, src1.increment, src2.end_offset));
|
m_loop_count, src1.init_counter, m_loop_count, src1.end_counter, m_loop_count, src1.increment, src2.end_offset));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -679,7 +682,7 @@ std::string FragmentProgramDecompiler::Decompile()
|
||||||
case RSX_FP_OPCODE_REP:
|
case RSX_FP_OPCODE_REP:
|
||||||
if (!src0.exec_if_eq && !src0.exec_if_gr && !src0.exec_if_lt)
|
if (!src0.exec_if_eq && !src0.exec_if_gr && !src0.exec_if_lt)
|
||||||
{
|
{
|
||||||
AddCode(fmt::format("$ifcond for(int i%u = %u; i%u < %u; i%u += %u) {} //-> %u //REP",
|
AddCode(fmt::format("//$ifcond for(int i%u = %u; i%u < %u; i%u += %u) {} //-> %u //REP",
|
||||||
m_loop_count, src1.init_counter, m_loop_count, src1.end_counter, m_loop_count, src1.increment, src2.end_offset));
|
m_loop_count, src1.init_counter, m_loop_count, src1.end_counter, m_loop_count, src1.increment, src2.end_offset));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -133,7 +133,7 @@ namespace gl
|
||||||
std::string vendor_string = (const char*)glGetString(GL_VENDOR);
|
std::string vendor_string = (const char*)glGetString(GL_VENDOR);
|
||||||
std::transform(vendor_string.begin(), vendor_string.end(), vendor_string.begin(), ::tolower);
|
std::transform(vendor_string.begin(), vendor_string.end(), vendor_string.begin(), ::tolower);
|
||||||
|
|
||||||
if (vendor_string.find("intel"))
|
if (vendor_string.find("intel") != std::string::npos)
|
||||||
{
|
{
|
||||||
int version_major = 0;
|
int version_major = 0;
|
||||||
int version_minor = 0;
|
int version_minor = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue