summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2018-04-01 17:08:35 -0400
committerMarek Olšák <[email protected]>2018-04-05 15:34:58 -0400
commit50c7aa67565fee2c103ed6229ac599e8d23839d8 (patch)
treebc88c0247f54eeeaaf8c960aee22734cc1710ff0 /src
parente332ba61f40bc77d3104bd060bc7d1b18edd7e95 (diff)
radeonsi: use si_context instead of pipe_context in parameters pt3
Acked-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/radeon/r600_texture.c4
-rw-r--r--src/gallium/drivers/radeonsi/si_blit.c56
-rw-r--r--src/gallium/drivers/radeonsi/si_clear.c12
-rw-r--r--src/gallium/drivers/radeonsi/si_cp_dma.c4
-rw-r--r--src/gallium/drivers/radeonsi/si_descriptors.c4
-rw-r--r--src/gallium/drivers/radeonsi/si_pipe.h6
-rw-r--r--src/gallium/drivers/radeonsi/si_state.c2
7 files changed, 42 insertions, 46 deletions
diff --git a/src/gallium/drivers/radeon/r600_texture.c b/src/gallium/drivers/radeon/r600_texture.c
index 7b1dbb824bb..ce193ab518b 100644
--- a/src/gallium/drivers/radeon/r600_texture.c
+++ b/src/gallium/drivers/radeon/r600_texture.c
@@ -482,7 +482,7 @@ bool si_texture_disable_dcc(struct si_context *sctx,
mtx_lock(&sscreen->aux_context_lock);
/* Decompress DCC. */
- si_decompress_dcc(&sctx->b.b, rtex);
+ si_decompress_dcc(sctx, rtex);
sctx->b.b.flush(&sctx->b.b, NULL, 0);
if (&sctx->b.b == sscreen->aux_context)
@@ -1976,7 +1976,7 @@ void vi_disable_dcc_if_incompatible_format(struct si_context *sctx,
if (vi_dcc_formats_are_incompatible(tex, level, view_format))
if (!si_texture_disable_dcc(sctx, (struct r600_texture*)tex))
- si_decompress_dcc(&sctx->b.b, rtex);
+ si_decompress_dcc(sctx, rtex);
}
struct pipe_surface *si_create_surface_custom(struct pipe_context *pipe,
diff --git a/src/gallium/drivers/radeonsi/si_blit.c b/src/gallium/drivers/radeonsi/si_blit.c
index 44809197227..c92fb2d7dbe 100644
--- a/src/gallium/drivers/radeonsi/si_blit.c
+++ b/src/gallium/drivers/radeonsi/si_blit.c
@@ -42,10 +42,8 @@ enum {
SI_COLOR_RESOLVE = SI_SAVE_FRAMEBUFFER | SI_SAVE_FRAGMENT_STATE
};
-void si_blitter_begin(struct pipe_context *ctx, enum si_blitter_op op)
+void si_blitter_begin(struct si_context *sctx, enum si_blitter_op op)
{
- struct si_context *sctx = (struct si_context *)ctx;
-
util_blitter_save_vertex_shader(sctx->blitter, sctx->vs_shader.cso);
util_blitter_save_tessctrl_shader(sctx->blitter, sctx->tcs_shader.cso);
util_blitter_save_tesseval_shader(sctx->blitter, sctx->tes_shader.cso);
@@ -79,10 +77,8 @@ void si_blitter_begin(struct pipe_context *ctx, enum si_blitter_op op)
sctx->b.render_cond_force_off = true;
}
-void si_blitter_end(struct pipe_context *ctx)
+void si_blitter_end(struct si_context *sctx)
{
- struct si_context *sctx = (struct si_context *)ctx;
-
sctx->b.render_cond_force_off = false;
/* Restore shader pointers because the VS blit shader changed all
@@ -147,10 +143,10 @@ si_blit_dbcb_copy(struct si_context *sctx,
si_mark_atom_dirty(sctx, &sctx->db_render_state);
}
- si_blitter_begin(&sctx->b.b, SI_DECOMPRESS);
+ si_blitter_begin(sctx, SI_DECOMPRESS);
util_blitter_custom_depth_stencil(sctx->blitter, zsurf, cbsurf, 1 << sample,
sctx->custom_dsa_flush, 1.0f);
- si_blitter_end(&sctx->b.b);
+ si_blitter_end(sctx);
}
pipe_surface_reference(&zsurf, NULL);
@@ -236,11 +232,11 @@ si_blit_decompress_zs_planes_in_place(struct si_context *sctx,
zsurf = sctx->b.b.create_surface(&sctx->b.b, &texture->resource.b.b, &surf_tmpl);
- si_blitter_begin(&sctx->b.b, SI_DECOMPRESS);
+ si_blitter_begin(sctx, SI_DECOMPRESS);
util_blitter_custom_depth_stencil(sctx->blitter, zsurf, NULL, ~0,
sctx->custom_dsa_flush,
1.0f);
- si_blitter_end(&sctx->b.b);
+ si_blitter_end(sctx);
pipe_surface_reference(&zsurf, NULL);
}
@@ -442,13 +438,12 @@ si_decompress_sampler_depth_textures(struct si_context *sctx,
}
}
-static void si_blit_decompress_color(struct pipe_context *ctx,
+static void si_blit_decompress_color(struct si_context *sctx,
struct r600_texture *rtex,
unsigned first_level, unsigned last_level,
unsigned first_layer, unsigned last_layer,
bool need_dcc_decompress)
{
- struct si_context *sctx = (struct si_context *)ctx;
void* custom_blend;
unsigned layer, checked_last_layer, max_layer;
unsigned level_mask =
@@ -498,16 +493,16 @@ static void si_blit_decompress_color(struct pipe_context *ctx,
surf_tmpl.u.tex.level = level;
surf_tmpl.u.tex.first_layer = layer;
surf_tmpl.u.tex.last_layer = layer;
- cbsurf = ctx->create_surface(ctx, &rtex->resource.b.b, &surf_tmpl);
+ cbsurf = sctx->b.b.create_surface(&sctx->b.b, &rtex->resource.b.b, &surf_tmpl);
/* Required before and after FMASK and DCC_DECOMPRESS. */
if (custom_blend == sctx->custom_blend_fmask_decompress ||
custom_blend == sctx->custom_blend_dcc_decompress)
sctx->b.flags |= SI_CONTEXT_FLUSH_AND_INV_CB;
- si_blitter_begin(ctx, SI_DECOMPRESS);
+ si_blitter_begin(sctx, SI_DECOMPRESS);
util_blitter_custom_color(sctx->blitter, cbsurf, custom_blend);
- si_blitter_end(ctx);
+ si_blitter_end(sctx);
if (custom_blend == sctx->custom_blend_fmask_decompress ||
custom_blend == sctx->custom_blend_dcc_decompress)
@@ -536,7 +531,7 @@ si_decompress_color_texture(struct si_context *sctx, struct r600_texture *tex,
if (!tex->cmask.size && !tex->fmask.size && !tex->dcc_offset)
return;
- si_blit_decompress_color(&sctx->b.b, tex, first_level, last_level, 0,
+ si_blit_decompress_color(sctx, tex, first_level, last_level, 0,
util_max_layer(&tex->resource.b.b, first_level),
false);
}
@@ -868,7 +863,7 @@ static void si_decompress_subresource(struct pipe_context *ctx,
}
}
- si_blit_decompress_color(ctx, rtex, level, level,
+ si_blit_decompress_color(sctx, rtex, level, level,
first_layer, last_layer, false);
}
}
@@ -1054,12 +1049,12 @@ void si_resource_copy_region(struct pipe_context *ctx,
abs(src_box->depth), &dstbox);
/* Copy. */
- si_blitter_begin(ctx, SI_COPY);
+ si_blitter_begin(sctx, SI_COPY);
util_blitter_blit_generic(sctx->blitter, dst_view, &dstbox,
src_view, src_box, src_width0, src_height0,
PIPE_MASK_RGBAZS, PIPE_TEX_FILTER_NEAREST, NULL,
false);
- si_blitter_end(ctx);
+ si_blitter_end(sctx);
pipe_surface_reference(&dst_view, NULL);
pipe_sampler_view_reference(&src_view, NULL);
@@ -1074,13 +1069,13 @@ static void si_do_CB_resolve(struct si_context *sctx,
/* Required before and after CB_RESOLVE. */
sctx->b.flags |= SI_CONTEXT_FLUSH_AND_INV_CB;
- si_blitter_begin(&sctx->b.b, SI_COLOR_RESOLVE |
+ si_blitter_begin(sctx, SI_COLOR_RESOLVE |
(info->render_condition_enable ? 0 : SI_DISABLE_RENDER_COND));
util_blitter_custom_resolve_color(sctx->blitter, dst, dst_level, dst_z,
info->src.resource, info->src.box.z,
~0, sctx->custom_blend_resolve,
format);
- si_blitter_end(&sctx->b.b);
+ si_blitter_end(sctx);
/* Flush caches for possible texturing. */
si_make_CB_shader_coherent(sctx, 1, false);
@@ -1204,10 +1199,10 @@ resolve_to_temp:
blit.src.resource = tmp;
blit.src.box.z = 0;
- si_blitter_begin(ctx, SI_BLIT |
+ si_blitter_begin(sctx, SI_BLIT |
(info->render_condition_enable ? 0 : SI_DISABLE_RENDER_COND));
util_blitter_blit(sctx->blitter, &blit);
- si_blitter_end(ctx);
+ si_blitter_end(sctx);
pipe_resource_reference(&tmp, NULL);
return true;
@@ -1259,10 +1254,10 @@ static void si_blit(struct pipe_context *ctx,
util_try_blit_via_copy_region(ctx, info))
return;
- si_blitter_begin(ctx, SI_BLIT |
+ si_blitter_begin(sctx, SI_BLIT |
(info->render_condition_enable ? 0 : SI_DISABLE_RENDER_COND));
util_blitter_blit(sctx->blitter, info);
- si_blitter_end(ctx);
+ si_blitter_end(sctx);
}
static boolean si_generate_mipmap(struct pipe_context *ctx,
@@ -1291,11 +1286,11 @@ static boolean si_generate_mipmap(struct pipe_context *ctx,
sctx->generate_mipmap_for_depth = rtex->is_depth;
- si_blitter_begin(ctx, SI_BLIT | SI_DISABLE_RENDER_COND);
+ si_blitter_begin(sctx, SI_BLIT | SI_DISABLE_RENDER_COND);
util_blitter_generate_mipmap(sctx->blitter, tex, format,
base_level, last_level,
first_layer, last_layer);
- si_blitter_end(ctx);
+ si_blitter_end(sctx);
sctx->generate_mipmap_for_depth = false;
return true;
@@ -1304,6 +1299,7 @@ static boolean si_generate_mipmap(struct pipe_context *ctx,
static void si_flush_resource(struct pipe_context *ctx,
struct pipe_resource *res)
{
+ struct si_context *sctx = (struct si_context*)ctx;
struct r600_texture *rtex = (struct r600_texture*)res;
assert(res->target != PIPE_BUFFER);
@@ -1315,7 +1311,7 @@ static void si_flush_resource(struct pipe_context *ctx,
return;
if (!rtex->is_depth && (rtex->cmask.size || rtex->dcc_offset)) {
- si_blit_decompress_color(ctx, rtex, 0, res->last_level,
+ si_blit_decompress_color(sctx, rtex, 0, res->last_level,
0, util_max_layer(res, 0),
rtex->dcc_separate_buffer != NULL);
}
@@ -1327,12 +1323,12 @@ static void si_flush_resource(struct pipe_context *ctx,
}
}
-void si_decompress_dcc(struct pipe_context *ctx, struct r600_texture *rtex)
+void si_decompress_dcc(struct si_context *sctx, struct r600_texture *rtex)
{
if (!rtex->dcc_offset)
return;
- si_blit_decompress_color(ctx, rtex, 0, rtex->resource.b.b.last_level,
+ si_blit_decompress_color(sctx, rtex, 0, rtex->resource.b.b.last_level,
0, util_max_layer(&rtex->resource.b.b, 0),
true);
}
diff --git a/src/gallium/drivers/radeonsi/si_clear.c b/src/gallium/drivers/radeonsi/si_clear.c
index 8198ffb8812..403480cfb5f 100644
--- a/src/gallium/drivers/radeonsi/si_clear.c
+++ b/src/gallium/drivers/radeonsi/si_clear.c
@@ -605,11 +605,11 @@ static void si_clear(struct pipe_context *ctx, unsigned buffers,
}
}
- si_blitter_begin(ctx, SI_CLEAR);
+ si_blitter_begin(sctx, SI_CLEAR);
util_blitter_clear(sctx->blitter, fb->width, fb->height,
util_framebuffer_get_num_layers(fb),
buffers, color, depth, stencil);
- si_blitter_end(ctx);
+ si_blitter_end(sctx);
if (sctx->db_depth_clear) {
sctx->db_depth_clear = false;
@@ -635,11 +635,11 @@ static void si_clear_render_target(struct pipe_context *ctx,
{
struct si_context *sctx = (struct si_context *)ctx;
- si_blitter_begin(ctx, SI_CLEAR_SURFACE |
+ si_blitter_begin(sctx, SI_CLEAR_SURFACE |
(render_condition_enabled ? 0 : SI_DISABLE_RENDER_COND));
util_blitter_clear_render_target(sctx->blitter, dst, color,
dstx, dsty, width, height);
- si_blitter_end(ctx);
+ si_blitter_end(sctx);
}
static void si_clear_depth_stencil(struct pipe_context *ctx,
@@ -653,11 +653,11 @@ static void si_clear_depth_stencil(struct pipe_context *ctx,
{
struct si_context *sctx = (struct si_context *)ctx;
- si_blitter_begin(ctx, SI_CLEAR_SURFACE |
+ si_blitter_begin(sctx, SI_CLEAR_SURFACE |
(render_condition_enabled ? 0 : SI_DISABLE_RENDER_COND));
util_blitter_clear_depth_stencil(sctx->blitter, dst, clear_flags, depth, stencil,
dstx, dsty, width, height);
- si_blitter_end(ctx);
+ si_blitter_end(sctx);
}
static void si_clear_texture(struct pipe_context *pipe,
diff --git a/src/gallium/drivers/radeonsi/si_cp_dma.c b/src/gallium/drivers/radeonsi/si_cp_dma.c
index 17e15d13744..b82e0abc529 100644
--- a/src/gallium/drivers/radeonsi/si_cp_dma.c
+++ b/src/gallium/drivers/radeonsi/si_cp_dma.c
@@ -321,11 +321,11 @@ static void si_pipe_clear_buffer(struct pipe_context *ctx,
union pipe_color_union clear_value;
memcpy(&clear_value, clear_value_ptr, clear_value_size);
- si_blitter_begin(ctx, SI_DISABLE_RENDER_COND);
+ si_blitter_begin(sctx, SI_DISABLE_RENDER_COND);
util_blitter_clear_buffer(sctx->blitter, dst, offset,
size, clear_value_size / 4,
&clear_value);
- si_blitter_end(ctx);
+ si_blitter_end(sctx);
return;
}
}
diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c
index a8c6e2d38f2..d97fcb1d93b 100644
--- a/src/gallium/drivers/radeonsi/si_descriptors.c
+++ b/src/gallium/drivers/radeonsi/si_descriptors.c
@@ -443,7 +443,7 @@ static void si_set_sampler_view_desc(struct si_context *sctx,
if (unlikely(!is_buffer && sview->dcc_incompatible)) {
if (vi_dcc_enabled(rtex, view->u.tex.first_level))
if (!si_texture_disable_dcc(sctx, rtex))
- si_decompress_dcc(&sctx->b.b, rtex);
+ si_decompress_dcc(sctx, rtex);
sview->dcc_incompatible = false;
}
@@ -731,7 +731,7 @@ static void si_set_shader_image_desc(struct si_context *ctx,
* has been decompressed already.
*/
if (!si_texture_disable_dcc(ctx, tex))
- si_decompress_dcc(&ctx->b.b, tex);
+ si_decompress_dcc(ctx, tex);
}
if (ctx->b.chip_class >= GFX9) {
diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h
index 72330b9f779..7feec263c99 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.h
+++ b/src/gallium/drivers/radeonsi/si_pipe.h
@@ -651,8 +651,8 @@ enum si_blitter_op /* bitmask */
SI_DISABLE_RENDER_COND = 8,
};
-void si_blitter_begin(struct pipe_context *ctx, enum si_blitter_op op);
-void si_blitter_end(struct pipe_context *ctx);
+void si_blitter_begin(struct si_context *sctx, enum si_blitter_op op);
+void si_blitter_end(struct si_context *sctx);
void si_init_blit_functions(struct si_context *sctx);
void si_decompress_textures(struct si_context *sctx, unsigned shader_mask);
void si_resource_copy_region(struct pipe_context *ctx,
@@ -662,7 +662,7 @@ void si_resource_copy_region(struct pipe_context *ctx,
struct pipe_resource *src,
unsigned src_level,
const struct pipe_box *src_box);
-void si_decompress_dcc(struct pipe_context *ctx, struct r600_texture *rtex);
+void si_decompress_dcc(struct si_context *sctx, struct r600_texture *rtex);
void si_blit_decompress_depth(struct pipe_context *ctx,
struct r600_texture *texture,
struct r600_texture *staging,
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index acba6c6660b..26feb654a91 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -2758,7 +2758,7 @@ static void si_set_framebuffer_state(struct pipe_context *ctx,
if (vi_dcc_enabled(rtex, surf->base.u.tex.level))
if (!si_texture_disable_dcc(sctx, rtex))
- si_decompress_dcc(ctx, rtex);
+ si_decompress_dcc(sctx, rtex);
surf->dcc_incompatible = false;
}