summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_vs_surface_state.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2012-06-20 12:29:29 -0700
committerEric Anholt <eric@anholt.net>2012-08-07 13:54:51 -0700
commit25d2bf3845e9a6faaef8d808c1255ec57dc71dba (patch)
tree838ba2d32ec6b35ad7df8de587282b5b3d8bc55f /src/mesa/drivers/dri/i965/brw_vs_surface_state.c
parent5bffbd7ba2ba2ff21469b2a69a0ed67f0802fec7 (diff)
downloadexternal_mesa3d-25d2bf3845e9a6faaef8d808c1255ec57dc71dba.zip
external_mesa3d-25d2bf3845e9a6faaef8d808c1255ec57dc71dba.tar.gz
external_mesa3d-25d2bf3845e9a6faaef8d808c1255ec57dc71dba.tar.bz2
i965: Bind UBOs as surfaces like we do for pull constants.
v2: Comment fix, drop extraneous parens (review by Kenneth) Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_vs_surface_state.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_vs_surface_state.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c b/src/mesa/drivers/dri/i965/brw_vs_surface_state.c
index 2026145..e29797e 100644
--- a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_vs_surface_state.c
@@ -111,6 +111,30 @@ const struct brw_tracked_state brw_vs_pull_constants = {
.emit = brw_upload_vs_pull_constants,
};
+static void
+brw_upload_vs_ubo_surfaces(struct brw_context *brw)
+{
+ struct gl_context *ctx = &brw->intel.ctx;
+ /* _NEW_PROGRAM */
+ struct gl_shader_program *prog = ctx->Shader.CurrentVertexProgram;
+
+ if (!prog)
+ return;
+
+ brw_upload_ubo_surfaces(brw, prog->_LinkedShaders[MESA_SHADER_VERTEX],
+ &brw->vs.surf_offset[SURF_INDEX_VS_UBO(0)]);
+}
+
+const struct brw_tracked_state brw_vs_ubo_surfaces = {
+ .dirty = {
+ .mesa = (_NEW_PROGRAM |
+ _NEW_BUFFER_OBJECT),
+ .brw = BRW_NEW_BATCH,
+ .cache = 0,
+ },
+ .emit = brw_upload_vs_ubo_surfaces,
+};
+
/**
* Constructs the binding table for the WM surface state, which maps unit
* numbers to surface state objects.