diff options
author | Kenneth Graunke <kenneth@whitecape.org> | 2013-08-14 20:25:40 -0700 |
---|---|---|
committer | Kenneth Graunke <kenneth@whitecape.org> | 2013-08-19 13:17:00 -0700 |
commit | 7e9559c9ba4dd82aca83b08d039103e38a3f94be (patch) | |
tree | be8c9972a7c13d46d83699f236fe8d5dfac60320 /src/mesa/drivers/dri/i965/brw_context.h | |
parent | c642bd3dcc1a6f1039732c614ab8a56dd3779427 (diff) | |
download | external_mesa3d-7e9559c9ba4dd82aca83b08d039103e38a3f94be.zip external_mesa3d-7e9559c9ba4dd82aca83b08d039103e38a3f94be.tar.gz external_mesa3d-7e9559c9ba4dd82aca83b08d039103e38a3f94be.tar.bz2 |
i965/vs: Rework binding table size calculation.
Unlike the FS, the VS backend already computed the binding table size.
However, it did so poorly: after compilation, it looked to see if any
pull constants/textures/UBOs were in use, and set num_surfaces to the
maximum surface index for that category. If the VS only used a single
texture or UBO, this overcounted by quite a bit.
The shader time surface was also noted at state upload time (during
drawing), not at compile time, which is inefficient. I believe it also
had an off by one error.
This patch computes it accurately, while also simplifying the code.
It also renames num_surfaces to binding_table_size, since num_surfaces
wasn't actually the number of surfaces used. For example, a VS that
used one UBO and no other surfaces would have set num_surfaces to
SURF_INDEX_VS_UBO(1) == 18, rather than 1. A bit of a misnomer there.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_context.h')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_context.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h index 9178485..dae3219 100644 --- a/src/mesa/drivers/dri/i965/brw_context.h +++ b/src/mesa/drivers/dri/i965/brw_context.h @@ -493,7 +493,7 @@ struct brw_vec4_prog_data { */ GLuint urb_entry_size; - int num_surfaces; + unsigned binding_table_size; /* These pointers must appear last. See brw_vec4_prog_data_compare(). */ const float **param; |