Lines Matching refs:prog
428 parcel_out_uniform_storage(struct gl_shader_program *prog, in parcel_out_uniform_storage() argument
432 : prog(prog), map(map), uniforms(uniforms), values(values) in parcel_out_uniform_storage()
459 prog->data->ShaderStorageBlocks : prog->data->UniformBlocks; in set_and_process()
461 prog->data->NumShaderStorageBlocks : prog->data->NumUniformBlocks; in set_and_process()
616 prog->_LinkedShaders[shader_type]->Program->sh.ImageAccess[i] = access; in handle_images()
627 prog->_LinkedShaders[shader_type]->Program->sh.NumSubroutineUniforms++; in handle_subroutines()
822 struct gl_shader_program *prog; member in parcel_out_uniform_storage
1016 find_empty_block(struct gl_shader_program *prog, in find_empty_block() argument
1022 &prog->EmptyUniformLocations) { in find_empty_block()
1045 struct gl_shader_program *prog, in link_setup_uniform_remap_tables() argument
1050 prog->NumUniformRemapTable - num_explicit_uniform_locs; in link_setup_uniform_remap_tables()
1053 for (unsigned i = 0; i < prog->data->NumUniformStorage; i++) { in link_setup_uniform_remap_tables()
1054 if (prog->data->UniformStorage[i].type->is_subroutine() || in link_setup_uniform_remap_tables()
1055 prog->data->UniformStorage[i].is_shader_storage) in link_setup_uniform_remap_tables()
1058 if (prog->data->UniformStorage[i].remap_location != in link_setup_uniform_remap_tables()
1062 MAX2(1, prog->data->UniformStorage[i].array_elements); in link_setup_uniform_remap_tables()
1067 prog->data->UniformStorage[i].remap_location + j; in link_setup_uniform_remap_tables()
1068 assert(prog->UniformRemapTable[element_loc] == in link_setup_uniform_remap_tables()
1070 prog->UniformRemapTable[element_loc] = in link_setup_uniform_remap_tables()
1071 &prog->data->UniformStorage[i]; in link_setup_uniform_remap_tables()
1077 for (unsigned i = 0; i < prog->data->NumUniformStorage; i++) { in link_setup_uniform_remap_tables()
1079 if (prog->data->UniformStorage[i].type->is_subroutine() || in link_setup_uniform_remap_tables()
1080 prog->data->UniformStorage[i].is_shader_storage) in link_setup_uniform_remap_tables()
1084 if (prog->data->UniformStorage[i].builtin) in link_setup_uniform_remap_tables()
1088 if (prog->data->UniformStorage[i].remap_location != UNMAPPED_UNIFORM_LOC) in link_setup_uniform_remap_tables()
1093 MAX2(1, prog->data->UniformStorage[i].array_elements); in link_setup_uniform_remap_tables()
1099 chosen_location = find_empty_block(prog, &prog->data->UniformStorage[i]); in link_setup_uniform_remap_tables()
1107 chosen_location = prog->NumUniformRemapTable; in link_setup_uniform_remap_tables()
1110 prog->UniformRemapTable = in link_setup_uniform_remap_tables()
1111 reralloc(prog, in link_setup_uniform_remap_tables()
1112 prog->UniformRemapTable, in link_setup_uniform_remap_tables()
1114 prog->NumUniformRemapTable + entries); in link_setup_uniform_remap_tables()
1115 prog->NumUniformRemapTable += entries; in link_setup_uniform_remap_tables()
1120 prog->UniformRemapTable[chosen_location + j] = in link_setup_uniform_remap_tables()
1121 &prog->data->UniformStorage[i]; in link_setup_uniform_remap_tables()
1124 prog->data->UniformStorage[i].remap_location = chosen_location; in link_setup_uniform_remap_tables()
1132 linker_error(prog, "count of uniform locations > MAX_UNIFORM_LOCATIONS" in link_setup_uniform_remap_tables()
1138 for (unsigned i = 0; i < prog->data->NumUniformStorage; i++) { in link_setup_uniform_remap_tables()
1139 if (!prog->data->UniformStorage[i].type->is_subroutine()) in link_setup_uniform_remap_tables()
1142 if (prog->data->UniformStorage[i].remap_location == UNMAPPED_UNIFORM_LOC) in link_setup_uniform_remap_tables()
1147 MAX2(1, prog->data->UniformStorage[i].array_elements); in link_setup_uniform_remap_tables()
1149 unsigned mask = prog->data->linked_stages; in link_setup_uniform_remap_tables()
1152 struct gl_program *p = prog->_LinkedShaders[j]->Program; in link_setup_uniform_remap_tables()
1154 if (!prog->data->UniformStorage[i].opaque[j].active) in link_setup_uniform_remap_tables()
1160 prog->data->UniformStorage[i].remap_location + k; in link_setup_uniform_remap_tables()
1164 &prog->data->UniformStorage[i]; in link_setup_uniform_remap_tables()
1170 for (unsigned i = 0; i < prog->data->NumUniformStorage; i++) { in link_setup_uniform_remap_tables()
1171 if (!prog->data->UniformStorage[i].type->is_subroutine()) in link_setup_uniform_remap_tables()
1174 if (prog->data->UniformStorage[i].remap_location != in link_setup_uniform_remap_tables()
1179 MAX2(1, prog->data->UniformStorage[i].array_elements); in link_setup_uniform_remap_tables()
1181 unsigned mask = prog->data->linked_stages; in link_setup_uniform_remap_tables()
1184 struct gl_program *p = prog->_LinkedShaders[j]->Program; in link_setup_uniform_remap_tables()
1186 if (!prog->data->UniformStorage[i].opaque[j].active) in link_setup_uniform_remap_tables()
1197 &prog->data->UniformStorage[i]; in link_setup_uniform_remap_tables()
1199 prog->data->UniformStorage[i].remap_location = in link_setup_uniform_remap_tables()
1208 struct gl_shader_program *prog, in link_assign_uniform_storage() argument
1214 if (prog->data->NumUniformStorage == 0) in link_assign_uniform_storage()
1219 prog->data->UniformStorage = rzalloc_array(prog, struct gl_uniform_storage, in link_assign_uniform_storage()
1220 prog->data->NumUniformStorage); in link_assign_uniform_storage()
1221 union gl_constant_value *data = rzalloc_array(prog->data->UniformStorage, in link_assign_uniform_storage()
1228 parcel_out_uniform_storage parcel(prog, prog->UniformHash, in link_assign_uniform_storage()
1229 prog->data->UniformStorage, data); in link_assign_uniform_storage()
1232 if (prog->_LinkedShaders[i] == NULL) in link_assign_uniform_storage()
1237 foreach_in_list(ir_instruction, node, prog->_LinkedShaders[i]->ir) { in link_assign_uniform_storage()
1247 prog->_LinkedShaders[i]->Program->SamplersUsed = in link_assign_uniform_storage()
1249 prog->_LinkedShaders[i]->shadow_samplers = parcel.shader_shadow_samplers; in link_assign_uniform_storage()
1251 STATIC_ASSERT(sizeof(prog->_LinkedShaders[i]->Program->sh.SamplerTargets) == in link_assign_uniform_storage()
1253 memcpy(prog->_LinkedShaders[i]->Program->sh.SamplerTargets, in link_assign_uniform_storage()
1255 sizeof(prog->_LinkedShaders[i]->Program->sh.SamplerTargets)); in link_assign_uniform_storage()
1259 for (unsigned i = 0; i < prog->data->NumUniformStorage; i++) { in link_assign_uniform_storage()
1260 assert(prog->data->UniformStorage[i].storage != NULL || in link_assign_uniform_storage()
1261 prog->data->UniformStorage[i].builtin || in link_assign_uniform_storage()
1262 prog->data->UniformStorage[i].is_shader_storage || in link_assign_uniform_storage()
1263 prog->data->UniformStorage[i].block_index != -1); in link_assign_uniform_storage()
1269 link_setup_uniform_remap_tables(ctx, prog, num_explicit_uniform_locs); in link_assign_uniform_storage()
1271 link_set_uniform_initializers(prog, boolean_true); in link_assign_uniform_storage()
1275 link_assign_uniform_locations(struct gl_shader_program *prog, in link_assign_uniform_locations() argument
1279 ralloc_free(prog->data->UniformStorage); in link_assign_uniform_locations()
1280 prog->data->UniformStorage = NULL; in link_assign_uniform_locations()
1281 prog->data->NumUniformStorage = 0; in link_assign_uniform_locations()
1283 if (prog->UniformHash != NULL) { in link_assign_uniform_locations()
1284 prog->UniformHash->clear(); in link_assign_uniform_locations()
1286 prog->UniformHash = new string_to_uint_map; in link_assign_uniform_locations()
1297 count_uniform_size uniform_size(prog->UniformHash, hiddenUniforms); in link_assign_uniform_locations()
1299 struct gl_linked_shader *sh = prog->_LinkedShaders[i]; in link_assign_uniform_locations()
1331 prog->data->NumUniformStorage = uniform_size.num_active_uniforms; in link_assign_uniform_locations()
1332 prog->data->NumHiddenUniforms = uniform_size.num_hidden_uniforms; in link_assign_uniform_locations()
1338 link_assign_uniform_storage(ctx, prog, uniform_size.num_values, in link_assign_uniform_locations()