mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 02:28:10 +02:00
i965: Add tessellation shader sampler support.
Based on code by Chris Forbes and Fabian Bieler. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
This commit is contained in:
parent
f34c04fda6
commit
c59d1b1fd1
4 changed files with 51 additions and 1 deletions
|
|
@ -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) */
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue