Mesa (master): i965/gs: Implement support for geometry shader samplers.
Paul Berry
stereotype441 at kemper.freedesktop.org
Sun Sep 1 00:27:04 UTC 2013
Module: Mesa
Branch: master
Commit: 4cc692e355e1f2a15c0d3613aec5dfc3a8bf8935
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=4cc692e355e1f2a15c0d3613aec5dfc3a8bf8935
Author: Paul Berry <stereotype441 at gmail.com>
Date: Sun Aug 25 07:36:18 2013 -0700
i965/gs: Implement support for geometry shader samplers.
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
---
src/mesa/drivers/dri/i965/brw_state.h | 1 +
src/mesa/drivers/dri/i965/brw_state_upload.c | 1 +
src/mesa/drivers/dri/i965/brw_wm_sampler_state.c | 28 ++++++++++++++++++++++
3 files changed, 30 insertions(+), 0 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_state.h b/src/mesa/drivers/dri/i965/brw_state.h
index d24bac5..22e4a61 100644
--- a/src/mesa/drivers/dri/i965/brw_state.h
+++ b/src/mesa/drivers/dri/i965/brw_state.h
@@ -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;
diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c
index 004e403..b6a6a0a 100644
--- a/src/mesa/drivers/dri/i965/brw_state_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_state_upload.c
@@ -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,
diff --git a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
index dd5896e..828820d 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
@@ -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)
{
More information about the mesa-commit
mailing list