|
|
@@ -811,57 +811,6 @@ static void precalc_txp( struct brw_wm_compile *c, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*********************************************************************** |
|
|
|
* Add instructions to perform fog blending |
|
|
|
*/ |
|
|
|
|
|
|
|
static void fog_blend( struct brw_wm_compile *c, |
|
|
|
struct prog_src_register fog_factor ) |
|
|
|
{ |
|
|
|
struct prog_dst_register outcolor = dst_reg(PROGRAM_OUTPUT, FRAG_RESULT_COLR); |
|
|
|
struct prog_src_register fogcolor = search_or_add_param5( c, STATE_FOG_COLOR, 0,0,0,0 ); |
|
|
|
|
|
|
|
/* color.xyz = LRP fog_factor.xxxx, output_color, fog_color */ |
|
|
|
|
|
|
|
emit_op(c, |
|
|
|
OPCODE_LRP, |
|
|
|
dst_mask(outcolor, WRITEMASK_XYZ), |
|
|
|
0, 0, 0, |
|
|
|
fog_factor, |
|
|
|
src_reg_from_dst(outcolor), |
|
|
|
fogcolor); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* This one is simple - just take the interpolated fog coordinate and |
|
|
|
* use it as the fog blend factor. |
|
|
|
*/ |
|
|
|
static void fog_interpolated( struct brw_wm_compile *c ) |
|
|
|
{ |
|
|
|
struct prog_src_register fogc = src_reg(PROGRAM_INPUT, FRAG_ATTRIB_FOGC); |
|
|
|
|
|
|
|
if (!(c->fp_interp_emitted & (1<<FRAG_ATTRIB_FOGC))) |
|
|
|
emit_interp(c, FRAG_ATTRIB_FOGC); |
|
|
|
|
|
|
|
fog_blend( c, src_swizzle1(fogc, GET_SWZ(fogc.Swizzle,X))); |
|
|
|
} |
|
|
|
|
|
|
|
static void emit_fog( struct brw_wm_compile *c ) |
|
|
|
{ |
|
|
|
if (!c->fp->program.FogOption) |
|
|
|
return; |
|
|
|
|
|
|
|
if (1) |
|
|
|
fog_interpolated( c ); |
|
|
|
else { |
|
|
|
/* TODO: per-pixel fog */ |
|
|
|
assert(0); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
static void emit_fb_write( struct brw_wm_compile *c ) |
|
|
|
{ |
|
|
|
struct prog_src_register payload_r0_depth = src_reg(PROGRAM_PAYLOAD, PAYLOAD_DEPTH); |
|
|
@@ -1059,7 +1008,6 @@ void brw_wm_pass_fp( struct brw_wm_compile *c ) |
|
|
|
emit_ddy(c, inst); |
|
|
|
break; |
|
|
|
case OPCODE_END: |
|
|
|
emit_fog(c); |
|
|
|
emit_fb_write(c); |
|
|
|
break; |
|
|
|
case OPCODE_PRINT: |