Lines Matching refs:prog
187 _mesa_init_gl_program(struct gl_program *prog, gl_shader_stage stage, in _mesa_init_gl_program() argument
190 if (!prog) in _mesa_init_gl_program()
193 memset(prog, 0, sizeof(*prog)); in _mesa_init_gl_program()
194 prog->Id = id; in _mesa_init_gl_program()
195 prog->Target = _mesa_shader_stage_to_program(stage); in _mesa_init_gl_program()
196 prog->RefCount = 1; in _mesa_init_gl_program()
197 prog->Format = GL_PROGRAM_FORMAT_ASCII_ARB; in _mesa_init_gl_program()
198 prog->info.stage = stage; in _mesa_init_gl_program()
199 prog->info.use_legacy_math_rules = is_arb_asm; in _mesa_init_gl_program()
215 prog->SamplerUnits[i] = i; in _mesa_init_gl_program()
218 return prog; in _mesa_init_gl_program()
225 struct gl_program *prog; in _mesa_new_program() local
229 prog = (struct gl_program*)rzalloc(NULL, struct gl_vertex_program); in _mesa_new_program()
232 prog = rzalloc(NULL, struct gl_program); in _mesa_new_program()
236 return _mesa_init_gl_program(prog, stage, id, is_arb_asm); in _mesa_new_program()
244 _mesa_delete_program(struct gl_context *ctx, struct gl_program *prog) in _mesa_delete_program() argument
247 assert(prog); in _mesa_delete_program()
248 assert(prog->RefCount==0); in _mesa_delete_program()
250 st_release_variants(st, prog); in _mesa_delete_program()
252 free(prog->serialized_nir); in _mesa_delete_program()
254 if (prog == &_mesa_DummyProgram) in _mesa_delete_program()
257 if (prog->Parameters) { in _mesa_delete_program()
258 _mesa_free_parameter_list(prog->Parameters); in _mesa_delete_program()
261 if (prog->nir) { in _mesa_delete_program()
262 ralloc_free(prog->nir); in _mesa_delete_program()
265 if (prog->sh.BindlessSamplers) { in _mesa_delete_program()
266 ralloc_free(prog->sh.BindlessSamplers); in _mesa_delete_program()
269 if (prog->sh.BindlessImages) { in _mesa_delete_program()
270 ralloc_free(prog->sh.BindlessImages); in _mesa_delete_program()
273 if (prog->driver_cache_blob) { in _mesa_delete_program()
274 ralloc_free(prog->driver_cache_blob); in _mesa_delete_program()
277 ralloc_free(prog); in _mesa_delete_program()
304 struct gl_program *prog) in _mesa_reference_program_() argument
308 if (*ptr && prog) { in _mesa_reference_program_()
311 assert(prog->Target == GL_VERTEX_PROGRAM_ARB); in _mesa_reference_program_()
313 assert(prog->Target == GL_FRAGMENT_PROGRAM_ARB || in _mesa_reference_program_()
314 prog->Target == GL_FRAGMENT_PROGRAM_NV); in _mesa_reference_program_()
316 assert(prog->Target == GL_GEOMETRY_PROGRAM_NV); in _mesa_reference_program_()
335 if (prog) { in _mesa_reference_program_()
336 p_atomic_inc(&prog->RefCount); in _mesa_reference_program_()
339 *ptr = prog; in _mesa_reference_program_()
348 const struct gl_program *prog) in _mesa_get_min_invocations_per_fragment() argument
366 if (prog->info.fs.uses_sample_qualifier || in _mesa_get_min_invocations_per_fragment()
367 BITSET_TEST(prog->info.system_values_read, SYSTEM_VALUE_SAMPLE_ID) || in _mesa_get_min_invocations_per_fragment()
368 BITSET_TEST(prog->info.system_values_read, SYSTEM_VALUE_SAMPLE_POS)) in _mesa_get_min_invocations_per_fragment()
381 gl_external_samplers(const struct gl_program *prog) in gl_external_samplers() argument
384 GLbitfield mask = prog->SamplersUsed; in gl_external_samplers()
388 if (prog->sh.SamplerTargets[idx] == TEXTURE_EXTERNAL_INDEX) in gl_external_samplers()
410 _mesa_add_separate_state_parameters(struct gl_program *prog, in _mesa_add_separate_state_parameters() argument
432 _mesa_add_parameter(prog->Parameters, PROGRAM_STATE_VAR, in _mesa_add_separate_state_parameters()
439 prog->Parameters->StateFlags |= in _mesa_add_separate_state_parameters()
444 int num_instr = prog->arb.NumInstructions; in _mesa_add_separate_state_parameters()
445 struct prog_instruction *instrs = prog->arb.Instructions; in _mesa_add_separate_state_parameters()