Lines Matching refs:program

59 	const struct si_compute *program,  in si_compute_get_code_object()  argument
62 if (!program->use_code_object_v2) { in si_compute_get_code_object()
66 (program->shader.binary.code + symbol_offset); in si_compute_get_code_object()
87 struct si_compute *program = (struct si_compute *)job; in si_create_compute_state_async() local
88 struct si_shader *shader = &program->shader; in si_create_compute_state_async()
91 struct pipe_debug_callback *debug = &program->compiler_ctx_state.debug; in si_create_compute_state_async()
95 assert(thread_index < ARRAY_SIZE(program->screen->tm)); in si_create_compute_state_async()
96 tm = program->screen->tm[thread_index]; in si_create_compute_state_async()
100 sel.screen = program->screen; in si_create_compute_state_async()
101 tgsi_scan_shader(program->tokens, &sel.info); in si_create_compute_state_async()
102 sel.tokens = program->tokens; in si_create_compute_state_async()
104 sel.local_size = program->local_size; in si_create_compute_state_async()
106 &program->active_const_and_shader_buffers, in si_create_compute_state_async()
107 &program->active_samplers_and_images); in si_create_compute_state_async()
109 program->shader.selector = &sel; in si_create_compute_state_async()
110 program->shader.is_monolithic = true; in si_create_compute_state_async()
111 program->uses_grid_size = sel.info.uses_grid_size; in si_create_compute_state_async()
112 program->uses_block_size = sel.info.uses_block_size; in si_create_compute_state_async()
113 program->uses_bindless_samplers = sel.info.uses_bindless_samplers; in si_create_compute_state_async()
114 program->uses_bindless_images = sel.info.uses_bindless_images; in si_create_compute_state_async()
116 if (si_shader_create(program->screen, tm, &program->shader, debug)) { in si_create_compute_state_async()
117 program->shader.compilation_failed = true; in si_create_compute_state_async()
140 program->variable_group_size = in si_create_compute_state_async()
144 FREE(program->tokens); in si_create_compute_state_async()
145 program->shader.selector = NULL; in si_create_compute_state_async()
154 struct si_compute *program = CALLOC_STRUCT(si_compute); in si_create_compute_state() local
156 pipe_reference_init(&program->reference, 1); in si_create_compute_state()
157 program->screen = (struct si_screen *)ctx->screen; in si_create_compute_state()
158 program->ir_type = cso->ir_type; in si_create_compute_state()
159 program->local_size = cso->req_local_mem; in si_create_compute_state()
160 program->private_size = cso->req_private_mem; in si_create_compute_state()
161 program->input_size = cso->req_input_mem; in si_create_compute_state()
162 program->use_code_object_v2 = HAVE_LLVM >= 0x0400 && in si_create_compute_state()
166 program->tokens = tgsi_dup_tokens(cso->prog); in si_create_compute_state()
167 if (!program->tokens) { in si_create_compute_state()
168 FREE(program); in si_create_compute_state()
172 program->compiler_ctx_state.debug = sctx->debug; in si_create_compute_state()
173 program->compiler_ctx_state.is_debug_context = sctx->is_debug; in si_create_compute_state()
175 util_queue_fence_init(&program->ready); in si_create_compute_state()
185 program->compiler_ctx_state.debug = async_debug.base; in si_create_compute_state()
189 program, &program->ready, in si_create_compute_state()
193 util_queue_fence_wait(&program->ready); in si_create_compute_state()
203 ac_elf_read(code, header->num_bytes, &program->shader.binary); in si_create_compute_state()
204 if (program->use_code_object_v2) { in si_create_compute_state()
206 si_compute_get_code_object(program, 0); in si_create_compute_state()
207 code_object_to_config(code_object, &program->shader.config); in si_create_compute_state()
209 si_shader_binary_read_config(&program->shader.binary, in si_create_compute_state()
210 &program->shader.config, 0); in si_create_compute_state()
212 si_shader_dump(sctx->screen, &program->shader, &sctx->debug, in si_create_compute_state()
214 if (si_shader_binary_upload(sctx->screen, &program->shader) < 0) { in si_create_compute_state()
216 FREE(program); in si_create_compute_state()
221 return program; in si_create_compute_state()
227 struct si_compute *program = (struct si_compute*)state; in si_bind_compute_state() local
229 sctx->cs_shader_state.program = program; in si_bind_compute_state()
230 if (!program) in si_bind_compute_state()
234 if (program->ir_type == PIPE_SHADER_IR_TGSI) in si_bind_compute_state()
235 util_queue_fence_wait(&program->ready); in si_bind_compute_state()
240 program->active_const_and_shader_buffers); in si_bind_compute_state()
244 program->active_samplers_and_images); in si_bind_compute_state()
254 struct si_compute *program = sctx->cs_shader_state.program; in si_set_global_binding() local
260 pipe_resource_reference(&program->global_buffers[first + i], NULL); in si_set_global_binding()
268 pipe_resource_reference(&program->global_buffers[first + i], resources[i]); in si_set_global_binding()
369 struct si_compute *program, in si_switch_compute_shader() argument
379 if (sctx->cs_shader_state.emitted_program == program && in si_switch_compute_shader()
383 if (program->ir_type == PIPE_SHADER_IR_TGSI) { in si_switch_compute_shader()
402 lds_blocks += align(program->local_size, 256) >> 8; in si_switch_compute_shader()
404 lds_blocks += align(program->local_size, 512) >> 9; in si_switch_compute_shader()
437 cik_prefetch_TC_L2_async(sctx, &program->shader.bo->b.b, in si_switch_compute_shader()
438 0, program->shader.bo->b.b.width0); in si_switch_compute_shader()
442 if (program->use_code_object_v2) { in si_switch_compute_shader()
466 sctx->cs_shader_state.emitted_program = program; in si_switch_compute_shader()
522 struct si_compute *program = sctx->cs_shader_state.program; in si_setup_user_sgprs_co_v2() local
559 dispatch.private_segment_size = program->private_size; in si_setup_user_sgprs_co_v2()
560 dispatch.group_segment_size = program->local_size; in si_setup_user_sgprs_co_v2()
613 struct si_compute *program = sctx->cs_shader_state.program; in si_upload_compute_input() local
616 unsigned num_work_size_bytes = program->use_code_object_v2 ? 0 : 36; in si_upload_compute_input()
624 kernel_args_size = program->input_size + num_work_size_bytes; in si_upload_compute_input()
646 program->input_size); in si_upload_compute_input()
675 struct si_compute *program = sctx->cs_shader_state.program; in si_setup_tgsi_grid() local
681 12 * program->uses_grid_size; in si_setup_tgsi_grid()
684 if (program->uses_grid_size) { in si_setup_tgsi_grid()
704 if (program->uses_grid_size) { in si_setup_tgsi_grid()
710 if (program->variable_group_size && program->uses_block_size) { in si_setup_tgsi_grid()
789 struct si_compute *program = sctx->cs_shader_state.program; in si_launch_grid() local
791 si_compute_get_code_object(program, info->pc); in si_launch_grid()
809 if (program->ir_type == PIPE_SHADER_IR_TGSI && in si_launch_grid()
810 program->shader.compilation_failed) in si_launch_grid()
821 si_context_add_resource_size(ctx, &program->shader.bo->b.b); in si_launch_grid()
843 if (!si_switch_compute_shader(sctx, program, &program->shader, in si_launch_grid()
856 if ((program->input_size || in si_launch_grid()
857 program->ir_type == PIPE_SHADER_IR_NATIVE) && in si_launch_grid()
865 (struct r600_resource*)program->global_buffers[i]; in si_launch_grid()
874 if (program->ir_type == PIPE_SHADER_IR_TGSI) in si_launch_grid()
893 void si_destroy_compute(struct si_compute *program) in si_destroy_compute() argument
895 if (program->ir_type == PIPE_SHADER_IR_TGSI) { in si_destroy_compute()
896 util_queue_drop_job(&program->screen->shader_compiler_queue, in si_destroy_compute()
897 &program->ready); in si_destroy_compute()
898 util_queue_fence_destroy(&program->ready); in si_destroy_compute()
901 si_shader_destroy(&program->shader); in si_destroy_compute()
902 FREE(program); in si_destroy_compute()
906 struct si_compute *program = (struct si_compute *)state; in si_delete_compute_state() local
912 if (program == sctx->cs_shader_state.program) in si_delete_compute_state()
913 sctx->cs_shader_state.program = NULL; in si_delete_compute_state()
915 if (program == sctx->cs_shader_state.emitted_program) in si_delete_compute_state()
918 si_compute_reference(&program, NULL); in si_delete_compute_state()