From 2b2ca5260f0e28e115a3f835c4e83e5714b41e99 Mon Sep 17 00:00:00 2001 From: NeoBrainX Date: Mon, 17 Jun 2013 13:03:38 +0200 Subject: [PATCH] PixelShaderGen: Fixed some bugs, removed unused shader uid fields. --- Source/Core/VideoCommon/Src/PixelShaderGen.cpp | 18 +++++++++--------- Source/Core/VideoCommon/Src/PixelShaderGen.h | 10 ++-------- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp index 36a6dc64e5..93e55e9353 100644 --- a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp @@ -720,7 +720,7 @@ static void WriteStage(T& out, pixel_shader_uid_data& uid_data, int n, API_TYPE out.Write("// TEV stage %d\n", n); uid_data.bHasIndStage |= bHasIndStage << n; - uid_data.tevorders_n_texcoord |= texcoord << (3 * n); + uid_data.tevorders_n_texcoord |= (u64)texcoord << (3 * n); if (bHasIndStage) { uid_data.tevind_n_bs |= bpmem.tevind[n].bs << (2*n); @@ -811,10 +811,10 @@ static void WriteStage(T& out, pixel_shader_uid_data& uid_data, int n, API_TYPE TevStageCombiner::ColorCombiner &cc = bpmem.combiners[n].colorC; TevStageCombiner::AlphaCombiner &ac = bpmem.combiners[n].alphaC; - uid_data.cc_n_d = cc.d << (4*n); - uid_data.cc_n_c = cc.c << (4*n); - uid_data.cc_n_b = cc.b << (4*n); - uid_data.cc_n_a = cc.a << (4*n); + uid_data.cc_n_d = (u64)cc.d << (4*n); + uid_data.cc_n_c = (u64)cc.c << (4*n); + uid_data.cc_n_b = (u64)cc.b << (4*n); + uid_data.cc_n_a = (u64)cc.a << (4*n); uid_data.cc_n_bias = cc.bias << (2*n); uid_data.cc_n_op = cc.op << n; uid_data.cc_n_clamp = cc.clamp << n; @@ -822,10 +822,10 @@ static void WriteStage(T& out, pixel_shader_uid_data& uid_data, int n, API_TYPE uid_data.cc_n_dest = cc.dest << (2*n); uid_data.ac_n_rswap = ac.rswap << (2*n); uid_data.ac_n_tswap = ac.tswap << (2*n); - uid_data.ac_n_d = ac.d << (3*n); - uid_data.ac_n_c = ac.c << (3*n); - uid_data.ac_n_b = ac.b << (3*n); - uid_data.ac_n_a = ac.a << (3*n); + uid_data.ac_n_d = (u64)ac.d << (3*n); + uid_data.ac_n_c = (u64)ac.c << (3*n); + uid_data.ac_n_b = (u64)ac.b << (3*n); + uid_data.ac_n_a = (u64)ac.a << (3*n); uid_data.ac_n_bias = ac.bias << (2*n); uid_data.ac_n_op = ac.op << n; uid_data.ac_n_clamp = ac.clamp << n; diff --git a/Source/Core/VideoCommon/Src/PixelShaderGen.h b/Source/Core/VideoCommon/Src/PixelShaderGen.h index 58e451d37d..a3ebdab3c1 100644 --- a/Source/Core/VideoCommon/Src/PixelShaderGen.h +++ b/Source/Core/VideoCommon/Src/PixelShaderGen.h @@ -69,13 +69,7 @@ struct pixel_shader_uid_data u32 nIndirectStagesUsed : 8; - u32 texMtxInfo_n_unknown : 8; // 8x1 bit u32 texMtxInfo_n_projection : 8; // 8x1 bit - u32 texMtxInfo_n_inputform : 16; // 8x2 bits - u32 texMtxInfo_n_texgentype : 24; // 8x3 bits - u64 texMtxInfo_n_sourcerow : 40; // 8x5 bits - u32 texMtxInfo_n_embosssourceshift : 24; // 8x3 bits - u32 texMtxInfo_n_embosslightshift : 24; // 8x3 bits u32 tevindref_bi0 : 3; u32 tevindref_bc0 : 3; @@ -135,8 +129,8 @@ struct pixel_shader_uid_data u64 tevksel_n_kasel0 : 40; // 8x5 bits u64 tevksel_n_kcsel1 : 40; // 8x5 bits u64 tevksel_n_kasel1 : 40; // 8x5 bits - void set_tevksel_kcsel(int index, int i, u32 value) { if (i) tevksel_n_kcsel1 |= value << (5*index); else tevksel_n_kcsel0 |= value << (5*index); } - void set_tevksel_kasel(int index, int i, u32 value) { if( i) tevksel_n_kasel1 |= value << (5*index); else tevksel_n_kasel0 |= value << (5*index); } + void set_tevksel_kcsel(int index, int i, u64 value) { if (i) tevksel_n_kcsel1 |= value << (5*index); else tevksel_n_kcsel0 |= value << (5*index); } + void set_tevksel_kasel(int index, int i, u64 value) { if( i) tevksel_n_kasel1 |= value << (5*index); else tevksel_n_kasel0 |= value << (5*index); } u64 cc_n_d : 64; // 16x4 bits u64 cc_n_c : 64; // 16x4 bits