Lines Matching refs:v
54 void perspective(ogles_context_t* c, vertex_t* v, uint32_t enables) in perspective() argument
69 const int32_t rw = gglRecip28(v->clip.w); in perspective()
71 v->window.w = rw; in perspective()
72 v->window.x = gglMulAddx(gglMulx(v->clip.x, rw, 16), m[ 0], m[12], 28); in perspective()
73 v->window.y = gglMulAddx(gglMulx(v->clip.y, rw, 16), m[ 5], m[13], 28); in perspective()
74 v->window.x = TRI_FROM_FIXED(v->window.x); in perspective()
75 v->window.y = TRI_FROM_FIXED(v->window.y); in perspective()
77 v->window.z = gglMulAddx(gglMulx(v->clip.z, rw, 16), m[10], m[14], 28); in perspective()
83 void clipFrustumPerspective(ogles_context_t* c, vertex_t* v, uint32_t enables) in clipFrustumPerspective() argument
89 uint32_t clip = v->flags & vertex_t::CLIP_ALL; in clipFrustumPerspective()
90 const GLfixed w = v->clip.w; in clipFrustumPerspective()
91 if (v->clip.x < -w) clip |= vertex_t::CLIP_L; in clipFrustumPerspective()
92 if (v->clip.x > w) clip |= vertex_t::CLIP_R; in clipFrustumPerspective()
93 if (v->clip.y < -w) clip |= vertex_t::CLIP_B; in clipFrustumPerspective()
94 if (v->clip.y > w) clip |= vertex_t::CLIP_T; in clipFrustumPerspective()
95 if (v->clip.z < -w) clip |= vertex_t::CLIP_N; in clipFrustumPerspective()
96 if (v->clip.z > w) clip |= vertex_t::CLIP_F; in clipFrustumPerspective()
98 v->flags |= clip; in clipFrustumPerspective()
104 perspective(c, v, enables); in clipFrustumPerspective()
110 void clipAllPerspective(ogles_context_t* c, vertex_t* v, uint32_t enables) in clipAllPerspective() argument
114 &c->transforms.modelview.transform, &v->eye, &v->obj); in clipAllPerspective()
115 v->flags |= vertex_t::EYE; in clipAllPerspective()
124 GLfixed d = dot4(c->clipPlanes.plane[i].equation.v, v->eye.v); in clipAllPerspective()
129 v->flags |= clip; in clipAllPerspective()
131 clipFrustumPerspective(c, v, enables); in clipAllPerspective()
136 void ogles_vertex_project(ogles_context_t* c, vertex_t* v) { in ogles_vertex_project() argument
137 perspective(c, v, c->rasterizer.state.enables); in ogles_vertex_project()
140 void ogles_vertex_perspective2D(ogles_context_t* c, vertex_t* v) in ogles_vertex_perspective2D() argument
145 v->window.x = TRI_FROM_FIXED(v->clip.x); in ogles_vertex_perspective2D()
146 v->window.y = TRI_FROM_FIXED(v->clip.y); in ogles_vertex_perspective2D()
147 v->window.z = v->clip.z; in ogles_vertex_perspective2D()
148 v->window.w = v->clip.w << 12; in ogles_vertex_perspective2D()
151 void ogles_vertex_perspective3DZ(ogles_context_t* c, vertex_t* v) { in ogles_vertex_perspective3DZ() argument
152 clipFrustumPerspective(c, v, GGL_ENABLE_DEPTH_TEST); in ogles_vertex_perspective3DZ()
154 void ogles_vertex_perspective3D(ogles_context_t* c, vertex_t* v) { in ogles_vertex_perspective3D() argument
155 clipFrustumPerspective(c, v, 0); in ogles_vertex_perspective3D()
157 void ogles_vertex_clipAllPerspective3DZ(ogles_context_t* c, vertex_t* v) { in ogles_vertex_clipAllPerspective3DZ() argument
158 clipAllPerspective(c, v, GGL_ENABLE_DEPTH_TEST); in ogles_vertex_clipAllPerspective3DZ()
160 void ogles_vertex_clipAllPerspective3D(ogles_context_t* c, vertex_t* v) { in ogles_vertex_clipAllPerspective3D() argument
161 clipAllPerspective(c, v, 0); in ogles_vertex_clipAllPerspective3D()
173 memcpy(equation.v, equ, sizeof(vec4_t)); in clipPlanex()