mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-28 01:00:25 +01:00
radeonsi: rename shader resource decompress masks to their true meaning
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
parent
da26de5ff7
commit
d8a577d96e
3 changed files with 28 additions and 28 deletions
|
|
@ -395,7 +395,7 @@ si_flush_depth_textures(struct si_context *sctx,
|
|||
struct si_textures_info *textures)
|
||||
{
|
||||
unsigned i;
|
||||
unsigned mask = textures->depth_texture_mask;
|
||||
unsigned mask = textures->needs_depth_decompress_mask;
|
||||
|
||||
while (mask) {
|
||||
struct pipe_sampler_view *view;
|
||||
|
|
@ -507,7 +507,7 @@ si_decompress_sampler_color_textures(struct si_context *sctx,
|
|||
struct si_textures_info *textures)
|
||||
{
|
||||
unsigned i;
|
||||
unsigned mask = textures->compressed_colortex_mask;
|
||||
unsigned mask = textures->needs_color_decompress_mask;
|
||||
|
||||
while (mask) {
|
||||
struct pipe_sampler_view *view;
|
||||
|
|
@ -530,7 +530,7 @@ si_decompress_image_color_textures(struct si_context *sctx,
|
|||
struct si_images_info *images)
|
||||
{
|
||||
unsigned i;
|
||||
unsigned mask = images->compressed_colortex_mask;
|
||||
unsigned mask = images->needs_color_decompress_mask;
|
||||
|
||||
while (mask) {
|
||||
const struct pipe_image_view *view;
|
||||
|
|
@ -664,13 +664,13 @@ static void si_decompress_textures(struct si_context *sctx, unsigned shader_mask
|
|||
while (mask) {
|
||||
unsigned i = u_bit_scan(&mask);
|
||||
|
||||
if (sctx->samplers[i].depth_texture_mask) {
|
||||
if (sctx->samplers[i].needs_depth_decompress_mask) {
|
||||
si_flush_depth_textures(sctx, &sctx->samplers[i]);
|
||||
}
|
||||
if (sctx->samplers[i].compressed_colortex_mask) {
|
||||
if (sctx->samplers[i].needs_color_decompress_mask) {
|
||||
si_decompress_sampler_color_textures(sctx, &sctx->samplers[i]);
|
||||
}
|
||||
if (sctx->images[i].compressed_colortex_mask) {
|
||||
if (sctx->images[i].needs_color_decompress_mask) {
|
||||
si_decompress_image_color_textures(sctx, &sctx->images[i]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -580,9 +580,9 @@ static void si_update_compressed_tex_shader_mask(struct si_context *sctx,
|
|||
struct si_textures_info *samplers = &sctx->samplers[shader];
|
||||
unsigned shader_bit = 1 << shader;
|
||||
|
||||
if (samplers->depth_texture_mask ||
|
||||
samplers->compressed_colortex_mask ||
|
||||
sctx->images[shader].compressed_colortex_mask)
|
||||
if (samplers->needs_depth_decompress_mask ||
|
||||
samplers->needs_color_decompress_mask ||
|
||||
sctx->images[shader].needs_color_decompress_mask)
|
||||
sctx->compressed_tex_shader_mask |= shader_bit;
|
||||
else
|
||||
sctx->compressed_tex_shader_mask &= ~shader_bit;
|
||||
|
|
@ -604,8 +604,8 @@ static void si_set_sampler_views(struct pipe_context *ctx,
|
|||
unsigned slot = start + i;
|
||||
|
||||
if (!views || !views[i]) {
|
||||
samplers->depth_texture_mask &= ~(1u << slot);
|
||||
samplers->compressed_colortex_mask &= ~(1u << slot);
|
||||
samplers->needs_depth_decompress_mask &= ~(1u << slot);
|
||||
samplers->needs_color_decompress_mask &= ~(1u << slot);
|
||||
si_set_sampler_view(sctx, shader, slot, NULL, false);
|
||||
continue;
|
||||
}
|
||||
|
|
@ -618,22 +618,22 @@ static void si_set_sampler_views(struct pipe_context *ctx,
|
|||
struct si_sampler_view *rview = (struct si_sampler_view *)views[i];
|
||||
|
||||
if (depth_needs_decompression(rtex, rview)) {
|
||||
samplers->depth_texture_mask |= 1u << slot;
|
||||
samplers->needs_depth_decompress_mask |= 1u << slot;
|
||||
} else {
|
||||
samplers->depth_texture_mask &= ~(1u << slot);
|
||||
samplers->needs_depth_decompress_mask &= ~(1u << slot);
|
||||
}
|
||||
if (color_needs_decompression(rtex)) {
|
||||
samplers->compressed_colortex_mask |= 1u << slot;
|
||||
samplers->needs_color_decompress_mask |= 1u << slot;
|
||||
} else {
|
||||
samplers->compressed_colortex_mask &= ~(1u << slot);
|
||||
samplers->needs_color_decompress_mask &= ~(1u << slot);
|
||||
}
|
||||
|
||||
if (rtex->dcc_offset &&
|
||||
p_atomic_read(&rtex->framebuffers_bound))
|
||||
sctx->need_check_render_feedback = true;
|
||||
} else {
|
||||
samplers->depth_texture_mask &= ~(1u << slot);
|
||||
samplers->compressed_colortex_mask &= ~(1u << slot);
|
||||
samplers->needs_depth_decompress_mask &= ~(1u << slot);
|
||||
samplers->needs_color_decompress_mask &= ~(1u << slot);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -653,9 +653,9 @@ si_samplers_update_compressed_colortex_mask(struct si_textures_info *samplers)
|
|||
struct r600_texture *rtex = (struct r600_texture *)res;
|
||||
|
||||
if (color_needs_decompression(rtex)) {
|
||||
samplers->compressed_colortex_mask |= 1u << i;
|
||||
samplers->needs_color_decompress_mask |= 1u << i;
|
||||
} else {
|
||||
samplers->compressed_colortex_mask &= ~(1u << i);
|
||||
samplers->needs_color_decompress_mask &= ~(1u << i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -702,7 +702,7 @@ si_disable_shader_image(struct si_context *ctx, unsigned shader, unsigned slot)
|
|||
unsigned desc_slot = si_get_image_slot(slot);
|
||||
|
||||
pipe_resource_reference(&images->views[slot].resource, NULL);
|
||||
images->compressed_colortex_mask &= ~(1 << slot);
|
||||
images->needs_color_decompress_mask &= ~(1 << slot);
|
||||
|
||||
memcpy(descs->list + desc_slot*8, null_image_descriptor, 8*4);
|
||||
images->enabled_mask &= ~(1u << slot);
|
||||
|
|
@ -756,7 +756,7 @@ static void si_set_shader_image(struct si_context *ctx,
|
|||
view->u.buf.size, desc);
|
||||
si_set_buf_desc_address(res, view->u.buf.offset, desc + 4);
|
||||
|
||||
images->compressed_colortex_mask &= ~(1 << slot);
|
||||
images->needs_color_decompress_mask &= ~(1 << slot);
|
||||
res->bind_history |= PIPE_BIND_SHADER_IMAGE;
|
||||
} else {
|
||||
static const unsigned char swizzle[4] = { 0, 1, 2, 3 };
|
||||
|
|
@ -782,9 +782,9 @@ static void si_set_shader_image(struct si_context *ctx,
|
|||
}
|
||||
|
||||
if (color_needs_decompression(tex)) {
|
||||
images->compressed_colortex_mask |= 1 << slot;
|
||||
images->needs_color_decompress_mask |= 1 << slot;
|
||||
} else {
|
||||
images->compressed_colortex_mask &= ~(1 << slot);
|
||||
images->needs_color_decompress_mask &= ~(1 << slot);
|
||||
}
|
||||
|
||||
if (uses_dcc &&
|
||||
|
|
@ -877,9 +877,9 @@ si_images_update_compressed_colortex_mask(struct si_images_info *images)
|
|||
struct r600_texture *rtex = (struct r600_texture *)res;
|
||||
|
||||
if (color_needs_decompression(rtex)) {
|
||||
images->compressed_colortex_mask |= 1 << i;
|
||||
images->needs_color_decompress_mask |= 1 << i;
|
||||
} else {
|
||||
images->compressed_colortex_mask &= ~(1 << i);
|
||||
images->needs_color_decompress_mask &= ~(1 << i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -153,13 +153,13 @@ struct si_cs_shader_state {
|
|||
|
||||
struct si_textures_info {
|
||||
struct si_sampler_views views;
|
||||
uint32_t depth_texture_mask; /* which textures are depth */
|
||||
uint32_t compressed_colortex_mask;
|
||||
uint32_t needs_depth_decompress_mask;
|
||||
uint32_t needs_color_decompress_mask;
|
||||
};
|
||||
|
||||
struct si_images_info {
|
||||
struct pipe_image_view views[SI_NUM_IMAGES];
|
||||
uint32_t compressed_colortex_mask;
|
||||
uint32_t needs_color_decompress_mask;
|
||||
unsigned enabled_mask;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue