Re: [Mesa-dev] [PATCH 2/2] gallium/util: don't pass a pipe_resource to util_resource_is_array_texture()
Reviewed-by: Marek OlšákMarek On Thu, Dec 7, 2017 at 11:25 PM, Brian Paul wrote: > No need to pass a pipe_resource when we can just pass the target. > This makes the function potentially more usable. Rename it too. > --- > src/gallium/auxiliary/util/u_resource.h | 6 +++--- > src/gallium/drivers/radeon/r600_texture.c | 2 +- > 2 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/src/gallium/auxiliary/util/u_resource.h > b/src/gallium/auxiliary/util/u_resource.h > index 6736476..3c6194b 100644 > --- a/src/gallium/auxiliary/util/u_resource.h > +++ b/src/gallium/auxiliary/util/u_resource.h > @@ -32,14 +32,14 @@ unsigned > util_resource_size(const struct pipe_resource *res); > > /** > - * Return true if the resource is an array texture. > + * Return true if the texture target is an array type. > * > * Note that this function returns true for single-layered array textures. > */ > static inline boolean > -util_resource_is_array_texture(const struct pipe_resource *res) > +util_texture_is_array(enum pipe_texture_target target) > { > - switch (res->target) { > + switch (target) { > case PIPE_TEXTURE_1D_ARRAY: > case PIPE_TEXTURE_2D_ARRAY: > case PIPE_TEXTURE_CUBE_ARRAY: > diff --git a/src/gallium/drivers/radeon/r600_texture.c > b/src/gallium/drivers/radeon/r600_texture.c > index cb69398..66d4f02 100644 > --- a/src/gallium/drivers/radeon/r600_texture.c > +++ b/src/gallium/drivers/radeon/r600_texture.c > @@ -582,7 +582,7 @@ static void si_query_opaque_metadata(struct si_screen > *sscreen, > PIPE_SWIZZLE_W > }; > uint32_t desc[8], i; > - bool is_array = util_resource_is_array_texture(res); > + bool is_array = util_texture_is_array(res->target); > > /* DRM 2.x.x doesn't support this. */ > if (sscreen->info.drm_major != 3) > -- > 1.9.1 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 2/2] gallium/util: don't pass a pipe_resource to util_resource_is_array_texture()
Series looks good. Reviewed-by: Charmaine LeeFrom: Brian Paul Sent: Thursday, December 7, 2017 2:25:05 PM To: mesa-dev@lists.freedesktop.org Cc: Charmaine Lee; Neha Bhende; Roland Scheidegger Subject: [PATCH 2/2] gallium/util: don't pass a pipe_resource to util_resource_is_array_texture() No need to pass a pipe_resource when we can just pass the target. This makes the function potentially more usable. Rename it too. --- src/gallium/auxiliary/util/u_resource.h | 6 +++--- src/gallium/drivers/radeon/r600_texture.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gallium/auxiliary/util/u_resource.h b/src/gallium/auxiliary/util/u_resource.h index 6736476..3c6194b 100644 --- a/src/gallium/auxiliary/util/u_resource.h +++ b/src/gallium/auxiliary/util/u_resource.h @@ -32,14 +32,14 @@ unsigned util_resource_size(const struct pipe_resource *res); /** - * Return true if the resource is an array texture. + * Return true if the texture target is an array type. * * Note that this function returns true for single-layered array textures. */ static inline boolean -util_resource_is_array_texture(const struct pipe_resource *res) +util_texture_is_array(enum pipe_texture_target target) { - switch (res->target) { + switch (target) { case PIPE_TEXTURE_1D_ARRAY: case PIPE_TEXTURE_2D_ARRAY: case PIPE_TEXTURE_CUBE_ARRAY: diff --git a/src/gallium/drivers/radeon/r600_texture.c b/src/gallium/drivers/radeon/r600_texture.c index cb69398..66d4f02 100644 --- a/src/gallium/drivers/radeon/r600_texture.c +++ b/src/gallium/drivers/radeon/r600_texture.c @@ -582,7 +582,7 @@ static void si_query_opaque_metadata(struct si_screen *sscreen, PIPE_SWIZZLE_W }; uint32_t desc[8], i; - bool is_array = util_resource_is_array_texture(res); + bool is_array = util_texture_is_array(res->target); /* DRM 2.x.x doesn't support this. */ if (sscreen->info.drm_major != 3) -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 2/2] gallium/util: don't pass a pipe_resource to util_resource_is_array_texture()
For the series: Reviewed-by: Roland ScheideggerAm 07.12.2017 um 23:25 schrieb Brian Paul: > No need to pass a pipe_resource when we can just pass the target. > This makes the function potentially more usable. Rename it too. > --- > src/gallium/auxiliary/util/u_resource.h | 6 +++--- > src/gallium/drivers/radeon/r600_texture.c | 2 +- > 2 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/src/gallium/auxiliary/util/u_resource.h > b/src/gallium/auxiliary/util/u_resource.h > index 6736476..3c6194b 100644 > --- a/src/gallium/auxiliary/util/u_resource.h > +++ b/src/gallium/auxiliary/util/u_resource.h > @@ -32,14 +32,14 @@ unsigned > util_resource_size(const struct pipe_resource *res); > > /** > - * Return true if the resource is an array texture. > + * Return true if the texture target is an array type. > * > * Note that this function returns true for single-layered array textures. > */ > static inline boolean > -util_resource_is_array_texture(const struct pipe_resource *res) > +util_texture_is_array(enum pipe_texture_target target) > { > - switch (res->target) { > + switch (target) { > case PIPE_TEXTURE_1D_ARRAY: > case PIPE_TEXTURE_2D_ARRAY: > case PIPE_TEXTURE_CUBE_ARRAY: > diff --git a/src/gallium/drivers/radeon/r600_texture.c > b/src/gallium/drivers/radeon/r600_texture.c > index cb69398..66d4f02 100644 > --- a/src/gallium/drivers/radeon/r600_texture.c > +++ b/src/gallium/drivers/radeon/r600_texture.c > @@ -582,7 +582,7 @@ static void si_query_opaque_metadata(struct si_screen > *sscreen, > PIPE_SWIZZLE_W > }; > uint32_t desc[8], i; > - bool is_array = util_resource_is_array_texture(res); > + bool is_array = util_texture_is_array(res->target); > > /* DRM 2.x.x doesn't support this. */ > if (sscreen->info.drm_major != 3) > ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev