aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorBryan Cain <[email protected]>2011-04-30 23:17:11 -0500
committerBryan Cain <[email protected]>2011-08-01 17:59:07 -0500
commita6705aa5ca151278ed1e596b68a327afd1405b9e (patch)
treedfcbb22ce6159213425bdb22f02a3f2df0d4e561 /src/mesa
parent5768ed6429937940bd48f5de4f8383273952880a (diff)
glsl_to_tgsi: lower noise opcodes when converting from GLSL IR, not when generating TGSI
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/state_tracker/st_glsl_to_tgsi.cpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 5f3f0ba295a..08c6a7b2dd3 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -1275,12 +1275,13 @@ glsl_to_tgsi_visitor::visit(ir_expression *ir)
break;
case ir_unop_noise: {
- const enum prog_opcode opcode =
- prog_opcode(OPCODE_NOISE1
- + (ir->operands[0]->type->vector_elements) - 1);
- assert((opcode >= OPCODE_NOISE1) && (opcode <= OPCODE_NOISE4));
-
- emit(ir, opcode, result_dst, op[0]);
+ /* At some point, a motivated person could add a better
+ * implementation of noise. Currently not even the nvidia
+ * binary drivers do anything more than this. In any case, the
+ * place to do this is in the GL state tracker, not the poor
+ * driver.
+ */
+ emit(ir, OPCODE_MOV, result_dst, st_src_reg_for_float(0.5));
break;
}
@@ -3484,13 +3485,7 @@ compile_tgsi_instruction(struct st_translate *t,
case OPCODE_NOISE2:
case OPCODE_NOISE3:
case OPCODE_NOISE4:
- /* At some point, a motivated person could add a better
- * implementation of noise. Currently not even the nvidia
- * binary drivers do anything more than this. In any case, the
- * place to do this is in the GL state tracker, not the poor
- * driver.
- */
- ureg_MOV( ureg, dst[0], ureg_imm1f(ureg, 0.5) );
+ assert(!"OPCODE_NOISE should have been lowered\n");
break;
case OPCODE_DDY: