[Mesa-dev] [RFC PATCH 07/12] i965: Use hw-bt for pull constants and VS UBO surface states.

Abdiel Janulgue abdiel.janulgue at linux.intel.com
Mon Jul 8 06:16:58 PDT 2013


When surface_state pointing to pull constant surfaces are changed, update
on-chip binding table. Same with VS ubo surface states.

Signed-off-by: Abdiel Janulgue <abdiel.janulgue at linux.intel.com>
---
 src/mesa/drivers/dri/i965/brw_vs_surface_state.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

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 605d394..1aa5250 100644
--- a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_vs_surface_state.c
@@ -34,6 +34,7 @@
 
 #include "brw_context.h"
 #include "brw_state.h"
+#include "brw_defines.h"
 
 /* Creates a new VS constant buffer reflecting the current VS program's
  * constants, if needed by the VS program.
@@ -94,6 +95,9 @@ brw_upload_vs_pull_constants(struct brw_context *brw)
    intel->vtbl.create_constant_surface(brw, brw->vs.const_bo, 0, size,
 				       &brw->vs.surf_offset[surf], false);
 
+   if (intel->is_haswell)
+      gen7_update_vs_binding_table(brw, surf, brw->vs.surf_offset[surf]);
+
    brw->state.dirty.brw |= BRW_NEW_VS_CONSTBUF;
 }
 
@@ -110,6 +114,8 @@ static void
 brw_upload_vs_ubo_surfaces(struct brw_context *brw)
 {
    struct gl_context *ctx = &brw->intel.ctx;
+   struct intel_context *intel = &brw->intel;
+   uint32_t p, surf_offset;
    /* _NEW_PROGRAM */
    struct gl_shader_program *prog = ctx->Shader.CurrentVertexProgram;
 
@@ -118,6 +124,10 @@ brw_upload_vs_ubo_surfaces(struct brw_context *brw)
 
    brw_upload_ubo_surfaces(brw, prog->_LinkedShaders[MESA_SHADER_VERTEX],
 			   &brw->vs.surf_offset[SURF_INDEX_VS_UBO(0)]);
+
+   if (intel->is_haswell)
+      gen7_update_vs_binding_table(brw, SURF_INDEX_VS_UBO(0),
+                                   brw->vs.surf_offset[SURF_INDEX_VS_UBO(0)]);
 }
 
 const struct brw_tracked_state brw_vs_ubo_surfaces = {
-- 
1.7.9.5



More information about the mesa-dev mailing list