1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-23 11:13:19 +01:00

Improved RSX emulation

- Fixed NV4097_SET_SHADER_CONTROL
- Vertex Shader: SCA instructions don't override VEC result
This commit is contained in:
DH 2014-07-19 12:24:15 +03:00
parent bd04990af3
commit 7433a021db
4 changed files with 9 additions and 12 deletions

View File

@ -340,13 +340,15 @@ bool GLGSRender::LoadProgram()
LOG_WARNING(RSX, "LoadProgram: m_cur_shader_prog == NULL");
return false;
}
m_cur_shader_prog->ctrl = m_shader_ctrl;
if(!m_cur_vertex_prog)
{
LOG_WARNING(RSX, "LoadProgram: m_cur_vertex_prog == NULL");
return false;
}
m_fp_buf_num = m_prog_buffer.SearchFp(*m_cur_shader_prog, m_shader_prog);
m_vp_buf_num = m_prog_buffer.SearchVp(*m_cur_vertex_prog, m_vertex_prog);

View File

@ -41,7 +41,7 @@ std::string GLVertexDecompilerThread::GetDST(bool isSca)
{
std::string ret;
switch(d3.dst)
switch(isSca ? 0x1f : d3.dst)
{
case 0x1f:
ret += m_parr.AddParam(PARAM_NONE, "vec4", std::string("tmp") + std::to_string(isSca ? d3.sca_dst_tmp : d0.dst_tmp));

View File

@ -972,13 +972,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t args, const u32
case NV4097_SET_SHADER_CONTROL:
{
if(!m_cur_shader_prog)
{
LOG_ERROR(RSX, "NV4097_SET_SHADER_CONTROL: m_cur_shader_prog == NULL");
break;
}
m_cur_shader_prog->ctrl = ARGS(0);
m_shader_ctrl = ARGS(0);
}
break;

View File

@ -112,8 +112,8 @@ public:
RSXIndexArrayData m_indexed_array;
std::vector<RSXTransformConstant> m_fragment_constants;
std::vector<RSXTransformConstant> m_transform_constants;
u32 m_cur_shader_prog_num;
u32 m_shader_ctrl, m_cur_shader_prog_num;
RSXShaderProgram m_shader_progs[m_fragment_count];
RSXShaderProgram* m_cur_shader_prog;
RSXVertexProgram m_vertex_progs[m_vertex_count];
@ -428,6 +428,7 @@ protected:
RSXThread()
: ThreadBase("RSXThread")
, m_ctrl(nullptr)
, m_shader_ctrl(0x40)
, m_flip_status(0)
, m_flip_mode(CELL_GCM_DISPLAY_VSYNC)
, m_debug_level(CELL_GCM_DEBUG_LEVEL0)