Lines Matching defs:nv50

32 nv50_constbufs_validate(struct nv50_context *nv50)
34 struct nouveau_pushbuf *push = nv50->base.pushbuf;
48 while (nv50->constbuf_dirty[s]) {
49 const int i = ffs(nv50->constbuf_dirty[s]) - 1;
50 nv50->constbuf_dirty[s] &= ~(1 << i);
52 if (nv50->constbuf[s][i].user) {
55 unsigned words = nv50->constbuf[s][0].size / 4;
60 if (!nv50->state.uniform_buffer_bound[s]) {
61 nv50->state.uniform_buffer_bound[s] = TRUE;
77 PUSH_DATAp(push, &nv50->constbuf[s][0].u.data[start * 4], nr);
84 nv04_resource(nv50->constbuf[s][i].u.buf);
92 PUSH_DATAh(push, res->address + nv50->constbuf[s][i].offset);
93 PUSH_DATA (push, res->address + nv50->constbuf[s][i].offset);
95 (nv50->constbuf[s][i].size & 0xffff));
99 BCTX_REFN(nv50->bufctx_3d, CB(s, i), res, RD);
105 nv50->state.uniform_buffer_bound[s] = FALSE;
112 nv50_program_validate(struct nv50_context *nv50, struct nv50_program *prog)
116 prog, nv50->screen->base.device->chipset);
123 return nv50_program_upload_code(nv50, prog);
127 nv50_program_update_context_state(struct nv50_context *nv50,
133 if (nv50->state.new_tls_space)
134 nouveau_bufctx_reset(nv50->bufctx_3d, NV50_BIND_TLS);
135 if (!nv50->state.tls_required || nv50->state.new_tls_space)
136 BCTX_REFN_bo(nv50->bufctx_3d, TLS, flags, nv50->screen->tls_bo);
137 nv50->state.new_tls_space = FALSE;
138 nv50->state.tls_required |= 1 << stage;
140 if (nv50->state.tls_required == (1 << stage))
141 nouveau_bufctx_reset(nv50->bufctx_3d, NV50_BIND_TLS);
142 nv50->state.tls_required &= ~(1 << stage);
147 nv50_vertprog_validate(struct nv50_context *nv50)
149 struct nouveau_pushbuf *push = nv50->base.pushbuf;
150 struct nv50_program *vp = nv50->vertprog;
152 if (!nv50_program_validate(nv50, vp))
154 nv50_program_update_context_state(nv50, vp, 0);
168 nv50_fragprog_validate(struct nv50_context *nv50)
170 struct nouveau_pushbuf *push = nv50->base.pushbuf;
171 struct nv50_program *fp = nv50->fragprog;
173 if (!nv50_program_validate(nv50, fp))
175 nv50_program_update_context_state(nv50, fp, 1);
190 nv50_gmtyprog_validate(struct nv50_context *nv50)
192 struct nouveau_pushbuf *push = nv50->base.pushbuf;
193 struct nv50_program *gp = nv50->gmtyprog;
207 nv50->state.prim_size = gp->gp.prim_type; /* enum matches vertex count */
209 nv50_program_update_context_state(nv50, gp, 2);
215 nv50_sprite_coords_validate(struct nv50_context *nv50)
217 struct nouveau_pushbuf *push = nv50->base.pushbuf;
219 struct nv50_program *fp = nv50->fragprog;
221 unsigned m = (nv50->state.interpolant_ctrl >> 8) & 0xff;
223 if (!nv50->rast->pipe.point_quad_rasterization) {
224 if (nv50->state.point_sprite) {
229 nv50->state.point_sprite = FALSE;
233 nv50->state.point_sprite = TRUE;
245 if (!(nv50->rast->pipe.sprite_coord_enable & (1 << fp->in[i].si))) {
258 if (nv50->rast->pipe.sprite_coord_mode == PIPE_SPRITE_COORD_LOWER_LEFT)
272 nv50_validate_derived_rs(struct nv50_context *nv50)
274 struct nouveau_pushbuf *push = nv50->base.pushbuf;
277 nv50_sprite_coords_validate(nv50);
279 if (nv50->state.rasterizer_discard != nv50->rast->pipe.rasterizer_discard) {
280 nv50->state.rasterizer_discard = nv50->rast->pipe.rasterizer_discard;
282 PUSH_DATA (push, !nv50->rast->pipe.rasterizer_discard);
285 if (nv50->dirty & NV50_NEW_FRAGPROG)
287 psize = nv50->state.semantic_psize & ~NV50_3D_SEMANTIC_PTSZ_PTSZ_EN__MASK;
288 color = nv50->state.semantic_color & ~NV50_3D_SEMANTIC_COLOR_CLMP_EN;
290 if (nv50->rast->pipe.clamp_vertex_color)
293 if (color != nv50->state.semantic_color) {
294 nv50->state.semantic_color = color;
299 if (nv50->rast->pipe.point_size_per_vertex)
302 if (psize != nv50->state.semantic_psize) {
303 nv50->state.semantic_psize = psize;
337 nv50_fp_linkage_validate(struct nv50_context *nv50)
339 struct nouveau_pushbuf *push = nv50->base.pushbuf;
340 struct nv50_program *vp = nv50->gmtyprog ? nv50->gmtyprog : nv50->vertprog;
341 struct nv50_program *fp = nv50->fragprog;
352 if (!(nv50->dirty & (NV50_NEW_VERTPROG |
356 ffc = (nv50->state.semantic_color & NV50_3D_SEMANTIC_COLOR_FFC0_ID__MASK);
357 bfc = (nv50->state.semantic_color & NV50_3D_SEMANTIC_COLOR_BFC0_ID__MASK)
359 if (nv50->rast->pipe.light_twoside == ((ffc == bfc) ? 0 : 1))
368 memset(map, nv50->gmtyprog ? 0x80 : 0x40, sizeof(map));
382 if (nv50->rast->pipe.light_twoside) {
411 if (nv50->rast->pipe.point_size_per_vertex) {
416 if (nv50->rast->pipe.clamp_vertex_color)
446 if (unlikely(nv50->gmtyprog)) {
473 nv50->state.interpolant_ctrl = interp;
475 nv50->state.semantic_color = colors;
476 nv50->state.semantic_psize = psiz;
482 PUSH_DATA (push, nv50->gmtyprog ? 1 : 0);
521 nv50_gp_linkage_validate(struct nv50_context *nv50)
523 struct nouveau_pushbuf *push = nv50->base.pushbuf;
524 struct nv50_program *vp = nv50->vertprog;
525 struct nv50_program *gp = nv50->gmtyprog;
548 nv50_stream_output_validate(struct nv50_context *nv50)
550 struct nouveau_pushbuf *push = nv50->base.pushbuf;
556 so = nv50->gmtyprog ? nv50->gmtyprog->so : nv50->vertprog->so;
560 if (!so || !nv50->num_so_targets) {
561 if (nv50->screen->base.class_3d < NVA0_3D_CLASS) {
571 if (nv50->screen->base.class_3d < NVA0_3D_CLASS) {
577 if (nv50->screen->base.class_3d >= NVA0_3D_CLASS)
583 nouveau_bufctx_reset(nv50->bufctx_3d, NV50_BIND_SO);
585 for (i = 0; i < nv50->num_so_targets; ++i) {
586 struct nv50_so_target *targ = nv50_so_target(nv50->so_target[i]);
589 const unsigned n = nv50->screen->base.class_3d >= NVA0_3D_CLASS ? 4 : 3;
610 (so->stride[i] * nv50->state.prim_size);
613 BCTX_REFN(nv50->bufctx_3d, SO, buf, WR);