PUSH_DATA (push, 0);
/* bind a compute shader clobbers fragment shader state */
- nv50->dirty |= NV50_NEW_FRAGPROG;
+ nv50->dirty_3d |= NV50_NEW_FRAGPROG;
}
for (i = 0; i < nv50->framebuffer.nr_cbufs; ++i) {
if (nv50->framebuffer.cbufs[i] &&
nv50->framebuffer.cbufs[i]->texture == res) {
- nv50->dirty |= NV50_NEW_FRAMEBUFFER;
+ nv50->dirty_3d |= NV50_NEW_FRAMEBUFFER;
nouveau_bufctx_reset(nv50->bufctx_3d, NV50_BIND_FB);
if (!--ref)
return ref;
if (bind & PIPE_BIND_DEPTH_STENCIL) {
if (nv50->framebuffer.zsbuf &&
nv50->framebuffer.zsbuf->texture == res) {
- nv50->dirty |= NV50_NEW_FRAMEBUFFER;
+ nv50->dirty_3d |= NV50_NEW_FRAMEBUFFER;
nouveau_bufctx_reset(nv50->bufctx_3d, NV50_BIND_FB);
if (!--ref)
return ref;
assert(nv50->num_vtxbufs <= PIPE_MAX_ATTRIBS);
for (i = 0; i < nv50->num_vtxbufs; ++i) {
if (nv50->vtxbuf[i].buffer == res) {
- nv50->dirty |= NV50_NEW_ARRAYS;
+ nv50->dirty_3d |= NV50_NEW_ARRAYS;
nouveau_bufctx_reset(nv50->bufctx_3d, NV50_BIND_VERTEX);
if (!--ref)
return ref;
for (i = 0; i < nv50->num_textures[s]; ++i) {
if (nv50->textures[s][i] &&
nv50->textures[s][i]->texture == res) {
- nv50->dirty |= NV50_NEW_TEXTURES;
+ nv50->dirty_3d |= NV50_NEW_TEXTURES;
nouveau_bufctx_reset(nv50->bufctx_3d, NV50_BIND_TEXTURES);
if (!--ref)
return ref;
continue;
if (!nv50->constbuf[s][i].user &&
nv50->constbuf[s][i].u.buf == res) {
- nv50->dirty |= NV50_NEW_CONSTBUF;
+ nv50->dirty_3d |= NV50_NEW_CONSTBUF;
nv50->constbuf_dirty[s] |= 1 << i;
nouveau_bufctx_reset(nv50->bufctx_3d, NV50_BIND_CB(s, i));
if (!--ref)
struct nouveau_bufctx *bufctx;
struct nouveau_bufctx *bufctx_cp;
- uint32_t dirty;
+ uint32_t dirty_3d; /* dirty flags for 3d state */
uint32_t dirty_cp; /* dirty flags for compute state */
bool cb_dirty;
fp->fp.force_persample_interp = rast->force_persample_interp;
}
- if (fp->mem && !(nv50->dirty & (NV50_NEW_FRAGPROG | NV50_NEW_MIN_SAMPLES)))
+ if (fp->mem && !(nv50->dirty_3d & (NV50_NEW_FRAGPROG | NV50_NEW_MIN_SAMPLES)))
return;
if (!nv50_program_validate(nv50, fp))
PUSH_DATA (push, !nv50->rast->pipe.rasterizer_discard);
}
- if (nv50->dirty & NV50_NEW_FRAGPROG)
+ if (nv50->dirty_3d & NV50_NEW_FRAGPROG)
return;
psize = nv50->state.semantic_psize & ~NV50_3D_SEMANTIC_PTSZ_PTSZ_EN__MASK;
color = nv50->state.semantic_color & ~NV50_3D_SEMANTIC_COLOR_CLMP_EN;
uint8_t map[64];
uint8_t so_map[64];
- if (!(nv50->dirty & (NV50_NEW_VERTPROG |
- NV50_NEW_FRAGPROG |
- NV50_NEW_GMTYPROG))) {
+ if (!(nv50->dirty_3d & (NV50_NEW_VERTPROG |
+ NV50_NEW_FRAGPROG |
+ NV50_NEW_GMTYPROG))) {
uint8_t bfc, ffc;
ffc = (nv50->state.semantic_color & NV50_3D_SEMANTIC_COLOR_FFC0_ID__MASK);
bfc = (nv50->state.semantic_color & NV50_3D_SEMANTIC_COLOR_BFC0_ID__MASK)
struct nv50_context *nv50 = nv50_context(pipe);
nv50->blend = hwcso;
- nv50->dirty |= NV50_NEW_BLEND;
+ nv50->dirty_3d |= NV50_NEW_BLEND;
}
static void
struct nv50_context *nv50 = nv50_context(pipe);
nv50->rast = hwcso;
- nv50->dirty |= NV50_NEW_RASTERIZER;
+ nv50->dirty_3d |= NV50_NEW_RASTERIZER;
}
static void
struct nv50_context *nv50 = nv50_context(pipe);
nv50->zsa = hwcso;
- nv50->dirty |= NV50_NEW_ZSA;
+ nv50->dirty_3d |= NV50_NEW_ZSA;
}
static void
nv50->num_samplers[s] = nr;
- nv50->dirty |= NV50_NEW_SAMPLERS;
+ nv50->dirty_3d |= NV50_NEW_SAMPLERS;
}
static void
nouveau_bufctx_reset(nv50->bufctx_3d, NV50_BIND_TEXTURES);
- nv50->dirty |= NV50_NEW_TEXTURES;
+ nv50->dirty_3d |= NV50_NEW_TEXTURES;
}
static void
struct nv50_context *nv50 = nv50_context(pipe);
nv50->vertprog = hwcso;
- nv50->dirty |= NV50_NEW_VERTPROG;
+ nv50->dirty_3d |= NV50_NEW_VERTPROG;
}
static void *
struct nv50_context *nv50 = nv50_context(pipe);
nv50->fragprog = hwcso;
- nv50->dirty |= NV50_NEW_FRAGPROG;
+ nv50->dirty_3d |= NV50_NEW_FRAGPROG;
}
static void *
struct nv50_context *nv50 = nv50_context(pipe);
nv50->gmtyprog = hwcso;
- nv50->dirty |= NV50_NEW_GMTYPROG;
+ nv50->dirty_3d |= NV50_NEW_GMTYPROG;
}
static void *
}
nv50->constbuf_dirty[s] |= 1 << i;
- nv50->dirty |= NV50_NEW_CONSTBUF;
+ nv50->dirty_3d |= NV50_NEW_CONSTBUF;
}
/* =============================================================================
struct nv50_context *nv50 = nv50_context(pipe);
nv50->blend_colour = *bcol;
- nv50->dirty |= NV50_NEW_BLEND_COLOUR;
+ nv50->dirty_3d |= NV50_NEW_BLEND_COLOUR;
}
static void
struct nv50_context *nv50 = nv50_context(pipe);
nv50->stencil_ref = *sr;
- nv50->dirty |= NV50_NEW_STENCIL_REF;
+ nv50->dirty_3d |= NV50_NEW_STENCIL_REF;
}
static void
memcpy(nv50->clip.ucp, clip->ucp, sizeof(clip->ucp));
- nv50->dirty |= NV50_NEW_CLIP;
+ nv50->dirty_3d |= NV50_NEW_CLIP;
}
static void
struct nv50_context *nv50 = nv50_context(pipe);
nv50->sample_mask = sample_mask;
- nv50->dirty |= NV50_NEW_SAMPLE_MASK;
+ nv50->dirty_3d |= NV50_NEW_SAMPLE_MASK;
}
static void
if (nv50->min_samples != min_samples) {
nv50->min_samples = min_samples;
- nv50->dirty |= NV50_NEW_MIN_SAMPLES;
+ nv50->dirty_3d |= NV50_NEW_MIN_SAMPLES;
}
}
util_copy_framebuffer_state(&nv50->framebuffer, fb);
- nv50->dirty |= NV50_NEW_FRAMEBUFFER;
+ nv50->dirty_3d |= NV50_NEW_FRAMEBUFFER;
}
static void
struct nv50_context *nv50 = nv50_context(pipe);
nv50->stipple = *stipple;
- nv50->dirty |= NV50_NEW_STIPPLE;
+ nv50->dirty_3d |= NV50_NEW_STIPPLE;
}
static void
continue;
nv50->scissors[start_slot + i] = scissor[i];
nv50->scissors_dirty |= 1 << (start_slot + i);
- nv50->dirty |= NV50_NEW_SCISSOR;
+ nv50->dirty_3d |= NV50_NEW_SCISSOR;
}
}
continue;
nv50->viewports[start_slot + i] = vpt[i];
nv50->viewports_dirty |= 1 << (start_slot + i);
- nv50->dirty |= NV50_NEW_VIEWPORT;
+ nv50->dirty_3d |= NV50_NEW_VIEWPORT;
}
}
unsigned i;
nouveau_bufctx_reset(nv50->bufctx_3d, NV50_BIND_VERTEX);
- nv50->dirty |= NV50_NEW_ARRAYS;
+ nv50->dirty_3d |= NV50_NEW_ARRAYS;
util_set_vertex_buffers_count(nv50->vtxbuf, &nv50->num_vtxbufs, vb,
start_slot, count);
struct nv50_context *nv50 = nv50_context(pipe);
nv50->vertex = hwcso;
- nv50->dirty |= NV50_NEW_VERTEX;
+ nv50->dirty_3d |= NV50_NEW_VERTEX;
}
static struct pipe_stream_output_target *
nv50->num_so_targets = num_targets;
if (nv50->so_targets_dirty)
- nv50->dirty |= NV50_NEW_STRMOUT;
+ nv50->dirty_3d |= NV50_NEW_STRMOUT;
}
static void
#ifdef NV50_SCISSORS_CLIPPING
int minx, maxx, miny, maxy, i;
- if (!(nv50->dirty &
+ if (!(nv50->dirty_3d &
(NV50_NEW_SCISSOR | NV50_NEW_VIEWPORT | NV50_NEW_FRAMEBUFFER)) &&
nv50->state.scissor == nv50->rast->pipe.scissor)
return;
nv50->state.scissor = nv50->rast->pipe.scissor;
- if ((nv50->dirty & NV50_NEW_FRAMEBUFFER) && !nv50->state.scissor)
+ if ((nv50->dirty_3d & NV50_NEW_FRAMEBUFFER) && !nv50->state.scissor)
nv50->scissors_dirty = (1 << NV50_MAX_VIEWPORTS) - 1;
for (i = 0; i < NV50_MAX_VIEWPORTS; i++) {
vp->vp.clpd_nr = n;
if (likely(vp == nv50->vertprog)) {
- nv50->dirty |= NV50_NEW_VERTPROG;
+ nv50->dirty_3d |= NV50_NEW_VERTPROG;
nv50_vertprog_validate(nv50);
} else {
- nv50->dirty |= NV50_NEW_GMTYPROG;
+ nv50->dirty_3d |= NV50_NEW_GMTYPROG;
nv50_gmtyprog_validate(nv50);
}
nv50_fp_linkage_validate(nv50);
struct nv50_program *vp;
uint8_t clip_enable;
- if (nv50->dirty & NV50_NEW_CLIP) {
+ if (nv50->dirty_3d & NV50_NEW_CLIP) {
BEGIN_NV04(push, NV50_3D(CB_ADDR), 1);
PUSH_DATA (push, (NV50_CB_AUX_UCP_OFFSET << 8) | NV50_CB_AUX);
BEGIN_NI04(push, NV50_3D(CB_DATA(0)), PIPE_MAX_CLIP_PLANES * 4);
else
ctx_to->state = ctx_to->screen->save_state;
- ctx_to->dirty = ~0;
+ ctx_to->dirty_3d = ~0;
ctx_to->viewports_dirty = ~0;
ctx_to->scissors_dirty = ~0;
ctx_to->constbuf_dirty[2] = (1 << NV50_MAX_PIPE_CONSTBUFS) - 1;
if (!ctx_to->vertex)
- ctx_to->dirty &= ~(NV50_NEW_VERTEX | NV50_NEW_ARRAYS);
+ ctx_to->dirty_3d &= ~(NV50_NEW_VERTEX | NV50_NEW_ARRAYS);
if (!ctx_to->vertprog)
- ctx_to->dirty &= ~NV50_NEW_VERTPROG;
+ ctx_to->dirty_3d &= ~NV50_NEW_VERTPROG;
if (!ctx_to->fragprog)
- ctx_to->dirty &= ~NV50_NEW_FRAGPROG;
+ ctx_to->dirty_3d &= ~NV50_NEW_FRAGPROG;
if (!ctx_to->blend)
- ctx_to->dirty &= ~NV50_NEW_BLEND;
+ ctx_to->dirty_3d &= ~NV50_NEW_BLEND;
if (!ctx_to->rast)
#ifdef NV50_SCISSORS_CLIPPING
- ctx_to->dirty &= ~(NV50_NEW_RASTERIZER | NV50_NEW_SCISSOR);
+ ctx_to->dirty_3d &= ~(NV50_NEW_RASTERIZER | NV50_NEW_SCISSOR);
#else
- ctx_to->dirty &= ~NV50_NEW_RASTERIZER;
+ ctx_to->dirty_3d &= ~NV50_NEW_RASTERIZER;
#endif
if (!ctx_to->zsa)
- ctx_to->dirty &= ~NV50_NEW_ZSA;
+ ctx_to->dirty_3d &= ~NV50_NEW_ZSA;
ctx_to->screen->cur_ctx = ctx_to;
}
if (nv50->screen->cur_ctx != nv50)
nv50_switch_pipe_context(nv50);
- state_mask = nv50->dirty & mask;
+ state_mask = nv50->dirty_3d & mask;
if (state_mask) {
for (i = 0; i < ARRAY_SIZE(validate_list); ++i) {
if (state_mask & validate->states)
validate->func(nv50);
}
- nv50->dirty &= ~state_mask;
+ nv50->dirty_3d &= ~state_mask;
if (nv50->state.rt_serialize) {
nv50->state.rt_serialize = false;
BEGIN_NV04(push, NV50_3D(COND_MODE), 1);
PUSH_DATA (push, nv50->cond_condmode);
- nv50->dirty |= NV50_NEW_FRAMEBUFFER | NV50_NEW_SCISSOR;
+ nv50->dirty_3d |= NV50_NEW_FRAMEBUFFER | NV50_NEW_SCISSOR;
}
static void
BEGIN_NV04(push, NV50_3D(COND_MODE), 1);
PUSH_DATA (push, nv50->cond_condmode);
- nv50->dirty |= NV50_NEW_FRAMEBUFFER | NV50_NEW_SCISSOR;
+ nv50->dirty_3d |= NV50_NEW_FRAMEBUFFER | NV50_NEW_SCISSOR;
}
void
data, data_size);
}
- nv50->dirty |= NV50_NEW_FRAMEBUFFER | NV50_NEW_SCISSOR;
+ nv50->dirty_3d |= NV50_NEW_FRAMEBUFFER | NV50_NEW_SCISSOR;
}
/* =============================== BLIT CODE ===================================
struct pipe_sampler_view *texture[2];
struct nv50_tsc_entry *sampler[2];
unsigned min_samples;
- uint32_t dirty;
+ uint32_t dirty_3d;
} saved;
struct nv50_rasterizer_stateobj rast;
};
nv50->min_samples = 1;
- ctx->saved.dirty = nv50->dirty;
+ ctx->saved.dirty_3d = nv50->dirty_3d;
nouveau_bufctx_reset(nv50->bufctx_3d, NV50_BIND_FB);
nouveau_bufctx_reset(nv50->bufctx_3d, NV50_BIND_TEXTURES);
- nv50->dirty =
+ nv50->dirty_3d =
NV50_NEW_FRAMEBUFFER | NV50_NEW_MIN_SAMPLES |
NV50_NEW_VERTPROG | NV50_NEW_FRAGPROG | NV50_NEW_GMTYPROG |
NV50_NEW_TEXTURES | NV50_NEW_SAMPLERS;
nouveau_bufctx_reset(nv50->bufctx_3d, NV50_BIND_FB);
nouveau_bufctx_reset(nv50->bufctx_3d, NV50_BIND_TEXTURES);
- nv50->dirty = blit->saved.dirty |
+ nv50->dirty_3d = blit->saved.dirty_3d |
(NV50_NEW_FRAMEBUFFER | NV50_NEW_SCISSOR | NV50_NEW_SAMPLE_MASK |
NV50_NEW_RASTERIZER | NV50_NEW_ZSA | NV50_NEW_BLEND |
NV50_NEW_TEXTURES | NV50_NEW_SAMPLERS |
nv50->vbo_push_hint = /* the 64 is heuristic */
!(info->indexed && ((nv50->vb_elt_limit + 64) < info->count));
- if (nv50->vbo_user && !(nv50->dirty & (NV50_NEW_ARRAYS | NV50_NEW_VERTEX))) {
+ if (nv50->vbo_user && !(nv50->dirty_3d & (NV50_NEW_ARRAYS | NV50_NEW_VERTEX))) {
if (!!nv50->vbo_fifo != nv50->vbo_push_hint)
- nv50->dirty |= NV50_NEW_ARRAYS;
+ nv50->dirty_3d |= NV50_NEW_ARRAYS;
else
if (!nv50->vbo_fifo)
nv50_update_user_vbufs(nv50);