mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 05:08:08 +02:00
change initialization of texcoords - not all C compilers support non-constant array initializers
This commit is contained in:
parent
3d8a791ff9
commit
0d957ca400
1 changed files with 36 additions and 6 deletions
|
|
@ -39,10 +39,15 @@ GLvoid _slang_library_tex1d (GLfloat bias, GLfloat s, GLfloat sampler, GLfloat *
|
|||
GET_CURRENT_CONTEXT(ctx);
|
||||
SWcontext *swrast = SWRAST_CONTEXT(ctx);
|
||||
GLuint unit = (GLuint) sampler;
|
||||
GLfloat texcoord[4] = { s, 0.0f, 0.0f, 1.0f };
|
||||
GLfloat texcoord[4];
|
||||
GLfloat lambda = bias;
|
||||
GLchan rgba[4];
|
||||
|
||||
texcoord[0] = s;
|
||||
texcoord[1] = 0.0f;
|
||||
texcoord[2] = 0.0f;
|
||||
texcoord[3] = 1.0f;
|
||||
|
||||
swrast->TextureSample[unit] (ctx, ctx->Texture.Unit[unit]._Current, 1,
|
||||
(const GLfloat (*)[4]) texcoord, &lambda, &rgba);
|
||||
color[0] = CHAN_TO_FLOAT(rgba[0]);
|
||||
|
|
@ -56,10 +61,15 @@ GLvoid _slang_library_tex2d (GLfloat bias, GLfloat s, GLfloat t, GLfloat sampler
|
|||
GET_CURRENT_CONTEXT(ctx);
|
||||
SWcontext *swrast = SWRAST_CONTEXT(ctx);
|
||||
GLuint unit = (GLuint) sampler;
|
||||
GLfloat texcoord[4] = { s, t, 0.0f, 1.0f };
|
||||
GLfloat texcoord[4];
|
||||
GLfloat lambda = bias;
|
||||
GLchan rgba[4];
|
||||
|
||||
texcoord[0] = s;
|
||||
texcoord[1] = t;
|
||||
texcoord[2] = 0.0f;
|
||||
texcoord[3] = 1.0f;
|
||||
|
||||
swrast->TextureSample[unit] (ctx, ctx->Texture.Unit[unit]._Current, 1,
|
||||
(const GLfloat (*)[4]) texcoord, &lambda, &rgba);
|
||||
color[0] = CHAN_TO_FLOAT(rgba[0]);
|
||||
|
|
@ -74,10 +84,15 @@ GLvoid _slang_library_tex3d (GLfloat bias, GLfloat s, GLfloat t, GLfloat r, GLfl
|
|||
GET_CURRENT_CONTEXT(ctx);
|
||||
SWcontext *swrast = SWRAST_CONTEXT(ctx);
|
||||
GLuint unit = (GLuint) sampler;
|
||||
GLfloat texcoord[4] = { s, t, r, 1.0f };
|
||||
GLfloat texcoord[4];
|
||||
GLfloat lambda = bias;
|
||||
GLchan rgba[4];
|
||||
|
||||
texcoord[0] = s;
|
||||
texcoord[1] = t;
|
||||
texcoord[2] = r;
|
||||
texcoord[3] = 1.0f;
|
||||
|
||||
swrast->TextureSample[unit] (ctx, ctx->Texture.Unit[unit]._Current, 1,
|
||||
(const GLfloat (*)[4]) texcoord, &lambda, &rgba);
|
||||
color[0] = CHAN_TO_FLOAT(rgba[0]);
|
||||
|
|
@ -92,10 +107,15 @@ GLvoid _slang_library_texcube (GLfloat bias, GLfloat s, GLfloat t, GLfloat r, GL
|
|||
GET_CURRENT_CONTEXT(ctx);
|
||||
SWcontext *swrast = SWRAST_CONTEXT(ctx);
|
||||
GLuint unit = (GLuint) sampler;
|
||||
GLfloat texcoord[4] = { s, t, r, 1.0f };
|
||||
GLfloat texcoord[4];
|
||||
GLfloat lambda = bias;
|
||||
GLchan rgba[4];
|
||||
|
||||
texcoord[0] = s;
|
||||
texcoord[1] = t;
|
||||
texcoord[2] = r;
|
||||
texcoord[3] = 1.0f;
|
||||
|
||||
swrast->TextureSample[unit] (ctx, ctx->Texture.Unit[unit]._Current, 1,
|
||||
(const GLfloat (*)[4]) texcoord, &lambda, &rgba);
|
||||
color[0] = CHAN_TO_FLOAT(rgba[0]);
|
||||
|
|
@ -110,10 +130,15 @@ GLvoid _slang_library_shad1d (GLfloat bias, GLfloat s, GLfloat t, GLfloat r, GLf
|
|||
GET_CURRENT_CONTEXT(ctx);
|
||||
SWcontext *swrast = SWRAST_CONTEXT(ctx);
|
||||
GLuint unit = (GLuint) sampler;
|
||||
GLfloat texcoord[4] = { s, t, r, 1.0f };
|
||||
GLfloat texcoord[4];
|
||||
GLfloat lambda = bias;
|
||||
GLchan rgba[4];
|
||||
|
||||
texcoord[0] = s;
|
||||
texcoord[1] = t;
|
||||
texcoord[2] = r;
|
||||
texcoord[3] = 1.0f;
|
||||
|
||||
swrast->TextureSample[unit] (ctx, ctx->Texture.Unit[unit]._Current, 1,
|
||||
(const GLfloat (*)[4]) texcoord, &lambda, &rgba);
|
||||
color[0] = CHAN_TO_FLOAT(rgba[0]);
|
||||
|
|
@ -128,10 +153,15 @@ GLvoid _slang_library_shad2d (GLfloat bias, GLfloat s, GLfloat t, GLfloat r, GLf
|
|||
GET_CURRENT_CONTEXT(ctx);
|
||||
SWcontext *swrast = SWRAST_CONTEXT(ctx);
|
||||
GLuint unit = (GLuint) sampler;
|
||||
GLfloat texcoord[4] = { s, t, r, 1.0f };
|
||||
GLfloat texcoord[4];
|
||||
GLfloat lambda = bias;
|
||||
GLchan rgba[4];
|
||||
|
||||
texcoord[0] = s;
|
||||
texcoord[1] = t;
|
||||
texcoord[2] = r;
|
||||
texcoord[3] = 1.0f;
|
||||
|
||||
swrast->TextureSample[unit] (ctx, ctx->Texture.Unit[unit]._Current, 1,
|
||||
(const GLfloat (*)[4]) texcoord, &lambda, &rgba);
|
||||
color[0] = CHAN_TO_FLOAT(rgba[0]);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue