X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fdrivers%2Fr300%2Fcompiler%2Fradeon_program_tex.c;h=17d6ee9aebbb1882deac91c73f5e1167fd0f2367;hb=87b4e4e29fb2013ce2f0770f39113069bd16057c;hp=9d69ebd18fbe1b79b1e93dc3465b9a3dadb03d6f;hpb=f8e6d19f3f40931be741b44d3edf210c38e13f0f;p=mesa.git diff --git a/src/gallium/drivers/r300/compiler/radeon_program_tex.c b/src/gallium/drivers/r300/compiler/radeon_program_tex.c index 9d69ebd18fb..17d6ee9aebb 100644 --- a/src/gallium/drivers/r300/compiler/radeon_program_tex.c +++ b/src/gallium/drivers/r300/compiler/radeon_program_tex.c @@ -37,17 +37,8 @@ static struct rc_src_register shadow_fail_value(struct r300_fragment_program_com { struct rc_src_register reg = { 0, 0, 0, 0, 0, 0 }; - if (compiler->enable_shadow_ambient) { - reg.File = RC_FILE_CONSTANT; - reg.Index = rc_constants_add_state(&compiler->Base.Program.Constants, - RC_STATE_SHADOW_AMBIENT, tmu); - reg.Swizzle = RC_SWIZZLE_WWWW; - } else { - reg.File = RC_FILE_NONE; - reg.Swizzle = RC_SWIZZLE_0000; - } - - reg.Swizzle = combine_swizzles(reg.Swizzle, + reg.File = RC_FILE_NONE; + reg.Swizzle = combine_swizzles(RC_SWIZZLE_0000, compiler->state.unit[tmu].texture_swizzle); return reg; } @@ -443,53 +434,6 @@ int radeonTransformTEX( scale_texcoords(compiler, inst, RC_STATE_R300_TEXSCALE_FACTOR); } - /* Convert SNORM-encoded ATI1N sampled as UNORM to SNORM. - * Formula: dst = tex > 0.5 ? tex*2-2 : tex*2 - */ - if (inst->U.I.Opcode != RC_OPCODE_KIL && - compiler->state.unit[inst->U.I.TexSrcUnit].convert_unorm_to_snorm) { - unsigned two, two_swizzle; - struct rc_instruction *inst_mul, *inst_mad, *inst_cnd; - - two = rc_constants_add_immediate_scalar(&c->Program.Constants, 2.35, &two_swizzle); - - inst_mul = rc_insert_new_instruction(c, inst); - inst_mul->U.I.Opcode = RC_OPCODE_MUL; - inst_mul->U.I.DstReg.File = RC_FILE_TEMPORARY; - inst_mul->U.I.DstReg.Index = rc_find_free_temporary(c); - inst_mul->U.I.SrcReg[0].File = RC_FILE_TEMPORARY; - inst_mul->U.I.SrcReg[0].Index = rc_find_free_temporary(c); /* redirected TEX output */ - inst_mul->U.I.SrcReg[1].File = RC_FILE_CONSTANT; /* 2 */ - inst_mul->U.I.SrcReg[1].Index = two; - inst_mul->U.I.SrcReg[1].Swizzle = two_swizzle; - - inst_mad = rc_insert_new_instruction(c, inst_mul); - inst_mad->U.I.Opcode = RC_OPCODE_MAD; - inst_mad->U.I.DstReg.File = RC_FILE_TEMPORARY; - inst_mad->U.I.DstReg.Index = rc_find_free_temporary(c); - inst_mad->U.I.SrcReg[0] = inst_mul->U.I.SrcReg[0]; /* redirected TEX output */ - inst_mad->U.I.SrcReg[1] = inst_mul->U.I.SrcReg[1]; /* 2 */ - inst_mad->U.I.SrcReg[2] = inst_mul->U.I.SrcReg[1]; /* 2 */ - inst_mad->U.I.SrcReg[2].Negate = RC_MASK_XYZW; - - inst_cnd = rc_insert_new_instruction(c, inst_mad); - inst_cnd->U.I.Opcode = RC_OPCODE_CND; - inst_cnd->U.I.SaturateMode = inst->U.I.SaturateMode; - inst_cnd->U.I.DstReg = inst->U.I.DstReg; - inst_cnd->U.I.SrcReg[0].File = RC_FILE_TEMPORARY; - inst_cnd->U.I.SrcReg[0].Index = inst_mad->U.I.DstReg.Index; - inst_cnd->U.I.SrcReg[0].Swizzle = compiler->state.unit[inst->U.I.TexSrcUnit].texture_swizzle; - inst_cnd->U.I.SrcReg[1].File = RC_FILE_TEMPORARY; - inst_cnd->U.I.SrcReg[1].Index = inst_mul->U.I.DstReg.Index; - inst_cnd->U.I.SrcReg[1].Swizzle = compiler->state.unit[inst->U.I.TexSrcUnit].texture_swizzle; - inst_cnd->U.I.SrcReg[2] = inst_mul->U.I.SrcReg[0]; /* redirected TEX output */ - - inst->U.I.SaturateMode = 0; - inst->U.I.DstReg.File = RC_FILE_TEMPORARY; - inst->U.I.DstReg.Index = inst_mul->U.I.SrcReg[0].Index; - inst->U.I.DstReg.WriteMask = RC_MASK_XYZW; - } - /* Cannot write texture to output registers or with saturate (all chips), * or with masks (non-r500). */ if (inst->U.I.Opcode != RC_OPCODE_KIL &&