Home | History | Annotate | Download | only in radeonsi

Lines Matching refs:sctx

43 	struct si_context *sctx = (struct si_context *)context;
52 si_release_all_descriptors(sctx);
54 if (sctx->ce_suballocator)
55 u_suballocator_destroy(sctx->ce_suballocator);
57 pipe_resource_reference(&sctx->esgs_ring, NULL);
58 pipe_resource_reference(&sctx->gsvs_ring, NULL);
59 pipe_resource_reference(&sctx->tf_ring, NULL);
60 pipe_resource_reference(&sctx->tess_offchip_ring, NULL);
61 pipe_resource_reference(&sctx->null_const_buf.buffer, NULL);
62 r600_resource_reference(&sctx->border_color_buffer, NULL);
63 free(sctx->border_color_table);
64 r600_resource_reference(&sctx->scratch_buffer, NULL);
65 r600_resource_reference(&sctx->compute_scratch_buffer, NULL);
67 si_pm4_free_state(sctx, sctx->init_config, ~0);
68 if (sctx->init_config_gs_rings)
69 si_pm4_free_state(sctx, sctx->init_config_gs_rings, ~0);
70 for (i = 0; i < ARRAY_SIZE(sctx->vgt_shader_config); i++)
71 si_pm4_delete_state(sctx, vgt_shader_config, sctx->vgt_shader_config[i]);
73 if (sctx->fixed_func_tcs_shader.cso)
74 sctx->b.b.delete_tcs_state(&sctx->b.b, sctx->fixed_func_tcs_shader.cso);
75 if (sctx->custom_dsa_flush)
76 sctx->b.b.delete_depth_stencil_alpha_state(&sctx->b.b, sctx->custom_dsa_flush);
77 if (sctx->custom_blend_resolve)
78 sctx->b.b.delete_blend_state(&sctx->b.b, sctx->custom_blend_resolve);
79 if (sctx->custom_blend_decompress)
80 sctx->b.b.delete_blend_state(&sctx->b.b, sctx->custom_blend_decompress);
81 if (sctx->custom_blend_fastclear)
82 sctx->b.b.delete_blend_state(&sctx->b.b, sctx->custom_blend_fastclear);
83 if (sctx->custom_blend_dcc_decompress)
84 sctx->b.b.delete_blend_state(&sctx->b.b, sctx->custom_blend_dcc_decompress);
86 if (sctx->blitter)
87 util_blitter_destroy(sctx->blitter);
89 r600_common_context_cleanup(&sctx->b);
91 LLVMDisposeTargetMachine(sctx->tm);
93 r600_resource_reference(&sctx->trace_buf, NULL);
94 r600_resource_reference(&sctx->last_trace_buf, NULL);
95 radeon_clear_saved_cs(&sctx->last_gfx);
97 FREE(sctx);
103 struct si_context *sctx = (struct si_context *)ctx;
105 return sctx->b.ws->ctx_query_reset_status(sctx->b.ctx);
119 struct si_context *sctx = (struct si_context *)ctx;
121 dd_parse_apitrace_marker(string, len, &sctx->apitrace_call_number);
144 struct si_context *sctx = CALLOC_STRUCT(si_context);
149 if (!sctx)
158 sctx->b.b.screen = screen; /* this must be set first */
159 sctx->b.b.priv = priv;
160 sctx->b.b.destroy = si_destroy_context;
161 sctx->b.b.emit_string_marker = si_emit_string_marker;
162 sctx->b.set_atom_dirty = (void *)si_set_atom_dirty;
163 sctx->screen = sscreen; /* Easy accessing of screen/winsys. */
164 sctx->is_debug = (flags & PIPE_CONTEXT_DEBUG) != 0;
166 if (!r600_common_context_init(&sctx->b, &sscreen->b, flags))
170 sctx->b.b.get_device_reset_status = si_amdgpu_get_reset_status;
172 si_init_blit_functions(sctx);
173 si_init_compute_functions(sctx);
174 si_init_cp_dma_functions(sctx);
175 si_init_debug_functions(sctx);
178 sctx->b.b.create_video_codec = si_uvd_create_decoder;
179 sctx->b.b.create_video_buffer = si_video_buffer_create;
181 sctx->b.b.create_video_codec = vl_create_decoder;
182 sctx->b.b.create_video_buffer = vl_video_buffer_create;
185 sctx->b.gfx.cs = ws->cs_create(sctx->b.ctx, RING_GFX,
186 si_context_gfx_flush, sctx);
194 sctx->ce_ib = ws->cs_add_const_ib(sctx->b.gfx.cs);
195 if (!sctx->ce_ib)
199 sctx->ce_preamble_ib =
200 ws->cs_add_const_preamble_ib(sctx->b.gfx.cs);
202 if (!sctx->ce_preamble_ib)
206 sctx->ce_suballocator =
207 u_suballocator_create(&sctx->b.b, 1024 * 1024,
209 if (!sctx->ce_suballocator)
213 sctx->b.gfx.flush = si_context_gfx_flush;
216 sctx->border_color_table = malloc(SI_MAX_BORDER_COLORS *
217 sizeof(*sctx->border_color_table));
218 if (!sctx->border_color_table)
221 sctx->border_color_buffer = (struct r600_resource*)
224 sizeof(*sctx->border_color_table));
225 if (!sctx->border_color_buffer)
228 sctx->border_color_map =
229 ws->buffer_map(sctx->border_color_buffer->buf,
231 if (!sctx->border_color_map)
234 si_init_all_descriptors(sctx);
235 si_init_state_functions(sctx);
236 si_init_shader_functions(sctx);
238 if (sctx->b.chip_class >= CIK)
239 cik_init_sdma_functions(sctx);
241 si_init_dma_functions(sctx);
244 sctx->b.b.resource_copy_region = sctx->b.dma_copy;
246 sctx->blitter = util_blitter_create(&sctx->b.b);
247 if (sctx->blitter == NULL)
249 sctx->blitter->draw_rectangle = r600_draw_rectangle;
251 sctx->sample_mask.sample_mask = 0xffff;
254 si_begin_new_cs(sctx);
255 r600_query_init_backend_mask(&sctx->b); /* this emits commands and must be last */
259 if (sctx->b.chip_class == CIK) {
260 sctx->null_const_buf.buffer = pipe_buffer_create(screen, PIPE_BIND_CONSTANT_BUFFER,
262 if (!sctx->null_const_buf.buffer)
264 sctx->null_const_buf.buffer_size = sctx->null_const_buf.buffer->width0;
268 sctx->b.b.set_constant_buffer(&sctx->b.b, shader, i,
269 &sctx->null_const_buf);
273 si_set_rw_buffer(sctx, SI_HS_CONST_DEFAULT_TESS_LEVELS,
274 &sctx->null_const_buf);
275 si_set_rw_buffer(sctx, SI_VS_CONST_CLIP_PLANES,
276 &sctx->null_const_buf);
277 si_set_rw_buffer(sctx, SI_PS_CONST_POLY_STIPPLE,
278 &sctx->null_const_buf);
279 si_set_rw_buffer(sctx, SI_PS_CONST_SAMPLE_POSITIONS,
280 &sctx->null_const_buf);
283 sctx->b.clear_buffer(&sctx->b.b, sctx->null_const_buf.buffer, 0,
284 sctx->null_const_buf.buffer->width0, 0,
297 * sctx->scratch_waves must be >= the maximum posible size of
305 sctx->scratch_waves = MAX2(32 * sscreen->b.info.num_good_compute_units,
308 sctx->tm = si_create_llvm_target_machine(sscreen);
310 return &sctx->b.b;
313 si_destroy_context(&sctx->b.b);