diff --git a/src/gallium/drivers/r300/compiler/r3xx_vertprog.c b/src/gallium/drivers/r300/compiler/r3xx_vertprog.c index e8e3712bffc..ceb590ea085 100644 --- a/src/gallium/drivers/r300/compiler/r3xx_vertprog.c +++ b/src/gallium/drivers/r300/compiler/r3xx_vertprog.c @@ -878,7 +878,6 @@ void r3xx_compile_vertex_program(struct r300_vertex_program_compiler *c) /* Lists of instruction transformations. */ struct radeon_program_transformation alu_rewrite_r500[] = { { &r300_transform_vertex_alu, NULL }, - { &r300_transform_trig_scale_vertex, NULL }, { NULL, NULL } }; diff --git a/src/gallium/drivers/r300/compiler/radeon_program_alu.c b/src/gallium/drivers/r300/compiler/radeon_program_alu.c index c28cebce3a4..4f2c5081c62 100644 --- a/src/gallium/drivers/r300/compiler/radeon_program_alu.c +++ b/src/gallium/drivers/r300/compiler/radeon_program_alu.c @@ -1036,48 +1036,6 @@ int radeonTransformTrigScale(struct radeon_compiler* c, return 1; } -/** - * Transform the trigonometric functions COS and SIN - * so that the input to COS and SIN is always in the range [-PI, PI]. - */ -int r300_transform_trig_scale_vertex(struct radeon_compiler *c, - struct rc_instruction *inst, - void *unused) -{ - static const float cons[4] = {0.15915494309189535, 0.5, 6.28318530717959, -3.14159265358979}; - unsigned int temp; - unsigned int constant; - - if (inst->U.I.Opcode != RC_OPCODE_COS && - inst->U.I.Opcode != RC_OPCODE_SIN) - return 0; - - if (!c->needs_trig_input_transform) - return 1; - - /* Repeat x in the range [-PI, PI]: - * - * repeat(x) = frac(x / 2PI + 0.5) * 2PI - PI - */ - - temp = rc_find_free_temporary(c); - constant = rc_constants_add_immediate_vec4(&c->Program.Constants, cons); - - emit3(c, inst->Prev, RC_OPCODE_MAD, NULL, dstregtmpmask(temp, RC_MASK_W), - swizzle_xxxx(inst->U.I.SrcReg[0]), - srcregswz(RC_FILE_CONSTANT, constant, RC_SWIZZLE_XXXX), - srcregswz(RC_FILE_CONSTANT, constant, RC_SWIZZLE_YYYY)); - emit1(c, inst->Prev, RC_OPCODE_FRC, NULL, dstregtmpmask(temp, RC_MASK_W), - srcreg(RC_FILE_TEMPORARY, temp)); - emit3(c, inst->Prev, RC_OPCODE_MAD, NULL, dstregtmpmask(temp, RC_MASK_W), - srcreg(RC_FILE_TEMPORARY, temp), - srcregswz(RC_FILE_CONSTANT, constant, RC_SWIZZLE_ZZZZ), - srcregswz(RC_FILE_CONSTANT, constant, RC_SWIZZLE_WWWW)); - - r300_transform_SIN_COS(c, inst, temp); - return 1; -} - /** * Replaces DDX/DDY instructions with MOV 0 to avoid using dummy shaders on r300/r400. * diff --git a/src/gallium/drivers/r300/r300_vs.c b/src/gallium/drivers/r300/r300_vs.c index dfa26de1c84..106d5520d41 100644 --- a/src/gallium/drivers/r300/r300_vs.c +++ b/src/gallium/drivers/r300/r300_vs.c @@ -201,7 +201,6 @@ void r300_translate_vertex_shader(struct r300_context *r300, compiler.Base.has_half_swizzles = FALSE; compiler.Base.has_presub = FALSE; compiler.Base.has_omod = FALSE; - compiler.Base.needs_trig_input_transform = DBG_ON(r300, DBG_USE_TGSI); compiler.Base.max_temp_regs = 32; compiler.Base.max_constants = 256; compiler.Base.max_alu_insts = r300->screen->caps.is_r500 ? 1024 : 256;