Lines Matching refs:c
93 static void step_y__generic(context_t* c);
95 static void step_y__smooth(context_t* c);
96 static void step_y__tmu(context_t* c);
97 static void step_y__w(context_t* c);
99 static void scanline(context_t* c);
100 static void scanline_perspective(context_t* c);
101 static void scanline_perspective_single(context_t* c);
102 static void scanline_t32cb16blend(context_t* c);
103 static void scanline_t32cb16blend_dither(context_t* c);
104 static void scanline_t32cb16blend_srca(context_t* c);
105 static void scanline_t32cb16blend_clamp(context_t* c);
106 static void scanline_t32cb16blend_clamp_dither(context_t* c);
107 static void scanline_t32cb16blend_clamp_mod(context_t* c);
108 static void scanline_x32cb16blend_clamp_mod(context_t* c);
109 static void scanline_t32cb16blend_clamp_mod_dither(context_t* c);
110 static void scanline_x32cb16blend_clamp_mod_dither(context_t* c);
111 static void scanline_t32cb16(context_t* c);
112 static void scanline_t32cb16_dither(context_t* c);
113 static void scanline_t32cb16_clamp(context_t* c);
114 static void scanline_t32cb16_clamp_dither(context_t* c);
115 static void scanline_col32cb16blend(context_t* c);
116 static void scanline_t16cb16_clamp(context_t* c);
117 static void scanline_t16cb16blend_clamp_mod(context_t* c);
118 static void scanline_memcpy(context_t* c);
119 static void scanline_memset8(context_t* c);
120 static void scanline_memset16(context_t* c);
121 static void scanline_memset32(context_t* c);
122 static void scanline_noop(context_t* c);
123 static void scanline_set(context_t* c);
124 static void scanline_clear(context_t* c);
126 static void rect_generic(context_t* c, size_t yc);
127 static void rect_memcpy(context_t* c, size_t yc);
308 void ggl_init_scanline(context_t* c) in ggl_init_scanline() argument
310 c->init_y = init_y; in ggl_init_scanline()
311 c->step_y = step_y__generic; in ggl_init_scanline()
312 c->scanline = scanline; in ggl_init_scanline()
315 void ggl_uninit_scanline(context_t* c) in ggl_uninit_scanline() argument
317 if (c->state.buffers.coverage) in ggl_uninit_scanline()
318 free(c->state.buffers.coverage); in ggl_uninit_scanline()
320 if (c->scanline_as) in ggl_uninit_scanline()
321 c->scanline_as->decStrong(c); in ggl_uninit_scanline()
327 static void pick_scanline(context_t* c) in pick_scanline() argument
332 c->init_y = init_y; in pick_scanline()
333 c->step_y = step_y__generic; in pick_scanline()
334 c->scanline = scanline; in pick_scanline()
343 const uint32_t cb_format = GGL_READ_NEEDS(CB_FORMAT, c->state.needs.n); in pick_scanline()
344 if (GGL_READ_NEEDS(T_FORMAT, c->state.needs.t[0]) == cb_format) { in pick_scanline()
345 if (c->state.needs.match(noblend1to1)) { in pick_scanline()
350 &(c->formats[GGL_READ_NEEDS(T_FORMAT, c->state.needs.t[0])]); in pick_scanline()
358 c->scanline = scanline_memcpy; in pick_scanline()
359 c->init_y = init_y_noop; in pick_scanline()
365 if (c->state.needs.match(fill16noblend)) { in pick_scanline()
366 c->init_y = init_y_packed; in pick_scanline()
367 switch (c->formats[cb_format].size) { in pick_scanline()
368 case 1: c->scanline = scanline_memset8; return; in pick_scanline()
369 case 2: c->scanline = scanline_memset16; return; in pick_scanline()
370 case 4: c->scanline = scanline_memset32; return; in pick_scanline()
376 if (c->state.needs.match(shortcuts[i].filter)) { in pick_scanline()
377 c->scanline = shortcuts[i].scanline; in pick_scanline()
378 c->init_y = shortcuts[i].init_y; in pick_scanline()
385 c->state.needs.n, c->state.needs.p, in pick_scanline()
386 c->state.needs.t[0], c->state.needs.t[1]); in pick_scanline()
391 c->init_y = init_y; in pick_scanline()
392 c->step_y = step_y__generic; in pick_scanline()
397 const AssemblyKey<needs_t> key(c->state.needs); in pick_scanline()
401 sp<ScanlineAssembly> a = new ScanlineAssembly(c->state.needs, in pick_scanline()
415 bool err = assembler.scanline(c->state.needs, c) != 0; in pick_scanline()
422 c->scanline = scanline_noop; in pick_scanline()
423 c->init_y = init_y_noop; in pick_scanline()
424 c->step_y = step_y__nop; in pick_scanline()
431 if (c->scanline_as) { in pick_scanline()
432 c->scanline_as->decStrong(c); in pick_scanline()
436 c->scanline_as = assembly.get(); in pick_scanline()
437 c->scanline_as->incStrong(c); // hold on to assembly in pick_scanline()
438 c->scanline = (void(*)(context_t* c))assembly->base(); in pick_scanline()
441 c->scanline = scanline; in pick_scanline()
445 void ggl_pick_scanline(context_t* c) in ggl_pick_scanline() argument
447 pick_scanline(c); in ggl_pick_scanline()
448 if ((c->state.enables & GGL_ENABLE_W) && in ggl_pick_scanline()
449 (c->state.enables & GGL_ENABLE_TMUS)) in ggl_pick_scanline()
451 c->span = c->scanline; in ggl_pick_scanline()
452 c->scanline = scanline_perspective; in ggl_pick_scanline()
453 if (!(c->state.enabled_tmu & (c->state.enabled_tmu - 1))) { in ggl_pick_scanline()
455 c->scanline = scanline_perspective_single; in ggl_pick_scanline()
462 static void blending(context_t* c, pixel_t* fragment, pixel_t* fb);
463 static void blend_factor(context_t* c, pixel_t* r, uint32_t factor,
489 void blending(context_t* c, pixel_t* fragment, pixel_t* fb) in blending() argument
491 rescale(fragment->c[0], fragment->s[0], fb->c[0], fb->s[0]); in blending()
492 rescale(fragment->c[1], fragment->s[1], fb->c[1], fb->s[1]); in blending()
493 rescale(fragment->c[2], fragment->s[2], fb->c[2], fb->s[2]); in blending()
494 rescale(fragment->c[3], fragment->s[3], fb->c[3], fb->s[3]); in blending()
497 blend_factor(c, &sf, c->state.blend.src, fragment, fb); in blending()
498 blend_factor(c, &df, c->state.blend.dst, fragment, fb); in blending()
500 fragment->c[1] = in blending()
501 gglMulAddx(fragment->c[1], sf.c[1], gglMulx(fb->c[1], df.c[1])); in blending()
502 fragment->c[2] = in blending()
503 gglMulAddx(fragment->c[2], sf.c[2], gglMulx(fb->c[2], df.c[2])); in blending()
504 fragment->c[3] = in blending()
505 gglMulAddx(fragment->c[3], sf.c[3], gglMulx(fb->c[3], df.c[3])); in blending()
507 if (c->state.blend.alpha_separate) { in blending()
508 blend_factor(c, &sf, c->state.blend.src_alpha, fragment, fb); in blending()
509 blend_factor(c, &df, c->state.blend.dst_alpha, fragment, fb); in blending()
512 fragment->c[0] = in blending()
513 gglMulAddx(fragment->c[0], sf.c[0], gglMulx(fb->c[0], df.c[0])); in blending()
516 if (fragment->c[0] >= (1LU<<fragment->s[0])) in blending()
517 fragment->c[0] = (1<<fragment->s[0])-1; in blending()
518 if (fragment->c[1] >= (1LU<<fragment->s[1])) in blending()
519 fragment->c[1] = (1<<fragment->s[1])-1; in blending()
520 if (fragment->c[2] >= (1LU<<fragment->s[2])) in blending()
521 fragment->c[2] = (1<<fragment->s[2])-1; in blending()
522 if (fragment->c[3] >= (1LU<<fragment->s[3])) in blending()
523 fragment->c[3] = (1<<fragment->s[3])-1; in blending()
546 r->c[1] = in blend_factor()
547 r->c[2] = in blend_factor()
548 r->c[3] = in blend_factor()
549 r->c[0] = 0; in blend_factor()
552 r->c[1] = in blend_factor()
553 r->c[2] = in blend_factor()
554 r->c[3] = in blend_factor()
555 r->c[0] = FIXED_ONE; in blend_factor()
558 r->c[1] = blendfactor(dst->c[1], dst->s[1]); in blend_factor()
559 r->c[2] = blendfactor(dst->c[2], dst->s[2]); in blend_factor()
560 r->c[3] = blendfactor(dst->c[3], dst->s[3]); in blend_factor()
561 r->c[0] = blendfactor(dst->c[0], dst->s[0]); in blend_factor()
564 r->c[1] = blendfactor(src->c[1], src->s[1]); in blend_factor()
565 r->c[2] = blendfactor(src->c[2], src->s[2]); in blend_factor()
566 r->c[3] = blendfactor(src->c[3], src->s[3]); in blend_factor()
567 r->c[0] = blendfactor(src->c[0], src->s[0]); in blend_factor()
570 r->c[1] = FIXED_ONE - blendfactor(dst->c[1], dst->s[1]); in blend_factor()
571 r->c[2] = FIXED_ONE - blendfactor(dst->c[2], dst->s[2]); in blend_factor()
572 r->c[3] = FIXED_ONE - blendfactor(dst->c[3], dst->s[3]); in blend_factor()
573 r->c[0] = FIXED_ONE - blendfactor(dst->c[0], dst->s[0]); in blend_factor()
576 r->c[1] = FIXED_ONE - blendfactor(src->c[1], src->s[1]); in blend_factor()
577 r->c[2] = FIXED_ONE - blendfactor(src->c[2], src->s[2]); in blend_factor()
578 r->c[3] = FIXED_ONE - blendfactor(src->c[3], src->s[3]); in blend_factor()
579 r->c[0] = FIXED_ONE - blendfactor(src->c[0], src->s[0]); in blend_factor()
582 r->c[1] = in blend_factor()
583 r->c[2] = in blend_factor()
584 r->c[3] = in blend_factor()
585 r->c[0] = blendfactor(src->c[0], src->s[0], FIXED_ONE); in blend_factor()
588 r->c[1] = in blend_factor()
589 r->c[2] = in blend_factor()
590 r->c[3] = in blend_factor()
591 r->c[0] = FIXED_ONE - blendfactor(src->c[0], src->s[0], FIXED_ONE); in blend_factor()
594 r->c[1] = in blend_factor()
595 r->c[2] = in blend_factor()
596 r->c[3] = in blend_factor()
597 r->c[0] = blendfactor(dst->c[0], dst->s[0], FIXED_ONE); in blend_factor()
600 r->c[1] = in blend_factor()
601 r->c[2] = in blend_factor()
602 r->c[3] = in blend_factor()
603 r->c[0] = FIXED_ONE - blendfactor(dst->c[0], dst->s[0], FIXED_ONE); in blend_factor()
642 void scanline(context_t* c) in scanline() argument
644 const uint32_t enables = c->state.enables; in scanline()
645 const int xs = c->iterators.xl; in scanline()
646 const int x1 = c->iterators.xr; in scanline()
648 const int16_t* covPtr = c->state.buffers.coverage + xs; in scanline()
654 iterators_t& ci = c->iterators; in scanline()
656 r = (xs * c->shade.drdx) + ci.ydrdy; in scanline()
657 g = (xs * c->shade.dgdx) + ci.ydgdy; in scanline()
658 b = (xs * c->shade.dbdx) + ci.ydbdy; in scanline()
659 a = (xs * c->shade.dadx) + ci.ydady; in scanline()
660 r = ADJUST_COLOR_ITERATOR(r, c->shade.drdx, xc); in scanline()
661 g = ADJUST_COLOR_ITERATOR(g, c->shade.dgdx, xc); in scanline()
662 b = ADJUST_COLOR_ITERATOR(b, c->shade.dbdx, xc); in scanline()
663 a = ADJUST_COLOR_ITERATOR(a, c->shade.dadx, xc); in scanline()
672 GGLfixed z = (xs * c->shade.dzdx) + ci.ydzdy; in scanline()
673 GGLfixed f = (xs * c->shade.dfdx) + ci.ydfdy; in scanline()
680 if (c->state.texture[i].enable) { in scanline()
681 texture_iterators_t& ti = c->state.texture[i].iterators; in scanline()
698 uint32_t y = c->iterators.y; in scanline()
707 fragment.c[1] = r >> (GGL_COLOR_BITS-8); in scanline()
708 fragment.c[2] = g >> (GGL_COLOR_BITS-8); in scanline()
709 fragment.c[3] = b >> (GGL_COLOR_BITS-8); in scanline()
710 fragment.c[0] = a >> (GGL_COLOR_BITS-8); in scanline()
715 texture_t& tx = c->state.texture[i]; in scanline()
745 tx.surface.read(&tx.surface, c, u, v, &texel); in scanline()
779 tx.surface.read(&tx.surface, c, u0, v0, &texels[0]); in scanline()
780 tx.surface.read(&tx.surface, c, u0, v1, &texels[1]); in scanline()
781 tx.surface.read(&tx.surface, c, u1, v0, &texels[2]); in scanline()
782 tx.surface.read(&tx.surface, c, u1, v1, &texels[3]); in scanline()
795 texel.c[j] = texels[0].c[j]*mm[0] + in scanline()
796 texels[1].c[j]*mm[1] + in scanline()
797 texels[2].c[j]*mm[2] + in scanline()
798 texels[3].c[j]*mm[3] ; in scanline()
804 uint32_t& Cf = fragment.c[j]; in scanline()
805 uint32_t& Ct = texel.c[j]; in scanline()
808 uint32_t At = texel.c[0]; in scanline()
852 fragment.c[0] = (int64_t(fragment.c[0]) * cf) >> 15; in scanline()
857 GGLcolor ref = c->state.alpha_test.ref; in scanline()
858 GGLcolor alpha = (uint64_t(fragment.c[0]) * in scanline()
860 switch (c->state.alpha_test.func) { in scanline()
872 if (c->state.buffers.depth.format) { in scanline()
874 surface_t* cb = &(c->state.buffers.depth); in scanline()
878 switch (c->state.depth_test.func) { in scanline()
896 if (c->state.mask.depth) { in scanline()
905 GGLfixed fc = (c->state.fog.color[i] * 0x10000) / 0xFF; in scanline()
906 uint32_t& c = fragment.c[i]; in scanline() local
908 c = (c * 0x10000) / ((1<<s)-1); in scanline()
909 c = gglMulAddx(c, f, gglMulx(fc, 0x10000 - f)); in scanline()
916 fb.c[1] = fb.c[2] = fb.c[3] = fb.c[0] = 0; // placate valgrind in scanline()
918 c->state.buffers.color.read( in scanline()
919 &(c->state.buffers.color), c, x, y, &fb); in scanline()
920 blending( c, &fragment, &fb ); in scanline()
924 c->state.buffers.color.write( in scanline()
925 &(c->state.buffers.color), c, x, y, &fragment); in scanline()
932 r += c->shade.drdx; in scanline()
933 g += c->shade.dgdx; in scanline()
934 b += c->shade.dbdx; in scanline()
935 a += c->shade.dadx; in scanline()
937 z += c->shade.dzdx; in scanline()
938 f += c->shade.dfdx; in scanline()
961 horz_iterator32(context_t* c) { in horz_iterator32()
962 const int x = c->iterators.xl; in horz_iterator32()
963 const int y = c->iterators.y; in horz_iterator32()
964 texture_t& tx = c->state.texture[0]; in horz_iterator32()
978 horz_iterator16(context_t* c) { in horz_iterator16()
979 const int x = c->iterators.xl; in horz_iterator16()
980 const int y = c->iterators.y; in horz_iterator16()
981 texture_t& tx = c->state.texture[0]; in horz_iterator16()
998 clamp_iterator(context_t* c) { in clamp_iterator()
999 const int xs = c->iterators.xl; in clamp_iterator()
1000 texture_t& tx = c->state.texture[0]; in clamp_iterator()
1054 static int is_context_horizontal(const context_t* c) { in is_context_horizontal() argument
1055 return (c->state.texture[0].iterators.dtdx == 0); in is_context_horizontal()
1080 void init(const context_t* c, int shift);
1087 void horz_clamp_iterator::init(const context_t* c, int shift) in init() argument
1089 const int xs = c->iterators.xl; in init()
1090 const texture_t& tx = c->state.texture[0]; in init()
1108 horz_clamp_iterator16(const context_t* c) { in horz_clamp_iterator16()
1109 init(c,1); in horz_clamp_iterator16()
1114 horz_clamp_iterator32(context_t* c) { in horz_clamp_iterator32()
1115 init(c,2); in horz_clamp_iterator32()
1122 ditherer(const context_t* c) { in ditherer()
1123 const int x = c->iterators.xl; in ditherer()
1124 const int y = c->iterators.y; in ditherer()
1125 m_line = &c->ditherMatrix[ ((y & GGL_DITHER_MASK)<<GGL_DITHER_ORDER_SHIFT) ]; in ditherer()
1250 void init(const context_t* c) { in init()
1251 const int r = c->iterators.ydrdy >> (GGL_COLOR_BITS-8); in init()
1252 const int g = c->iterators.ydgdy >> (GGL_COLOR_BITS-8); in init()
1253 const int b = c->iterators.ydbdy >> (GGL_COLOR_BITS-8); in init()
1254 const int a = c->iterators.ydady >> (GGL_COLOR_BITS-8); in init()
1267 blender_32to16_modulate(const context_t* c) { in blender_32to16_modulate()
1268 init(c); in blender_32to16_modulate()
1339 blender_x32to16_modulate(const context_t* c) { in blender_x32to16_modulate()
1340 init(c); in blender_x32to16_modulate()
1394 blender_16to16_modulate(const context_t* c) { in blender_16to16_modulate()
1395 init(c); in blender_16to16_modulate()
1430 dst_iterator16(const context_t* c) { in dst_iterator16()
1431 const int x = c->iterators.xl; in dst_iterator16()
1432 const int width = c->iterators.xr - x; in dst_iterator16()
1433 const int32_t y = c->iterators.y; in dst_iterator16()
1434 const surface_t* cb = &(c->state.buffers.color); in dst_iterator16()
1443 static void scanline_t32cb16_clamp(context_t* c) in scanline_t32cb16_clamp() argument
1445 dst_iterator16 di(c); in scanline_t32cb16_clamp()
1447 if (is_context_horizontal(c)) { in scanline_t32cb16_clamp()
1449 horz_clamp_iterator32 ci(c); in scanline_t32cb16_clamp()
1456 clamp_iterator ci(c); in scanline_t32cb16_clamp()
1464 static void scanline_t32cb16_dither(context_t* c) in scanline_t32cb16_dither() argument
1466 horz_iterator32 si(c); in scanline_t32cb16_dither()
1467 dst_iterator16 di(c); in scanline_t32cb16_dither()
1468 ditherer dither(c); in scanline_t32cb16_dither()
1476 static void scanline_t32cb16_clamp_dither(context_t* c) in scanline_t32cb16_clamp_dither() argument
1478 dst_iterator16 di(c); in scanline_t32cb16_clamp_dither()
1479 ditherer dither(c); in scanline_t32cb16_clamp_dither()
1481 if (is_context_horizontal(c)) { in scanline_t32cb16_clamp_dither()
1483 horz_clamp_iterator32 ci(c); in scanline_t32cb16_clamp_dither()
1490 clamp_iterator ci(c); in scanline_t32cb16_clamp_dither()
1498 static void scanline_t32cb16blend_dither(context_t* c) in scanline_t32cb16blend_dither() argument
1500 dst_iterator16 di(c); in scanline_t32cb16blend_dither()
1501 ditherer dither(c); in scanline_t32cb16blend_dither()
1502 blender_32to16 bl(c); in scanline_t32cb16blend_dither()
1503 horz_iterator32 hi(c); in scanline_t32cb16blend_dither()
1511 static void scanline_t32cb16blend_clamp(context_t* c) in scanline_t32cb16blend_clamp() argument
1513 dst_iterator16 di(c); in scanline_t32cb16blend_clamp()
1514 blender_32to16 bl(c); in scanline_t32cb16blend_clamp()
1516 if (is_context_horizontal(c)) { in scanline_t32cb16blend_clamp()
1517 horz_clamp_iterator32 ci(c); in scanline_t32cb16blend_clamp()
1524 clamp_iterator ci(c); in scanline_t32cb16blend_clamp()
1533 static void scanline_t32cb16blend_clamp_dither(context_t* c) in scanline_t32cb16blend_clamp_dither() argument
1535 dst_iterator16 di(c); in scanline_t32cb16blend_clamp_dither()
1536 ditherer dither(c); in scanline_t32cb16blend_clamp_dither()
1537 blender_32to16 bl(c); in scanline_t32cb16blend_clamp_dither()
1539 clamp_iterator ci(c); in scanline_t32cb16blend_clamp_dither()
1547 void scanline_t32cb16blend_clamp_mod(context_t* c) in scanline_t32cb16blend_clamp_mod() argument
1549 dst_iterator16 di(c); in scanline_t32cb16blend_clamp_mod()
1550 blender_32to16_modulate bl(c); in scanline_t32cb16blend_clamp_mod()
1552 clamp_iterator ci(c); in scanline_t32cb16blend_clamp_mod()
1560 void scanline_t32cb16blend_clamp_mod_dither(context_t* c) in scanline_t32cb16blend_clamp_mod_dither() argument
1562 dst_iterator16 di(c); in scanline_t32cb16blend_clamp_mod_dither()
1563 blender_32to16_modulate bl(c); in scanline_t32cb16blend_clamp_mod_dither()
1564 ditherer dither(c); in scanline_t32cb16blend_clamp_mod_dither()
1566 clamp_iterator ci(c); in scanline_t32cb16blend_clamp_mod_dither()
1575 void scanline_x32cb16blend_clamp_mod(context_t* c) in scanline_x32cb16blend_clamp_mod() argument
1577 dst_iterator16 di(c); in scanline_x32cb16blend_clamp_mod()
1578 blender_x32to16_modulate bl(c); in scanline_x32cb16blend_clamp_mod()
1580 clamp_iterator ci(c); in scanline_x32cb16blend_clamp_mod()
1588 void scanline_x32cb16blend_clamp_mod_dither(context_t* c) in scanline_x32cb16blend_clamp_mod_dither() argument
1590 dst_iterator16 di(c); in scanline_x32cb16blend_clamp_mod_dither()
1591 blender_x32to16_modulate bl(c); in scanline_x32cb16blend_clamp_mod_dither()
1592 ditherer dither(c); in scanline_x32cb16blend_clamp_mod_dither()
1594 clamp_iterator ci(c); in scanline_x32cb16blend_clamp_mod_dither()
1602 void scanline_t16cb16_clamp(context_t* c) in scanline_t16cb16_clamp() argument
1604 dst_iterator16 di(c); in scanline_t16cb16_clamp()
1607 if (is_context_horizontal(c)) { in scanline_t16cb16_clamp()
1608 horz_clamp_iterator16 ci(c); in scanline_t16cb16_clamp()
1613 clamp_iterator ci(c); in scanline_t16cb16_clamp()
1635 void init_y(context_t* c, int32_t ys) in init_y() argument
1637 const uint32_t enables = c->state.enables; in init_y()
1640 iterators_t& ci = c->iterators; in init_y()
1646 ci.ydzdy = interpolate(ys, c->shade.z0, c->shade.dzdx, c->shade.dzdy); in init_y()
1647 ci.ydwdy = interpolate(ys, c->shade.w0, c->shade.dwdx, c->shade.dwdy); in init_y()
1648 ci.ydfdy = interpolate(ys, c->shade.f0, c->shade.dfdx, c->shade.dfdy); in init_y()
1652 ci.ydrdy = interpolate(ys, c->shade.r0, c->shade.drdx, c->shade.drdy); in init_y()
1653 ci.ydgdy = interpolate(ys, c->shade.g0, c->shade.dgdx, c->shade.dgdy); in init_y()
1654 ci.ydbdy = interpolate(ys, c->shade.b0, c->shade.dbdx, c->shade.dbdy); in init_y()
1655 ci.ydady = interpolate(ys, c->shade.a0, c->shade.dadx, c->shade.dady); in init_y()
1656 c->step_y = step_y__smooth; in init_y()
1658 ci.ydrdy = c->shade.r0; in init_y()
1659 ci.ydgdy = c->shade.g0; in init_y()
1660 ci.ydbdy = c->shade.b0; in init_y()
1661 ci.ydady = c->shade.a0; in init_y()
1663 c->packed = ggl_pack_color(c, c->state.buffers.color.format, in init_y()
1665 c->packed8888 = ggl_pack_color(c, GGL_PIXEL_FORMAT_RGBA_8888, in init_y()
1670 generated_vars_t& gen = c->generated_vars; in init_y()
1671 gen.argb[GGLFormat::ALPHA].c = ci.ydady; in init_y()
1672 gen.argb[GGLFormat::ALPHA].dx = c->shade.dadx; in init_y()
1673 gen.argb[GGLFormat::RED ].c = ci.ydrdy; in init_y()
1674 gen.argb[GGLFormat::RED ].dx = c->shade.drdx; in init_y()
1675 gen.argb[GGLFormat::GREEN].c = ci.ydgdy; in init_y()
1676 gen.argb[GGLFormat::GREEN].dx = c->shade.dgdx; in init_y()
1677 gen.argb[GGLFormat::BLUE ].c = ci.ydbdy; in init_y()
1678 gen.argb[GGLFormat::BLUE ].dx = c->shade.dbdx; in init_y()
1679 gen.dzdx = c->shade.dzdx; in init_y()
1681 gen.dfdx = c->shade.dfdx; in init_y()
1685 texture_t& t = c->state.texture[i]; in init_y()
1732 generated_tex_vars_t& gen = c->generated_vars.texture[i]; in init_y()
1743 c->step_y = step_y__nop; in init_y()
1745 c->step_y = step_y__generic; in init_y()
1748 c->step_y = step_y__generic; in init_y()
1750 c->step_y = step_y__w; in init_y()
1752 c->step_y = step_y__tmu; in init_y()
1756 c->step_y = step_y__smooth; in init_y()
1761 c->rect = rect_generic; in init_y()
1762 if ((c->step_y == step_y__nop) && in init_y()
1763 (c->scanline == scanline_memcpy)) in init_y()
1765 c->rect = rect_memcpy; in init_y()
1769 void init_y_packed(context_t* c, int32_t y0) in init_y_packed() argument
1771 uint8_t f = c->state.buffers.color.format; in init_y_packed()
1772 c->packed = ggl_pack_color(c, f, in init_y_packed()
1773 c->shade.r0, c->shade.g0, c->shade.b0, c->shade.a0); in init_y_packed()
1774 c->packed8888 = ggl_pack_color(c, GGL_PIXEL_FORMAT_RGBA_8888, in init_y_packed()
1775 c->shade.r0, c->shade.g0, c->shade.b0, c->shade.a0); in init_y_packed()
1776 c->iterators.y = y0; in init_y_packed()
1777 c->step_y = step_y__nop; in init_y_packed()
1779 c->rect = rect_generic; in init_y_packed()
1780 if (c->scanline == scanline_memcpy) { in init_y_packed()
1781 c->rect = rect_memcpy; in init_y_packed()
1785 void init_y_noop(context_t* c, int32_t y0) in init_y_noop() argument
1787 c->iterators.y = y0; in init_y_noop()
1788 c->step_y = step_y__nop; in init_y_noop()
1790 c->rect = rect_generic; in init_y_noop()
1791 if (c->scanline == scanline_memcpy) { in init_y_noop()
1792 c->rect = rect_memcpy; in init_y_noop()
1796 void init_y_error(context_t* c, int32_t y0) in init_y_error() argument
1800 init_y_noop(c, y0); in init_y_error()
1809 void step_y__generic(context_t* c) in step_y__generic() argument
1811 const uint32_t enables = c->state.enables; in step_y__generic()
1814 iterators_t& ci = c->iterators; in step_y__generic()
1818 ci.ydrdy += c->shade.drdy; in step_y__generic()
1819 ci.ydgdy += c->shade.dgdy; in step_y__generic()
1820 ci.ydbdy += c->shade.dbdy; in step_y__generic()
1821 ci.ydady += c->shade.dady; in step_y__generic()
1829 ci.ydzdy += c->shade.dzdy; in step_y__generic()
1830 ci.ydwdy += c->shade.dwdy; in step_y__generic()
1831 ci.ydfdy += c->shade.dfdy; in step_y__generic()
1836 if (c->state.texture[i].enable) { in step_y__generic()
1837 texture_iterators_t& ti = c->state.texture[i].iterators; in step_y__generic()
1845 void step_y__nop(context_t* c) in step_y__nop() argument
1847 c->iterators.y += 1; in step_y__nop()
1848 c->iterators.ydzdy += c->shade.dzdy; in step_y__nop()
1851 void step_y__smooth(context_t* c) in step_y__smooth() argument
1853 iterators_t& ci = c->iterators; in step_y__smooth()
1855 ci.ydrdy += c->shade.drdy; in step_y__smooth()
1856 ci.ydgdy += c->shade.dgdy; in step_y__smooth()
1857 ci.ydbdy += c->shade.dbdy; in step_y__smooth()
1858 ci.ydady += c->shade.dady; in step_y__smooth()
1859 ci.ydzdy += c->shade.dzdy; in step_y__smooth()
1862 void step_y__w(context_t* c) in step_y__w() argument
1864 iterators_t& ci = c->iterators; in step_y__w()
1866 ci.ydzdy += c->shade.dzdy; in step_y__w()
1867 ci.ydwdy += c->shade.dwdy; in step_y__w()
1870 void step_y__tmu(context_t* c) in step_y__tmu() argument
1872 iterators_t& ci = c->iterators; in step_y__tmu()
1874 ci.ydzdy += c->shade.dzdy; in step_y__tmu()
1876 if (c->state.texture[i].enable) { in step_y__tmu()
1877 texture_iterators_t& ti = c->state.texture[i].iterators; in step_y__tmu()
1889 void scanline_perspective(context_t* c) in scanline_perspective() argument
1908 const uint32_t ys = c->iterators.y; in scanline_perspective()
1909 const uint32_t xs = c->iterators.xl; in scanline_perspective()
1910 const uint32_t x1 = c->iterators.xr; in scanline_perspective()
1915 const iterators_t& ci = c->iterators; in scanline_perspective()
1916 int32_t w0 = (xs * c->shade.dwdx) + ci.ydwdy; in scanline_perspective()
1920 const int32_t dwdx = c->shade.dwdx << SPAN_BITS; in scanline_perspective()
1921 int32_t xl = c->iterators.xl; in scanline_perspective()
1927 const texture_t& tmu = c->state.texture[i]; in scanline_perspective()
1950 w1 = (c->shade.dwdx * span) + w0; in scanline_perspective()
1957 texture_t& tmu = c->state.texture[i]; in scanline_perspective()
1982 generated_tex_vars_t& gen = c->generated_vars.texture[i]; in scanline_perspective()
1986 c->iterators.xl = xl; in scanline_perspective()
1987 c->iterators.xr = xl = xl + (span ? span : (1<<SPAN_BITS)); in scanline_perspective()
1990 c->span(c); in scanline_perspective()
1994 void scanline_perspective_single(context_t* c) in scanline_perspective_single() argument
1999 const uint32_t ys = c->iterators.y; in scanline_perspective_single()
2000 const uint32_t xs = c->iterators.xl; in scanline_perspective_single()
2001 const uint32_t x1 = c->iterators.xr; in scanline_perspective_single()
2004 const iterators_t& ci = c->iterators; in scanline_perspective_single()
2005 int32_t w = (xs * c->shade.dwdx) + ci.ydwdy; in scanline_perspective_single()
2009 const int i = 31 - gglClz(c->state.enabled_tmu); in scanline_perspective_single()
2010 generated_tex_vars_t& gen = c->generated_vars.texture[i]; in scanline_perspective_single()
2011 texture_t& tmu = c->state.texture[i]; in scanline_perspective_single()
2023 int32_t xl = c->iterators.xl; in scanline_perspective_single()
2028 if (c->shade.dwdx == 0) { in scanline_perspective_single()
2036 w += c->shade.dwdx * premainder; in scanline_perspective_single()
2045 c->iterators.xl = xl; in scanline_perspective_single()
2046 c->iterators.xr = xl = xl + premainder; in scanline_perspective_single()
2051 w += c->shade.dwdx << SPAN_BITS; in scanline_perspective_single()
2059 c->iterators.xl = xl; in scanline_perspective_single()
2060 c->iterators.xr = xl = xl + (1<<SPAN_BITS); in scanline_perspective_single()
2080 c->span(c); in scanline_perspective_single()
2086 void scanline_col32cb16blend(context_t* c) in scanline_col32cb16blend() argument
2088 int32_t x = c->iterators.xl; in scanline_col32cb16blend()
2089 size_t ct = c->iterators.xr - x; in scanline_col32cb16blend()
2090 int32_t y = c->iterators.y; in scanline_col32cb16blend()
2091 surface_t* cb = &(c->state.buffers.color); in scanline_col32cb16blend()
2100 scanline_col32cb16blend_neon(dst, &(c->packed8888), ct); in scanline_col32cb16blend()
2102 scanline_col32cb16blend_arm(dst, GGL_RGBA_TO_HOST(c->packed8888), ct); in scanline_col32cb16blend()
2105 scanline_col32cb16blend_arm64(dst, GGL_RGBA_TO_HOST(c->packed8888), ct); in scanline_col32cb16blend()
2107 uint32_t s = GGL_RGBA_TO_HOST(c->packed8888); in scanline_col32cb16blend()
2127 void scanline_t32cb16(context_t* c) in scanline_t32cb16() argument
2129 int32_t x = c->iterators.xl; in scanline_t32cb16()
2130 size_t ct = c->iterators.xr - x; in scanline_t32cb16()
2131 int32_t y = c->iterators.y; in scanline_t32cb16()
2132 surface_t* cb = &(c->state.buffers.color); in scanline_t32cb16()
2139 surface_t* tex = &(c->state.texture[0].surface); in scanline_t32cb16()
2140 const int32_t u = (c->state.texture[0].shade.is0>>16) + x; in scanline_t32cb16()
2141 const int32_t v = (c->state.texture[0].shade.it0>>16) + y; in scanline_t32cb16()
2176 void scanline_t32cb16blend(context_t* c) in scanline_t32cb16blend() argument
2179 int32_t x = c->iterators.xl; in scanline_t32cb16blend()
2180 size_t ct = c->iterators.xr - x; in scanline_t32cb16blend()
2181 int32_t y = c->iterators.y; in scanline_t32cb16blend()
2182 surface_t* cb = &(c->state.buffers.color); in scanline_t32cb16blend()
2185 surface_t* tex = &(c->state.texture[0].surface); in scanline_t32cb16blend()
2186 const int32_t u = (c->state.texture[0].shade.is0>>16) + x; in scanline_t32cb16blend()
2187 const int32_t v = (c->state.texture[0].shade.it0>>16) + y; in scanline_t32cb16blend()
2198 dst_iterator16 di(c); in scanline_t32cb16blend()
2199 horz_iterator32 hi(c); in scanline_t32cb16blend()
2200 blender_32to16 bl(c); in scanline_t32cb16blend()
2209 void scanline_t32cb16blend_srca(context_t* c) in scanline_t32cb16blend_srca() argument
2211 dst_iterator16 di(c); in scanline_t32cb16blend_srca()
2212 horz_iterator32 hi(c); in scanline_t32cb16blend_srca()
2213 blender_32to16_srcA blender(c); in scanline_t32cb16blend_srca()
2222 void scanline_t16cb16blend_clamp_mod(context_t* c) in scanline_t16cb16blend_clamp_mod() argument
2224 const int a = c->iterators.ydady >> (GGL_COLOR_BITS-8); in scanline_t16cb16blend_clamp_mod()
2230 scanline_t16cb16_clamp(c); in scanline_t16cb16blend_clamp_mod()
2234 dst_iterator16 di(c); in scanline_t16cb16blend_clamp_mod()
2235 blender_16to16_modulate blender(c); in scanline_t16cb16blend_clamp_mod()
2236 clamp_iterator ci(c); in scanline_t16cb16blend_clamp_mod()
2245 void scanline_memcpy(context_t* c) in scanline_memcpy() argument
2247 int32_t x = c->iterators.xl; in scanline_memcpy()
2248 size_t ct = c->iterators.xr - x; in scanline_memcpy()
2249 int32_t y = c->iterators.y; in scanline_memcpy()
2250 surface_t* cb = &(c->state.buffers.color); in scanline_memcpy()
2251 const GGLFormat* fp = &(c->formats[cb->format]); in scanline_memcpy()
2255 surface_t* tex = &(c->state.texture[0].surface); in scanline_memcpy()
2256 const int32_t u = (c->state.texture[0].shade.is0>>16) + x; in scanline_memcpy()
2257 const int32_t v = (c->state.texture[0].shade.it0>>16) + y; in scanline_memcpy()
2265 void scanline_memset8(context_t* c) in scanline_memset8() argument
2267 int32_t x = c->iterators.xl; in scanline_memset8()
2268 size_t ct = c->iterators.xr - x; in scanline_memset8()
2269 int32_t y = c->iterators.y; in scanline_memset8()
2270 surface_t* cb = &(c->state.buffers.color); in scanline_memset8()
2272 uint32_t packed = c->packed; in scanline_memset8()
2276 void scanline_memset16(context_t* c) in scanline_memset16() argument
2278 int32_t x = c->iterators.xl; in scanline_memset16()
2279 size_t ct = c->iterators.xr - x; in scanline_memset16()
2280 int32_t y = c->iterators.y; in scanline_memset16()
2281 surface_t* cb = &(c->state.buffers.color); in scanline_memset16()
2283 uint32_t packed = c->packed; in scanline_memset16()
2287 void scanline_memset32(context_t* c) in scanline_memset32() argument
2289 int32_t x = c->iterators.xl; in scanline_memset32()
2290 size_t ct = c->iterators.xr - x; in scanline_memset32()
2291 int32_t y = c->iterators.y; in scanline_memset32()
2292 surface_t* cb = &(c->state.buffers.color); in scanline_memset32()
2294 uint32_t packed = GGL_HOST_TO_RGBA(c->packed); in scanline_memset32()
2298 void scanline_clear(context_t* c) in scanline_clear() argument
2300 int32_t x = c->iterators.xl; in scanline_clear()
2301 size_t ct = c->iterators.xr - x; in scanline_clear()
2302 int32_t y = c->iterators.y; in scanline_clear()
2303 surface_t* cb = &(c->state.buffers.color); in scanline_clear()
2304 const GGLFormat* fp = &(c->formats[cb->format]); in scanline_clear()
2311 void scanline_set(context_t* c) in scanline_set() argument
2313 int32_t x = c->iterators.xl; in scanline_set()
2314 size_t ct = c->iterators.xr - x; in scanline_set()
2315 int32_t y = c->iterators.y; in scanline_set()
2316 surface_t* cb = &(c->state.buffers.color); in scanline_set()
2317 const GGLFormat* fp = &(c->formats[cb->format]); in scanline_set()
2328 void rect_generic(context_t* c, size_t yc) in rect_generic() argument
2331 c->scanline(c); in rect_generic()
2332 c->step_y(c); in rect_generic()
2336 void rect_memcpy(context_t* c, size_t yc) in rect_memcpy() argument
2338 int32_t x = c->iterators.xl; in rect_memcpy()
2339 size_t ct = c->iterators.xr - x; in rect_memcpy()
2340 int32_t y = c->iterators.y; in rect_memcpy()
2341 surface_t* cb = &(c->state.buffers.color); in rect_memcpy()
2342 const GGLFormat* fp = &(c->formats[cb->format]); in rect_memcpy()
2346 surface_t* tex = &(c->state.texture[0].surface); in rect_memcpy()
2347 const int32_t u = (c->state.texture[0].shade.is0>>16) + x; in rect_memcpy()
2348 const int32_t v = (c->state.texture[0].shade.it0>>16) + y; in rect_memcpy()