Lines Matching refs:fragment
446 static void blending(context_t* c, pixel_t* fragment, pixel_t* fb);
473 void blending(context_t* c, pixel_t* fragment, pixel_t* fb)
475 rescale(fragment->c[0], fragment->s[0], fb->c[0], fb->s[0]);
476 rescale(fragment->c[1], fragment->s[1], fb->c[1], fb->s[1]);
477 rescale(fragment->c[2], fragment->s[2], fb->c[2], fb->s[2]);
478 rescale(fragment->c[3], fragment->s[3], fb->c[3], fb->s[3]);
481 blend_factor(c, &sf, c->state.blend.src, fragment, fb);
482 blend_factor(c, &df, c->state.blend.dst, fragment, fb);
484 fragment->c[1] =
485 gglMulAddx(fragment->c[1], sf.c[1], gglMulx(fb->c[1], df.c[1]));
486 fragment->c[2] =
487 gglMulAddx(fragment->c[2], sf.c[2], gglMulx(fb->c[2], df.c[2]));
488 fragment->c[3] =
489 gglMulAddx(fragment->c[3], sf.c[3], gglMulx(fb->c[3], df.c[3]));
492 blend_factor(c, &sf, c->state.blend.src_alpha, fragment, fb);
493 blend_factor(c, &df, c->state.blend.dst_alpha, fragment, fb);
496 fragment->c[0] =
497 gglMulAddx(fragment->c[0], sf.c[0], gglMulx(fb->c[0], df.c[0]));
500 if (fragment->c[0] >= (1LU<<fragment->s[0]))
501 fragment->c[0] = (1<<fragment->s[0])-1;
502 if (fragment->c[1] >= (1LU<<fragment->s[1]))
503 fragment->c[1] = (1<<fragment->s[1])-1;
504 if (fragment->c[2] >= (1LU<<fragment->s[2]))
505 fragment->c[2] = (1<<fragment->s[2])-1;
506 if (fragment->c[3] >= (1LU<<fragment->s[3]))
507 fragment->c[3] = (1<<fragment->s[3])-1;
677 pixel_t fragment;
689 fragment.s[1] = fragment.s[2] =
690 fragment.s[3] = fragment.s[0] = 8;
691 fragment.c[1] = r >> (GGL_COLOR_BITS-8);
692 fragment.c[2] = g >> (GGL_COLOR_BITS-8);
693 fragment.c[3] = b >> (GGL_COLOR_BITS-8);
694 fragment.c[0] = a >> (GGL_COLOR_BITS-8);
788 uint32_t& Cf = fragment.c[j];
790 uint8_t& sf = fragment.s[j];
836 fragment.c[0] = (int64_t(fragment.c[0]) * cf) >> 15;
842 GGLcolor alpha = (uint64_t(fragment.c[0]) *
843 ((1<<GGL_COLOR_BITS)-1)) / ((1<<fragment.s[0])-1);
873 fragment.s[1] = fragment.s[2] =
874 fragment.s[3] = fragment.s[0] = 8;
875 fragment.c[1] =
876 fragment.c[2] =
877 fragment.c[3] =
878 fragment.c[0] = 255 - (zz>>8);
890 uint32_t& c = fragment.c[i];
891 uint8_t& s = fragment.s[i];
904 blending( c, &fragment, &fb );
909 &(c->state.buffers.color), c, x, y, &fragment);