Home | History | Annotate | Download | only in nvc0

Lines Matching refs:nvc0

210 nvc0_validate_tic(struct nvc0_context *nvc0, int s)
213 struct nouveau_pushbuf *push = nvc0->base.pushbuf;
214 struct nouveau_bo *txc = nvc0->screen->txc;
219 for (i = 0; i < nvc0->num_textures[s]; ++i) {
220 struct nv50_tic_entry *tic = nv50_tic_entry(nvc0->textures[s][i]);
222 const boolean dirty = !!(nvc0->textures_dirty[s] & (1 << i));
232 tic->id = nvc0_screen_tic_alloc(nvc0->screen, tic);
252 nvc0->screen->tic.lock[tic->id / 32] |= 1 << (tic->id % 32);
261 BCTX_REFN(nvc0->bufctx_3d, TEX(s, i), res, RD);
263 for (; i < nvc0->state.num_textures[s]; ++i)
266 nvc0->state.num_textures[s] = nvc0->num_textures[s];
272 nvc0->textures_dirty[s] = 0;
278 nve4_validate_tic(struct nvc0_context *nvc0, unsigned s)
280 struct nouveau_bo *txc = nvc0->screen->txc;
281 struct nouveau_pushbuf *push = nvc0->base.pushbuf;
285 for (i = 0; i < nvc0->num_textures[s]; ++i) {
286 struct nv50_tic_entry *tic = nv50_tic_entry(nvc0->textures[s][i]);
288 const boolean dirty = !!(nvc0->textures_dirty[s] & (1 << i));
291 nvc0->tex_handles[s][i] |= NVE4_TIC_ENTRY_INVALID;
297 tic->id = nvc0_screen_tic_alloc(nvc0->screen, tic);
316 nvc0->screen->tic.lock[tic->id / 32] |= 1 << (tic->id % 32);
321 nvc0->tex_handles[s][i] &= ~NVE4_TIC_ENTRY_INVALID;
322 nvc0->tex_handles[s][i] |= tic->id;
324 BCTX_REFN(nvc0->bufctx_3d, TEX(s, i), res, RD);
326 for (; i < nvc0->state.num_textures[s]; ++i)
327 nvc0->tex_handles[s][i] |= NVE4_TIC_ENTRY_INVALID;
329 nvc0->state.num_textures[s] = nvc0->num_textures[s];
334 void nvc0_validate_textures(struct nvc0_context *nvc0)
338 if (nvc0->screen->base.class_3d >= NVE4_3D_CLASS) {
339 need_flush = nve4_validate_tic(nvc0, 0);
340 need_flush |= nve4_validate_tic(nvc0, 3);
341 need_flush |= nve4_validate_tic(nvc0, 4);
343 need_flush = nvc0_validate_tic(nvc0, 0);
344 need_flush |= nvc0_validate_tic(nvc0, 3);
345 need_flush |= nvc0_validate_tic(nvc0, 4);
349 BEGIN_NVC0(nvc0->base.pushbuf, NVC0_3D(TIC_FLUSH), 1);
350 PUSH_DATA (nvc0->base.pushbuf, 0);
355 nvc0_validate_tsc(struct nvc0_context *nvc0, int s)
358 struct nouveau_pushbuf *push = nvc0->base.pushbuf;
363 for (i = 0; i < nvc0->num_samplers[s]; ++i) {
364 struct nv50_tsc_entry *tsc = nv50_tsc_entry(nvc0->samplers[s][i]);
366 if (!(nvc0->samplers_dirty[s] & (1 << i)))
373 tsc->id = nvc0_screen_tsc_alloc(nvc0->screen, tsc);
375 nvc0_m2mf_push_linear(&nvc0->base, nvc0->screen->txc,
380 nvc0->screen->tsc.lock[tsc->id / 32] |= 1 << (tsc->id % 32);
384 for (; i < nvc0->state.num_samplers[s]; ++i)
387 nvc0->state.num_samplers[s] = nvc0->num_samplers[s];
393 nvc0->samplers_dirty[s] = 0;
399 nve4_validate_tsc(struct nvc0_context *nvc0, int s)
401 struct nouveau_bo *txc = nvc0->screen->txc;
402 struct nouveau_pushbuf *push = nvc0->base.pushbuf;
406 for (i = 0; i < nvc0->num_samplers[s]; ++i) {
407 struct nv50_tsc_entry *tsc = nv50_tsc_entry(nvc0->samplers[s][i]);
410 nvc0->tex_handles[s][i] |= NVE4_TSC_ENTRY_INVALID;
414 tsc->id = nvc0_screen_tsc_alloc(nvc0->screen, tsc);
429 nvc0->screen->tsc.lock[tsc->id / 32] |= 1 << (tsc->id % 32);
431 nvc0->tex_handles[s][i] &= ~NVE4_TSC_ENTRY_INVALID;
432 nvc0->tex_handles[s][i] |= tsc->id << 20;
434 for (; i < nvc0->state.num_samplers[s]; ++i)
435 nvc0->tex_handles[s][i] |= NVE4_TSC_ENTRY_INVALID;
437 nvc0->state.num_samplers[s] = nvc0->num_samplers[s];
442 void nvc0_validate_samplers(struct nvc0_context *nvc0)
446 if (nvc0->screen->base.class_3d >= NVE4_3D_CLASS) {
447 need_flush = nve4_validate_tsc(nvc0, 0);
448 need_flush |= nve4_validate_tsc(nvc0, 3);
449 need_flush |= nve4_validate_tsc(nvc0, 4);
451 need_flush = nvc0_validate_tsc(nvc0, 0);
452 need_flush |= nvc0_validate_tsc(nvc0, 3);
453 need_flush |= nvc0_validate_tsc(nvc0, 4);
457 BEGIN_NVC0(nvc0->base.pushbuf, NVC0_3D(TSC_FLUSH), 1);
458 PUSH_DATA (nvc0->base.pushbuf, 0);
467 nve4_set_tex_handles(struct nvc0_context *nvc0)
469 struct nouveau_pushbuf *push = nvc0->base.pushbuf;
473 if (nvc0->screen->base.class_3d < NVE4_3D_CLASS)
475 address = nvc0->screen->uniform_bo->offset + (5 << 16);
478 uint32_t dirty = nvc0->textures_dirty[s] | nvc0->samplers_dirty[s];
491 PUSH_DATA (push, nvc0->tex_handles[s][i]);
494 nvc0->textures_dirty[s] = 0;
495 nvc0->samplers_dirty[s] = 0;