Lines Matching defs:blit
451 nv50_blitctx_make_vp(struct nv50_blitctx *blit)
467 blit->vp.type = PIPE_SHADER_VERTEX;
468 blit->vp.translated = TRUE;
469 blit->vp.code = (uint32_t *)code; /* const_cast */
470 blit->vp.code_size = sizeof(code);
471 blit->vp.max_gpr = 4;
472 blit->vp.max_out = 5;
473 blit->vp.out_nr = 2;
474 blit->vp.out[0].mask = 0x3;
475 blit->vp.out[0].sn = TGSI_SEMANTIC_POSITION;
476 blit->vp.out[1].hw = 2;
477 blit->vp.out[1].mask = 0x7;
478 blit->vp.out[1].sn = TGSI_SEMANTIC_GENERIC;
479 blit->vp.vp.attrs[0] = 0x73;
480 blit->vp.vp.psiz = 0x40;
481 blit->vp.vp.edgeflag = 0x40;
485 nv50_blitctx_make_fp(struct nv50_blitctx *blit)
578 blit->fp.type = PIPE_SHADER_FRAGMENT;
579 blit->fp.translated = TRUE;
580 blit->fp.code = (uint32_t *)code; /* const_cast */
581 blit->fp.code_size = sizeof(code);
582 blit->fp.max_gpr = 5;
583 blit->fp.max_out = 4;
584 blit->fp.in_nr = 1;
585 blit->fp.in[0].mask = 0x7; /* last component flat */
586 blit->fp.in[0].linear = 1;
587 blit->fp.in[0].sn = TGSI_SEMANTIC_GENERIC;
588 blit->fp.out_nr = 1;
589 blit->fp.out[0].mask = 0xf;
590 blit->fp.out[0].sn = TGSI_SEMANTIC_COLOR;
591 blit->fp.fp.interp = 0x00020403;
592 blit->fp.gp.primid = 0x80;
596 nv50_blitctx_make_sampler(struct nv50_blitctx *blit)
600 blit->sampler[0].id = -1;
602 blit->sampler[0].tsc[0] = NV50_TSC_0_SRGB_CONVERSION_ALLOWED |
606 blit->sampler[0].tsc[1] =
611 blit->sampler[1].id = -1;
613 blit->sampler[1].tsc[0] = blit->sampler[0].tsc[0];
614 blit->sampler[1].tsc[1] =
638 nv50_blitctx_get_color_mask_and_fp(struct nv50_blitctx *blit,
641 blit->color_mask = 0;
646 blit->fp_offset = 0xb0;
648 blit->color_mask |= 0x0111;
650 blit->color_mask |= 0x1000;
653 blit->fp_offset = 0x18;
655 blit->color_mask |= 0x1110;
657 blit->color_mask |= 0x0001;
660 blit->fp_offset = 0;
661 if (mask & (PIPE_MASK_R | PIPE_MASK_Z)) blit->color_mask |= 0x0001;
662 if (mask & (PIPE_MASK_G | PIPE_MASK_S)) blit->color_mask |= 0x0010;
663 if (mask & PIPE_MASK_B) blit->color_mask |= 0x0100;
664 if (mask & PIPE_MASK_A) blit->color_mask |= 0x1000;
736 nv50_blitctx_prepare_state(struct nv50_blitctx *blit)
738 struct nouveau_pushbuf *push = blit->screen->base.pushbuf;
742 PUSH_DATA (push, blit->color_mask);
785 nv50_blitctx_pre_blit(struct nv50_blitctx *blit, struct nv50_context *nv50)
789 blit->saved.fb.width = nv50->framebuffer.width;
790 blit->saved.fb.height = nv50->framebuffer.height;
791 blit->saved.fb.nr_cbufs = nv50->framebuffer.nr_cbufs;
792 blit->saved.fb.cbufs[0] = nv50->framebuffer.cbufs[0];
793 blit->saved.fb.zsbuf = nv50->framebuffer.zsbuf;
795 blit->saved.vp = nv50->vertprog;
796 blit->saved.gp = nv50->gmtyprog;
797 blit->saved.fp = nv50->fragprog;
799 nv50->vertprog = &blit->vp;
801 nv50->fragprog = &blit->fp;
804 blit->saved.num_textures[s] = nv50->num_textures[s];
805 blit->saved.num_samplers[s] = nv50->num_samplers[s];
807 blit->saved.texture[0] = nv50->textures[2][0];
808 blit->saved.texture[1] = nv50->textures[2][1];
809 blit->saved.sampler[0] = nv50->samplers[2][0];
810 blit->saved.sampler[1] = nv50->samplers[2][1];
812 nv50->samplers[2][0] = &blit->sampler[blit->filter];
813 nv50->samplers[2][1] = &blit->sampler[blit->filter];
818 blit->saved.dirty = nv50->dirty;
827 nv50_blitctx_post_blit(struct nv50_context *nv50, struct nv50_blitctx *blit)
833 nv50->framebuffer.width = blit->saved.fb.width;
834 nv50->framebuffer.height = blit->saved.fb.height;
835 nv50->framebuffer.nr_cbufs = blit->saved.fb.nr_cbufs;
836 nv50->framebuffer.cbufs[0] = blit->saved.fb.cbufs[0];
837 nv50->framebuffer.zsbuf = blit->saved.fb.zsbuf;
839 nv50->vertprog = blit->saved.vp;
840 nv50->gmtyprog = blit->saved.gp;
841 nv50->fragprog = blit->saved.fp;
847 nv50->num_textures[s] = blit->saved.num_textures[s];
848 nv50->num_samplers[s] = blit->saved.num_samplers[s];
850 nv50->textures[2][0] = blit->saved.texture[0];
851 nv50->textures[2][1] = blit->saved.texture[1];
852 nv50->samplers[2][0] = blit->saved.sampler[0];
853 nv50->samplers[2][1] = blit->saved.sampler[1];
855 nv50->dirty = blit->saved.dirty |
868 struct nv50_blitctx *blit = screen->blitctx;
875 nv50_blitctx_get_color_mask_and_fp(blit, dst->format, info->mask);
877 blit->filter = util_format_is_depth_or_stencil(dst->format) ? 0 : 1;
879 nv50_blitctx_pre_blit(blit, nv50);
884 nv50_blitctx_prepare_state(blit);
910 blit->fp.code_base + blit->fp_offset);
956 nv50_blitctx_post_blit(nv50, blit);
964 NOUVEAU_ERR("failed to allocate blit context\n");