diff options
author | Plamena Manolova <[email protected]> | 2016-02-11 15:00:02 +0200 |
---|---|---|
committer | Tapani Pälli <[email protected]> | 2016-02-18 11:53:35 +0200 |
commit | 65dfb3048e8291675ca33581aeff8921f7ea509d (patch) | |
tree | 8a2aba1e5b5460df1eff630bfcda3ba0b4524d88 /src/mesa/main | |
parent | d335b6abc0eaa7506203df7c99898645214b4c72 (diff) |
compiler/glsl: Fix uniform location counting.
This patch moves the calculation of current uniforms to
link_uniforms, which makes use of UniformRemapTable which
stores all the reserved uniform locations.
Location assignment for implicit uniforms now tries to use
any gaps left in the table after the location assignment
for explicit uniforms. This gives us more space to store more
uniforms.
Patch is based on earlier patch with following changes/additions:
1: Move the counting of explicit locations to
check_explicit_uniform_locations and then pass
the number to link_assign_uniform_locations.
2: Count the number of empty slots in UniformRemapTable
and store them in a list_head.
3: Try to find an empty slot for implicit locations from
the list, if that fails resize UniformRemapTable.
Fixes following CTS tests:
ES31-CTS.explicit_uniform_location.uniform-loc-mix-with-implicit-max
ES31-CTS.explicit_uniform_location.uniform-loc-mix-with-implicit-max-array
Signed-off-by: Tapani Pälli <[email protected]>
Signed-off-by: Plamena Manolova <[email protected]>
Reviewed-by: Ilia Mirkin <[email protected]>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93696
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/mtypes.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index e5f2da0b3c4..12d3863719b 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -44,6 +44,7 @@ #include "math/m_matrix.h" /* GLmatrix */ #include "compiler/shader_enums.h" #include "main/formats.h" /* MESA_FORMAT_COUNT */ +#include "compiler/glsl/list.h" #ifdef __cplusplus @@ -2771,6 +2772,13 @@ struct gl_shader_program struct gl_uniform_storage **UniformRemapTable; /** + * Sometimes there are empty slots left over in UniformRemapTable after we + * allocate slots to explicit locations. This list stores the blocks of + * continuous empty slots inside UniformRemapTable. + */ + struct exec_list EmptyUniformLocations; + + /** * Size of the gl_ClipDistance array that is output from the last pipeline * stage before the fragment shader. */ |