break;
case FS_OPCODE_DDY_COARSE:
case FS_OPCODE_DDY_FINE:
- /* Make sure fp->UsesDFdy flag got set (otherwise there's no
- * guarantee that key->render_to_fbo is set).
- */
- assert(stage == MESA_SHADER_FRAGMENT &&
- ((gl_fragment_program *) prog)->UsesDFdy);
- generate_ddy(inst->opcode, dst, src[0],
- ((brw_wm_prog_key * const) this->key)->render_to_fbo);
+ assert(src[1].file == BRW_IMMEDIATE_VALUE);
+ generate_ddy(inst->opcode, dst, src[0], src[1].dw1.ud);
break;
case SHADER_OPCODE_GEN4_SCRATCH_WRITE:
case ir_unop_dFdy:
/* Select one of the two opcodes based on the glHint value. */
if (fs_key->high_quality_derivatives)
- emit(FS_OPCODE_DDY_FINE, this->result, op[0]);
+ emit(FS_OPCODE_DDY_FINE, result, op[0], fs_reg(fs_key->render_to_fbo));
else
- emit(FS_OPCODE_DDY_COARSE, this->result, op[0]);
+ emit(FS_OPCODE_DDY_COARSE, result, op[0], fs_reg(fs_key->render_to_fbo));
break;
case ir_unop_dFdy_coarse:
- emit(FS_OPCODE_DDY_COARSE, this->result, op[0]);
+ emit(FS_OPCODE_DDY_COARSE, result, op[0], fs_reg(fs_key->render_to_fbo));
break;
case ir_unop_dFdy_fine:
- emit(FS_OPCODE_DDY_FINE, this->result, op[0]);
+ emit(FS_OPCODE_DDY_FINE, result, op[0], fs_reg(fs_key->render_to_fbo));
break;
case ir_binop_add: