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.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
Brian Paul
2017-12-07 15:00:49 -07:00
parent dde8309cde
commit 63b03dc924
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -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:
+1 -1
View File
@@ -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)