Home | History | Annotate | Download | only in program

Lines Matching full:ctx

51 _mesa_fetch_state(struct gl_context *ctx, const gl_state_index state[],
59 const struct gl_material *mat = &ctx->Light.Material;
87 _mesa_problem(ctx, "Invalid material state in fetch_state");
98 COPY_4V(value, ctx->Light.Light[ln].Ambient);
101 COPY_4V(value, ctx->Light.Light[ln].Diffuse);
104 COPY_4V(value, ctx->Light.Light[ln].Specular);
107 COPY_4V(value, ctx->Light.Light[ln].EyePosition);
110 value[0] = ctx->Light.Light[ln].ConstantAttenuation;
111 value[1] = ctx->Light.Light[ln].LinearAttenuation;
112 value[2] = ctx->Light.Light[ln].QuadraticAttenuation;
113 value[3] = ctx->Light.Light[ln].SpotExponent;
116 COPY_3V(value, ctx->Light.Light[ln].SpotDirection);
117 value[3] = ctx->Light.Light[ln]._CosCutoff;
120 value[0] = ctx->Light.Light[ln].SpotCutoff;
130 COPY_3V(p, ctx->Light.Light[ln].EyePosition);
138 _mesa_problem(ctx, "Invalid light state in fetch_state");
143 COPY_4V(value, ctx->Light.Model.Ambient);
150 value[i] = ctx->Light.Model.Ambient[i]
151 * ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_AMBIENT][i]
152 + ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_EMISSION][i];
154 value[3] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3];
160 value[i] = ctx->Light.Model.Ambient[i]
161 * ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_AMBIENT][i]
162 + ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_EMISSION][i];
164 value[3] = ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_DIFFUSE][3];
176 value[i] = ctx->Light.Light[ln].Ambient[i] *
177 ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_AMBIENT+face][i];
180 value[3] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_AMBIENT+face][3];
184 value[i] = ctx->Light.Light[ln].Diffuse[i] *
185 ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE+face][i];
188 value[3] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE+face][3];
192 value[i] = ctx->Light.Light[ln].Specular[i] *
193 ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_SPECULAR+face][i];
196 value[3] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_SPECULAR+face][3];
199 _mesa_problem(ctx, "Invalid lightprod state in fetch_state");
210 COPY_4V(value, ctx->Texture.Unit[unit].GenS.EyePlane);
213 COPY_4V(value, ctx->Texture.Unit[unit].GenT.EyePlane);
216 COPY_4V(value, ctx->Texture.Unit[unit].GenR.EyePlane);
219 COPY_4V(value, ctx->Texture.Unit[unit].GenQ.EyePlane);
222 COPY_4V(value, ctx->Texture.Unit[unit].GenS.ObjectPlane);
225 COPY_4V(value, ctx->Texture.Unit[unit].GenT.ObjectPlane);
228 COPY_4V(value, ctx->Texture.Unit[unit].GenR.ObjectPlane);
231 COPY_4V(value, ctx->Texture.Unit[unit].GenQ.ObjectPlane);
234 _mesa_problem(ctx, "Invalid texgen state in fetch_state");
242 if(ctx->Color._ClampFragmentColor)
243 COPY_4V(value, ctx->Texture.Unit[unit].EnvColor);
245 COPY_4V(value, ctx->Texture.Unit[unit].EnvColorUnclamped);
249 if(ctx->Color._ClampFragmentColor)
250 COPY_4V(value, ctx->Fog.Color);
252 COPY_4V(value, ctx->Fog.ColorUnclamped);
255 value[0] = ctx->Fog.Density;
256 value[1] = ctx->Fog.Start;
257 value[2] = ctx->Fog.End;
258 value[3] = (ctx->Fog.End == ctx->Fog.Start)
259 ? 1.0f : (GLfloat)(1.0 / (ctx->Fog.End - ctx->Fog.Start));
264 COPY_4V(value, ctx->Transform.EyeUserPlane[plane]);
268 value[0] = ctx->Point.Size;
269 value[1] = ctx->Point.MinSize;
270 value[2] = ctx->Point.MaxSize;
271 value[3] = ctx->Point.Threshold;
274 value[0] = ctx->Point.Params[0];
275 value[1] = ctx->Point.Params[1];
276 value[2] = ctx->Point.Params[2];
303 matrix = ctx->ModelviewMatrixStack.Top;
306 matrix = ctx->ProjectionMatrixStack.Top;
309 matrix = &ctx->_ModelProjectMatrix;
312 ASSERT(index < Elements(ctx->TextureMatrixStack));
313 matrix = ctx->TextureMatrixStack[index].Top;
316 ASSERT(index < Elements(ctx->ProgramMatrixStack));
317 matrix = ctx->ProgramMatrixStack[index].Top;
320 _mesa_problem(ctx, "Bad matrix name in _mesa_fetch_state()");
353 value[0] = ctx->Viewport.Near; /* near */
354 value[1] = ctx->Viewport.Far; /* far */
355 value[2] = ctx->Viewport.Far - ctx->Viewport.Near; /* far - near */
365 COPY_4V(value, ctx->FragmentProgram.Parameters[idx]);
368 COPY_4V(value, ctx->FragmentProgram.Current->Base.LocalParams[idx]);
371 _mesa_problem(ctx, "Bad state switch in _mesa_fetch_state()");
384 COPY_4V(value, ctx->VertexProgram.Parameters[idx]);
387 COPY_4V(value, ctx->VertexProgram.Current->Base.LocalParams[idx]);
390 _mesa_problem(ctx, "Bad state switch in _mesa_fetch_state()");
397 ASSIGN_4V(value, ctx->_ModelViewInvScale, 0, 0, 1);
405 COPY_4V(value, ctx->Current.Attrib[idx]);
412 if(ctx->Light._ClampVertexColor &&
415 value[0] = CLAMP(ctx->Current.Attrib[idx][0], 0.0f, 1.0f);
416 value[1] = CLAMP(ctx->Current.Attrib[idx][1], 0.0f, 1.0f);
417 value[2] = CLAMP(ctx->Current.Attrib[idx][2], 0.0f, 1.0f);
418 value[3] = CLAMP(ctx->Current.Attrib[idx][3], 0.0f, 1.0f);
421 COPY_4V(value, ctx->Current.Attrib[idx]);
427 ctx->_ModelViewInvScale,
428 ctx->_ModelViewInvScale,
429 ctx->_ModelViewInvScale,
440 = ctx->Texture.Unit[unit]._Current;
460 value[0] = (ctx->Fog.End == ctx->Fog.Start)
461 ? 1.0f : (GLfloat)(-1.0F / (ctx->Fog.End - ctx->Fog.Start));
462 value[1] = ctx->Fog.End * -value[0];
463 value[2] = (GLfloat)(ctx->Fog.Density * M_LOG2E); /* M_LOG2E == 1/ln(2) */
464 value[3] = (GLfloat)(ctx->Fog.Density * ONE_DIV_SQRT_LN2);
481 if (ctx->Point.PointSprite) {
482 minImplSize = ctx->Const.MinPointSizeAA;
483 maxImplSize = ctx->Const.MaxPointSize;
485 else if (ctx->Point.SmoothFlag || ctx->Multisample._Enabled) {
486 minImplSize = ctx->Const.MinPointSizeAA;
487 maxImplSize = ctx->Const.MaxPointSizeAA;
490 minImplSize = ctx->Const.MinPointSize;
491 maxImplSize = ctx->Const.MaxPointSize;
493 value[0] = ctx->Point.Size;
494 value[1] = ctx->Point.MinSize >= minImplSize ? ctx->Point.MinSize : minImplSize;
495 value[2] = ctx->Point.MaxSize <= maxImplSize ? ctx->Point.MaxSize : maxImplSize;
496 value[3] = ctx->Point.Threshold;
504 COPY_3V(value, ctx->Light.Light[ln]._NormSpotDirection);
505 value[3] = ctx->Light.Light[ln]._CosCutoff;
512 COPY_4V(value, ctx->Light.Light[ln]._Position);
519 COPY_4V(value, ctx->Light.Light[ln]._Position);
532 COPY_3V(p, ctx->Light.Light[ln]._Position);
534 ADD_3V(value, p, ctx->_EyeZDir);
541 value[0] = ctx->Pixel.RedScale;
542 value[1] = ctx->Pixel.GreenScale;
543 value[2] = ctx->Pixel.BlueScale;
544 value[3] = ctx->Pixel.AlphaScale;
548 value[0] = ctx->Pixel.RedBias;
549 value[1] = ctx->Pixel.GreenBias;
550 value[2] = ctx->Pixel.BlueBias;
551 value[3] = ctx->Pixel.AlphaBias;
555 value[0] = (GLfloat) (ctx->DrawBuffer->Width - 1);
556 value[1] = (GLfloat) (ctx->DrawBuffer->Height - 1);
564 if (_mesa_is_user_fbo(ctx->DrawBuffer)) {
569 value[3] = (GLfloat) ctx->DrawBuffer->Height;
573 value[1] = (GLfloat) ctx->DrawBuffer->Height;
582 GLfloat *rotMat22 = ctx->Texture.Unit[unit].RotMatrix;
593 GLfloat *rotMat22 = ctx->Texture.Unit[unit].RotMatrix;
613 _mesa_problem(ctx, "Invalid state in _mesa_fetch_state");
1061 _mesa_load_state_parameters(struct gl_context *ctx,
1071 _mesa_fetch_state(ctx,
1113 _mesa_load_tracked_matrices(struct gl_context *ctx)
1120 if (ctx->VertexProgram.TrackMatrix[i] == GL_MODELVIEW) {
1121 mat = ctx->ModelviewMatrixStack.Top;
1123 else if (ctx->VertexProgram.TrackMatrix[i] == GL_PROJECTION) {
1124 mat = ctx->ProjectionMatrixStack.Top;
1126 else if (ctx->VertexProgram.TrackMatrix[i] == GL_TEXTURE) {
1127 GLuint unit = MIN2(ctx->Texture.CurrentUnit,
1128 Elements(ctx->TextureMatrixStack) - 1);
1129 mat = ctx->TextureMatrixStack[unit].Top;
1131 else if (ctx->VertexProgram.TrackMatrix[i]==GL_MODELVIEW_PROJECTION_NV) {
1133 mat = &ctx->_ModelProjectMatrix;
1135 else if (ctx->VertexProgram.TrackMatrix[i] >= GL_MATRIX0_NV &&
1136 ctx->VertexProgram.TrackMatrix[i] <= GL_MATRIX7_NV) {
1137 GLuint n = ctx->VertexProgram.TrackMatrix[i] - GL_MATRIX0_NV;
1138 ASSERT(n < Elements(ctx->ProgramMatrixStack));
1139 mat = ctx->ProgramMatrixStack[n].Top;
1143 assert(ctx->VertexProgram.TrackMatrix[i] == GL_NONE);
1148 if (ctx->VertexProgram.TrackMatrixTransform[i] == GL_IDENTITY_NV) {
1149 load_matrix(ctx->VertexProgram.Parameters, i*4, mat->m);
1151 else if (ctx->VertexProgram.TrackMatrixTransform[i] == GL_INVERSE_NV) {
1154 load_matrix(ctx->VertexProgram.Parameters, i*4, mat->inv);
1156 else if (ctx->VertexProgram.TrackMatrixTransform[i] == GL_TRANSPOSE_NV) {
1157 load_transpose_matrix(ctx->VertexProgram.Parameters, i*4, mat->m);
1160 assert(ctx->VertexProgram.TrackMatrixTransform[i]
1164 load_transpose_matrix(ctx->VertexProgram.Parameters, i*4, mat->inv);