aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/main.cpp
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-01-10 23:39:19 +0100
committermarha <marha@users.sourceforge.net>2014-01-10 23:39:19 +0100
commitaaeb8bf497c82efabc4f9b27c319042c0e72d816 (patch)
tree0df2c4a5b027a07dd1e3bf8707c72f25fe71b4f1 /mesalib/src/glsl/main.cpp
parentbe6e384aa4b97dc81b88ab5b04328c161828e760 (diff)
downloadvcxsrv-aaeb8bf497c82efabc4f9b27c319042c0e72d816.tar.gz
vcxsrv-aaeb8bf497c82efabc4f9b27c319042c0e72d816.tar.bz2
vcxsrv-aaeb8bf497c82efabc4f9b27c319042c0e72d816.zip
randrproto libfontenc mesa xserver git update 10 Jan 2014
xserver commit a92c6406e7f6c0b74fb1cb9361ad904facc0f722 libfontenc commit 0037a42107b952c9d903719615747e760e4e7247 randrproto commit 1755cbe0f501a86afe515f92bb24e417a1866092 mesa commit 532b1fecd93fd30d3b1b101b55fd2c6e074088ad
Diffstat (limited to 'mesalib/src/glsl/main.cpp')
-rw-r--r--mesalib/src/glsl/main.cpp127
1 files changed, 64 insertions, 63 deletions
diff --git a/mesalib/src/glsl/main.cpp b/mesalib/src/glsl/main.cpp
index aa188b1f1..03b7c786b 100644
--- a/mesalib/src/glsl/main.cpp
+++ b/mesalib/src/glsl/main.cpp
@@ -62,20 +62,20 @@ initialize_context(struct gl_context *ctx, gl_api api)
ctx->Const.MaxTextureCoordUnits = 0;
ctx->Const.MaxTextureUnits = 8;
- ctx->Const.VertexProgram.MaxAttribs = 8;
- ctx->Const.VertexProgram.MaxTextureImageUnits = 0;
- ctx->Const.VertexProgram.MaxUniformComponents = 128 * 4;
- ctx->Const.VertexProgram.MaxInputComponents = 0; /* not used */
- ctx->Const.VertexProgram.MaxOutputComponents = 32;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs = 8;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits = 0;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents = 128 * 4;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxInputComponents = 0; /* not used */
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents = 32;
- ctx->Const.FragmentProgram.MaxTextureImageUnits =
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits =
ctx->Const.MaxCombinedTextureImageUnits;
- ctx->Const.FragmentProgram.MaxUniformComponents = 16 * 4;
- ctx->Const.FragmentProgram.MaxInputComponents =
- ctx->Const.VertexProgram.MaxOutputComponents;
- ctx->Const.FragmentProgram.MaxOutputComponents = 0; /* not used */
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents = 16 * 4;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents =
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxOutputComponents = 0; /* not used */
- ctx->Const.MaxVarying = ctx->Const.VertexProgram.MaxOutputComponents / 4;
+ ctx->Const.MaxVarying = ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents / 4;
break;
case 110:
case 120:
@@ -88,20 +88,20 @@ initialize_context(struct gl_context *ctx, gl_api api)
ctx->Const.MaxTextureCoordUnits = 2;
ctx->Const.MaxTextureUnits = 2;
- ctx->Const.VertexProgram.MaxAttribs = 16;
- ctx->Const.VertexProgram.MaxTextureImageUnits = 0;
- ctx->Const.VertexProgram.MaxUniformComponents = 512;
- ctx->Const.VertexProgram.MaxInputComponents = 0; /* not used */
- ctx->Const.VertexProgram.MaxOutputComponents = 32;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs = 16;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits = 0;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents = 512;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxInputComponents = 0; /* not used */
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents = 32;
- ctx->Const.FragmentProgram.MaxTextureImageUnits =
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits =
ctx->Const.MaxCombinedTextureImageUnits;
- ctx->Const.FragmentProgram.MaxUniformComponents = 64;
- ctx->Const.FragmentProgram.MaxInputComponents =
- ctx->Const.VertexProgram.MaxOutputComponents;
- ctx->Const.FragmentProgram.MaxOutputComponents = 0; /* not used */
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents = 64;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents =
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxOutputComponents = 0; /* not used */
- ctx->Const.MaxVarying = ctx->Const.VertexProgram.MaxOutputComponents / 4;
+ ctx->Const.MaxVarying = ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents / 4;
break;
case 130:
case 140:
@@ -114,19 +114,19 @@ initialize_context(struct gl_context *ctx, gl_api api)
ctx->Const.MaxTextureCoordUnits = 8;
ctx->Const.MaxTextureUnits = 2;
- ctx->Const.VertexProgram.MaxAttribs = 16;
- ctx->Const.VertexProgram.MaxTextureImageUnits = 16;
- ctx->Const.VertexProgram.MaxUniformComponents = 1024;
- ctx->Const.VertexProgram.MaxInputComponents = 0; /* not used */
- ctx->Const.VertexProgram.MaxOutputComponents = 64;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs = 16;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits = 16;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents = 1024;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxInputComponents = 0; /* not used */
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents = 64;
- ctx->Const.FragmentProgram.MaxTextureImageUnits = 16;
- ctx->Const.FragmentProgram.MaxUniformComponents = 1024;
- ctx->Const.FragmentProgram.MaxInputComponents =
- ctx->Const.VertexProgram.MaxOutputComponents;
- ctx->Const.FragmentProgram.MaxOutputComponents = 0; /* not used */
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits = 16;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents = 1024;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents =
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxOutputComponents = 0; /* not used */
- ctx->Const.MaxVarying = ctx->Const.VertexProgram.MaxOutputComponents / 4;
+ ctx->Const.MaxVarying = ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents / 4;
break;
case 150:
case 330:
@@ -138,28 +138,28 @@ initialize_context(struct gl_context *ctx, gl_api api)
ctx->Const.MaxTextureCoordUnits = 8;
ctx->Const.MaxTextureUnits = 2;
- ctx->Const.VertexProgram.MaxAttribs = 16;
- ctx->Const.VertexProgram.MaxTextureImageUnits = 16;
- ctx->Const.VertexProgram.MaxUniformComponents = 1024;
- ctx->Const.VertexProgram.MaxInputComponents = 0; /* not used */
- ctx->Const.VertexProgram.MaxOutputComponents = 64;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs = 16;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits = 16;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents = 1024;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxInputComponents = 0; /* not used */
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents = 64;
- ctx->Const.GeometryProgram.MaxTextureImageUnits = 16;
- ctx->Const.GeometryProgram.MaxUniformComponents = 1024;
- ctx->Const.GeometryProgram.MaxInputComponents =
- ctx->Const.VertexProgram.MaxOutputComponents;
- ctx->Const.GeometryProgram.MaxOutputComponents = 128;
+ ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxTextureImageUnits = 16;
+ ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxUniformComponents = 1024;
+ ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxInputComponents =
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents;
+ ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxOutputComponents = 128;
- ctx->Const.FragmentProgram.MaxTextureImageUnits = 16;
- ctx->Const.FragmentProgram.MaxUniformComponents = 1024;
- ctx->Const.FragmentProgram.MaxInputComponents =
- ctx->Const.GeometryProgram.MaxOutputComponents;
- ctx->Const.FragmentProgram.MaxOutputComponents = 0; /* not used */
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits = 16;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents = 1024;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents =
+ ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxOutputComponents;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxOutputComponents = 0; /* not used */
ctx->Const.MaxCombinedTextureImageUnits =
- ctx->Const.VertexProgram.MaxTextureImageUnits
- + ctx->Const.GeometryProgram.MaxTextureImageUnits
- + ctx->Const.FragmentProgram.MaxTextureImageUnits;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits
+ + ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxTextureImageUnits
+ + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits;
ctx->Const.MaxGeometryOutputVertices = 256;
ctx->Const.MaxGeometryTotalOutputComponents = 1024;
@@ -178,18 +178,18 @@ initialize_context(struct gl_context *ctx, gl_api api)
ctx->Const.MaxTextureCoordUnits = 0;
ctx->Const.MaxTextureUnits = 0;
- ctx->Const.VertexProgram.MaxAttribs = 16;
- ctx->Const.VertexProgram.MaxTextureImageUnits = 16;
- ctx->Const.VertexProgram.MaxUniformComponents = 1024;
- ctx->Const.VertexProgram.MaxInputComponents = 0; /* not used */
- ctx->Const.VertexProgram.MaxOutputComponents = 16 * 4;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs = 16;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits = 16;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents = 1024;
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxInputComponents = 0; /* not used */
+ ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents = 16 * 4;
- ctx->Const.FragmentProgram.MaxTextureImageUnits = 16;
- ctx->Const.FragmentProgram.MaxUniformComponents = 224;
- ctx->Const.FragmentProgram.MaxInputComponents = 15 * 4;
- ctx->Const.FragmentProgram.MaxOutputComponents = 0; /* not used */
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits = 16;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents = 224;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents = 15 * 4;
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxOutputComponents = 0; /* not used */
- ctx->Const.MaxVarying = ctx->Const.FragmentProgram.MaxInputComponents / 4;
+ ctx->Const.MaxVarying = ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents / 4;
break;
}
@@ -276,7 +276,7 @@ void
compile_shader(struct gl_context *ctx, struct gl_shader *shader)
{
struct _mesa_glsl_parse_state *state =
- new(shader) _mesa_glsl_parse_state(ctx, shader->Type, shader);
+ new(shader) _mesa_glsl_parse_state(ctx, shader->Stage, shader);
_mesa_glsl_compile_shader(ctx, shader, dump_ast, dump_hir);
@@ -362,6 +362,7 @@ main(int argc, char **argv)
shader->Type = GL_FRAGMENT_SHADER;
else
usage_fail(argv[0]);
+ shader->Stage = _mesa_shader_enum_to_shader_stage(shader->Type);
shader->Source = load_text_file(whole_program, argv[optind]);
if (shader->Source == NULL) {
@@ -388,7 +389,7 @@ main(int argc, char **argv)
printf("Info log for linking:\n%s\n", whole_program->InfoLog);
}
- for (unsigned i = 0; i < MESA_SHADER_TYPES; i++)
+ for (unsigned i = 0; i < MESA_SHADER_STAGES; i++)
ralloc_free(whole_program->_LinkedShaders[i]);
ralloc_free(whole_program);