Lines Matching refs:c
37 static void primitive_point(ogles_context_t* c, vertex_t* v);
38 static void primitive_line(ogles_context_t* c, vertex_t* v0, vertex_t* v1);
39 static void primitive_clip_triangle(ogles_context_t* c,
42 static void primitive_nop_point(ogles_context_t* c, vertex_t* v);
43 static void primitive_nop_line(ogles_context_t* c, vertex_t* v0, vertex_t* v1);
44 static void primitive_nop_triangle(ogles_context_t* c,
47 static inline bool cull_triangle(ogles_context_t* c,
50 static void lerp_triangle(ogles_context_t* c,
53 static void lerp_texcoords(ogles_context_t* c,
56 static void lerp_texcoords_w(ogles_context_t* c,
59 static void triangle(ogles_context_t* c,
62 static void clip_triangle(ogles_context_t* c,
65 static unsigned int clip_line(ogles_context_t* c,
73 static void lightTriangleDarkSmooth(ogles_context_t* c, in lightTriangleDarkSmooth() argument
78 const GLvoid* cp = c->arrays.color.element( in lightTriangleDarkSmooth()
80 c->arrays.color.fetch(c, v0->color.v, cp); in lightTriangleDarkSmooth()
84 const GLvoid* cp = c->arrays.color.element( in lightTriangleDarkSmooth()
86 c->arrays.color.fetch(c, v1->color.v, cp); in lightTriangleDarkSmooth()
90 const GLvoid* cp = c->arrays.color.element( in lightTriangleDarkSmooth()
92 c->arrays.color.fetch(c, v2->color.v, cp); in lightTriangleDarkSmooth()
96 static void lightTriangleDarkFlat(ogles_context_t* c, in lightTriangleDarkFlat() argument
101 const GLvoid* cp = c->arrays.color.element( in lightTriangleDarkFlat()
103 c->arrays.color.fetch(c, v2->color.v, cp); in lightTriangleDarkFlat()
106 c->rasterizer.procs.color4xv(c, v2->color.v); in lightTriangleDarkFlat()
109 static void lightTriangleSmooth(ogles_context_t* c, in lightTriangleSmooth() argument
113 c->lighting.lightVertex(c, v0); in lightTriangleSmooth()
115 c->lighting.lightVertex(c, v1); in lightTriangleSmooth()
117 c->lighting.lightVertex(c, v2); in lightTriangleSmooth()
120 static void lightTriangleFlat(ogles_context_t* c, in lightTriangleFlat() argument
124 c->lighting.lightVertex(c, v2); in lightTriangleFlat()
126 c->rasterizer.procs.color4xv(c, v2->color.v); in lightTriangleFlat()
132 void lightVertexDarkSmoothFog(ogles_context_t* c, vertex_t* v) in lightVertexDarkSmoothFog() argument
136 v->fog = c->fog.fog(c, v->eye.z); in lightVertexDarkSmoothFog()
137 const GLvoid* cp = c->arrays.color.element( in lightVertexDarkSmoothFog()
139 c->arrays.color.fetch(c, v->color.v, cp); in lightVertexDarkSmoothFog()
143 void lightVertexDarkFlatFog(ogles_context_t* c, vertex_t* v) in lightVertexDarkFlatFog() argument
147 v->fog = c->fog.fog(c, v->eye.z); in lightVertexDarkFlatFog()
151 void lightVertexSmoothFog(ogles_context_t* c, vertex_t* v) in lightVertexSmoothFog() argument
154 v->fog = c->fog.fog(c, v->eye.z); in lightVertexSmoothFog()
155 c->lighting.lightVertex(c, v); in lightVertexSmoothFog()
159 static void lightTriangleDarkSmoothFog(ogles_context_t* c, in lightTriangleDarkSmoothFog() argument
162 lightVertexDarkSmoothFog(c, v0); in lightTriangleDarkSmoothFog()
163 lightVertexDarkSmoothFog(c, v1); in lightTriangleDarkSmoothFog()
164 lightVertexDarkSmoothFog(c, v2); in lightTriangleDarkSmoothFog()
167 static void lightTriangleDarkFlatFog(ogles_context_t* c, in lightTriangleDarkFlatFog() argument
170 lightVertexDarkFlatFog(c, v0); in lightTriangleDarkFlatFog()
171 lightVertexDarkFlatFog(c, v1); in lightTriangleDarkFlatFog()
172 lightVertexDarkSmoothFog(c, v2); in lightTriangleDarkFlatFog()
174 c->rasterizer.procs.color4xv(c, v2->color.v); in lightTriangleDarkFlatFog()
177 static void lightTriangleSmoothFog(ogles_context_t* c, in lightTriangleSmoothFog() argument
180 lightVertexSmoothFog(c, v0); in lightTriangleSmoothFog()
181 lightVertexSmoothFog(c, v1); in lightTriangleSmoothFog()
182 lightVertexSmoothFog(c, v2); in lightTriangleSmoothFog()
185 static void lightTriangleFlatFog(ogles_context_t* c, in lightTriangleFlatFog() argument
188 lightVertexDarkFlatFog(c, v0); in lightTriangleFlatFog()
189 lightVertexDarkFlatFog(c, v1); in lightTriangleFlatFog()
190 lightVertexSmoothFog(c, v2); in lightTriangleFlatFog()
192 c->rasterizer.procs.color4xv(c, v2->color.v); in lightTriangleFlatFog()
212 void ogles_validate_primitives(ogles_context_t* c) in ogles_validate_primitives() argument
214 const uint32_t enables = c->rasterizer.state.enables; in ogles_validate_primitives()
218 index |= c->lighting.enable ? 0x2 : 0; in ogles_validate_primitives()
220 c->lighting.lightTriangle = lightPrimitive[index]; in ogles_validate_primitives()
223 if (ggl_likely(c->arrays.vertex.enable)) { in ogles_validate_primitives()
224 c->prims.renderPoint = primitive_point; in ogles_validate_primitives()
225 c->prims.renderLine = primitive_line; in ogles_validate_primitives()
226 c->prims.renderTriangle = primitive_clip_triangle; in ogles_validate_primitives()
228 c->prims.renderPoint = primitive_nop_point; in ogles_validate_primitives()
229 c->prims.renderLine = primitive_nop_line; in ogles_validate_primitives()
230 c->prims.renderTriangle = primitive_nop_triangle; in ogles_validate_primitives()
324 int32_t c = c0 - (gglMulAddx(dcdx, m_x0, in iteratorsScale() local
326 it[0] = c; in iteratorsScale()
341 int32_t c = c0 - (gglMulAddx(dcdx, m_x0, in iterators1616() local
343 it[0] = c; in iterators1616()
391 void fetch_texcoord_impl(ogles_context_t* c, in fetch_texcoord_impl() argument
395 array_t const * const texcoordArray = c->arrays.texture; in fetch_texcoord_impl()
398 if (!(c->rasterizer.state.texture[i].enable)) in fetch_texcoord_impl()
413 texcoordArray[i].fetch(c, coords.v, tp); in fetch_texcoord_impl()
417 const transform_t& tr = c->transforms.texture[i].transform; in fetch_texcoord_impl()
419 c->arrays.tex_transform[i](&tr, &coords, &coords); in fetch_texcoord_impl()
436 inline void fetch_texcoord(ogles_context_t* c, in fetch_texcoord() argument
439 const uint32_t enables = c->rasterizer.state.enables; in fetch_texcoord()
448 fetch_texcoord_impl(c, v0, v1, v2); in fetch_texcoord()
460 void primitive_point(ogles_context_t* c, vertex_t* v) in primitive_point() argument
463 const uint32_t enables = c->rasterizer.state.enables; in primitive_point()
466 if (c->lighting.enable) { in primitive_point()
467 c->lighting.lightVertex(c, v); in primitive_point()
470 const GLvoid* cp = c->arrays.color.element( in primitive_point()
472 c->arrays.color.fetch(c, v->color.v, cp); in primitive_point()
475 v->fog = c->fog.fog(c, v->eye.z); in primitive_point()
481 c->rasterizer.procs.color4xv(c, v->color.v); in primitive_point()
485 fetch_texcoord(c, v,v,v); in primitive_point()
487 if (!c->rasterizer.state.texture[i].enable) in primitive_point()
492 if (c->rasterizer.state.texture[i].s_wrap == GGL_CLAMP) { in primitive_point()
493 int width = c->textures.tmu[i].texture->surface.width; in primitive_point()
497 if (c->rasterizer.state.texture[i].t_wrap == GGL_CLAMP) { in primitive_point()
498 int height = c->textures.tmu[i].texture->surface.height; in primitive_point()
502 c->rasterizer.procs.texCoordGradScale8xv(c, i, itt); in primitive_point()
510 c->rasterizer.procs.zGrad3xv(c, itz); in primitive_point()
517 c->rasterizer.procs.fogGrad3xv(c, itf); in primitive_point()
521 c->rasterizer.procs.pointx(c, v->window.v, c->point.size); in primitive_point()
533 void primitive_line(ogles_context_t* c, vertex_t* v0, vertex_t* v1) in primitive_line() argument
536 fetch_texcoord(c, v0, v1, v1); in primitive_line()
539 c->lighting.lightTriangle(c, v0, v1, v1); in primitive_line()
543 unsigned int count = clip_line(c, v0, v1); in primitive_line()
549 const uint32_t enables = c->rasterizer.state.enables; in primitive_line()
557 c->lerp.initLine(v0, v1); in primitive_line()
558 lerp_triangle(c, v0, v1, v0); in primitive_line()
562 c->rasterizer.procs.linex(c, v0->window.v, v1->window.v, c->line.width); in primitive_line()
575 void primitive_clip_triangle(ogles_context_t* c, in primitive_clip_triangle() argument
585 c->lerp.initTriangle(v0, v1, v2); in primitive_clip_triangle()
586 if (cull_triangle(c, v0, v1, v2)) in primitive_clip_triangle()
590 fetch_texcoord(c, v0, v1, v2); in primitive_clip_triangle()
593 c->lighting.lightTriangle(c, v0, v1, v2); in primitive_clip_triangle()
595 triangle(c, v0, v1, v2); in primitive_clip_triangle()
605 fetch_texcoord(c, v0, v1, v2); in primitive_clip_triangle()
608 c->lighting.lightTriangle(c, v0, v1, v2); in primitive_clip_triangle()
610 clip_triangle(c, v0, v1, v2); in primitive_clip_triangle()
615 void triangle(ogles_context_t* c, in triangle() argument
619 const uint32_t enables = c->rasterizer.state.enables; in triangle()
627 lerp_triangle(c, v0, v1, v2); in triangle()
629 c->rasterizer.procs.trianglex(c, v0->window.v, v1->window.v, v2->window.v); in triangle()
632 void lerp_triangle(ogles_context_t* c, in lerp_triangle() argument
635 const uint32_t enables = c->rasterizer.state.enables; in lerp_triangle()
636 c->lerp.initLerp(v0, enables); in lerp_triangle()
641 lerp_texcoords_w(c, v0, v1, v2); in lerp_triangle()
643 lerp_texcoords(c, v0, v1, v2); in lerp_triangle()
648 const compute_iterators_t& lerp = c->lerp; in lerp_triangle()
657 c->rasterizer.procs.colorGrad12xv(c, itc); in lerp_triangle()
665 if (ggl_unlikely(c->polygonOffset.enable)) { in lerp_triangle()
666 const int32_t units = (c->polygonOffset.units << 16); in lerp_triangle()
667 const GLfixed factor = c->polygonOffset.factor; in lerp_triangle()
683 c->rasterizer.procs.zGrad3xv(c, itz); in lerp_triangle()
689 c->rasterizer.procs.fogGrad3xv(c, itf); in lerp_triangle()
695 int compute_lod(ogles_context_t* c, int i, in compute_lod() argument
703 const compute_iterators_t& lerp = c->lerp; in compute_lod()
705 const int w = c->textures.tmu[i].texture->surface.width; in compute_lod()
706 const int h = c->textures.tmu[i].texture->surface.height; in compute_lod()
716 void lerp_texcoords(ogles_context_t* c, in lerp_texcoords() argument
719 const compute_iterators_t& lerp = c->lerp; in lerp_texcoords()
722 const texture_t& tmu = c->rasterizer.state.texture[i]; in lerp_texcoords()
734 const GLenum min_filter = c->textures.tmu[i].texture->min_filter; in lerp_texcoords()
736 int lod = compute_lod(c, i, s0, t0, s1, t1, s2, t2); in lerp_texcoords()
737 c->rasterizer.procs.bindTextureLod(c, i, in lerp_texcoords()
738 &c->textures.tmu[i].texture->mip(lod)); in lerp_texcoords()
756 c->rasterizer.procs.texCoordGradScale8xv(c, i, itt); in lerp_texcoords()
760 void lerp_texcoords_w(ogles_context_t* c, in lerp_texcoords_w() argument
763 const compute_iterators_t& lerp = c->lerp; in lerp_texcoords_w()
776 c->rasterizer.procs.wGrad3xv(c, itw); in lerp_texcoords_w()
779 const texture_t& tmu = c->rasterizer.state.texture[i]; in lerp_texcoords_w()
791 const GLenum min_filter = c->textures.tmu[i].texture->min_filter; in lerp_texcoords_w()
793 int lod = compute_lod(c, i, s0, t0, s1, t1, s2, t2); in lerp_texcoords_w()
794 c->rasterizer.procs.bindTextureLod(c, i, in lerp_texcoords_w()
795 &c->textures.tmu[i].texture->mip(lod)); in lerp_texcoords_w()
821 c->rasterizer.procs.texCoordGradScale8xv(c, i, itt); in lerp_texcoords_w()
827 bool cull_triangle(ogles_context_t* c, vertex_t* /*v0*/, vertex_t* /*v1*/, vertex_t* /*v2*/) in cull_triangle() argument
829 if (ggl_likely(c->cull.enable)) { in cull_triangle()
830 const GLenum winding = (c->lerp.area() > 0) ? GL_CW : GL_CCW; in cull_triangle()
831 const GLenum face = (winding == c->cull.frontFace) ? GL_FRONT : GL_BACK; in cull_triangle()
832 if (face == c->cull.cullFace) in cull_triangle()
851 void clip_triangle(ogles_context_t* c, in clip_triangle() argument
902 const vec4_t& equation = c->clipPlanes.plane[plane].equation; in clip_triangle()
916 c->arrays.clipEye(c, buf, t, p, s); in clip_triangle()
927 c->arrays.clipEye(c, buf, t, s, p); in clip_triangle()
981 c->arrays.clipVertex(c, buf, t, p, s); in clip_triangle()
992 c->arrays.clipVertex(c, buf, t, s, p); in clip_triangle()
1024 c->lerp.initTriangle(p0, p1, p2); in clip_triangle()
1025 if (cull_triangle(c, p0, p1, p2)) { in clip_triangle()
1029 triangle(c, p0, p1, p2); in clip_triangle()
1034 unsigned int clip_line(ogles_context_t* c, vertex_t* s, vertex_t* p) in clip_line() argument
1044 const vec4_t& equation = c->clipPlanes.plane[plane].equation; in clip_line()
1053 c->arrays.clipEye(c, p, t, p, s); in clip_line()
1060 c->arrays.clipEye(c, s, t, s, p); in clip_line()
1088 c->arrays.clipVertex(c, p, t, p, s); in clip_line()
1095 c->arrays.clipVertex(c, s, t, s, p); in clip_line()