• Home
  • Raw
  • Download

Lines Matching refs:prog

260    gl_shader_program *prog;  member in __anon8ad725fe0111::array_resize_visitor
264 gl_shader_program *prog, in array_resize_visitor() argument
268 this->prog = prog; in array_resize_visitor()
291 linker_error(this->prog, "size of array %s declared as %u, " in visit()
302 linker_error(this->prog, "%s shader accesses element %i of " in visit()
450 linker_error(gl_shader_program *prog, const char *fmt, ...) in linker_error() argument
454 ralloc_strcat(&prog->data->InfoLog, "error: "); in linker_error()
456 ralloc_vasprintf_append(&prog->data->InfoLog, fmt, ap); in linker_error()
459 prog->data->LinkStatus = linking_failure; in linker_error()
464 linker_warning(gl_shader_program *prog, const char *fmt, ...) in linker_warning() argument
468 ralloc_strcat(&prog->data->InfoLog, "warning: "); in linker_warning()
470 ralloc_vasprintf_append(&prog->data->InfoLog, fmt, ap); in linker_warning()
583 analyze_clip_cull_usage(struct gl_shader_program *prog, in analyze_clip_cull_usage() argument
592 if (prog->data->Version >= (prog->IsES ? 300 : 130)) { in analyze_clip_cull_usage()
609 !prog->IsES ? &gl_ClipVertex : NULL, in analyze_clip_cull_usage()
623 if (!prog->IsES) { in analyze_clip_cull_usage()
625 linker_error(prog, "%s shader writes to both `gl_ClipVertex' " in analyze_clip_cull_usage()
631 linker_error(prog, "%s shader writes to both `gl_ClipVertex' " in analyze_clip_cull_usage()
659 linker_error(prog, "%s shader: the combined size of " in analyze_clip_cull_usage()
679 validate_vertex_shader_executable(struct gl_shader_program *prog, in validate_vertex_shader_executable() argument
712 if (prog->data->Version < (prog->IsES ? 300 : 140)) { in validate_vertex_shader_executable()
716 if (prog->IsES) { in validate_vertex_shader_executable()
717 linker_warning(prog, in validate_vertex_shader_executable()
721 linker_error(prog, in validate_vertex_shader_executable()
728 analyze_clip_cull_usage(prog, shader, ctx, in validate_vertex_shader_executable()
734 validate_tess_eval_shader_executable(struct gl_shader_program *prog, in validate_tess_eval_shader_executable() argument
741 analyze_clip_cull_usage(prog, shader, ctx, in validate_tess_eval_shader_executable()
753 validate_fragment_shader_executable(struct gl_shader_program *prog, in validate_fragment_shader_executable() argument
765 linker_error(prog, "fragment shader writes to both " in validate_fragment_shader_executable()
779 validate_geometry_shader_executable(struct gl_shader_program *prog, in validate_geometry_shader_executable() argument
788 prog->Geom.VerticesIn = num_vertices; in validate_geometry_shader_executable()
790 analyze_clip_cull_usage(prog, shader, ctx, in validate_geometry_shader_executable()
801 struct gl_shader_program *prog) in validate_geometry_shader_emissions() argument
803 struct gl_linked_shader *sh = prog->_LinkedShaders[MESA_SHADER_GEOMETRY]; in validate_geometry_shader_emissions()
809 linker_error(prog, "Invalid call %s(%d). Accepted values for the " in validate_geometry_shader_emissions()
815 prog->Geom.UsesStreams = emit_vertex.uses_streams(); in validate_geometry_shader_emissions()
816 prog->Geom.UsesEndPrimitive = emit_vertex.uses_end_primitive(); in validate_geometry_shader_emissions()
842 if (prog->Geom.UsesStreams && in validate_geometry_shader_emissions()
844 linker_error(prog, "EmitStreamVertex(n) and EndStreamPrimitive(n) " in validate_geometry_shader_emissions()
851 validate_intrastage_arrays(struct gl_shader_program *prog, in validate_intrastage_arrays() argument
865 linker_error(prog, "%s `%s' declared as type " in validate_intrastage_arrays()
877 linker_error(prog, "%s `%s' declared as type " in validate_intrastage_arrays()
896 cross_validate_globals(struct gl_shader_program *prog, in cross_validate_globals() argument
934 if (!validate_intrastage_arrays(prog, var, existing)) { in cross_validate_globals()
946 linker_error(prog, "%s `%s' declared as type " in cross_validate_globals()
959 linker_error(prog, "explicit locations for %s " in cross_validate_globals()
966 linker_error(prog, "explicit components for %s `%s' have " in cross_validate_globals()
994 linker_error(prog, "explicit bindings for %s " in cross_validate_globals()
1006 linker_error(prog, "offset specifications for %s " in cross_validate_globals()
1029 linker_error(prog, in cross_validate_globals()
1036 linker_error(prog, in cross_validate_globals()
1063 linker_error(prog, "initializers for %s " in cross_validate_globals()
1081 linker_error(prog, in cross_validate_globals()
1090 linker_error(prog, "declarations for %s `%s' have " in cross_validate_globals()
1096 linker_error(prog, "declarations for %s `%s' have " in cross_validate_globals()
1102 linker_error(prog, "declarations for %s `%s` have " in cross_validate_globals()
1108 linker_error(prog, "declarations for %s `%s` have " in cross_validate_globals()
1117 if (prog->IsES && !var->get_interface_type() && in cross_validate_globals()
1119 if ((existing->data.used && var->data.used) || prog->data->Version >= 300) { in cross_validate_globals()
1120 linker_error(prog, "declarations for %s `%s` have " in cross_validate_globals()
1125 linker_warning(prog, "declarations for %s `%s` have " in cross_validate_globals()
1146 linker_error(prog, "declarations for %s `%s` are inside block " in cross_validate_globals()
1152 linker_error(prog, "declarations for %s `%s` are inside blocks " in cross_validate_globals()
1170 cross_validate_uniforms(struct gl_shader_program *prog) in cross_validate_uniforms() argument
1174 if (prog->_LinkedShaders[i] == NULL) in cross_validate_uniforms()
1177 cross_validate_globals(prog, prog->_LinkedShaders[i]->ir, &variables, in cross_validate_uniforms()
1187 interstage_cross_validate_uniform_blocks(struct gl_shader_program *prog, in interstage_cross_validate_uniform_blocks() argument
1192 unsigned *num_blks = validate_ssbo ? &prog->data->NumShaderStorageBlocks : in interstage_cross_validate_uniform_blocks()
1193 &prog->data->NumUniformBlocks; in interstage_cross_validate_uniform_blocks()
1197 if (prog->_LinkedShaders[i]) { in interstage_cross_validate_uniform_blocks()
1200 prog->_LinkedShaders[i]->Program->info.num_ssbos; in interstage_cross_validate_uniform_blocks()
1203 prog->_LinkedShaders[i]->Program->info.num_ubos; in interstage_cross_validate_uniform_blocks()
1209 struct gl_linked_shader *sh = prog->_LinkedShaders[i]; in interstage_cross_validate_uniform_blocks()
1221 sh_num_blocks = prog->_LinkedShaders[i]->Program->info.num_ssbos; in interstage_cross_validate_uniform_blocks()
1224 sh_num_blocks = prog->_LinkedShaders[i]->Program->info.num_ubos; in interstage_cross_validate_uniform_blocks()
1229 int index = link_cross_validate_uniform_block(prog->data, &blks, in interstage_cross_validate_uniform_blocks()
1233 linker_error(prog, "buffer block `%s' has mismatching " in interstage_cross_validate_uniform_blocks()
1260 struct gl_linked_shader *sh = prog->_LinkedShaders[i]; in interstage_cross_validate_uniform_blocks()
1277 prog->data->ShaderStorageBlocks = blks; in interstage_cross_validate_uniform_blocks()
1279 prog->data->UniformBlocks = blks; in interstage_cross_validate_uniform_blocks()
1648 struct gl_shader_program *prog) in validate_xfb_buffer_stride() argument
1651 if (prog->TransformFeedback.BufferStride[idx] % 4) { in validate_xfb_buffer_stride()
1652 linker_error(prog, "invalid qualifier xfb_stride=%d must be a " in validate_xfb_buffer_stride()
1655 prog->TransformFeedback.BufferStride[idx]); in validate_xfb_buffer_stride()
1659 if (prog->TransformFeedback.BufferStride[idx] / 4 > in validate_xfb_buffer_stride()
1661 linker_error(prog, "The MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS " in validate_xfb_buffer_stride()
1675 struct gl_shader_program *prog, in link_xfb_stride_layout_qualifiers() argument
1680 prog->TransformFeedback.BufferStride[i] = 0; in link_xfb_stride_layout_qualifiers()
1688 if (prog->TransformFeedback.BufferStride[j] == 0) { in link_xfb_stride_layout_qualifiers()
1689 prog->TransformFeedback.BufferStride[j] = in link_xfb_stride_layout_qualifiers()
1691 if (!validate_xfb_buffer_stride(ctx, j, prog)) in link_xfb_stride_layout_qualifiers()
1693 } else if (prog->TransformFeedback.BufferStride[j] != in link_xfb_stride_layout_qualifiers()
1695 linker_error(prog, in link_xfb_stride_layout_qualifiers()
1698 prog->TransformFeedback.BufferStride[j], in link_xfb_stride_layout_qualifiers()
1712 link_bindless_layout_qualifiers(struct gl_shader_program *prog, in link_bindless_layout_qualifiers() argument
1742 linker_error(prog, "both bindless_sampler and bound_sampler, or " in link_bindless_layout_qualifiers()
1755 link_tcs_out_layout_qualifiers(struct gl_shader_program *prog, in link_tcs_out_layout_qualifiers() argument
1782 linker_error(prog, "tessellation control shader defined with " in link_tcs_out_layout_qualifiers()
1798 linker_error(prog, "tessellation control shader didn't declare " in link_tcs_out_layout_qualifiers()
1812 link_tes_in_layout_qualifiers(struct gl_shader_program *prog, in link_tes_in_layout_qualifiers() argument
1847 linker_error(prog, "tessellation evaluation shader defined with " in link_tes_in_layout_qualifiers()
1858 linker_error(prog, "tessellation evaluation shader defined with " in link_tes_in_layout_qualifiers()
1868 linker_error(prog, "tessellation evaluation shader defined with " in link_tes_in_layout_qualifiers()
1878 linker_error(prog, "tessellation evaluation shader defined with " in link_tes_in_layout_qualifiers()
1892 linker_error(prog, in link_tes_in_layout_qualifiers()
1920 link_fs_inout_layout_qualifiers(struct gl_shader_program *prog, in link_fs_inout_layout_qualifiers() argument
1931 (prog->data->Version < 150 && in link_fs_inout_layout_qualifiers()
1932 !prog->ARB_fragment_coord_conventions_enable)) in link_fs_inout_layout_qualifiers()
1947 linker_error(prog, "fragment shader defined with conflicting " in link_fs_inout_layout_qualifiers()
1959 linker_error(prog, "fragment shader defined with conflicting " in link_fs_inout_layout_qualifiers()
1991 link_gs_inout_layout_qualifiers(struct gl_shader_program *prog, in link_gs_inout_layout_qualifiers() argument
2000 prog->data->Version < 150) in link_gs_inout_layout_qualifiers()
2026 linker_error(prog, "geometry shader defined with conflicting " in link_gs_inout_layout_qualifiers()
2037 linker_error(prog, "geometry shader defined with conflicting " in link_gs_inout_layout_qualifiers()
2047 linker_error(prog, "geometry shader defined with conflicting " in link_gs_inout_layout_qualifiers()
2059 linker_error(prog, "geometry shader defined with conflicting " in link_gs_inout_layout_qualifiers()
2074 linker_error(prog, in link_gs_inout_layout_qualifiers()
2080 linker_error(prog, in link_gs_inout_layout_qualifiers()
2086 linker_error(prog, in link_gs_inout_layout_qualifiers()
2104 link_cs_input_layout_qualifiers(struct gl_shader_program *prog, in link_cs_input_layout_qualifiers() argument
2138 linker_error(prog, "compute shader defined with conflicting " in link_cs_input_layout_qualifiers()
2157 linker_error(prog, "compute shader defined with both fixed and " in link_cs_input_layout_qualifiers()
2171 linker_error(prog, "compute shader must contain a fixed or a variable " in link_cs_input_layout_qualifiers()
2188 struct gl_shader_program *prog, in link_intrastage_shaders() argument
2204 cross_validate_globals(prog, shader_list[i]->ir, &variables, false); in link_intrastage_shaders()
2207 if (!prog->data->LinkStatus) in link_intrastage_shaders()
2212 validate_intrastage_interface_blocks(prog, (const gl_shader **)shader_list, in link_intrastage_shaders()
2214 if (!prog->data->LinkStatus) in link_intrastage_shaders()
2245 linker_error(prog, "function `%s' is multiply defined\n", in link_intrastage_shaders()
2273 linker_error(prog, "%s shader lacks `main'\n", in link_intrastage_shaders()
2285 prog->Name, false); in link_intrastage_shaders()
2287 prog->data->LinkStatus = linking_failure; in link_intrastage_shaders()
2292 _mesa_reference_shader_program_data(ctx, &gl_prog->sh.data, prog->data); in link_intrastage_shaders()
2300 link_fs_inout_layout_qualifiers(prog, linked, shader_list, num_shaders); in link_intrastage_shaders()
2301 link_tcs_out_layout_qualifiers(prog, gl_prog, shader_list, num_shaders); in link_intrastage_shaders()
2302 link_tes_in_layout_qualifiers(prog, gl_prog, shader_list, num_shaders); in link_intrastage_shaders()
2303 link_gs_inout_layout_qualifiers(prog, gl_prog, shader_list, num_shaders); in link_intrastage_shaders()
2304 link_cs_input_layout_qualifiers(prog, gl_prog, shader_list, num_shaders); in link_intrastage_shaders()
2307 link_xfb_stride_layout_qualifiers(ctx, prog, shader_list, num_shaders); in link_intrastage_shaders()
2309 link_bindless_layout_qualifiers(prog, shader_list, num_shaders); in link_intrastage_shaders()
2336 if (!link_function_calls(prog, linked, shader_list, num_shaders)) { in link_intrastage_shaders()
2350 link_uniform_blocks(mem_ctx, ctx, prog, linked, &ubo_blocks, in link_intrastage_shaders()
2353 if (!prog->data->LinkStatus) { in link_intrastage_shaders()
2385 array_resize_visitor input_resize_visitor(num_vertices, prog, in link_intrastage_shaders()
2427 update_array_sizes(struct gl_shader_program *prog) in update_array_sizes() argument
2430 if (prog->_LinkedShaders[i] == NULL) in update_array_sizes()
2435 foreach_in_list(ir_instruction, node, prog->_LinkedShaders[i]->ir) { in update_array_sizes()
2458 if (prog->_LinkedShaders[j] == NULL) in update_array_sizes()
2461 foreach_in_list(ir_instruction, node2, prog->_LinkedShaders[j]->ir) { in update_array_sizes()
2497 v.run(prog->_LinkedShaders[i]->ir); in update_array_sizes()
2508 struct gl_shader_program *prog) in resize_tes_inputs() argument
2510 if (prog->_LinkedShaders[MESA_SHADER_TESS_EVAL] == NULL) in resize_tes_inputs()
2513 gl_linked_shader *const tcs = prog->_LinkedShaders[MESA_SHADER_TESS_CTRL]; in resize_tes_inputs()
2514 gl_linked_shader *const tes = prog->_LinkedShaders[MESA_SHADER_TESS_EVAL]; in resize_tes_inputs()
2524 array_resize_visitor input_resize_visitor(num_vertices, prog, in resize_tes_inputs()
2598 gl_shader_program *prog, in assign_attribute_or_color_locations() argument
2618 gl_linked_shader *const sh = prog->_LinkedShaders[target_index]; in assign_attribute_or_color_locations()
2683 linker_error(prog, in assign_attribute_or_color_locations()
2694 if (prog->AttributeBindings->get(binding, var->name)) { in assign_attribute_or_color_locations()
2707 if (prog->FragDataBindings->get(binding, name)) { in assign_attribute_or_color_locations()
2712 if (prog->FragDataIndexBindings->get(index, name)) { in assign_attribute_or_color_locations()
2743 linker_error(prog, in assign_attribute_or_color_locations()
2840 linker_error(prog, in assign_attribute_or_color_locations()
2851 if (target_index == MESA_SHADER_FRAGMENT && !prog->IsES) { in assign_attribute_or_color_locations()
2875 linker_error(prog, "types do not match for aliased" in assign_attribute_or_color_locations()
2888 linker_error(prog, "overlapping component is " in assign_attribute_or_color_locations()
2898 (prog->IsES && prog->data->Version >= 300)) { in assign_attribute_or_color_locations()
2899 linker_error(prog, "overlapping location is assigned " in assign_attribute_or_color_locations()
2904 linker_warning(prog, "overlapping location is assigned " in assign_attribute_or_color_locations()
2910 if (target_index == MESA_SHADER_FRAGMENT && !prog->IsES) { in assign_attribute_or_color_locations()
2952 linker_error(prog, "too many %s (max %u)", in assign_attribute_or_color_locations()
2968 linker_error(prog, in assign_attribute_or_color_locations()
3007 linker_error(prog, in assign_attribute_or_color_locations()
3032 linker_error(prog, in assign_attribute_or_color_locations()
3095 store_fragdepth_layout(struct gl_shader_program *prog) in store_fragdepth_layout() argument
3097 if (prog->_LinkedShaders[MESA_SHADER_FRAGMENT] == NULL) { in store_fragdepth_layout()
3101 struct exec_list *ir = prog->_LinkedShaders[MESA_SHADER_FRAGMENT]->ir; in store_fragdepth_layout()
3120 prog->FragDepthLayout = FRAG_DEPTH_LAYOUT_NONE; in store_fragdepth_layout()
3123 prog->FragDepthLayout = FRAG_DEPTH_LAYOUT_ANY; in store_fragdepth_layout()
3126 prog->FragDepthLayout = FRAG_DEPTH_LAYOUT_GREATER; in store_fragdepth_layout()
3129 prog->FragDepthLayout = FRAG_DEPTH_LAYOUT_LESS; in store_fragdepth_layout()
3132 prog->FragDepthLayout = FRAG_DEPTH_LAYOUT_UNCHANGED; in store_fragdepth_layout()
3146 check_resources(struct gl_context *ctx, struct gl_shader_program *prog) in check_resources() argument
3152 struct gl_linked_shader *sh = prog->_LinkedShaders[i]; in check_resources()
3159 linker_error(prog, "Too many %s shader texture samplers\n", in check_resources()
3166 linker_warning(prog, "Too many %s shader default uniform block " in check_resources()
3172 linker_error(prog, "Too many %s shader default uniform block " in check_resources()
3181 linker_warning(prog, "Too many %s shader uniform components, " in check_resources()
3186 linker_error(prog, "Too many %s shader uniform components\n", in check_resources()
3197 linker_error(prog, "Too many %s uniform blocks (%d/%d)\n", in check_resources()
3205 linker_error(prog, "Too many %s shader storage blocks (%d/%d)\n", in check_resources()
3212 linker_error(prog, "Too many combined uniform blocks (%d/%d)\n", in check_resources()
3217 linker_error(prog, "Too many combined shader storage blocks (%d/%d)\n", in check_resources()
3222 for (unsigned i = 0; i < prog->data->NumUniformBlocks; i++) { in check_resources()
3223 if (prog->data->UniformBlocks[i].UniformBufferSize > in check_resources()
3225 linker_error(prog, "Uniform block %s too big (%d/%d)\n", in check_resources()
3226 prog->data->UniformBlocks[i].Name, in check_resources()
3227 prog->data->UniformBlocks[i].UniformBufferSize, in check_resources()
3232 for (unsigned i = 0; i < prog->data->NumShaderStorageBlocks; i++) { in check_resources()
3233 if (prog->data->ShaderStorageBlocks[i].UniformBufferSize > in check_resources()
3235 linker_error(prog, "Shader storage block %s too big (%d/%d)\n", in check_resources()
3236 prog->data->ShaderStorageBlocks[i].Name, in check_resources()
3237 prog->data->ShaderStorageBlocks[i].UniformBufferSize, in check_resources()
3244 link_calculate_subroutine_compat(struct gl_shader_program *prog) in link_calculate_subroutine_compat() argument
3246 unsigned mask = prog->data->linked_stages; in link_calculate_subroutine_compat()
3249 struct gl_program *p = prog->_LinkedShaders[i]->Program; in link_calculate_subroutine_compat()
3262 …linker_error(prog, "subroutine uniform %s defined but no valid functions found\n", uni->type->name… in link_calculate_subroutine_compat()
3280 check_subroutine_resources(struct gl_shader_program *prog) in check_subroutine_resources() argument
3282 unsigned mask = prog->data->linked_stages; in check_subroutine_resources()
3285 struct gl_program *p = prog->_LinkedShaders[i]->Program; in check_subroutine_resources()
3288 linker_error(prog, "Too many %s shader subroutine uniforms\n", in check_subroutine_resources()
3297 check_image_resources(struct gl_context *ctx, struct gl_shader_program *prog) in check_image_resources() argument
3307 struct gl_linked_shader *sh = prog->_LinkedShaders[i]; in check_image_resources()
3311 linker_error(prog, "Too many %s shader image uniforms (%u > %u)\n", in check_image_resources()
3331 linker_error(prog, "Too many combined image uniforms\n"); in check_image_resources()
3335 linker_error(prog, "Too many combined image uniforms, shader storage " in check_image_resources()
3346 reserve_explicit_locations(struct gl_shader_program *prog, in reserve_explicit_locations() argument
3354 if (max_loc + 1 > prog->NumUniformRemapTable) { in reserve_explicit_locations()
3355 prog->UniformRemapTable = in reserve_explicit_locations()
3356 reralloc(prog, prog->UniformRemapTable, in reserve_explicit_locations()
3360 if (!prog->UniformRemapTable) { in reserve_explicit_locations()
3361 linker_error(prog, "Out of memory during linking.\n"); in reserve_explicit_locations()
3366 for (unsigned i = prog->NumUniformRemapTable; i < max_loc + 1; i++) in reserve_explicit_locations()
3367 prog->UniformRemapTable[i] = NULL; in reserve_explicit_locations()
3369 prog->NumUniformRemapTable = max_loc + 1; in reserve_explicit_locations()
3376 if (prog->UniformRemapTable[loc] == INACTIVE_UNIFORM_EXPLICIT_LOCATION) { in reserve_explicit_locations()
3391 linker_error(prog, in reserve_explicit_locations()
3401 prog->UniformRemapTable[loc] = INACTIVE_UNIFORM_EXPLICIT_LOCATION; in reserve_explicit_locations()
3411 reserve_subroutine_explicit_locations(struct gl_shader_program *prog, in reserve_subroutine_explicit_locations() argument
3426 linker_error(prog, "Out of memory during linking.\n"); in reserve_subroutine_explicit_locations()
3448 linker_error(prog, in reserve_subroutine_explicit_locations()
3470 struct gl_shader_program *prog) in check_explicit_uniform_locations() argument
3472 prog->NumExplicitUniformLocations = 0; in check_explicit_uniform_locations()
3483 linker_error(prog, "Out of memory during linking.\n"); in check_explicit_uniform_locations()
3488 unsigned mask = prog->data->linked_stages; in check_explicit_uniform_locations()
3491 struct gl_program *p = prog->_LinkedShaders[i]->Program; in check_explicit_uniform_locations()
3493 foreach_in_list(ir_instruction, node, prog->_LinkedShaders[i]->ir) { in check_explicit_uniform_locations()
3501 ret = reserve_subroutine_explicit_locations(prog, p, var); in check_explicit_uniform_locations()
3503 int slots = reserve_explicit_locations(prog, uniform_map, in check_explicit_uniform_locations()
3520 for (unsigned i = 0; i < prog->NumUniformRemapTable; i++) { in check_explicit_uniform_locations()
3522 if (prog->UniformRemapTable[i] == NULL) { in check_explicit_uniform_locations()
3525 current_block = rzalloc(prog, struct empty_uniform_block); in check_explicit_uniform_locations()
3527 exec_list_push_tail(&prog->EmptyUniformLocations, in check_explicit_uniform_locations()
3537 prog->NumExplicitUniformLocations = entries_total; in check_explicit_uniform_locations()
3616 add_program_resource(struct gl_shader_program *prog, in add_program_resource() argument
3626 prog->data->ProgramResourceList = in add_program_resource()
3627 reralloc(prog->data, in add_program_resource()
3628 prog->data->ProgramResourceList, in add_program_resource()
3630 prog->data->NumProgramResourceList + 1); in add_program_resource()
3632 if (!prog->data->ProgramResourceList) { in add_program_resource()
3633 linker_error(prog, "Out of memory during linking.\n"); in add_program_resource()
3638 &prog->data->ProgramResourceList[prog->data->NumProgramResourceList]; in add_program_resource()
3644 prog->data->NumProgramResourceList++; in add_program_resource()
4490 struct gl_shader_program *prog) in validate_sampler_array_indexing() argument
4494 if (prog->_LinkedShaders[i] == NULL) in validate_sampler_array_indexing()
4501 v.run(prog->_LinkedShaders[i]->ir); in validate_sampler_array_indexing()
4507 linker_error(prog, msg, prog->IsES ? "ES" : "", in validate_sampler_array_indexing()
4508 prog->data->Version); in validate_sampler_array_indexing()
4511 linker_warning(prog, msg, prog->IsES ? "ES" : "", in validate_sampler_array_indexing()
4512 prog->data->Version); in validate_sampler_array_indexing()
4520 link_assign_subroutine_types(struct gl_shader_program *prog) in link_assign_subroutine_types() argument
4522 unsigned mask = prog->data->linked_stages; in link_assign_subroutine_types()
4525 gl_program *p = prog->_LinkedShaders[i]->Program; in link_assign_subroutine_types()
4528 foreach_in_list(ir_instruction, node, prog->_LinkedShaders[i]->ir) { in link_assign_subroutine_types()
4542 linker_error(prog, "Too many subroutine functions declared.\n"); in link_assign_subroutine_types()
4564 linker_error(prog, "each subroutine index qualifier in the " in link_assign_subroutine_types()
4607 disable_varying_optimizations_for_sso(struct gl_shader_program *prog) in disable_varying_optimizations_for_sso() argument
4610 assert(prog->SeparateShader); in disable_varying_optimizations_for_sso()
4617 if (!prog->_LinkedShaders[i]) in disable_varying_optimizations_for_sso()
4628 gl_linked_shader *sh = prog->_LinkedShaders[stage]; in disable_varying_optimizations_for_sso()
4648 struct gl_shader_program *prog) in link_and_validate_uniforms() argument
4650 update_array_sizes(prog); in link_and_validate_uniforms()
4651 link_assign_uniform_locations(prog, ctx); in link_and_validate_uniforms()
4653 link_assign_atomic_counter_resources(ctx, prog); in link_and_validate_uniforms()
4654 link_calculate_subroutine_compat(prog); in link_and_validate_uniforms()
4655 check_resources(ctx, prog); in link_and_validate_uniforms()
4656 check_subroutine_resources(prog); in link_and_validate_uniforms()
4657 check_image_resources(ctx, prog); in link_and_validate_uniforms()
4658 link_check_atomic_counter_resources(ctx, prog); in link_and_validate_uniforms()
4664 struct gl_shader_program *prog, void *mem_ctx) in link_varyings_and_uniforms() argument
4668 if (prog->_LinkedShaders[i] != NULL) { in link_varyings_and_uniforms()
4669 link_invalidate_variable_locations(prog->_LinkedShaders[i]->ir); in link_varyings_and_uniforms()
4675 if (prog->_LinkedShaders[i] == NULL) in link_varyings_and_uniforms()
4678 match_explicit_outputs_to_inputs(prog->_LinkedShaders[prev], in link_varyings_and_uniforms()
4679 prog->_LinkedShaders[i]); in link_varyings_and_uniforms()
4683 if (!assign_attribute_or_color_locations(mem_ctx, prog, &ctx->Const, in link_varyings_and_uniforms()
4688 if (!assign_attribute_or_color_locations(mem_ctx, prog, &ctx->Const, in link_varyings_and_uniforms()
4693 prog->last_vert_prog = NULL; in link_varyings_and_uniforms()
4695 if (prog->_LinkedShaders[i] == NULL) in link_varyings_and_uniforms()
4698 prog->last_vert_prog = prog->_LinkedShaders[i]->Program; in link_varyings_and_uniforms()
4702 if (!link_varyings(prog, first, last, ctx, mem_ctx)) in link_varyings_and_uniforms()
4705 link_and_validate_uniforms(ctx, prog); in link_varyings_and_uniforms()
4707 if (!prog->data->LinkStatus) in link_varyings_and_uniforms()
4711 if (prog->_LinkedShaders[i] == NULL) in link_varyings_and_uniforms()
4718 lower_ubo_reference(prog->_LinkedShaders[i], in link_varyings_and_uniforms()
4723 lower_shared_reference(ctx, prog, prog->_LinkedShaders[i]); in link_varyings_and_uniforms()
4725 lower_vector_derefs(prog->_LinkedShaders[i]); in link_varyings_and_uniforms()
4726 do_vec_index_to_swizzle(prog->_LinkedShaders[i]->ir); in link_varyings_and_uniforms()
4751 link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) in link_shaders() argument
4753 prog->data->LinkStatus = linking_success; /* All error paths will set this to false */ in link_shaders()
4754 prog->data->Validated = false; in link_shaders()
4769 if (prog->NumShaders == 0) { in link_shaders()
4771 linker_error(prog, "no shaders attached to the program\n"); in link_shaders()
4778 if (prog->TransformFeedback.NumVarying > 0) { in link_shaders()
4779 for (unsigned i = 0; i < prog->NumShaders; i++) { in link_shaders()
4780 _mesa_glsl_compile_shader(ctx, prog->Shaders[i], false, false, true); in link_shaders()
4785 if (!skip_cache && shader_cache_read_program_metadata(ctx, prog)) in link_shaders()
4791 prog->ARB_fragment_coord_conventions_enable = false; in link_shaders()
4800 calloc(prog->NumShaders, sizeof(struct gl_shader *)); in link_shaders()
4806 for (unsigned i = 0; i < prog->NumShaders; i++) { in link_shaders()
4807 min_version = MIN2(min_version, prog->Shaders[i]->Version); in link_shaders()
4808 max_version = MAX2(max_version, prog->Shaders[i]->Version); in link_shaders()
4810 if (prog->Shaders[i]->IsES != prog->Shaders[0]->IsES) { in link_shaders()
4811 linker_error(prog, "all shaders must use same shading " in link_shaders()
4816 if (prog->Shaders[i]->ARB_fragment_coord_conventions_enable) { in link_shaders()
4817 prog->ARB_fragment_coord_conventions_enable = true; in link_shaders()
4820 gl_shader_stage shader_type = prog->Shaders[i]->Stage; in link_shaders()
4821 shader_list[shader_type][num_shaders[shader_type]] = prog->Shaders[i]; in link_shaders()
4828 if (prog->Shaders[0]->IsES && min_version != max_version) { in link_shaders()
4829 linker_error(prog, "all shaders must use same shading " in link_shaders()
4834 prog->data->Version = max_version; in link_shaders()
4835 prog->IsES = prog->Shaders[0]->IsES; in link_shaders()
4839 if (!prog->SeparateShader) { in link_shaders()
4842 linker_error(prog, "Geometry shader must be linked with " in link_shaders()
4848 linker_error(prog, "Tessellation evaluation shader must be linked " in link_shaders()
4854 linker_error(prog, "Tessellation control shader must be linked with " in link_shaders()
4885 linker_error(prog, "Tessellation control shader must be linked with " in link_shaders()
4890 if (prog->IsES) { in link_shaders()
4893 linker_error(prog, "GLSL ES requires non-separable programs " in link_shaders()
4903 num_shaders[MESA_SHADER_COMPUTE] != prog->NumShaders) { in link_shaders()
4904 linker_error(prog, "Compute shaders may not be linked with any other " in link_shaders()
4913 link_intrastage_shaders(mem_ctx, ctx, prog, shader_list[stage], in link_shaders()
4916 if (!prog->data->LinkStatus) { in link_shaders()
4924 validate_vertex_shader_executable(prog, sh, ctx); in link_shaders()
4930 validate_tess_eval_shader_executable(prog, sh, ctx); in link_shaders()
4933 validate_geometry_shader_executable(prog, sh, ctx); in link_shaders()
4936 validate_fragment_shader_executable(prog, sh); in link_shaders()
4939 if (!prog->data->LinkStatus) { in link_shaders()
4945 prog->_LinkedShaders[stage] = sh; in link_shaders()
4946 prog->data->linked_stages |= 1 << stage; in link_shaders()
4954 cross_validate_uniforms(prog); in link_shaders()
4955 if (!prog->data->LinkStatus) in link_shaders()
4965 if (!prog->_LinkedShaders[i]) in link_shaders()
4972 check_explicit_uniform_locations(ctx, prog); in link_shaders()
4973 link_assign_subroutine_types(prog); in link_shaders()
4975 if (!prog->data->LinkStatus) in link_shaders()
4978 resize_tes_inputs(ctx, prog); in link_shaders()
4985 if (prog->_LinkedShaders[i] == NULL) in link_shaders()
4988 validate_interstage_inout_blocks(prog, prog->_LinkedShaders[prev], in link_shaders()
4989 prog->_LinkedShaders[i]); in link_shaders()
4990 if (!prog->data->LinkStatus) in link_shaders()
4993 cross_validate_outputs_to_inputs(ctx, prog, in link_shaders()
4994 prog->_LinkedShaders[prev], in link_shaders()
4995 prog->_LinkedShaders[i]); in link_shaders()
4996 if (!prog->data->LinkStatus) in link_shaders()
5007 if (prog->SeparateShader) in link_shaders()
5008 validate_sso_explicit_locations(ctx, prog, in link_shaders()
5013 validate_interstage_uniform_blocks(prog, prog->_LinkedShaders); in link_shaders()
5014 if (!prog->data->LinkStatus) in link_shaders()
5018 if (prog->_LinkedShaders[i] != NULL) in link_shaders()
5019 lower_named_interface_blocks(mem_ctx, prog->_LinkedShaders[i]); in link_shaders()
5028 if (max_version >= (prog->IsES ? 300 : 130)) { in link_shaders()
5029 struct gl_linked_shader *sh = prog->_LinkedShaders[MESA_SHADER_FRAGMENT]; in link_shaders()
5035 if (prog->SeparateShader) in link_shaders()
5036 disable_varying_optimizations_for_sso(prog); in link_shaders()
5039 if (!interstage_cross_validate_uniform_blocks(prog, false)) in link_shaders()
5043 if (!interstage_cross_validate_uniform_blocks(prog, true)) in link_shaders()
5051 if (prog->_LinkedShaders[i] == NULL) in link_shaders()
5054 detect_recursion_linked(prog, prog->_LinkedShaders[i]->ir); in link_shaders()
5055 if (!prog->data->LinkStatus) in link_shaders()
5059 lower_clip_cull_distance(prog, prog->_LinkedShaders[i]); in link_shaders()
5063 lower_tess_level(prog->_LinkedShaders[i]); in link_shaders()
5069 linker_optimisation_loop(ctx, prog->_LinkedShaders[i]->ir, i); in link_shaders()
5072 if (lower_const_arrays_to_uniforms(prog->_LinkedShaders[i]->ir, i)) in link_shaders()
5073 linker_optimisation_loop(ctx, prog->_LinkedShaders[i]->ir, i); in link_shaders()
5075 propagate_invariance(prog->_LinkedShaders[i]->ir); in link_shaders()
5082 if ((!prog->IsES && prog->data->Version < 130) || in link_shaders()
5083 (prog->IsES && prog->data->Version < 300)) { in link_shaders()
5084 if (!validate_sampler_array_indexing(ctx, prog)) in link_shaders()
5089 validate_geometry_shader_emissions(ctx, prog); in link_shaders()
5091 store_fragdepth_layout(prog); in link_shaders()
5093 if(!link_varyings_and_uniforms(first, last, ctx, prog, mem_ctx)) in link_shaders()
5100 if (prog->_LinkedShaders[i] == NULL) in link_shaders()
5103 optimize_swizzles(prog->_LinkedShaders[i]->ir); in link_shaders()
5132 if (!prog->SeparateShader && ctx->API == API_OPENGLES2 && in link_shaders()
5134 if (prog->_LinkedShaders[MESA_SHADER_VERTEX] == NULL) { in link_shaders()
5135 linker_error(prog, "program lacks a vertex shader\n"); in link_shaders()
5136 } else if (prog->_LinkedShaders[MESA_SHADER_FRAGMENT] == NULL) { in link_shaders()
5137 linker_error(prog, "program lacks a fragment shader\n"); in link_shaders()
5144 if (prog->_LinkedShaders[i] == NULL) in link_shaders()
5150 validate_ir_tree(prog->_LinkedShaders[i]->ir); in link_shaders()
5153 reparent_ir(prog->_LinkedShaders[i]->ir, prog->_LinkedShaders[i]->ir); in link_shaders()
5160 delete prog->_LinkedShaders[i]->symbols; in link_shaders()
5161 prog->_LinkedShaders[i]->symbols = NULL; in link_shaders()