[Mesa-dev] [PATCH 3/5] radeonsi: add new is_depth_texture() helper
Marek Olšák
maraeo at gmail.com
Mon Apr 10 15:12:33 UTC 2017
On Thu, Apr 6, 2017 at 12:07 AM, Samuel Pitoiset
<samuel.pitoiset at gmail.com> wrote:
> For bindless.
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
> src/gallium/drivers/radeonsi/si_descriptors.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c
> index 703a7cb1fa..524277462f 100644
> --- a/src/gallium/drivers/radeonsi/si_descriptors.c
> +++ b/src/gallium/drivers/radeonsi/si_descriptors.c
> @@ -559,6 +559,13 @@ static bool is_compressed_colortex(struct r600_texture *rtex)
> (rtex->dcc_offset && rtex->dirty_level_mask);
> }
>
> +static bool is_depth_texture(struct r600_texture *rtex,
> + struct si_sampler_view *sview)
Please rename this to depth_needs_decompression.
Similarly, is_compressed_colortex can be renamed to
color_needs_decompression, but you don't have to do that.
Thanks,
Marek
> +{
> + return rtex->db_compatible &&
> + (!rtex->tc_compatible_htile || sview->is_stencil_sampler);
> +}
> +
> static void si_update_compressed_tex_shader_mask(struct si_context *sctx,
> unsigned shader)
> {
> @@ -602,8 +609,7 @@ static void si_set_sampler_views(struct pipe_context *ctx,
> (struct r600_texture*)views[i]->texture;
> struct si_sampler_view *rview = (struct si_sampler_view *)views[i];
>
> - if (rtex->db_compatible &&
> - (!rtex->tc_compatible_htile || rview->is_stencil_sampler)) {
> + if (is_depth_texture(rtex, rview)) {
> samplers->depth_texture_mask |= 1u << slot;
> } else {
> samplers->depth_texture_mask &= ~(1u << slot);
> --
> 2.12.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list