1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 18:53:28 +01:00

Small fixes

This commit is contained in:
DH 2014-01-31 22:54:26 +02:00
parent 4b8d6b6919
commit d93ce95a36
3 changed files with 16 additions and 13 deletions

View File

@ -6,7 +6,7 @@ void GLFragmentDecompilerThread::AddCode(std::string code, bool append_mask)
if(!src0.exec_if_eq && !src0.exec_if_gr && !src0.exec_if_lt) return; if(!src0.exec_if_eq && !src0.exec_if_gr && !src0.exec_if_lt) return;
const std::string mask = GetMask().c_str(); const std::string mask = GetMask().c_str();
std::string cond = ""; std::string cond;
if(!src0.exec_if_gr || !src0.exec_if_lt || !src0.exec_if_eq) if(!src0.exec_if_gr || !src0.exec_if_lt || !src0.exec_if_eq)
{ {
@ -70,26 +70,22 @@ void GLFragmentDecompilerThread::AddCode(std::string code, bool append_mask)
code = "clamp(" + code + ", 0.0, 1.0)"; code = "clamp(" + code + ", 0.0, 1.0)";
} }
if(!dst.no_dest) std::string dest;
{
std::string dest;
if(dst.no_dest)
{
if(dst.set_cond) if(dst.set_cond)
{ {
dest = m_parr.AddParam(PARAM_NONE , "vec4", std::string(dst.fp16 ? "hc" : "rc") + std::to_string(src0.cond_reg_index)); dest = m_parr.AddParam(PARAM_NONE , "vec4", std::string(dst.fp16 ? "hc" : "rc") + std::to_string(src0.cond_reg_index));
} }
else
{
dest = AddReg(dst.dest_reg, dst.fp16);
}
code = cond + dest + mask + " = " + code + (append_mask ? mask : "");
} }
else else
{ {
code = cond + code + (append_mask ? mask : ""); dest = AddReg(dst.dest_reg, dst.fp16);
} }
code = cond + (dest.length() ? dest + mask + " = " : "") + code + (append_mask ? mask : "");
main += "\t" + code + ";\n"; main += "\t" + code + ";\n";
} }

View File

@ -214,7 +214,7 @@ void GLVertexDecompilerThread::AddCode(bool is_sca, wxString code, bool src_mask
{ {
if(d3.vec_writemask_x) if(d3.vec_writemask_x)
{ {
dest = "gl_FogFragCoord"; dest = m_parr.AddParam(PARAM_OUT, "vec4", "fogc") + mask;
} }
else else
{ {
@ -338,6 +338,8 @@ wxString GLVertexDecompilerThread::BuildCode()
void GLVertexDecompilerThread::Task() void GLVertexDecompilerThread::Task()
{ {
m_parr.params.Clear();
for(u32 i=0;;) for(u32 i=0;;)
{ {
d0.HEX = m_data[i++]; d0.HEX = m_data[i++];

View File

@ -691,12 +691,17 @@ struct _func_arg
template<typename T> template<typename T>
struct _func_arg<mem_base_t<T>> struct _func_arg<mem_base_t<T>>
{ {
__forceinline static u64 get_value(const mem_base_t<T>& arg) __forceinline static u64 get_value(const mem_base_t<T> arg)
{ {
return arg.GetAddr(); return arg.GetAddr();
} }
}; };
template<typename T> struct _func_arg<mem_ptr_t<T>> : public _func_arg<mem_base_t<T>> {};
template<> struct _func_arg<mem_ptr_t<void>> : public _func_arg<mem_base_t<u8>> {};
template<typename T> struct _func_arg<mem_list_ptr_t<T>> : public _func_arg<mem_base_t<T>> {};
template<typename T> struct _func_arg<mem_t<T>> : public _func_arg<mem_base_t<T>> {};
template<typename T> template<typename T>
struct _func_arg<be_t<T>> struct _func_arg<be_t<T>>
{ {