diff options
author | Kenneth Graunke <[email protected]> | 2015-10-09 17:07:23 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2015-12-11 13:11:15 -0800 |
commit | c59d1b1fd1ac5dca3b769f42fe0e42a11c10d4b8 (patch) | |
tree | ca7e1991c5d2a3f26834e39565e904fad13b4f42 /src/mesa | |
parent | f34c04fda69c6fc91e60633d41108e488af1f88a (diff) |
i965: Add tessellation shader sampler support.
Based on code by Chris Forbes and Fabian Bieler.
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_context.h | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_sampler_state.c | 46 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_state.h | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_state_upload.c | 2 |
4 files changed, 51 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h index 7e7faf93404..fd3d3746579 100644 --- a/src/mesa/drivers/dri/i965/brw_context.h +++ b/src/mesa/drivers/dri/i965/brw_context.h @@ -1236,7 +1236,7 @@ struct brw_context } perfmon; int num_atoms[BRW_NUM_PIPELINES]; - const struct brw_tracked_state render_atoms[72]; + const struct brw_tracked_state render_atoms[74]; const struct brw_tracked_state compute_atoms[10]; /* If (INTEL_DEBUG & DEBUG_BATCH) */ diff --git a/src/mesa/drivers/dri/i965/brw_sampler_state.c b/src/mesa/drivers/dri/i965/brw_sampler_state.c index 6d73444dad0..3f29e2fc105 100644 --- a/src/mesa/drivers/dri/i965/brw_sampler_state.c +++ b/src/mesa/drivers/dri/i965/brw_sampler_state.c @@ -55,6 +55,8 @@ gen7_emit_sampler_state_pointers_xs(struct brw_context *brw, { static const uint16_t packet_headers[] = { [MESA_SHADER_VERTEX] = _3DSTATE_SAMPLER_STATE_POINTERS_VS, + [MESA_SHADER_TESS_CTRL] = _3DSTATE_SAMPLER_STATE_POINTERS_HS, + [MESA_SHADER_TESS_EVAL] = _3DSTATE_SAMPLER_STATE_POINTERS_DS, [MESA_SHADER_GEOMETRY] = _3DSTATE_SAMPLER_STATE_POINTERS_GS, [MESA_SHADER_FRAGMENT] = _3DSTATE_SAMPLER_STATE_POINTERS_PS, }; @@ -647,3 +649,47 @@ const struct brw_tracked_state brw_gs_samplers = { }, .emit = brw_upload_gs_samplers, }; + + +static void +brw_upload_tcs_samplers(struct brw_context *brw) +{ + /* BRW_NEW_TESS_CTRL_PROGRAM */ + struct gl_program *tcs = (struct gl_program *) brw->tess_ctrl_program; + if (!tcs) + return; + + brw_upload_sampler_state_table(brw, tcs, &brw->tcs.base); +} + + +const struct brw_tracked_state brw_tcs_samplers = { + .dirty = { + .mesa = _NEW_TEXTURE, + .brw = BRW_NEW_BATCH | + BRW_NEW_TESS_CTRL_PROGRAM, + }, + .emit = brw_upload_tcs_samplers, +}; + + +static void +brw_upload_tes_samplers(struct brw_context *brw) +{ + /* BRW_NEW_TESS_EVAL_PROGRAM */ + struct gl_program *tes = (struct gl_program *) brw->tess_eval_program; + if (!tes) + return; + + brw_upload_sampler_state_table(brw, tes, &brw->tes.base); +} + + +const struct brw_tracked_state brw_tes_samplers = { + .dirty = { + .mesa = _NEW_TEXTURE, + .brw = BRW_NEW_BATCH | + BRW_NEW_TESS_EVAL_PROGRAM, + }, + .emit = brw_upload_tes_samplers, +}; diff --git a/src/mesa/drivers/dri/i965/brw_state.h b/src/mesa/drivers/dri/i965/brw_state.h index c6197cc6a5b..986406bab19 100644 --- a/src/mesa/drivers/dri/i965/brw_state.h +++ b/src/mesa/drivers/dri/i965/brw_state.h @@ -72,6 +72,8 @@ extern const struct brw_tracked_state brw_state_base_address; extern const struct brw_tracked_state brw_urb_fence; extern const struct brw_tracked_state brw_vs_prog; extern const struct brw_tracked_state brw_vs_samplers; +extern const struct brw_tracked_state brw_tcs_samplers; +extern const struct brw_tracked_state brw_tes_samplers; extern const struct brw_tracked_state brw_gs_samplers; extern const struct brw_tracked_state brw_vs_ubo_surfaces; extern const struct brw_tracked_state brw_vs_abo_surfaces; diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c index 90c62f48e05..a31e3f4eead 100644 --- a/src/mesa/drivers/dri/i965/brw_state_upload.c +++ b/src/mesa/drivers/dri/i965/brw_state_upload.c @@ -325,6 +325,8 @@ static const struct brw_tracked_state *gen8_render_atoms[] = &brw_fs_samplers, &brw_vs_samplers, + &brw_tcs_samplers, + &brw_tes_samplers, &brw_gs_samplers, &gen8_multisample_state, |