i965/gs: Implement support for geometry shader samplers.
authorPaul Berry <stereotype441@gmail.com>
Sun, 25 Aug 2013 14:36:18 +0000 (07:36 -0700)
committerPaul Berry <stereotype441@gmail.com>
Sun, 1 Sep 2013 00:13:10 +0000 (17:13 -0700)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_state.h
src/mesa/drivers/dri/i965/brw_state_upload.c
src/mesa/drivers/dri/i965/brw_wm_sampler_state.c

index d24bac542e792c7a8c8bcf2b7f01db22e8a8d04b..22e4a6128c7bd4e9133f7c0585fe0d0a2457a9e5 100644 (file)
@@ -69,6 +69,7 @@ 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_gs_samplers;
 extern const struct brw_tracked_state brw_vs_ubo_surfaces;
 extern const struct brw_tracked_state brw_gs_ubo_surfaces;
 extern const struct brw_tracked_state brw_vs_unit;
index 004e4032c763b8f0d9d39b499992bb51a8f79bcd..b6a6a0a727fa84e4d0e30aae105aa4333b569fee 100644 (file)
@@ -215,6 +215,7 @@ static const struct brw_tracked_state *gen7_atoms[] =
 
    &brw_fs_samplers,
    &brw_vs_samplers,
+   &brw_gs_samplers,
    &gen6_multisample_state,
 
    &gen7_disable_stages,
index dd5896e450525d4bd50fd2b3a61e9fd4cd7543f5..828820d533ef4fda7a0d036a286cfc0db4c1ac6c 100644 (file)
@@ -443,6 +443,34 @@ const struct brw_tracked_state brw_vs_samplers = {
 };
 
 
+static void
+brw_upload_gs_samplers(struct brw_context *brw)
+{
+   struct brw_stage_state *stage_state = &brw->gs.base;
+
+   /* BRW_NEW_GEOMETRY_PROGRAM */
+   struct gl_program *gs = (struct gl_program *) brw->geometry_program;
+   if (!gs)
+      return;
+
+   brw->vtbl.upload_sampler_state_table(brw, gs,
+                                        stage_state->sampler_count,
+                                        &stage_state->sampler_offset,
+                                        stage_state->sdc_offset);
+}
+
+
+const struct brw_tracked_state brw_gs_samplers = {
+   .dirty = {
+      .mesa = _NEW_TEXTURE,
+      .brw = BRW_NEW_BATCH |
+             BRW_NEW_GEOMETRY_PROGRAM,
+      .cache = 0
+   },
+   .emit = brw_upload_gs_samplers,
+};
+
+
 void
 gen4_init_vtable_sampler_functions(struct brw_context *brw)
 {