llvmpipe: Fix resource_is_texture.
It was missing PIPE_BIND_RENDER_TARGET, causing assertion failures for pure render targets. Also bind flags are too variable and complex for a good assessment for whether the resource is a texture or not. Target is more concise.
This commit is contained in:
@@ -55,14 +55,18 @@
|
|||||||
static INLINE boolean
|
static INLINE boolean
|
||||||
resource_is_texture(const struct pipe_resource *resource)
|
resource_is_texture(const struct pipe_resource *resource)
|
||||||
{
|
{
|
||||||
const unsigned tex_binds = (PIPE_BIND_DISPLAY_TARGET |
|
switch (resource->target) {
|
||||||
PIPE_BIND_SCANOUT |
|
case PIPE_BUFFER:
|
||||||
PIPE_BIND_SHARED |
|
return FALSE;
|
||||||
PIPE_BIND_DEPTH_STENCIL |
|
case PIPE_TEXTURE_1D:
|
||||||
PIPE_BIND_SAMPLER_VIEW);
|
case PIPE_TEXTURE_2D:
|
||||||
const struct llvmpipe_resource *lpr = llvmpipe_resource_const(resource);
|
case PIPE_TEXTURE_3D:
|
||||||
|
case PIPE_TEXTURE_CUBE:
|
||||||
return (lpr->base.bind & tex_binds) ? TRUE : FALSE;
|
return TRUE;
|
||||||
|
default:
|
||||||
|
assert(0);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user