Lines Matching defs:sctx

57 void si_execute_clears(struct si_context *sctx, struct si_clear_info *info,
65 sctx->flags |= si_get_flush_flags(sctx, SI_COHERENCY_CB_META, L2_LRU);
68 sctx->flags |= si_get_flush_flags(sctx, SI_COHERENCY_DB_META, L2_LRU);
71 sctx->flags |= SI_CONTEXT_INV_VCACHE;
74 if (sctx->gfx_level <= GFX8)
75 sctx->flags |= SI_CONTEXT_INV_L2;
80 gfx9_clear_dcc_msaa(sctx, info[i].resource, info[i].clear_value,
88 si_compute_clear_buffer_rmw(sctx, info[i].resource, info[i].offset, info[i].size,
93 si_clear_buffer(sctx, info[i].resource, info[i].offset, info[i].size,
100 sctx->flags |= SI_CONTEXT_CS_PARTIAL_FLUSH;
103 if (sctx->gfx_level <= GFX8)
104 sctx->flags |= SI_CONTEXT_WB_L2;
420 bool vi_dcc_get_clear_info(struct si_context *sctx, struct si_texture *tex, unsigned level,
429 if (sctx->gfx_level >= GFX10) {
433 if (sctx->gfx_level < GFX11 && tex->buffer.b.b.nr_storage_samples >= 4)
451 } else if (sctx->gfx_level == GFX9) {
665 static void si_fast_clear(struct si_context *sctx, unsigned *buffers,
668 struct pipe_framebuffer_state *fb = &sctx->framebuffer.state;
679 if (sctx->render_cond)
699 si_set_optimal_micro_tile_mode(sctx->screen, tex);
708 p_atomic_inc(&sctx->screen->dirty_tex_counter);
731 if (sctx->screen->debug_flags & DBG(NO_DCC_CLEAR))
734 if (sctx->gfx_level >= GFX11) {
735 if (!gfx11_get_dcc_clear_parameters(sctx->screen, fb->cbufs[i]->format, color,
739 if (!gfx8_get_dcc_clear_parameters(sctx->screen, tex->buffer.b.b.format,
751 if ((eliminate_needed || !sctx->screen->info.has_dcc_constant_encode) &&
763 if (level > 0 && (eliminate_needed || !sctx->screen->info.has_dcc_constant_encode))
767 !sctx->screen->allow_dcc_msaa_clear_to_reg_for_bpp[util_logbase2(tex->surface.bpe)])
772 if (!vi_dcc_get_clear_info(sctx, tex, level, reset_value, &info[num_clears]))
778 si_mark_display_dcc_dirty(sctx, tex);
782 assert(sctx->gfx_level < GFX11); /* no FMASK/CMASK on GFX11 */
791 if (sctx->gfx_level >= GFX11)
813 if (sctx->family == CHIP_STONEY)
823 if (sctx->gfx_level >= GFX10) {
832 if (!si_alloc_separate_cmask(sctx->screen, tex))
846 } else if (sctx->gfx_level == GFX9) {
854 if (!si_alloc_separate_cmask(sctx->screen, tex))
860 if (!si_alloc_separate_cmask(sctx->screen, tex))
878 assert(sctx->gfx_level < GFX11); /* no decompression needed on GFX11 */
880 si_set_sampler_depth_decompress_mask(sctx, tex);
881 p_atomic_inc(&sctx->screen->compressed_colortex_counter);
889 if (sctx->screen->info.has_dcc_constant_encode && !eliminate_needed)
893 assert(sctx->gfx_level < GFX11);
896 sctx->framebuffer.dirty_cbufs |= 1 << i;
897 si_mark_atom_dirty(sctx, &sctx->atoms.s.framebuffer);
929 sctx->framebuffer.DB_has_shader_readable_metadata = true;
930 sctx->framebuffer.dirty_zsbuf = true;
931 si_mark_atom_dirty(sctx, &sctx->atoms.s.framebuffer);
934 p_atomic_inc(&sctx->screen->dirty_tex_counter);
972 zstex->need_flush_after_depth_decompression = sctx->gfx_level == GFX10_3;
991 if (sctx->gfx_level >= GFX10) {
1079 zstex->need_flush_after_depth_decompression = update_db_depth_clear && sctx->gfx_level == GFX10_3;
1085 sctx->framebuffer.dirty_zsbuf = true;
1086 si_mark_atom_dirty(sctx, &sctx->atoms.s.framebuffer);
1093 sctx->framebuffer.dirty_zsbuf = true;
1094 si_mark_atom_dirty(sctx, &sctx->atoms.s.framebuffer);
1099 si_execute_clears(sctx, info, num_clears, clear_types);
1106 struct si_context *sctx = (struct si_context *)ctx;
1107 struct pipe_framebuffer_state *fb = &sctx->framebuffer.state;
1122 si_fast_clear(sctx, &buffers, color, depth, stencil);
1146 sctx->db_depth_disable_expclear = true;
1157 sctx->framebuffer.dirty_zsbuf = true;
1158 si_mark_atom_dirty(sctx, &sctx->atoms.s.framebuffer);
1160 sctx->db_depth_clear = true;
1161 si_mark_atom_dirty(sctx, &sctx->atoms.s.db_render_state);
1171 sctx->db_stencil_disable_expclear = true;
1177 sctx->framebuffer.dirty_zsbuf = true;
1178 si_mark_atom_dirty(sctx, &sctx->atoms.s.framebuffer);
1180 sctx->db_stencil_clear = true;
1181 si_mark_atom_dirty(sctx, &sctx->atoms.s.db_render_state);
1185 sctx->flags |= SI_CONTEXT_FLUSH_AND_INV_DB;
1188 if (unlikely(sctx->thread_trace_enabled)) {
1190 sctx->sqtt_next_event = EventCmdClearColorImage;
1192 sctx->sqtt_next_event = EventCmdClearDepthStencilImage;
1195 si_blitter_begin(sctx, SI_CLEAR);
1196 util_blitter_clear(sctx->blitter, fb->width, fb->height, util_framebuffer_get_num_layers(fb),
1197 buffers, color, depth, stencil, sctx->framebuffer.nr_samples > 1);
1198 si_blitter_end(sctx);
1200 if (sctx->db_depth_clear) {
1201 sctx->db_depth_clear = false;
1202 sctx->db_depth_disable_expclear = false;
1205 si_mark_atom_dirty(sctx, &sctx->atoms.s.db_render_state);
1208 if (sctx->db_stencil_clear) {
1209 sctx->db_stencil_clear = false;
1210 sctx->db_stencil_disable_expclear = false;
1212 si_mark_atom_dirty(sctx, &sctx->atoms.s.db_render_state);
1216 static bool si_try_normal_clear(struct si_context *sctx, struct pipe_surface *dst,
1229 (!sctx->render_cond || render_condition_enabled) &&
1230 sctx->has_graphics) {
1231 struct pipe_context *ctx = &sctx->b;
1234 util_copy_framebuffer_state(&saved_fb, &sctx->framebuffer.state);
1263 struct si_context *sctx = (struct si_context *)ctx;
1267 if (si_try_normal_clear(sctx, dst, dstx, dsty, width, height, render_condition_enabled,
1272 (sctx->gfx_level >= GFX10 || !vi_dcc_enabled(sdst, dst->u.tex.level))) {
1278 si_blitter_begin(sctx,
1280 util_blitter_clear_render_target(sctx->blitter, dst, color, dstx, dsty, width, height);
1281 si_blitter_end(sctx);
1289 struct si_context *sctx = (struct si_context *)ctx;
1293 if (si_try_normal_clear(sctx, dst, dstx, dsty, width, height, render_condition_enabled,
1297 si_blitter_begin(sctx,
1299 util_blitter_clear_depth_stencil(sctx->blitter, dst, clear_flags, depth, stencil, dstx, dsty,
1301 si_blitter_end(sctx);
1352 void si_init_clear_functions(struct si_context *sctx)
1354 sctx->b.clear_render_target = si_clear_render_target;
1355 sctx->b.clear_texture = si_clear_texture;
1357 if (sctx->has_graphics) {
1358 sctx->b.clear = si_clear;
1359 sctx->b.clear_depth_stencil = si_clear_depth_stencil;