summaryrefslogtreecommitdiff
path: root/src/mesa/tnl
diff options
context:
space:
mode:
authorMichal Krol <mjkrol@gmail.org>2006-03-21 10:37:40 +0000
committerMichal Krol <mjkrol@gmail.org>2006-03-21 10:37:40 +0000
commit071357096e682e9af59ad45ea5abc444ab431837 (patch)
tree99fba2183fe97981f7c309d99b206b39e43f5bec /src/mesa/tnl
parent519b23b21f9cd6945fd17cdb26e7a6f531cdeec0 (diff)
GLSL fixes:
- generate error on NULL pointers in glShaderSourceARB; - reinstall program object, if current, in glLinkProgramARB; - vertex and fragment shaders are optional in program object; - floor asm was wrongly computed for x86 back-end; - allow for (void) idiom in function prototypes; - all fixed-state uniforms are updated; - local variable initializers are working; - implement texture* and shadow* functions for vertex processor; - generate error if too many arguments in general constructor; - trim unused data in general constructor; - struct r-value field select was badly relocated; Changes: - add derived state gl_fog_attrib::_Scale; - add derived state gl_light::_CosCutoffNeg;
Diffstat (limited to 'src/mesa/tnl')
-rw-r--r--src/mesa/tnl/t_vb_arbprogram.c4
-rw-r--r--src/mesa/tnl/t_vb_arbshader.c4
-rw-r--r--src/mesa/tnl/t_vb_cull.c2
-rw-r--r--src/mesa/tnl/t_vb_fog.c2
-rw-r--r--src/mesa/tnl/t_vb_light.c4
-rw-r--r--src/mesa/tnl/t_vb_normals.c2
-rw-r--r--src/mesa/tnl/t_vb_points.c2
-rw-r--r--src/mesa/tnl/t_vb_program.c2
-rw-r--r--src/mesa/tnl/t_vb_texgen.c4
-rw-r--r--src/mesa/tnl/t_vb_texmat.c2
-rw-r--r--src/mesa/tnl/t_vb_vertex.c2
11 files changed, 15 insertions, 15 deletions
diff --git a/src/mesa/tnl/t_vb_arbprogram.c b/src/mesa/tnl/t_vb_arbprogram.c
index 7472b51d70..11a5b654fc 100644
--- a/src/mesa/tnl/t_vb_arbprogram.c
+++ b/src/mesa/tnl/t_vb_arbprogram.c
@@ -1264,7 +1264,7 @@ run_arb_vertex_program(GLcontext *ctx, struct tnl_pipeline_stage *stage)
GLuint i, j;
GLbitfield outputs;
- if (ctx->ShaderObjects.CurrentProgram != NULL)
+ if (ctx->ShaderObjects._VertexShaderPresent)
return GL_TRUE;
program = (ctx->VertexProgram._Enabled ? ctx->VertexProgram.Current : ctx->_TnlProgram);
@@ -1427,7 +1427,7 @@ validate_vertex_program( GLcontext *ctx, struct tnl_pipeline_stage *stage )
struct arb_vp_machine *m = ARB_VP_MACHINE(stage);
struct vertex_program *program;
- if (ctx->ShaderObjects.CurrentProgram != NULL)
+ if (ctx->ShaderObjects._VertexShaderPresent)
return;
program = (ctx->VertexProgram._Enabled ? ctx->VertexProgram.Current : 0);
diff --git a/src/mesa/tnl/t_vb_arbshader.c b/src/mesa/tnl/t_vb_arbshader.c
index 65304372dd..a2e6b37cd3 100644
--- a/src/mesa/tnl/t_vb_arbshader.c
+++ b/src/mesa/tnl/t_vb_arbshader.c
@@ -172,10 +172,10 @@ static GLboolean run_arb_vertex_shader (GLcontext *ctx, struct tnl_pipeline_stag
struct gl2_program_intf **pro;
GLsizei i, j;
- pro = ctx->ShaderObjects.CurrentProgram;
- if (pro == NULL)
+ if (!ctx->ShaderObjects._VertexShaderPresent)
return GL_TRUE;
+ pro = ctx->ShaderObjects.CurrentProgram;
(**pro).UpdateFixedUniforms (pro);
for (i = 0; i < vb->Count; i++)
diff --git a/src/mesa/tnl/t_vb_cull.c b/src/mesa/tnl/t_vb_cull.c
index 3a022e84c4..b5ba68dc86 100644
--- a/src/mesa/tnl/t_vb_cull.c
+++ b/src/mesa/tnl/t_vb_cull.c
@@ -57,7 +57,7 @@ static GLboolean run_cull_stage( GLcontext *ctx,
GLuint count = VB->Count;
GLuint i;
- if (ctx->ShaderObjects.CurrentProgram != NULL)
+ if (ctx->ShaderObjects._VertexShaderPresent)
return GL_TRUE;
if (ctx->VertexProgram._Enabled ||
diff --git a/src/mesa/tnl/t_vb_fog.c b/src/mesa/tnl/t_vb_fog.c
index 2bd9824dc0..bbee44ebea 100644
--- a/src/mesa/tnl/t_vb_fog.c
+++ b/src/mesa/tnl/t_vb_fog.c
@@ -148,7 +148,7 @@ run_fog_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage)
struct fog_stage_data *store = FOG_STAGE_DATA(stage);
GLvector4f *input;
- if (ctx->ShaderObjects.CurrentProgram != NULL)
+ if (ctx->ShaderObjects._VertexShaderPresent)
return GL_TRUE;
if (!ctx->Fog.Enabled || ctx->VertexProgram._Enabled)
diff --git a/src/mesa/tnl/t_vb_light.c b/src/mesa/tnl/t_vb_light.c
index d4c83189c2..4d360007a4 100644
--- a/src/mesa/tnl/t_vb_light.c
+++ b/src/mesa/tnl/t_vb_light.c
@@ -203,7 +203,7 @@ static GLboolean run_lighting( GLcontext *ctx,
GLvector4f *input = ctx->_NeedEyeCoords ? VB->EyePtr : VB->ObjPtr;
GLuint idx;
- if (ctx->ShaderObjects.CurrentProgram != NULL)
+ if (ctx->ShaderObjects._VertexShaderPresent)
return GL_TRUE;
if (!ctx->Light.Enabled || ctx->VertexProgram._Enabled)
@@ -264,7 +264,7 @@ static void validate_lighting( GLcontext *ctx,
{
light_func *tab;
- if (ctx->ShaderObjects.CurrentProgram != NULL)
+ if (ctx->ShaderObjects._VertexShaderPresent)
return;
if (!ctx->Light.Enabled || ctx->VertexProgram._Enabled)
diff --git a/src/mesa/tnl/t_vb_normals.c b/src/mesa/tnl/t_vb_normals.c
index e87a67981e..edcb4de6e9 100644
--- a/src/mesa/tnl/t_vb_normals.c
+++ b/src/mesa/tnl/t_vb_normals.c
@@ -95,7 +95,7 @@ validate_normal_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage)
{
struct normal_stage_data *store = NORMAL_STAGE_DATA(stage);
- if (ctx->ShaderObjects.CurrentProgram != NULL) {
+ if (ctx->ShaderObjects._VertexShaderPresent) {
store->NormalTransform = NULL;
return;
}
diff --git a/src/mesa/tnl/t_vb_points.c b/src/mesa/tnl/t_vb_points.c
index d7f9ad687e..0ad3607917 100644
--- a/src/mesa/tnl/t_vb_points.c
+++ b/src/mesa/tnl/t_vb_points.c
@@ -47,7 +47,7 @@ struct point_stage_data {
static GLboolean
run_point_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage)
{
- if (ctx->ShaderObjects.CurrentProgram != NULL)
+ if (ctx->ShaderObjects._VertexShaderPresent)
return GL_TRUE;
if (ctx->Point._Attenuated && !ctx->VertexProgram._Enabled) {
diff --git a/src/mesa/tnl/t_vb_program.c b/src/mesa/tnl/t_vb_program.c
index 3908997d71..06789b97ba 100644
--- a/src/mesa/tnl/t_vb_program.c
+++ b/src/mesa/tnl/t_vb_program.c
@@ -80,7 +80,7 @@ run_vp( GLcontext *ctx, struct tnl_pipeline_stage *stage )
struct vertex_program *program = ctx->VertexProgram.Current;
GLuint i;
- if (ctx->ShaderObjects.CurrentProgram != NULL)
+ if (ctx->ShaderObjects._VertexShaderPresent)
return GL_TRUE;
if (!ctx->VertexProgram._Enabled ||
diff --git a/src/mesa/tnl/t_vb_texgen.c b/src/mesa/tnl/t_vb_texgen.c
index 058e7b10b2..bfb7a50369 100644
--- a/src/mesa/tnl/t_vb_texgen.c
+++ b/src/mesa/tnl/t_vb_texgen.c
@@ -488,7 +488,7 @@ static GLboolean run_texgen_stage( GLcontext *ctx,
struct texgen_stage_data *store = TEXGEN_STAGE_DATA(stage);
GLuint i;
- if (ctx->ShaderObjects.CurrentProgram != NULL)
+ if (ctx->ShaderObjects._VertexShaderPresent)
return GL_TRUE;
if (!ctx->Texture._TexGenEnabled || ctx->VertexProgram._Enabled)
@@ -516,7 +516,7 @@ static void validate_texgen_stage( GLcontext *ctx,
struct texgen_stage_data *store = TEXGEN_STAGE_DATA(stage);
GLuint i;
- if (ctx->ShaderObjects.CurrentProgram != NULL)
+ if (ctx->ShaderObjects._VertexShaderPresent)
return;
if (!ctx->Texture._TexGenEnabled || ctx->VertexProgram._Enabled)
diff --git a/src/mesa/tnl/t_vb_texmat.c b/src/mesa/tnl/t_vb_texmat.c
index 701f27bd8a..1feb0b750e 100644
--- a/src/mesa/tnl/t_vb_texmat.c
+++ b/src/mesa/tnl/t_vb_texmat.c
@@ -61,7 +61,7 @@ static GLboolean run_texmat_stage( GLcontext *ctx,
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
GLuint i;
- if (ctx->ShaderObjects.CurrentProgram != NULL)
+ if (ctx->ShaderObjects._VertexShaderPresent)
return GL_TRUE;
if (!ctx->Texture._TexMatEnabled || ctx->VertexProgram._Enabled)
diff --git a/src/mesa/tnl/t_vb_vertex.c b/src/mesa/tnl/t_vb_vertex.c
index f0694f9a69..e0a58aaaf3 100644
--- a/src/mesa/tnl/t_vb_vertex.c
+++ b/src/mesa/tnl/t_vb_vertex.c
@@ -126,7 +126,7 @@ static GLboolean run_vertex_stage( GLcontext *ctx,
TNLcontext *tnl = TNL_CONTEXT(ctx);
struct vertex_buffer *VB = &tnl->vb;
- if (ctx->ShaderObjects.CurrentProgram != NULL)
+ if (ctx->ShaderObjects._VertexShaderPresent)
return GL_TRUE;
if (ctx->VertexProgram._Enabled)