Lines Matching refs:ctx
82 fetch_state(struct gl_context *ctx, const gl_state_index16 state[],
92 const struct gl_material *mat = &ctx->Light.Material;
113 COPY_4V(value, (float*)&ctx->Light.LightSource[ln] + index * 4);
115 value[0] = ctx->Light.LightSource[ln].SpotCutoff;
123 STATIC_ASSERT(ARRAY_SIZE(ctx->Light.LightSourceData) == 29 * MAX_LIGHTS);
126 assert(state[1] + state[2] <= ARRAY_SIZE(ctx->Light.LightSourceData));
127 memcpy(value, &ctx->Light.LightSourceData[state[1]],
136 &ctx->Light.LightSource[first + i].ConstantAttenuation);
142 COPY_4V(value, ctx->Light.Model.Ambient);
149 value[i] = ctx->Light.Model.Ambient[i]
150 * ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_AMBIENT][i]
151 + ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_EMISSION][i];
153 value[3] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3];
159 value[i] = ctx->Light.Model.Ambient[i]
160 * ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_AMBIENT][i]
161 + ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_EMISSION][i];
163 value[3] = ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_DIFFUSE][3];
183 value[i] = ctx->Light.LightSource[ln].Ambient[attr + i] *
184 ctx->Light.Material.Attrib[index][i];
187 value[3] = ctx->Light.Material.Attrib[index][3];
207 (&ctx->Light.LightSource[light].Ambient[0])[offset] *
208 ctx->Light.Material.Attrib[attrib][chan];
211 *value++ = ctx->Light.Material.Attrib[attrib][3];
233 (&ctx->Light.LightSource[light].Ambient[0])[offset] *
234 ctx->Light.Material.Attrib[attrib][chan];
237 *value++ = ctx->Light.Material.Attrib[attrib][3];
259 (&ctx->Light.LightSource[light].Ambient[0])[offset] *
260 ctx->Light.Material.Attrib[attrib][chan];
263 *value++ = ctx->Light.Material.Attrib[attrib][3];
290 const float *attr = (float*)ctx->Texture.FixedFuncUnit[unit].EyePlane +
299 if (_mesa_get_clamp_fragment_color(ctx, ctx->DrawBuffer))
300 COPY_4V(value, ctx->Texture.FixedFuncUnit[unit].EnvColor);
302 COPY_4V(value, ctx->Texture.FixedFuncUnit[unit].EnvColorUnclamped);
306 if (_mesa_get_clamp_fragment_color(ctx, ctx->DrawBuffer))
307 COPY_4V(value, ctx->Fog.Color);
309 COPY_4V(value, ctx->Fog.ColorUnclamped);
312 value[0] = ctx->Fog.Density;
313 value[1] = ctx->Fog.Start;
314 value[2] = ctx->Fog.End;
315 value[3] = 1.0f / (ctx->Fog.End - ctx->Fog.Start);
320 COPY_4V(value, ctx->Transform.EyeUserPlane[plane]);
324 value[0] = ctx->Point.Size;
325 value[1] = ctx->Point.MinSize;
326 value[2] = ctx->Point.MaxSize;
327 value[3] = ctx->Point.Threshold;
330 value[0] = ctx->Point.Params[0];
331 value[1] = ctx->Point.Params[1];
332 value[2] = ctx->Point.Params[2];
340 const GLmatrix *matrix = ctx->ModelviewMatrixStack.Top;
345 const GLmatrix *matrix = ctx->ModelviewMatrixStack.Top;
350 const GLmatrix *matrix = ctx->ModelviewMatrixStack.Top;
355 const GLmatrix *matrix = ctx->ModelviewMatrixStack.Top;
360 const GLmatrix *matrix = ctx->ProjectionMatrixStack.Top;
365 GLmatrix *matrix = ctx->ProjectionMatrixStack.Top;
371 const GLmatrix *matrix = ctx->ProjectionMatrixStack.Top;
376 GLmatrix *matrix = ctx->ProjectionMatrixStack.Top;
382 const GLmatrix *matrix = &ctx->_ModelProjectMatrix;
387 GLmatrix *matrix = &ctx->_ModelProjectMatrix;
393 const GLmatrix *matrix = &ctx->_ModelProjectMatrix;
398 GLmatrix *matrix = &ctx->_ModelProjectMatrix;
405 assert(index < ARRAY_SIZE(ctx->TextureMatrixStack));
406 const GLmatrix *matrix = ctx->TextureMatrixStack[index].Top;
412 assert(index < ARRAY_SIZE(ctx->TextureMatrixStack));
413 const GLmatrix *matrix = ctx->TextureMatrixStack[index].Top;
419 assert(index < ARRAY_SIZE(ctx->TextureMatrixStack));
420 const GLmatrix *matrix = ctx->TextureMatrixStack[index].Top;
426 assert(index < ARRAY_SIZE(ctx->TextureMatrixStack));
427 const GLmatrix *matrix = ctx->TextureMatrixStack[index].Top;
433 assert(index < ARRAY_SIZE(ctx->ProgramMatrixStack));
434 const GLmatrix *matrix = ctx->ProgramMatrixStack[index].Top;
440 assert(index < ARRAY_SIZE(ctx->ProgramMatrixStack));
441 const GLmatrix *matrix = ctx->ProgramMatrixStack[index].Top;
448 assert(index < ARRAY_SIZE(ctx->ProgramMatrixStack));
449 const GLmatrix *matrix = ctx->ProgramMatrixStack[index].Top;
455 assert(index < ARRAY_SIZE(ctx->ProgramMatrixStack));
456 const GLmatrix *matrix = ctx->ProgramMatrixStack[index].Top;
462 val[0].i = MAX2(1, _mesa_geometric_samples(ctx->DrawBuffer));
465 value[0] = ctx->ViewportArray[0].Near; /* near */
466 value[1] = ctx->ViewportArray[0].Far; /* far */
467 value[2] = ctx->ViewportArray[0].Far - ctx->ViewportArray[0].Near; /* far - near */
472 COPY_4V(value, ctx->FragmentProgram.Parameters[idx]);
478 memcpy(value, ctx->FragmentProgram.Parameters[idx], bytes);
482 float (*params)[4] = ctx->FragmentProgram.Current->arb.LocalParams;
499 float (*params)[4] = ctx->FragmentProgram.Current->arb.LocalParams;
513 COPY_4V(value, ctx->VertexProgram.Parameters[idx]);
519 memcpy(value, ctx->VertexProgram.Parameters[idx], bytes);
523 float (*params)[4] = ctx->VertexProgram.Current->arb.LocalParams;
540 float (*params)[4] = ctx->VertexProgram.Current->arb.LocalParams;
554 ASSIGN_4V(value, ctx->_ModelViewInvScaleEyespace, 0, 0, 1);
560 COPY_4V(value, ctx->Current.Attrib[idx]);
567 if(ctx->Light._ClampVertexColor &&
570 value[0] = SATURATE(ctx->Current.Attrib[idx][0]);
571 value[1] = SATURATE(ctx->Current.Attrib[idx][1]);
572 value[2] = SATURATE(ctx->Current.Attrib[idx][2]);
573 value[3] = SATURATE(ctx->Current.Attrib[idx][3]);
576 COPY_4V(value, ctx->Current.Attrib[idx]);
582 ctx->_ModelViewInvScale,
583 ctx->_ModelViewInvScale,
584 ctx->_ModelViewInvScale,
597 float val = (ctx->Fog.End == ctx->Fog.Start)
598 ? 1.0f : (GLfloat)(-1.0F / (ctx->Fog.End - ctx->Fog.Start));
600 value[1] = ctx->Fog.End * -val;
601 value[2] = (GLfloat)(ctx->Fog.Density * M_LOG2E); /* M_LOG2E == 1/ln(2) */
602 value[3] = (GLfloat)(ctx->Fog.Density * ONE_DIV_SQRT_LN2);
620 if (ctx->Point.PointSprite) {
621 minImplSize = ctx->Const.MinPointSizeAA;
622 maxImplSize = ctx->Const.MaxPointSize;
624 else if (ctx->Point.SmoothFlag || _mesa_is_multisample_enabled(ctx)) {
625 minImplSize = ctx->Const.MinPointSizeAA;
626 maxImplSize = ctx->Const.MaxPointSizeAA;
629 minImplSize = ctx->Const.MinPointSize;
630 maxImplSize = ctx->Const.MaxPointSize;
632 value[0] = ctx->Point.Size;
633 value[1] = ctx->Point.MinSize >= minImplSize ? ctx->Point.MinSize : minImplSize;
634 value[2] = ctx->Point.MaxSize <= maxImplSize ? ctx->Point.MaxSize : maxImplSize;
635 value[3] = ctx->Point.Threshold;
643 COPY_3V(value, ctx->Light.Light[ln]._NormSpotDirection);
644 value[3] = ctx->Light.LightSource[ln]._CosCutoff;
651 COPY_4V(value, ctx->Light.Light[ln]._Position);
659 COPY_4V(value, ctx->Light.Light[first + i]._Position);
669 COPY_4V(p, ctx->Light.Light[ln]._Position);
680 COPY_4V(p, ctx->Light.Light[first + i]._Position);
696 COPY_3V(p, ctx->Light.Light[ln]._Position);
698 ADD_3V(p, p, ctx->_EyeZDir);
706 value[0] = ctx->Pixel.RedScale;
707 value[1] = ctx->Pixel.GreenScale;
708 value[2] = ctx->Pixel.BlueScale;
709 value[3] = ctx->Pixel.AlphaScale;
713 value[0] = ctx->Pixel.RedBias;
714 value[1] = ctx->Pixel.GreenBias;
715 value[2] = ctx->Pixel.BlueBias;
716 value[3] = ctx->Pixel.AlphaBias;
720 value[0] = (GLfloat) (ctx->DrawBuffer->Width - 1);
721 value[1] = (GLfloat) (ctx->DrawBuffer->Height - 1);
729 if (!ctx->DrawBuffer->FlipY) {
734 value[3] = _mesa_geometric_height(ctx->DrawBuffer);
738 value[1] = _mesa_geometric_height(ctx->DrawBuffer);
746 bool flip_y = (ctx->Point.SpriteOrigin == GL_UPPER_LEFT) ^
747 (ctx->Const.PointCoordOriginUpperLeft) ^
748 (ctx->DrawBuffer->FlipY);
758 val[0].i = ctx->TessCtrlProgram.patch_vertices;
762 if (ctx->TessCtrlProgram._Current)
763 val[0].i = ctx->TessCtrlProgram._Current->info.tess.tcs_vertices_out;
765 val[0].i = ctx->TessCtrlProgram.patch_vertices;
770 ctx->Color.BlendEnabled, ctx->Color._AdvancedBlendMode);
774 value[0] = ctx->Color.AlphaRefUnclamped;
780 COPY_4V(value, ctx->Transform._ClipUserPlane[plane]);
787 val[0].i = ctx->AtomicBufferBindings[counter].Offset % ctx->Const.ShaderStorageBufferOffsetAlignment;
1379 _mesa_load_state_parameters(struct gl_context *ctx,
1389 fetch_state(ctx, paramList->Parameters[i].StateIndexes,
1395 _mesa_upload_state_parameters(struct gl_context *ctx,
1403 fetch_state(ctx, paramList->Parameters[i].StateIndexes,