Disable hierarchical zbuffer
``nocmask``
Disable AA compression and fast AA clear
- ``use_tgsi``
- Request TGSI shaders from the state tracker
``notcl``
Disable hardware accelerated Transform/Clip/Lighting
struct radeon_program_transformation native_rewrite_r500[] = {
{ &radeonTransformALU, NULL },
{ &radeonTransformDeriv, NULL },
- { &radeonTransformTrigScale, NULL },
{ NULL, NULL }
};
unsigned has_presub:1;
unsigned has_omod:1;
unsigned disable_optimizations:1;
- unsigned needs_trig_input_transform:1;
unsigned max_temp_regs;
unsigned max_constants;
int max_alu_insts;
rc_remove_instruction(inst);
}
-
-/**
- * Transform the trigonometric functions COS and SIN
- * to include pre-scaling by 1/(2*PI) and taking the fractional
- * part, so that the input to COS and SIN is always in the range [0,1).
- *
- * @warning This transformation implicitly changes the semantics of SIN and COS!
- */
-int radeonTransformTrigScale(struct radeon_compiler* c,
- struct rc_instruction* inst,
- void* unused)
-{
- static const float RCP_2PI = 0.15915494309189535;
- unsigned int temp;
- unsigned int constant;
- unsigned int constant_swizzle;
-
- 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;
-
- temp = rc_find_free_temporary(c);
- constant = rc_constants_add_immediate_scalar(&c->Program.Constants, RCP_2PI, &constant_swizzle);
-
- emit2(c, inst->Prev, RC_OPCODE_MUL, NULL, dstregtmpmask(temp, RC_MASK_W),
- swizzle_xxxx(inst->U.I.SrcReg[0]),
- srcregswz(RC_FILE_CONSTANT, constant, constant_swizzle));
- emit1(c, inst->Prev, RC_OPCODE_FRC, NULL, dstregtmpmask(temp, RC_MASK_W),
- srcreg(RC_FILE_TEMPORARY, temp));
-
- r300_transform_SIN_COS(c, inst, temp);
- return 1;
-}
-
/**
* Replaces DDX/DDY instructions with MOV 0 to avoid using dummy shaders on r300/r400.
*
struct rc_instruction * inst,
void*);
-int radeonTransformTrigScale(
- struct radeon_compiler * c,
- struct rc_instruction * inst,
- void*);
-
int r300_transform_trig_scale_vertex(
struct radeon_compiler *c,
struct rc_instruction *inst,
{ "nozmask", DBG_NO_ZMASK, "Disable zbuffer compression" },
{ "nohiz", DBG_NO_HIZ, "Disable hierarchical zbuffer" },
{ "nocmask", DBG_NO_CMASK, "Disable AA compression and fast AA clear" },
- { "use_tgsi", DBG_USE_TGSI, "Request TGSI shaders from the state tracker" },
{ "notcl", DBG_NO_TCL, "Disable hardware accelerated Transform/Clip/Lighting" },
/* must be last */
compiler.Base.has_half_swizzles = TRUE;
compiler.Base.has_presub = TRUE;
compiler.Base.has_omod = TRUE;
- compiler.Base.needs_trig_input_transform = DBG_ON(r300, DBG_USE_TGSI);
compiler.Base.max_temp_regs =
compiler.Base.is_r500 ? 128 : (compiler.Base.is_r400 ? 64 : 32);
compiler.Base.max_constants = compiler.Base.is_r500 ? 256 : 32;
switch (param) {
case PIPE_SHADER_CAP_PREFERRED_IR:
- return (r300screen->debug & DBG_USE_TGSI) ? PIPE_SHADER_IR_TGSI : PIPE_SHADER_IR_NIR;
+ return PIPE_SHADER_IR_NIR;
case PIPE_SHADER_CAP_SUPPORTED_IRS:
return (1 << PIPE_SHADER_IR_NIR) | (1 << PIPE_SHADER_IR_TGSI);
default:
#define DBG_NO_ZMASK (1 << 21)
#define DBG_NO_HIZ (1 << 22)
#define DBG_NO_CMASK (1 << 23)
-#define DBG_USE_TGSI (1 << 24)
#define DBG_NO_TCL (1 << 25)
/*@}*/
static inline boolean SCREEN_DBG_ON(struct r300_screen * screen, unsigned flags)