On Friday, August 16, 2013 06:11:25 AM Paul Berry wrote: > On 14 August 2013 21:07, Kenneth Graunke <kenn...@whitecape.org> wrote: > > This allows us to determine how small we can make the binding table. > > > > Since it depends entirely on the shader program, we can just compute > > it once at compile time, rather than at binding table emit time (which > > happens during drawing). > > > > Signed-off-by: Kenneth Graunke <kenn...@whitecape.org> > > --- > > > > src/mesa/drivers/dri/i965/brw_context.h | 2 ++ > > src/mesa/drivers/dri/i965/brw_fs.h | 2 ++ > > src/mesa/drivers/dri/i965/brw_fs_emit.cpp | 23 +++++++++++++++++++++++ > > 3 files changed, 27 insertions(+) > > > > diff --git a/src/mesa/drivers/dri/i965/brw_context.h > > b/src/mesa/drivers/dri/i965/brw_context.h > > index ff0a65c..380fe08 100644 > > --- a/src/mesa/drivers/dri/i965/brw_context.h > > +++ b/src/mesa/drivers/dri/i965/brw_context.h > > @@ -305,6 +305,8 @@ struct brw_wm_prog_data { > > > > GLuint reg_blocks_16; > > GLuint total_scratch; > > > > + unsigned max_surface_index; > > + > > I'm bothered by the off-by-one inconsistency of using max_surface_index > here, but using binding_table_size over in brw_vec4_prog_data (see patch > 5). Could we change this to binding_table_size, and update > fs_generator::mark_surface_used() to do: > > prog_data->binding_table_size = MAX2(prog_data->binding_table_size, > surf_index + 1); > > Then it would be consistent with vec4_generator::mark_surface_used(). > > With that changed, this patch is: > > Reviewed-by: Paul Berry <stereotype...@gmail.com>
Sure. That would be better. I wrote this code first, and didn't think about the case where there were 0 surfaces. For the FS, it doesn't matter much since you always have at least one render target at surface index 0. For the VS, surface index 0 is the pull constant buffer, which is very optional. I'll make them consistent. --Ken _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev