diff options
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/fog.c | 24 | ||||
-rw-r--r-- | src/mesa/main/hint.c | 26 | ||||
-rw-r--r-- | src/mesa/main/mtypes.h | 8 |
3 files changed, 29 insertions, 29 deletions
diff --git a/src/mesa/main/fog.c b/src/mesa/main/fog.c index df99c6519f6..50a61bd84bf 100644 --- a/src/mesa/main/fog.c +++ b/src/mesa/main/fog.c @@ -70,14 +70,14 @@ _mesa_Fogiv(GLenum pname, const GLint *params ) ; } _mesa_Fogfv(pname, p); -}
-
-
-#define UPDATE_FOG_SCALE(ctx) do {\
- if (ctx->Fog.End == ctx->Fog.Start)\
- ctx->Fog._Scale = 1.0f;\
- else\
- ctx->Fog._Scale = 1.0f / (ctx->Fog.End - ctx->Fog.Start);\
+} + + +#define UPDATE_FOG_SCALE(ctx) do {\ + if (ctx->Fog.End == ctx->Fog.Start)\ + ctx->Fog._Scale = 1.0f;\ + else\ + ctx->Fog._Scale = 1.0f / (ctx->Fog.End - ctx->Fog.Start);\ } while(0) @@ -119,14 +119,14 @@ _mesa_Fogfv( GLenum pname, const GLfloat *params ) if (ctx->Fog.Start == *params) return; FLUSH_VERTICES(ctx, _NEW_FOG); - ctx->Fog.Start = *params;
+ ctx->Fog.Start = *params; UPDATE_FOG_SCALE(ctx); break; case GL_FOG_END: if (ctx->Fog.End == *params) return; - FLUSH_VERTICES(ctx, _NEW_FOG);
- ctx->Fog.End = *params;
+ FLUSH_VERTICES(ctx, _NEW_FOG); + ctx->Fog.End = *params; UPDATE_FOG_SCALE(ctx); break; case GL_FOG_INDEX: @@ -183,6 +183,6 @@ void _mesa_init_fog( GLcontext * ctx ) ctx->Fog.Start = 0.0; ctx->Fog.End = 1.0; ctx->Fog.ColorSumEnabled = GL_FALSE; - ctx->Fog.FogCoordinateSource = GL_FRAGMENT_DEPTH_EXT;
+ ctx->Fog.FogCoordinateSource = GL_FRAGMENT_DEPTH_EXT; ctx->Fog._Scale = 1.0f; } diff --git a/src/mesa/main/hint.c b/src/mesa/main/hint.c index 6680edd1655..dcfa9c7363f 100644 --- a/src/mesa/main/hint.c +++ b/src/mesa/main/hint.c @@ -109,18 +109,18 @@ _mesa_Hint( GLenum target, GLenum mode ) return; FLUSH_VERTICES(ctx, _NEW_HINT); ctx->Hint.GenerateMipmap = mode; - break;
-
- /* GL_ARB_fragment_shader */
- case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB:
- if (!ctx->Extensions.ARB_fragment_shader) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glHint(target)");
- return;
- }
- if (ctx->Hint.FragmentShaderDerivative == mode)
- return;
- FLUSH_VERTICES(ctx, _NEW_HINT);
- ctx->Hint.FragmentShaderDerivative = mode;
+ break; + + /* GL_ARB_fragment_shader */ + case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB: + if (!ctx->Extensions.ARB_fragment_shader) { + _mesa_error(ctx, GL_INVALID_ENUM, "glHint(target)"); + return; + } + if (ctx->Hint.FragmentShaderDerivative == mode) + return; + FLUSH_VERTICES(ctx, _NEW_HINT); + ctx->Hint.FragmentShaderDerivative = mode; break; default: @@ -148,6 +148,6 @@ void _mesa_init_hint( GLcontext * ctx ) ctx->Hint.Fog = GL_DONT_CARE; ctx->Hint.ClipVolumeClipping = GL_DONT_CARE; ctx->Hint.TextureCompression = GL_DONT_CARE; - ctx->Hint.GenerateMipmap = GL_DONT_CARE;
+ ctx->Hint.GenerateMipmap = GL_DONT_CARE; ctx->Hint.FragmentShaderDerivative = GL_DONT_CARE; } diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 00b01878465..7876cff2ed5 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -451,7 +451,7 @@ struct gl_light GLfloat EyePosition[4]; /**< position in eye coordinates */ GLfloat EyeDirection[4]; /**< spotlight dir in eye coordinates */ GLfloat SpotExponent; - GLfloat SpotCutoff; /**< in degrees */
+ GLfloat SpotCutoff; /**< in degrees */ GLfloat _CosCutoffNeg; /**< = cos(SpotCutoff) */ GLfloat _CosCutoff; /**< = MAX(0, cos(SpotCutoff)) */ GLfloat ConstantAttenuation; @@ -750,7 +750,7 @@ struct gl_fog_attrib GLfloat Index; /**< Fog index */ GLenum Mode; /**< Fog mode */ GLboolean ColorSumEnabled; - GLenum FogCoordinateSource; /**< GL_EXT_fog_coord */
+ GLenum FogCoordinateSource; /**< GL_EXT_fog_coord */ GLfloat _Scale; /**< (End == Start) ? 1.0 : 1.0 / (End - Start) */ }; @@ -1974,8 +1974,8 @@ struct gl_query_state */ struct gl_shader_objects_state { - struct gl2_program_intf **CurrentProgram;
- GLboolean _VertexShaderPresent;
+ struct gl2_program_intf **CurrentProgram; + GLboolean _VertexShaderPresent; GLboolean _FragmentShaderPresent; }; |