• Home
  • Raw
  • Download

Lines Matching refs:c

84 static void step_y__generic(context_t* c);
86 static void step_y__smooth(context_t* c);
87 static void step_y__tmu(context_t* c);
88 static void step_y__w(context_t* c);
90 static void scanline(context_t* c);
91 static void scanline_perspective(context_t* c);
92 static void scanline_perspective_single(context_t* c);
93 static void scanline_t32cb16blend(context_t* c);
94 static void scanline_t32cb16blend_dither(context_t* c);
95 static void scanline_t32cb16blend_srca(context_t* c);
96 static void scanline_t32cb16blend_clamp(context_t* c);
97 static void scanline_t32cb16blend_clamp_dither(context_t* c);
98 static void scanline_t32cb16blend_clamp_mod(context_t* c);
99 static void scanline_x32cb16blend_clamp_mod(context_t* c);
100 static void scanline_t32cb16blend_clamp_mod_dither(context_t* c);
101 static void scanline_x32cb16blend_clamp_mod_dither(context_t* c);
102 static void scanline_t32cb16(context_t* c);
103 static void scanline_t32cb16_dither(context_t* c);
104 static void scanline_t32cb16_clamp(context_t* c);
105 static void scanline_t32cb16_clamp_dither(context_t* c);
106 static void scanline_col32cb16blend(context_t* c);
107 static void scanline_t16cb16_clamp(context_t* c);
108 static void scanline_t16cb16blend_clamp_mod(context_t* c);
109 static void scanline_memcpy(context_t* c);
110 static void scanline_memset8(context_t* c);
111 static void scanline_memset16(context_t* c);
112 static void scanline_memset32(context_t* c);
113 static void scanline_noop(context_t* c);
114 static void scanline_set(context_t* c);
115 static void scanline_clear(context_t* c);
117 static void rect_generic(context_t* c, size_t yc);
118 static void rect_memcpy(context_t* c, size_t yc);
294 void ggl_init_scanline(context_t* c) in ggl_init_scanline() argument
296 c->init_y = init_y; in ggl_init_scanline()
297 c->step_y = step_y__generic; in ggl_init_scanline()
298 c->scanline = scanline; in ggl_init_scanline()
301 void ggl_uninit_scanline(context_t* c) in ggl_uninit_scanline() argument
303 if (c->state.buffers.coverage) in ggl_uninit_scanline()
304 free(c->state.buffers.coverage); in ggl_uninit_scanline()
306 if (c->scanline_as) in ggl_uninit_scanline()
307 c->scanline_as->decStrong(c); in ggl_uninit_scanline()
313 static void pick_scanline(context_t* c) in pick_scanline() argument
318 c->init_y = init_y; in pick_scanline()
319 c->step_y = step_y__generic; in pick_scanline()
320 c->scanline = scanline; in pick_scanline()
329 const uint32_t cb_format = GGL_READ_NEEDS(CB_FORMAT, c->state.needs.n); in pick_scanline()
330 if (GGL_READ_NEEDS(T_FORMAT, c->state.needs.t[0]) == cb_format) { in pick_scanline()
331 if (c->state.needs.match(noblend1to1)) { in pick_scanline()
336 &(c->formats[GGL_READ_NEEDS(T_FORMAT, c->state.needs.t[0])]); in pick_scanline()
344 c->scanline = scanline_memcpy; in pick_scanline()
345 c->init_y = init_y_noop; in pick_scanline()
351 if (c->state.needs.match(fill16noblend)) { in pick_scanline()
352 c->init_y = init_y_packed; in pick_scanline()
353 switch (c->formats[cb_format].size) { in pick_scanline()
354 case 1: c->scanline = scanline_memset8; return; in pick_scanline()
355 case 2: c->scanline = scanline_memset16; return; in pick_scanline()
356 case 4: c->scanline = scanline_memset32; return; in pick_scanline()
362 if (c->state.needs.match(shortcuts[i].filter)) { in pick_scanline()
363 c->scanline = shortcuts[i].scanline; in pick_scanline()
364 c->init_y = shortcuts[i].init_y; in pick_scanline()
371 c->state.needs.n, c->state.needs.p, in pick_scanline()
372 c->state.needs.t[0], c->state.needs.t[1]); in pick_scanline()
377 c->init_y = init_y; in pick_scanline()
378 c->step_y = step_y__generic; in pick_scanline()
383 const AssemblyKey<needs_t> key(c->state.needs); in pick_scanline()
387 sp<ScanlineAssembly> a = new ScanlineAssembly(c->state.needs, in pick_scanline()
399 int err = assembler.scanline(c->state.needs, c); in pick_scanline()
406 c->scanline = scanline_noop; in pick_scanline()
407 c->init_y = init_y_noop; in pick_scanline()
408 c->step_y = step_y__nop; in pick_scanline()
415 if (c->scanline_as) { in pick_scanline()
416 c->scanline_as->decStrong(c); in pick_scanline()
420 c->scanline_as = assembly.get(); in pick_scanline()
421 c->scanline_as->incStrong(c); // hold on to assembly in pick_scanline()
422 c->scanline = (void(*)(context_t* c))assembly->base(); in pick_scanline()
425 c->scanline = scanline; in pick_scanline()
429 void ggl_pick_scanline(context_t* c) in ggl_pick_scanline() argument
431 pick_scanline(c); in ggl_pick_scanline()
432 if ((c->state.enables & GGL_ENABLE_W) && in ggl_pick_scanline()
433 (c->state.enables & GGL_ENABLE_TMUS)) in ggl_pick_scanline()
435 c->span = c->scanline; in ggl_pick_scanline()
436 c->scanline = scanline_perspective; in ggl_pick_scanline()
437 if (!(c->state.enabled_tmu & (c->state.enabled_tmu - 1))) { in ggl_pick_scanline()
439 c->scanline = scanline_perspective_single; in ggl_pick_scanline()
446 static void blending(context_t* c, pixel_t* fragment, pixel_t* fb);
447 static void blend_factor(context_t* c, pixel_t* r, uint32_t factor,
473 void blending(context_t* c, pixel_t* fragment, pixel_t* fb) in blending() argument
475 rescale(fragment->c[0], fragment->s[0], fb->c[0], fb->s[0]); in blending()
476 rescale(fragment->c[1], fragment->s[1], fb->c[1], fb->s[1]); in blending()
477 rescale(fragment->c[2], fragment->s[2], fb->c[2], fb->s[2]); in blending()
478 rescale(fragment->c[3], fragment->s[3], fb->c[3], fb->s[3]); in blending()
481 blend_factor(c, &sf, c->state.blend.src, fragment, fb); in blending()
482 blend_factor(c, &df, c->state.blend.dst, fragment, fb); in blending()
484 fragment->c[1] = in blending()
485 gglMulAddx(fragment->c[1], sf.c[1], gglMulx(fb->c[1], df.c[1])); in blending()
486 fragment->c[2] = in blending()
487 gglMulAddx(fragment->c[2], sf.c[2], gglMulx(fb->c[2], df.c[2])); in blending()
488 fragment->c[3] = in blending()
489 gglMulAddx(fragment->c[3], sf.c[3], gglMulx(fb->c[3], df.c[3])); in blending()
491 if (c->state.blend.alpha_separate) { in blending()
492 blend_factor(c, &sf, c->state.blend.src_alpha, fragment, fb); in blending()
493 blend_factor(c, &df, c->state.blend.dst_alpha, fragment, fb); in blending()
496 fragment->c[0] = in blending()
497 gglMulAddx(fragment->c[0], sf.c[0], gglMulx(fb->c[0], df.c[0])); in blending()
500 if (fragment->c[0] >= (1LU<<fragment->s[0])) in blending()
501 fragment->c[0] = (1<<fragment->s[0])-1; in blending()
502 if (fragment->c[1] >= (1LU<<fragment->s[1])) in blending()
503 fragment->c[1] = (1<<fragment->s[1])-1; in blending()
504 if (fragment->c[2] >= (1LU<<fragment->s[2])) in blending()
505 fragment->c[2] = (1<<fragment->s[2])-1; in blending()
506 if (fragment->c[3] >= (1LU<<fragment->s[3])) in blending()
507 fragment->c[3] = (1<<fragment->s[3])-1; in blending()
525 void blend_factor(context_t* c, pixel_t* r, in blend_factor() argument
530 r->c[1] = in blend_factor()
531 r->c[2] = in blend_factor()
532 r->c[3] = in blend_factor()
533 r->c[0] = 0; in blend_factor()
536 r->c[1] = in blend_factor()
537 r->c[2] = in blend_factor()
538 r->c[3] = in blend_factor()
539 r->c[0] = FIXED_ONE; in blend_factor()
542 r->c[1] = blendfactor(dst->c[1], dst->s[1]); in blend_factor()
543 r->c[2] = blendfactor(dst->c[2], dst->s[2]); in blend_factor()
544 r->c[3] = blendfactor(dst->c[3], dst->s[3]); in blend_factor()
545 r->c[0] = blendfactor(dst->c[0], dst->s[0]); in blend_factor()
548 r->c[1] = blendfactor(src->c[1], src->s[1]); in blend_factor()
549 r->c[2] = blendfactor(src->c[2], src->s[2]); in blend_factor()
550 r->c[3] = blendfactor(src->c[3], src->s[3]); in blend_factor()
551 r->c[0] = blendfactor(src->c[0], src->s[0]); in blend_factor()
554 r->c[1] = FIXED_ONE - blendfactor(dst->c[1], dst->s[1]); in blend_factor()
555 r->c[2] = FIXED_ONE - blendfactor(dst->c[2], dst->s[2]); in blend_factor()
556 r->c[3] = FIXED_ONE - blendfactor(dst->c[3], dst->s[3]); in blend_factor()
557 r->c[0] = FIXED_ONE - blendfactor(dst->c[0], dst->s[0]); in blend_factor()
560 r->c[1] = FIXED_ONE - blendfactor(src->c[1], src->s[1]); in blend_factor()
561 r->c[2] = FIXED_ONE - blendfactor(src->c[2], src->s[2]); in blend_factor()
562 r->c[3] = FIXED_ONE - blendfactor(src->c[3], src->s[3]); in blend_factor()
563 r->c[0] = FIXED_ONE - blendfactor(src->c[0], src->s[0]); in blend_factor()
566 r->c[1] = in blend_factor()
567 r->c[2] = in blend_factor()
568 r->c[3] = in blend_factor()
569 r->c[0] = blendfactor(src->c[0], src->s[0], FIXED_ONE); in blend_factor()
572 r->c[1] = in blend_factor()
573 r->c[2] = in blend_factor()
574 r->c[3] = in blend_factor()
575 r->c[0] = FIXED_ONE - blendfactor(src->c[0], src->s[0], FIXED_ONE); in blend_factor()
578 r->c[1] = in blend_factor()
579 r->c[2] = in blend_factor()
580 r->c[3] = in blend_factor()
581 r->c[0] = blendfactor(dst->c[0], dst->s[0], FIXED_ONE); in blend_factor()
584 r->c[1] = in blend_factor()
585 r->c[2] = in blend_factor()
586 r->c[3] = in blend_factor()
587 r->c[0] = FIXED_ONE - blendfactor(dst->c[0], dst->s[0], FIXED_ONE); in blend_factor()
626 void scanline(context_t* c) in scanline() argument
628 const uint32_t enables = c->state.enables; in scanline()
629 const int xs = c->iterators.xl; in scanline()
630 const int x1 = c->iterators.xr; in scanline()
632 const int16_t* covPtr = c->state.buffers.coverage + xs; in scanline()
638 iterators_t& ci = c->iterators; in scanline()
640 r = (xs * c->shade.drdx) + ci.ydrdy; in scanline()
641 g = (xs * c->shade.dgdx) + ci.ydgdy; in scanline()
642 b = (xs * c->shade.dbdx) + ci.ydbdy; in scanline()
643 a = (xs * c->shade.dadx) + ci.ydady; in scanline()
644 r = ADJUST_COLOR_ITERATOR(r, c->shade.drdx, xc); in scanline()
645 g = ADJUST_COLOR_ITERATOR(g, c->shade.dgdx, xc); in scanline()
646 b = ADJUST_COLOR_ITERATOR(b, c->shade.dbdx, xc); in scanline()
647 a = ADJUST_COLOR_ITERATOR(a, c->shade.dadx, xc); in scanline()
656 GGLfixed z = (xs * c->shade.dzdx) + ci.ydzdy; in scanline()
657 GGLfixed f = (xs * c->shade.dfdx) + ci.ydfdy; in scanline()
664 if (c->state.texture[i].enable) { in scanline()
665 texture_iterators_t& ti = c->state.texture[i].iterators; in scanline()
682 uint32_t y = c->iterators.y; in scanline()
691 fragment.c[1] = r >> (GGL_COLOR_BITS-8); in scanline()
692 fragment.c[2] = g >> (GGL_COLOR_BITS-8); in scanline()
693 fragment.c[3] = b >> (GGL_COLOR_BITS-8); in scanline()
694 fragment.c[0] = a >> (GGL_COLOR_BITS-8); in scanline()
699 texture_t& tx = c->state.texture[i]; in scanline()
729 tx.surface.read(&tx.surface, c, u, v, &texel); in scanline()
763 tx.surface.read(&tx.surface, c, u0, v0, &texels[0]); in scanline()
764 tx.surface.read(&tx.surface, c, u0, v1, &texels[1]); in scanline()
765 tx.surface.read(&tx.surface, c, u1, v0, &texels[2]); in scanline()
766 tx.surface.read(&tx.surface, c, u1, v1, &texels[3]); in scanline()
779 texel.c[j] = texels[0].c[j]*mm[0] + in scanline()
780 texels[1].c[j]*mm[1] + in scanline()
781 texels[2].c[j]*mm[2] + in scanline()
782 texels[3].c[j]*mm[3] ; in scanline()
788 uint32_t& Cf = fragment.c[j]; in scanline()
789 uint32_t& Ct = texel.c[j]; in scanline()
792 uint32_t At = texel.c[0]; in scanline()
836 fragment.c[0] = (int64_t(fragment.c[0]) * cf) >> 15; in scanline()
841 GGLcolor ref = c->state.alpha_test.ref; in scanline()
842 GGLcolor alpha = (uint64_t(fragment.c[0]) * in scanline()
844 switch (c->state.alpha_test.func) { in scanline()
856 if (c->state.buffers.depth.format) { in scanline()
858 surface_t* cb = &(c->state.buffers.depth); in scanline()
862 switch (c->state.depth_test.func) { in scanline()
880 if (c->state.mask.depth) { in scanline()
889 GGLfixed fc = (c->state.fog.color[i] * 0x10000) / 0xFF; in scanline()
890 uint32_t& c = fragment.c[i]; in scanline() local
892 c = (c * 0x10000) / ((1<<s)-1); in scanline()
893 c = gglMulAddx(c, f, gglMulx(fc, 0x10000 - f)); in scanline()
900 fb.c[1] = fb.c[2] = fb.c[3] = fb.c[0] = 0; // placate valgrind in scanline()
902 c->state.buffers.color.read( in scanline()
903 &(c->state.buffers.color), c, x, y, &fb); in scanline()
904 blending( c, &fragment, &fb ); in scanline()
908 c->state.buffers.color.write( in scanline()
909 &(c->state.buffers.color), c, x, y, &fragment); in scanline()
916 r += c->shade.drdx; in scanline()
917 g += c->shade.dgdx; in scanline()
918 b += c->shade.dbdx; in scanline()
919 a += c->shade.dadx; in scanline()
921 z += c->shade.dzdx; in scanline()
922 f += c->shade.dfdx; in scanline()
945 horz_iterator32(context_t* c) { in horz_iterator32()
946 const int x = c->iterators.xl; in horz_iterator32()
947 const int y = c->iterators.y; in horz_iterator32()
948 texture_t& tx = c->state.texture[0]; in horz_iterator32()
962 horz_iterator16(context_t* c) { in horz_iterator16()
963 const int x = c->iterators.xl; in horz_iterator16()
964 const int y = c->iterators.y; in horz_iterator16()
965 texture_t& tx = c->state.texture[0]; in horz_iterator16()
982 clamp_iterator(context_t* c) { in clamp_iterator()
983 const int xs = c->iterators.xl; in clamp_iterator()
984 texture_t& tx = c->state.texture[0]; in clamp_iterator()
1038 static int is_context_horizontal(const context_t* c) { in is_context_horizontal() argument
1039 return (c->state.texture[0].iterators.dtdx == 0); in is_context_horizontal()
1064 void init(const context_t* c, int shift);
1071 void horz_clamp_iterator::init(const context_t* c, int shift) in init() argument
1073 const int xs = c->iterators.xl; in init()
1074 const texture_t& tx = c->state.texture[0]; in init()
1092 horz_clamp_iterator16(const context_t* c) { in horz_clamp_iterator16()
1093 init(c,1); in horz_clamp_iterator16()
1098 horz_clamp_iterator32(context_t* c) { in horz_clamp_iterator32()
1099 init(c,2); in horz_clamp_iterator32()
1106 ditherer(const context_t* c) { in ditherer()
1107 const int x = c->iterators.xl; in ditherer()
1108 const int y = c->iterators.y; in ditherer()
1109 m_line = &c->ditherMatrix[ ((y & GGL_DITHER_MASK)<<GGL_DITHER_ORDER_SHIFT) ]; in ditherer()
1152 blender_32to16(context_t* c) { } in blender_32to16()
1209 blender_32to16_srcA(const context_t* c) { } in blender_32to16_srcA()
1234 void init(const context_t* c) { in init()
1235 const int r = c->iterators.ydrdy >> (GGL_COLOR_BITS-8); in init()
1236 const int g = c->iterators.ydgdy >> (GGL_COLOR_BITS-8); in init()
1237 const int b = c->iterators.ydbdy >> (GGL_COLOR_BITS-8); in init()
1238 const int a = c->iterators.ydady >> (GGL_COLOR_BITS-8); in init()
1251 blender_32to16_modulate(const context_t* c) { in blender_32to16_modulate()
1252 init(c); in blender_32to16_modulate()
1323 blender_x32to16_modulate(const context_t* c) { in blender_x32to16_modulate()
1324 init(c); in blender_x32to16_modulate()
1378 blender_16to16_modulate(const context_t* c) { in blender_16to16_modulate()
1379 init(c); in blender_16to16_modulate()
1414 dst_iterator16(const context_t* c) { in dst_iterator16()
1415 const int x = c->iterators.xl; in dst_iterator16()
1416 const int width = c->iterators.xr - x; in dst_iterator16()
1417 const int32_t y = c->iterators.y; in dst_iterator16()
1418 const surface_t* cb = &(c->state.buffers.color); in dst_iterator16()
1427 static void scanline_t32cb16_clamp(context_t* c) in scanline_t32cb16_clamp() argument
1429 dst_iterator16 di(c); in scanline_t32cb16_clamp()
1431 if (is_context_horizontal(c)) { in scanline_t32cb16_clamp()
1433 horz_clamp_iterator32 ci(c); in scanline_t32cb16_clamp()
1440 clamp_iterator ci(c); in scanline_t32cb16_clamp()
1448 static void scanline_t32cb16_dither(context_t* c) in scanline_t32cb16_dither() argument
1450 horz_iterator32 si(c); in scanline_t32cb16_dither()
1451 dst_iterator16 di(c); in scanline_t32cb16_dither()
1452 ditherer dither(c); in scanline_t32cb16_dither()
1460 static void scanline_t32cb16_clamp_dither(context_t* c) in scanline_t32cb16_clamp_dither() argument
1462 dst_iterator16 di(c); in scanline_t32cb16_clamp_dither()
1463 ditherer dither(c); in scanline_t32cb16_clamp_dither()
1465 if (is_context_horizontal(c)) { in scanline_t32cb16_clamp_dither()
1467 horz_clamp_iterator32 ci(c); in scanline_t32cb16_clamp_dither()
1474 clamp_iterator ci(c); in scanline_t32cb16_clamp_dither()
1482 static void scanline_t32cb16blend_dither(context_t* c) in scanline_t32cb16blend_dither() argument
1484 dst_iterator16 di(c); in scanline_t32cb16blend_dither()
1485 ditherer dither(c); in scanline_t32cb16blend_dither()
1486 blender_32to16 bl(c); in scanline_t32cb16blend_dither()
1487 horz_iterator32 hi(c); in scanline_t32cb16blend_dither()
1495 static void scanline_t32cb16blend_clamp(context_t* c) in scanline_t32cb16blend_clamp() argument
1497 dst_iterator16 di(c); in scanline_t32cb16blend_clamp()
1498 blender_32to16 bl(c); in scanline_t32cb16blend_clamp()
1500 if (is_context_horizontal(c)) { in scanline_t32cb16blend_clamp()
1501 horz_clamp_iterator32 ci(c); in scanline_t32cb16blend_clamp()
1508 clamp_iterator ci(c); in scanline_t32cb16blend_clamp()
1517 static void scanline_t32cb16blend_clamp_dither(context_t* c) in scanline_t32cb16blend_clamp_dither() argument
1519 dst_iterator16 di(c); in scanline_t32cb16blend_clamp_dither()
1520 ditherer dither(c); in scanline_t32cb16blend_clamp_dither()
1521 blender_32to16 bl(c); in scanline_t32cb16blend_clamp_dither()
1523 clamp_iterator ci(c); in scanline_t32cb16blend_clamp_dither()
1531 void scanline_t32cb16blend_clamp_mod(context_t* c) in scanline_t32cb16blend_clamp_mod() argument
1533 dst_iterator16 di(c); in scanline_t32cb16blend_clamp_mod()
1534 blender_32to16_modulate bl(c); in scanline_t32cb16blend_clamp_mod()
1536 clamp_iterator ci(c); in scanline_t32cb16blend_clamp_mod()
1544 void scanline_t32cb16blend_clamp_mod_dither(context_t* c) in scanline_t32cb16blend_clamp_mod_dither() argument
1546 dst_iterator16 di(c); in scanline_t32cb16blend_clamp_mod_dither()
1547 blender_32to16_modulate bl(c); in scanline_t32cb16blend_clamp_mod_dither()
1548 ditherer dither(c); in scanline_t32cb16blend_clamp_mod_dither()
1550 clamp_iterator ci(c); in scanline_t32cb16blend_clamp_mod_dither()
1559 void scanline_x32cb16blend_clamp_mod(context_t* c) in scanline_x32cb16blend_clamp_mod() argument
1561 dst_iterator16 di(c); in scanline_x32cb16blend_clamp_mod()
1562 blender_x32to16_modulate bl(c); in scanline_x32cb16blend_clamp_mod()
1564 clamp_iterator ci(c); in scanline_x32cb16blend_clamp_mod()
1572 void scanline_x32cb16blend_clamp_mod_dither(context_t* c) in scanline_x32cb16blend_clamp_mod_dither() argument
1574 dst_iterator16 di(c); in scanline_x32cb16blend_clamp_mod_dither()
1575 blender_x32to16_modulate bl(c); in scanline_x32cb16blend_clamp_mod_dither()
1576 ditherer dither(c); in scanline_x32cb16blend_clamp_mod_dither()
1578 clamp_iterator ci(c); in scanline_x32cb16blend_clamp_mod_dither()
1586 void scanline_t16cb16_clamp(context_t* c) in scanline_t16cb16_clamp() argument
1588 dst_iterator16 di(c); in scanline_t16cb16_clamp()
1591 if (is_context_horizontal(c)) { in scanline_t16cb16_clamp()
1592 horz_clamp_iterator16 ci(c); in scanline_t16cb16_clamp()
1597 clamp_iterator ci(c); in scanline_t16cb16_clamp()
1619 void init_y(context_t* c, int32_t ys) in init_y() argument
1621 const uint32_t enables = c->state.enables; in init_y()
1624 iterators_t& ci = c->iterators; in init_y()
1630 ci.ydzdy = interpolate(ys, c->shade.z0, c->shade.dzdx, c->shade.dzdy); in init_y()
1631 ci.ydwdy = interpolate(ys, c->shade.w0, c->shade.dwdx, c->shade.dwdy); in init_y()
1632 ci.ydfdy = interpolate(ys, c->shade.f0, c->shade.dfdx, c->shade.dfdy); in init_y()
1636 ci.ydrdy = interpolate(ys, c->shade.r0, c->shade.drdx, c->shade.drdy); in init_y()
1637 ci.ydgdy = interpolate(ys, c->shade.g0, c->shade.dgdx, c->shade.dgdy); in init_y()
1638 ci.ydbdy = interpolate(ys, c->shade.b0, c->shade.dbdx, c->shade.dbdy); in init_y()
1639 ci.ydady = interpolate(ys, c->shade.a0, c->shade.dadx, c->shade.dady); in init_y()
1640 c->step_y = step_y__smooth; in init_y()
1642 ci.ydrdy = c->shade.r0; in init_y()
1643 ci.ydgdy = c->shade.g0; in init_y()
1644 ci.ydbdy = c->shade.b0; in init_y()
1645 ci.ydady = c->shade.a0; in init_y()
1647 c->packed = ggl_pack_color(c, c->state.buffers.color.format, in init_y()
1649 c->packed8888 = ggl_pack_color(c, GGL_PIXEL_FORMAT_RGBA_8888, in init_y()
1654 generated_vars_t& gen = c->generated_vars; in init_y()
1655 gen.argb[GGLFormat::ALPHA].c = ci.ydady; in init_y()
1656 gen.argb[GGLFormat::ALPHA].dx = c->shade.dadx; in init_y()
1657 gen.argb[GGLFormat::RED ].c = ci.ydrdy; in init_y()
1658 gen.argb[GGLFormat::RED ].dx = c->shade.drdx; in init_y()
1659 gen.argb[GGLFormat::GREEN].c = ci.ydgdy; in init_y()
1660 gen.argb[GGLFormat::GREEN].dx = c->shade.dgdx; in init_y()
1661 gen.argb[GGLFormat::BLUE ].c = ci.ydbdy; in init_y()
1662 gen.argb[GGLFormat::BLUE ].dx = c->shade.dbdx; in init_y()
1663 gen.dzdx = c->shade.dzdx; in init_y()
1665 gen.dfdx = c->shade.dfdx; in init_y()
1669 texture_t& t = c->state.texture[i]; in init_y()
1716 generated_tex_vars_t& gen = c->generated_vars.texture[i]; in init_y()
1727 c->step_y = step_y__nop; in init_y()
1729 c->step_y = step_y__generic; in init_y()
1732 c->step_y = step_y__generic; in init_y()
1734 c->step_y = step_y__w; in init_y()
1736 c->step_y = step_y__tmu; in init_y()
1740 c->step_y = step_y__smooth; in init_y()
1745 c->rect = rect_generic; in init_y()
1746 if ((c->step_y == step_y__nop) && in init_y()
1747 (c->scanline == scanline_memcpy)) in init_y()
1749 c->rect = rect_memcpy; in init_y()
1753 void init_y_packed(context_t* c, int32_t y0) in init_y_packed() argument
1755 uint8_t f = c->state.buffers.color.format; in init_y_packed()
1756 c->packed = ggl_pack_color(c, f, in init_y_packed()
1757 c->shade.r0, c->shade.g0, c->shade.b0, c->shade.a0); in init_y_packed()
1758 c->packed8888 = ggl_pack_color(c, GGL_PIXEL_FORMAT_RGBA_8888, in init_y_packed()
1759 c->shade.r0, c->shade.g0, c->shade.b0, c->shade.a0); in init_y_packed()
1760 c->iterators.y = y0; in init_y_packed()
1761 c->step_y = step_y__nop; in init_y_packed()
1763 c->rect = rect_generic; in init_y_packed()
1764 if (c->scanline == scanline_memcpy) { in init_y_packed()
1765 c->rect = rect_memcpy; in init_y_packed()
1769 void init_y_noop(context_t* c, int32_t y0) in init_y_noop() argument
1771 c->iterators.y = y0; in init_y_noop()
1772 c->step_y = step_y__nop; in init_y_noop()
1774 c->rect = rect_generic; in init_y_noop()
1775 if (c->scanline == scanline_memcpy) { in init_y_noop()
1776 c->rect = rect_memcpy; in init_y_noop()
1780 void init_y_error(context_t* c, int32_t y0) in init_y_error() argument
1784 init_y_noop(c, y0); in init_y_error()
1793 void step_y__generic(context_t* c) in step_y__generic() argument
1795 const uint32_t enables = c->state.enables; in step_y__generic()
1798 iterators_t& ci = c->iterators; in step_y__generic()
1802 ci.ydrdy += c->shade.drdy; in step_y__generic()
1803 ci.ydgdy += c->shade.dgdy; in step_y__generic()
1804 ci.ydbdy += c->shade.dbdy; in step_y__generic()
1805 ci.ydady += c->shade.dady; in step_y__generic()
1813 ci.ydzdy += c->shade.dzdy; in step_y__generic()
1814 ci.ydwdy += c->shade.dwdy; in step_y__generic()
1815 ci.ydfdy += c->shade.dfdy; in step_y__generic()
1820 if (c->state.texture[i].enable) { in step_y__generic()
1821 texture_iterators_t& ti = c->state.texture[i].iterators; in step_y__generic()
1829 void step_y__nop(context_t* c) in step_y__nop() argument
1831 c->iterators.y += 1; in step_y__nop()
1832 c->iterators.ydzdy += c->shade.dzdy; in step_y__nop()
1835 void step_y__smooth(context_t* c) in step_y__smooth() argument
1837 iterators_t& ci = c->iterators; in step_y__smooth()
1839 ci.ydrdy += c->shade.drdy; in step_y__smooth()
1840 ci.ydgdy += c->shade.dgdy; in step_y__smooth()
1841 ci.ydbdy += c->shade.dbdy; in step_y__smooth()
1842 ci.ydady += c->shade.dady; in step_y__smooth()
1843 ci.ydzdy += c->shade.dzdy; in step_y__smooth()
1846 void step_y__w(context_t* c) in step_y__w() argument
1848 iterators_t& ci = c->iterators; in step_y__w()
1850 ci.ydzdy += c->shade.dzdy; in step_y__w()
1851 ci.ydwdy += c->shade.dwdy; in step_y__w()
1854 void step_y__tmu(context_t* c) in step_y__tmu() argument
1856 iterators_t& ci = c->iterators; in step_y__tmu()
1858 ci.ydzdy += c->shade.dzdy; in step_y__tmu()
1860 if (c->state.texture[i].enable) { in step_y__tmu()
1861 texture_iterators_t& ti = c->state.texture[i].iterators; in step_y__tmu()
1873 void scanline_perspective(context_t* c) in scanline_perspective() argument
1892 const uint32_t ys = c->iterators.y; in scanline_perspective()
1893 const uint32_t xs = c->iterators.xl; in scanline_perspective()
1894 const uint32_t x1 = c->iterators.xr; in scanline_perspective()
1899 const iterators_t& ci = c->iterators; in scanline_perspective()
1900 int32_t w0 = (xs * c->shade.dwdx) + ci.ydwdy; in scanline_perspective()
1904 const int32_t dwdx = c->shade.dwdx << SPAN_BITS; in scanline_perspective()
1905 int32_t xl = c->iterators.xl; in scanline_perspective()
1911 const texture_t& tmu = c->state.texture[i]; in scanline_perspective()
1934 w1 = (c->shade.dwdx * span) + w0; in scanline_perspective()
1941 texture_t& tmu = c->state.texture[i]; in scanline_perspective()
1966 generated_tex_vars_t& gen = c->generated_vars.texture[i]; in scanline_perspective()
1970 c->iterators.xl = xl; in scanline_perspective()
1971 c->iterators.xr = xl = xl + (span ? span : (1<<SPAN_BITS)); in scanline_perspective()
1974 c->span(c); in scanline_perspective()
1978 void scanline_perspective_single(context_t* c) in scanline_perspective_single() argument
1983 const uint32_t ys = c->iterators.y; in scanline_perspective_single()
1984 const uint32_t xs = c->iterators.xl; in scanline_perspective_single()
1985 const uint32_t x1 = c->iterators.xr; in scanline_perspective_single()
1988 const iterators_t& ci = c->iterators; in scanline_perspective_single()
1989 int32_t w = (xs * c->shade.dwdx) + ci.ydwdy; in scanline_perspective_single()
1993 const int i = 31 - gglClz(c->state.enabled_tmu); in scanline_perspective_single()
1994 generated_tex_vars_t& gen = c->generated_vars.texture[i]; in scanline_perspective_single()
1995 texture_t& tmu = c->state.texture[i]; in scanline_perspective_single()
2007 int32_t xl = c->iterators.xl; in scanline_perspective_single()
2012 if (c->shade.dwdx == 0) { in scanline_perspective_single()
2020 w += c->shade.dwdx * premainder; in scanline_perspective_single()
2029 c->iterators.xl = xl; in scanline_perspective_single()
2030 c->iterators.xr = xl = xl + premainder; in scanline_perspective_single()
2035 w += c->shade.dwdx << SPAN_BITS; in scanline_perspective_single()
2043 c->iterators.xl = xl; in scanline_perspective_single()
2044 c->iterators.xr = xl = xl + (1<<SPAN_BITS); in scanline_perspective_single()
2064 c->span(c); in scanline_perspective_single()
2070 void scanline_col32cb16blend(context_t* c) in scanline_col32cb16blend() argument
2072 int32_t x = c->iterators.xl; in scanline_col32cb16blend()
2073 size_t ct = c->iterators.xr - x; in scanline_col32cb16blend()
2074 int32_t y = c->iterators.y; in scanline_col32cb16blend()
2075 surface_t* cb = &(c->state.buffers.color); in scanline_col32cb16blend()
2084 scanline_col32cb16blend_neon(dst, &(c->packed8888), ct); in scanline_col32cb16blend()
2086 scanline_col32cb16blend_arm(dst, GGL_RGBA_TO_HOST(c->packed8888), ct); in scanline_col32cb16blend()
2089 uint32_t s = GGL_RGBA_TO_HOST(c->packed8888); in scanline_col32cb16blend()
2109 void scanline_t32cb16(context_t* c) in scanline_t32cb16() argument
2111 int32_t x = c->iterators.xl; in scanline_t32cb16()
2112 size_t ct = c->iterators.xr - x; in scanline_t32cb16()
2113 int32_t y = c->iterators.y; in scanline_t32cb16()
2114 surface_t* cb = &(c->state.buffers.color); in scanline_t32cb16()
2121 surface_t* tex = &(c->state.texture[0].surface); in scanline_t32cb16()
2122 const int32_t u = (c->state.texture[0].shade.is0>>16) + x; in scanline_t32cb16()
2123 const int32_t v = (c->state.texture[0].shade.it0>>16) + y; in scanline_t32cb16()
2158 void scanline_t32cb16blend(context_t* c) in scanline_t32cb16blend() argument
2161 int32_t x = c->iterators.xl; in scanline_t32cb16blend()
2162 size_t ct = c->iterators.xr - x; in scanline_t32cb16blend()
2163 int32_t y = c->iterators.y; in scanline_t32cb16blend()
2164 surface_t* cb = &(c->state.buffers.color); in scanline_t32cb16blend()
2167 surface_t* tex = &(c->state.texture[0].surface); in scanline_t32cb16blend()
2168 const int32_t u = (c->state.texture[0].shade.is0>>16) + x; in scanline_t32cb16blend()
2169 const int32_t v = (c->state.texture[0].shade.it0>>16) + y; in scanline_t32cb16blend()
2178 dst_iterator16 di(c); in scanline_t32cb16blend()
2179 horz_iterator32 hi(c); in scanline_t32cb16blend()
2180 blender_32to16 bl(c); in scanline_t32cb16blend()
2189 void scanline_t32cb16blend_srca(context_t* c) in scanline_t32cb16blend_srca() argument
2191 dst_iterator16 di(c); in scanline_t32cb16blend_srca()
2192 horz_iterator32 hi(c); in scanline_t32cb16blend_srca()
2193 blender_32to16_srcA blender(c); in scanline_t32cb16blend_srca()
2202 void scanline_t16cb16blend_clamp_mod(context_t* c) in scanline_t16cb16blend_clamp_mod() argument
2204 const int a = c->iterators.ydady >> (GGL_COLOR_BITS-8); in scanline_t16cb16blend_clamp_mod()
2210 scanline_t16cb16_clamp(c); in scanline_t16cb16blend_clamp_mod()
2214 dst_iterator16 di(c); in scanline_t16cb16blend_clamp_mod()
2215 blender_16to16_modulate blender(c); in scanline_t16cb16blend_clamp_mod()
2216 clamp_iterator ci(c); in scanline_t16cb16blend_clamp_mod()
2225 void scanline_memcpy(context_t* c) in scanline_memcpy() argument
2227 int32_t x = c->iterators.xl; in scanline_memcpy()
2228 size_t ct = c->iterators.xr - x; in scanline_memcpy()
2229 int32_t y = c->iterators.y; in scanline_memcpy()
2230 surface_t* cb = &(c->state.buffers.color); in scanline_memcpy()
2231 const GGLFormat* fp = &(c->formats[cb->format]); in scanline_memcpy()
2235 surface_t* tex = &(c->state.texture[0].surface); in scanline_memcpy()
2236 const int32_t u = (c->state.texture[0].shade.is0>>16) + x; in scanline_memcpy()
2237 const int32_t v = (c->state.texture[0].shade.it0>>16) + y; in scanline_memcpy()
2245 void scanline_memset8(context_t* c) in scanline_memset8() argument
2247 int32_t x = c->iterators.xl; in scanline_memset8()
2248 size_t ct = c->iterators.xr - x; in scanline_memset8()
2249 int32_t y = c->iterators.y; in scanline_memset8()
2250 surface_t* cb = &(c->state.buffers.color); in scanline_memset8()
2252 uint32_t packed = c->packed; in scanline_memset8()
2256 void scanline_memset16(context_t* c) in scanline_memset16() argument
2258 int32_t x = c->iterators.xl; in scanline_memset16()
2259 size_t ct = c->iterators.xr - x; in scanline_memset16()
2260 int32_t y = c->iterators.y; in scanline_memset16()
2261 surface_t* cb = &(c->state.buffers.color); in scanline_memset16()
2263 uint32_t packed = c->packed; in scanline_memset16()
2267 void scanline_memset32(context_t* c) in scanline_memset32() argument
2269 int32_t x = c->iterators.xl; in scanline_memset32()
2270 size_t ct = c->iterators.xr - x; in scanline_memset32()
2271 int32_t y = c->iterators.y; in scanline_memset32()
2272 surface_t* cb = &(c->state.buffers.color); in scanline_memset32()
2274 uint32_t packed = GGL_HOST_TO_RGBA(c->packed); in scanline_memset32()
2278 void scanline_clear(context_t* c) in scanline_clear() argument
2280 int32_t x = c->iterators.xl; in scanline_clear()
2281 size_t ct = c->iterators.xr - x; in scanline_clear()
2282 int32_t y = c->iterators.y; in scanline_clear()
2283 surface_t* cb = &(c->state.buffers.color); in scanline_clear()
2284 const GGLFormat* fp = &(c->formats[cb->format]); in scanline_clear()
2291 void scanline_set(context_t* c) in scanline_set() argument
2293 int32_t x = c->iterators.xl; in scanline_set()
2294 size_t ct = c->iterators.xr - x; in scanline_set()
2295 int32_t y = c->iterators.y; in scanline_set()
2296 surface_t* cb = &(c->state.buffers.color); in scanline_set()
2297 const GGLFormat* fp = &(c->formats[cb->format]); in scanline_set()
2304 void scanline_noop(context_t* c) in scanline_noop() argument
2308 void rect_generic(context_t* c, size_t yc) in rect_generic() argument
2311 c->scanline(c); in rect_generic()
2312 c->step_y(c); in rect_generic()
2316 void rect_memcpy(context_t* c, size_t yc) in rect_memcpy() argument
2318 int32_t x = c->iterators.xl; in rect_memcpy()
2319 size_t ct = c->iterators.xr - x; in rect_memcpy()
2320 int32_t y = c->iterators.y; in rect_memcpy()
2321 surface_t* cb = &(c->state.buffers.color); in rect_memcpy()
2322 const GGLFormat* fp = &(c->formats[cb->format]); in rect_memcpy()
2326 surface_t* tex = &(c->state.texture[0].surface); in rect_memcpy()
2327 const int32_t u = (c->state.texture[0].shade.is0>>16) + x; in rect_memcpy()
2328 const int32_t v = (c->state.texture[0].shade.it0>>16) + y; in rect_memcpy()