diff options
author | Eric Anholt <[email protected]> | 2012-08-27 14:35:01 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2012-10-08 08:50:27 -0700 |
commit | 97615b2d8c7c3cea6fd3a43bcb1739a96e2046c4 (patch) | |
tree | e8b5b5bedbf9ec120b2b2cbecce3fda3e49795e8 /src/mesa/drivers/dri/i965/brw_wm.c | |
parent | 014aaa97d3d7f78629e6e030953be0e9fb7f33dd (diff) |
i965: Replace brw_wm_* with dumping code into the fs_visitor.
This makes a giant pile of code newly dead. It also fixes TXB on newer
chipsets, which has been totally broken (I now have a piglit test for that).
It passes the same set of Ian's ARB_fragment_program tests. It also improves
high-settings ETQW performance by 3.2 +/- 1.9% (n=3), thanks to better
optimization and having 8-wide along with 16-wide shaders.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=24355
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_wm.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_wm.c | 58 |
1 files changed, 1 insertions, 57 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c index f8eb54fce1d..fa0f684a626 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.c +++ b/src/mesa/drivers/dri/i965/brw_wm.c @@ -85,46 +85,6 @@ GLuint brw_wm_is_scalar_result( GLuint opcode ) } } - -/** - * Do GPU code generation for non-GLSL shader. non-GLSL shaders have - * no flow control instructions so we can more readily do SSA-style - * optimizations. - */ -static void -brw_wm_non_glsl_emit(struct brw_context *brw, struct brw_wm_compile *c) -{ - /* Augment fragment program. Add instructions for pre- and - * post-fragment-program tasks such as interpolation and fogging. - */ - brw_wm_pass_fp(c); - - /* Translate to intermediate representation. Build register usage - * chains. - */ - brw_wm_pass0(c); - - /* Dead code removal. - */ - brw_wm_pass1(c); - - /* Register allocation. - * Divide by two because we operate on 16 pixels at a time and require - * two GRF entries for each logical shader register. - */ - c->grf_limit = BRW_WM_MAX_GRF / 2; - - brw_wm_pass2(c); - - /* how many general-purpose registers are used */ - c->prog_data.reg_blocks = brw_register_blocks(c->max_wm_grf); - - /* Emit GEN4 code. - */ - brw_wm_emit(c); -} - - /** * Return a bitfield where bit n is set if barycentric interpolation mode n * (see enum brw_wm_barycentric_interp_mode) is needed by the fragment shader. @@ -356,23 +316,7 @@ bool do_wm_prog(struct brw_context *brw, brw_compute_barycentric_interp_modes(brw, c->key.flat_shade, &fp->program); - if (prog && prog->_LinkedShaders[MESA_SHADER_FRAGMENT]) { - if (!brw_wm_fs_emit(brw, c, prog)) - return false; - } else { - if (!c->instruction) { - c->instruction = rzalloc_array(c, struct brw_wm_instruction, BRW_WM_MAX_INSN); - c->prog_instructions = rzalloc_array(c, struct prog_instruction, BRW_WM_MAX_INSN); - c->vreg = rzalloc_array(c, struct brw_wm_value, BRW_WM_MAX_VREG); - c->refs = rzalloc_array(c, struct brw_wm_ref, BRW_WM_MAX_REF); - } - - /* Fallback for fixed function and ARB_fp shaders. */ - c->dispatch_width = 16; - brw_wm_payload_setup(brw, c); - brw_wm_non_glsl_emit(brw, c); - c->prog_data.dispatch_width = 16; - } + brw_wm_fs_emit(brw, c, prog); /* Scratch space is used for register spilling */ if (c->last_scratch) { |