struct gl_opaque_uniform_index opaque[MESA_SHADER_STAGES];
+ /**
+ * Mask of shader stages (1 << MESA_SHADER_xxx) where this uniform is used.
+ */
+ unsigned active_shader_mask;
+
/**
* Storage used by the driver for the uniform
*/
this->uniforms[id].opaque[shader_type].index = ~0;
this->uniforms[id].opaque[shader_type].active = false;
+ this->uniforms[id].active_shader_mask |= 1 << shader_type;
+
/* This assigns uniform indices to sampler and image uniforms. */
handle_samplers(base_type, &this->uniforms[id], name);
handle_images(base_type, &this->uniforms[id], name);
blob_write_uint32(metadata, prog->data->UniformStorage[i].array_stride);
blob_write_uint32(metadata, prog->data->UniformStorage[i].hidden);
blob_write_uint32(metadata, prog->data->UniformStorage[i].is_shader_storage);
+ blob_write_uint32(metadata, prog->data->UniformStorage[i].active_shader_mask);
blob_write_uint32(metadata, prog->data->UniformStorage[i].matrix_stride);
blob_write_uint32(metadata, prog->data->UniformStorage[i].row_major);
blob_write_uint32(metadata, prog->data->UniformStorage[i].is_bindless);
uniforms[i].array_stride = blob_read_uint32(metadata);
uniforms[i].hidden = blob_read_uint32(metadata);
uniforms[i].is_shader_storage = blob_read_uint32(metadata);
+ uniforms[i].active_shader_mask = blob_read_uint32(metadata);
uniforms[i].matrix_stride = blob_read_uint32(metadata);
uniforms[i].row_major = blob_read_uint32(metadata);
uniforms[i].is_bindless = blob_read_uint32(metadata);