mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-29 01:30:08 +01:00
nvfx: use common NOUVEAU_RESOURCE_FLAG_LINEAR define
This commit is contained in:
parent
0a3f0ff264
commit
3b3d2e53bc
8 changed files with 16 additions and 15 deletions
|
|
@ -17,7 +17,8 @@
|
|||
#define NV04_PFIFO_MAX_PACKET_LEN 2047
|
||||
#endif
|
||||
|
||||
#define NOUVEAU_RESOURCE_FLAG_LINEAR (PIPE_RESOURCE_FLAG_DRV_PRIV << 0)
|
||||
#define NOUVEAU_RESOURCE_FLAG_LINEAR (PIPE_RESOURCE_FLAG_DRV_PRIV << 0)
|
||||
#define NOUVEAU_RESOURCE_FLAG_DRV_PRIV (PIPE_RESOURCE_FLAG_DRV_PRIV << 1)
|
||||
|
||||
static INLINE uint32_t
|
||||
nouveau_screen_transfer_flags(unsigned pipe)
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ nv30_sampler_view_init(struct pipe_context *pipe,
|
|||
if(pt->height0 <= 1 || util_format_is_compressed(sv->base.format))
|
||||
sv->u.nv30.rect = -1;
|
||||
else
|
||||
sv->u.nv30.rect = !!(pt->flags & NVFX_RESOURCE_FLAG_LINEAR);
|
||||
sv->u.nv30.rect = !!(pt->flags & NOUVEAU_RESOURCE_FLAG_LINEAR);
|
||||
|
||||
sv->lod_offset = sv->base.u.tex.first_level - level;
|
||||
sv->max_lod_limit = sv->base.u.tex.last_level - level;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ nvfx_buffer_create(struct pipe_screen *pscreen,
|
|||
return NULL;
|
||||
|
||||
buffer->base.base = *template;
|
||||
buffer->base.base.flags |= NVFX_RESOURCE_FLAG_LINEAR;
|
||||
buffer->base.base.flags |= NOUVEAU_RESOURCE_FLAG_LINEAR;
|
||||
pipe_reference_init(&buffer->base.base.reference, 1);
|
||||
buffer->base.base.screen = pscreen;
|
||||
buffer->size = util_format_get_stride(template->format, template->width0);
|
||||
|
|
@ -56,7 +56,8 @@ nvfx_user_buffer_create(struct pipe_screen *pscreen,
|
|||
return NULL;
|
||||
|
||||
pipe_reference_init(&buffer->base.base.reference, 1);
|
||||
buffer->base.base.flags = NVFX_RESOURCE_FLAG_LINEAR | NVFX_RESOURCE_FLAG_USER;
|
||||
buffer->base.base.flags =
|
||||
NOUVEAU_RESOURCE_FLAG_LINEAR | NVFX_RESOURCE_FLAG_USER;
|
||||
buffer->base.base.screen = pscreen;
|
||||
buffer->base.base.format = PIPE_FORMAT_R8_UNORM;
|
||||
buffer->base.base.usage = PIPE_USAGE_IMMUTABLE;
|
||||
|
|
|
|||
|
|
@ -33,13 +33,13 @@ nvfx_miptree_choose_format(struct nvfx_miptree *mt)
|
|||
|| util_format_is_compressed(pt->format)
|
||||
|| no_swizzle
|
||||
)
|
||||
mt->base.base.flags |= NVFX_RESOURCE_FLAG_LINEAR;
|
||||
mt->base.base.flags |= NOUVEAU_RESOURCE_FLAG_LINEAR;
|
||||
|
||||
/* non compressed formats with uniform pitch must be linear, and vice versa */
|
||||
if(!util_format_is_s3tc(pt->format)
|
||||
&& (uniform_pitch || mt->base.base.flags & NVFX_RESOURCE_FLAG_LINEAR))
|
||||
&& (uniform_pitch || mt->base.base.flags & NOUVEAU_RESOURCE_FLAG_LINEAR))
|
||||
{
|
||||
mt->base.base.flags |= NVFX_RESOURCE_FLAG_LINEAR;
|
||||
mt->base.base.flags |= NOUVEAU_RESOURCE_FLAG_LINEAR;
|
||||
uniform_pitch = 1;
|
||||
}
|
||||
|
||||
|
|
@ -175,7 +175,7 @@ nvfx_miptree_from_handle(struct pipe_screen *pscreen, const struct pipe_resource
|
|||
unsigned stride;
|
||||
if(whandle->stride) {
|
||||
mt->linear_pitch = whandle->stride;
|
||||
mt->base.base.flags |= NVFX_RESOURCE_FLAG_LINEAR;
|
||||
mt->base.base.flags |= NOUVEAU_RESOURCE_FLAG_LINEAR;
|
||||
} else
|
||||
nvfx_miptree_choose_format(mt);
|
||||
|
||||
|
|
|
|||
|
|
@ -23,8 +23,7 @@ struct nvfx_resource *nvfx_resource(struct pipe_resource *resource)
|
|||
return (struct nvfx_resource *)resource;
|
||||
}
|
||||
|
||||
#define NVFX_RESOURCE_FLAG_LINEAR (PIPE_RESOURCE_FLAG_DRV_PRIV << 0)
|
||||
#define NVFX_RESOURCE_FLAG_USER (PIPE_RESOURCE_FLAG_DRV_PRIV << 1)
|
||||
#define NVFX_RESOURCE_FLAG_USER (NOUVEAU_RESOURCE_FLAG_DRV_PRIV << 0)
|
||||
|
||||
/* is resource mapped into the GPU's address space (i.e. VRAM or GART) ? */
|
||||
static INLINE boolean
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ static inline boolean
|
|||
nvfx_surface_linear_renderable(struct pipe_surface* surf)
|
||||
{
|
||||
/* TODO: precompute this in nvfx_surface creation */
|
||||
return (surf->texture->flags & NVFX_RESOURCE_FLAG_LINEAR)
|
||||
return (surf->texture->flags & NOUVEAU_RESOURCE_FLAG_LINEAR)
|
||||
&& !(((struct nvfx_surface*)surf)->offset & 63)
|
||||
&& !(((struct nvfx_surface*)surf)->pitch & 63);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ nvfx_region_init_for_surface(struct nv04_region* rgn, struct nvfx_surface* surf,
|
|||
rgn->bo = ((struct nvfx_resource*)surf->base.base.texture)->bo;
|
||||
rgn->offset = surf->offset;
|
||||
|
||||
if(surf->base.base.texture->flags & NVFX_RESOURCE_FLAG_LINEAR)
|
||||
if(surf->base.base.texture->flags & NOUVEAU_RESOURCE_FLAG_LINEAR)
|
||||
rgn->pitch = surf->pitch;
|
||||
else
|
||||
{
|
||||
|
|
@ -137,7 +137,7 @@ nvfx_region_init_for_subresource(struct nv04_region* rgn, struct pipe_resource*
|
|||
rgn->x = x;
|
||||
rgn->y = y;
|
||||
|
||||
if(pt->flags & NVFX_RESOURCE_FLAG_LINEAR)
|
||||
if(pt->flags & NOUVEAU_RESOURCE_FLAG_LINEAR)
|
||||
{
|
||||
rgn->pitch = nvfx_subresource_pitch(pt, level);
|
||||
rgn->z = 0;
|
||||
|
|
@ -438,7 +438,7 @@ nvfx_surface_create_temp(struct pipe_context* pipe, struct pipe_surface* surf)
|
|||
template.height0 = surf->height;
|
||||
template.depth0 = 1;
|
||||
template.nr_samples = surf->texture->nr_samples;
|
||||
template.flags = NVFX_RESOURCE_FLAG_LINEAR;
|
||||
template.flags = NOUVEAU_RESOURCE_FLAG_LINEAR;
|
||||
|
||||
assert(!ns->temp && !util_dirty_surface_is_dirty(&ns->base));
|
||||
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ nvfx_transfer_new(struct pipe_context *pipe,
|
|||
else
|
||||
{
|
||||
struct nvfx_staging_transfer* tx;
|
||||
boolean direct = !nvfx_resource_on_gpu(pt) && pt->flags & NVFX_RESOURCE_FLAG_LINEAR;
|
||||
boolean direct = !nvfx_resource_on_gpu(pt) && pt->flags & NOUVEAU_RESOURCE_FLAG_LINEAR;
|
||||
|
||||
tx = CALLOC_STRUCT(nvfx_staging_transfer);
|
||||
if(!tx)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue