aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_gs.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2019-02-21 17:20:39 -0600
committerJason Ekstrand <[email protected]>2019-07-10 19:35:55 +0000
commit14781e21227d036b8875bbdde9f343a8e73ceeb6 (patch)
treef7691a6244aa1cf546d8b6282aa080b1a31e75c4 /src/mesa/drivers/dri/i965/brw_gs.c
parent3a4667e502c458b6ac0ae3d4641612a9186a1924 (diff)
intel/compiler: Add a "base class" for program keys
Right now, all keys have two things in common: a program string ID and a sampler_prog_key_data. I'd like to add another thing or two and need a place to put it. This commit adds a new brw_base_prog_key struct which contains those two common bits. Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_gs.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_gs.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_gs.c b/src/mesa/drivers/dri/i965/brw_gs.c
index 34e37373999..ef8b9239d79 100644
--- a/src/mesa/drivers/dri/i965/brw_gs.c
+++ b/src/mesa/drivers/dri/i965/brw_gs.c
@@ -105,7 +105,7 @@ brw_codegen_gs_prog(struct brw_context *brw,
if (unlikely(brw->perf_debug)) {
if (gp->compiled_once) {
brw_debug_recompile(brw, MESA_SHADER_GEOMETRY, gp->program.Id,
- key->program_string_id, key);
+ &key->base);
}
if (start_busy && !brw_bo_busy(brw->batch.last_bo)) {
perf_debug("GS compile took %.03f ms and stalled the GPU\n",
@@ -150,10 +150,7 @@ brw_gs_populate_key(struct brw_context *brw,
memset(key, 0, sizeof(*key));
- key->program_string_id = gp->id;
-
- /* _NEW_TEXTURE */
- brw_populate_sampler_prog_key_data(ctx, &gp->program, &key->tex);
+ brw_populate_base_prog_key(ctx, gp, &key->base);
}
void
@@ -179,7 +176,7 @@ brw_upload_gs_prog(struct brw_context *brw)
return;
gp = (struct brw_program *) brw->programs[MESA_SHADER_GEOMETRY];
- gp->id = key.program_string_id;
+ gp->id = key.base.program_string_id;
MAYBE_UNUSED bool success = brw_codegen_gs_prog(brw, gp, &key);
assert(success);
@@ -194,8 +191,8 @@ brw_gs_populate_default_key(const struct brw_compiler *compiler,
memset(key, 0, sizeof(*key));
- brw_setup_tex_for_precompile(devinfo, &key->tex, prog);
- key->program_string_id = brw_program(prog)->id;
+ brw_populate_default_base_prog_key(devinfo, brw_program(prog),
+ &key->base);
}
bool