summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_vec4.cpp
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2013-10-02 14:07:40 -0700
committerEric Anholt <[email protected]>2013-10-15 10:18:42 -0700
commit3c9dc2d31b80fc73bffa1f40a91443a53229c8e2 (patch)
tree0b254db5106e9a93aad131d79c6e1399a6301db6 /src/mesa/drivers/dri/i965/brw_vec4.cpp
parent5463b5bbbdf133986ac89fd6afdf2bc9622e3ca6 (diff)
i965: Make a brw_stage_prog_data for storing the SURF_INDEX information.
It would be nice to be able to pack our binding table so that programs that use 1 render target don't upload an extra BRW_MAX_DRAW_BUFFERS - 1 binding table entries. To do that, we need the compiled program to have information on where its surfaces go. v2: Rename size to size_bytes to be more explicit. Reviewed-by: Paul Berry <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_vec4.cpp')
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vec4.cpp b/src/mesa/drivers/dri/i965/brw_vec4.cpp
index bfd01068aba..14ba251d4fb 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4.cpp
@@ -1421,6 +1421,18 @@ vec4_visitor::emit_shader_time_write(enum shader_time_shader_type type,
emit(SHADER_OPCODE_SHADER_TIME_ADD, dst_reg(), src_reg(dst));
}
+void
+vec4_visitor::assign_binding_table_offsets()
+{
+ prog_data->base.binding_table.texture_start = SURF_INDEX_VEC4_TEXTURE(0);
+ prog_data->base.binding_table.ubo_start = SURF_INDEX_VEC4_UBO(0);
+ prog_data->base.binding_table.shader_time_start = SURF_INDEX_VEC4_SHADER_TIME;
+ prog_data->base.binding_table.gather_texture_start = SURF_INDEX_VEC4_GATHER_TEXTURE(0);
+ prog_data->base.binding_table.pull_constants_start = SURF_INDEX_VEC4_CONST_BUFFER;
+
+ /* prog_data->base.binding_table.size will be set by mark_surface_used. */
+}
+
bool
vec4_visitor::run()
{
@@ -1429,6 +1441,8 @@ vec4_visitor::run()
if (INTEL_DEBUG & DEBUG_SHADER_TIME)
emit_shader_time_begin();
+ assign_binding_table_offsets();
+
emit_prolog();
/* Generate VS IR for main(). (the visitor only descends into
@@ -1594,7 +1608,7 @@ bool
brw_vec4_prog_data_compare(const struct brw_vec4_prog_data *a,
const struct brw_vec4_prog_data *b)
{
- /* Compare all the struct up to the pointers. */
+ /* Compare all the struct (including the base) up to the pointers. */
if (memcmp(a, b, offsetof(struct brw_vec4_prog_data, param)))
return false;