PixelShaderGen: Fixed some bugs, removed unused shader uid fields.

This commit is contained in:
NeoBrainX 2013-06-17 13:03:38 +02:00
parent 7a01ceba73
commit 2b2ca5260f
2 changed files with 11 additions and 17 deletions

View File

@ -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;

View File

@ -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