mesa/program: Associate uniform storage without using names
authorCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Wed, 21 Aug 2019 19:16:29 +0000 (12:16 -0700)
committerCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Tue, 10 Sep 2019 21:36:46 +0000 (14:36 -0700)
Use the new UniformStorageIndex field in Parameter instead.  This
mechanism was added so we could match those in the SPIR-V case, where
names are optional.

v2: Use UniformStorageIndex for all cases.  (Timothy)

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/mesa/program/ir_to_mesa.cpp

index 30e8606b2539fc69707c8f8dee4044982cdbf4dd..777fd168c7ec579ccb94330a70c54e9682732fe2 100644 (file)
@@ -2536,13 +2536,7 @@ _mesa_associate_uniform_storage(struct gl_context *ctx,
       if (params->Parameters[i].Type != PROGRAM_UNIFORM)
          continue;
 
-      unsigned location;
-      const bool found =
-         shader_program->UniformHash->get(location, params->Parameters[i].Name);
-      assert(found);
-
-      if (!found)
-         continue;
+      unsigned location = params->Parameters[i].UniformStorageIndex;
 
       struct gl_uniform_storage *storage =
          &shader_program->data->UniformStorage[location];