mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 04:50:11 +01:00
glsl: tidy up entries temporary
Here we just move initialisation of entries to where it is needed i.e. outside the loop and after the continue checks. Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
This commit is contained in:
parent
c20564ae3e
commit
adb3a83c09
1 changed files with 8 additions and 6 deletions
|
|
@ -1130,6 +1130,10 @@ link_setup_uniform_remap_tables(struct gl_context *ctx,
|
||||||
if (prog->UniformStorage[i].remap_location == UNMAPPED_UNIFORM_LOC)
|
if (prog->UniformStorage[i].remap_location == UNMAPPED_UNIFORM_LOC)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
/* How many new entries for this uniform? */
|
||||||
|
const unsigned entries =
|
||||||
|
MAX2(1, prog->UniformStorage[i].array_elements);
|
||||||
|
|
||||||
for (unsigned j = 0; j < MESA_SHADER_STAGES; j++) {
|
for (unsigned j = 0; j < MESA_SHADER_STAGES; j++) {
|
||||||
struct gl_linked_shader *sh = prog->_LinkedShaders[j];
|
struct gl_linked_shader *sh = prog->_LinkedShaders[j];
|
||||||
if (!sh)
|
if (!sh)
|
||||||
|
|
@ -1138,10 +1142,6 @@ link_setup_uniform_remap_tables(struct gl_context *ctx,
|
||||||
if (!prog->UniformStorage[i].opaque[j].active)
|
if (!prog->UniformStorage[i].opaque[j].active)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* How many new entries for this uniform? */
|
|
||||||
const unsigned entries =
|
|
||||||
MAX2(1, prog->UniformStorage[i].array_elements);
|
|
||||||
|
|
||||||
/* Set remap table entries point to correct gl_uniform_storage. */
|
/* Set remap table entries point to correct gl_uniform_storage. */
|
||||||
for (unsigned k = 0; k < entries; k++) {
|
for (unsigned k = 0; k < entries; k++) {
|
||||||
unsigned element_loc = prog->UniformStorage[i].remap_location + k;
|
unsigned element_loc = prog->UniformStorage[i].remap_location + k;
|
||||||
|
|
@ -1155,13 +1155,15 @@ link_setup_uniform_remap_tables(struct gl_context *ctx,
|
||||||
|
|
||||||
/* reserve subroutine locations */
|
/* reserve subroutine locations */
|
||||||
for (unsigned i = 0; i < prog->NumUniformStorage; i++) {
|
for (unsigned i = 0; i < prog->NumUniformStorage; i++) {
|
||||||
|
|
||||||
if (!prog->UniformStorage[i].type->is_subroutine())
|
if (!prog->UniformStorage[i].type->is_subroutine())
|
||||||
continue;
|
continue;
|
||||||
const unsigned entries = MAX2(1, prog->UniformStorage[i].array_elements);
|
|
||||||
|
|
||||||
if (prog->UniformStorage[i].remap_location != UNMAPPED_UNIFORM_LOC)
|
if (prog->UniformStorage[i].remap_location != UNMAPPED_UNIFORM_LOC)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
const unsigned entries =
|
||||||
|
MAX2(1, prog->UniformStorage[i].array_elements);
|
||||||
|
|
||||||
for (unsigned j = 0; j < MESA_SHADER_STAGES; j++) {
|
for (unsigned j = 0; j < MESA_SHADER_STAGES; j++) {
|
||||||
struct gl_linked_shader *sh = prog->_LinkedShaders[j];
|
struct gl_linked_shader *sh = prog->_LinkedShaders[j];
|
||||||
if (!sh)
|
if (!sh)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue