aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_fs.cpp
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2013-10-03 09:58:43 -0700
committerEric Anholt <[email protected]>2013-10-15 10:18:50 -0700
commit705a90e30435490c2de84f4f6741cab335fa7608 (patch)
tree942db192506eb1fde5db1de8f9a7765b71de33f8 /src/mesa/drivers/dri/i965/brw_fs.cpp
parentd395485e1df44853cdf86b0bd46b7af36c7e1c13 (diff)
i965: Move the common binding table offset code to brw_shader.cpp.
Now that both vec4 and fs are dynamically assigning offsets, a lot of the code is the same. v2: Avoid passing around the next offset through the class. (Review by Paul) Reviewed-by: Paul Berry <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_fs.cpp')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.cpp33
1 files changed, 4 insertions, 29 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 4d83c079c98..aec6fc7f38e 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -2981,37 +2981,12 @@ fs_visitor::setup_payload_gen6()
void
fs_visitor::assign_binding_table_offsets()
{
- int num_textures = _mesa_fls(fp->Base.SamplersUsed);
- int next = 0;
+ uint32_t next_binding_table_offset = 0;
- c->prog_data.binding_table.render_target_start = next;
- next += c->key.nr_color_regions;
+ c->prog_data.binding_table.render_target_start = next_binding_table_offset;
+ next_binding_table_offset += c->key.nr_color_regions;
- c->prog_data.base.binding_table.texture_start = next;
- next += num_textures;
-
- if (shader) {
- c->prog_data.base.binding_table.ubo_start = next;
- next += shader->base.NumUniformBlocks;
- }
-
- if (INTEL_DEBUG & DEBUG_SHADER_TIME) {
- c->prog_data.base.binding_table.shader_time_start = next;
- next++;
- }
-
- if (fp->Base.UsesGather) {
- c->prog_data.base.binding_table.gather_texture_start = next;
- next += num_textures;
- }
-
- /* This may or may not be used depending on how the compile goes. */
- c->prog_data.base.binding_table.pull_constants_start = next;
- next++;
-
- assert(next < BRW_MAX_SURFACES);
-
- /* c->prog_data.base.binding_table.size will be set by mark_surface_used. */
+ assign_common_binding_table_offsets(next_binding_table_offset);
}
bool