aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/program/ir_to_mesa.cpp
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-11-17 16:37:26 +0100
committermarha <marha@users.sourceforge.net>2011-11-17 16:37:26 +0100
commitd41bc08d1ae8c4784c09d8977816c0fadab1ba52 (patch)
tree4dc3081a9af0316eeee02356a44fcc2419e1b15e /mesalib/src/mesa/program/ir_to_mesa.cpp
parent156e37d3879b316329e3e05579414031da2647e2 (diff)
downloadvcxsrv-d41bc08d1ae8c4784c09d8977816c0fadab1ba52.tar.gz
vcxsrv-d41bc08d1ae8c4784c09d8977816c0fadab1ba52.tar.bz2
vcxsrv-d41bc08d1ae8c4784c09d8977816c0fadab1ba52.zip
xserver mesa git update 17 nov 2011
Diffstat (limited to 'mesalib/src/mesa/program/ir_to_mesa.cpp')
-rw-r--r--mesalib/src/mesa/program/ir_to_mesa.cpp59
1 files changed, 3 insertions, 56 deletions
diff --git a/mesalib/src/mesa/program/ir_to_mesa.cpp b/mesalib/src/mesa/program/ir_to_mesa.cpp
index 1b8b48e53..5cee83778 100644
--- a/mesalib/src/mesa/program/ir_to_mesa.cpp
+++ b/mesalib/src/mesa/program/ir_to_mesa.cpp
@@ -2541,58 +2541,6 @@ count_resources(struct gl_program *prog)
_mesa_update_shader_textures_used(prog);
}
-
-/**
- * Check if the given vertex/fragment/shader program is within the
- * resource limits of the context (number of texture units, etc).
- * If any of those checks fail, record a linker error.
- *
- * XXX more checks are needed...
- */
-static bool
-check_resources(const struct gl_context *ctx,
- struct gl_shader_program *shader_program,
- struct gl_program *prog)
-{
- switch (prog->Target) {
- case GL_VERTEX_PROGRAM_ARB:
- if (_mesa_bitcount(prog->SamplersUsed) >
- ctx->Const.MaxVertexTextureImageUnits) {
- linker_error(shader_program,
- "Too many vertex shader texture samplers");
- }
- if (prog->Parameters->NumParameters > MAX_UNIFORMS) {
- linker_error(shader_program, "Too many vertex shader constants");
- }
- break;
- case MESA_GEOMETRY_PROGRAM:
- if (_mesa_bitcount(prog->SamplersUsed) >
- ctx->Const.MaxGeometryTextureImageUnits) {
- linker_error(shader_program,
- "Too many geometry shader texture samplers");
- }
- if (prog->Parameters->NumParameters >
- MAX_GEOMETRY_UNIFORM_COMPONENTS / 4) {
- linker_error(shader_program, "Too many geometry shader constants");
- }
- break;
- case GL_FRAGMENT_PROGRAM_ARB:
- if (_mesa_bitcount(prog->SamplersUsed) >
- ctx->Const.MaxTextureImageUnits) {
- linker_error(shader_program,
- "Too many fragment shader texture samplers");
- }
- if (prog->Parameters->NumParameters > MAX_UNIFORMS) {
- linker_error(shader_program, "Too many fragment shader constants");
- }
- break;
- default:
- _mesa_problem(ctx, "unexpected program type in check_resources()");
- }
-
- return shader_program->LinkStatus;
-}
-
class add_uniform_to_shader : public uniform_field_visitor {
public:
add_uniform_to_shader(struct gl_shader_program *shader_program,
@@ -3274,9 +3222,6 @@ get_mesa_program(struct gl_context *ctx,
do_set_program_inouts(shader->ir, prog, shader->Type == GL_FRAGMENT_SHADER);
count_resources(prog);
- if (!check_resources(ctx, shader_program, prog))
- goto fail_exit;
-
_mesa_reference_program(ctx, &shader->Program, prog);
if ((ctx->Shader.Flags & GLSL_NO_OPT) == 0) {
@@ -3513,7 +3458,9 @@ _mesa_glsl_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
}
}
- set_uniform_initializers(ctx, prog);
+ if (prog->LinkStatus) {
+ set_uniform_initializers(ctx, prog);
+ }
if (ctx->Shader.Flags & GLSL_DUMP) {
if (!prog->LinkStatus) {