diff options
author | Marek Olšák <[email protected]> | 2017-06-09 23:27:41 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-06-22 01:51:02 +0200 |
commit | 68a0e15f44cf351eab97a734b1cffeade1873fdf (patch) | |
tree | 99162f29dc09f7f0c11e89d5508d9f7c337f6892 /src/mesa/main/state.h | |
parent | 585c5cf8a514783d9ed31dba3aa432797dd5f0e8 (diff) |
mesa: replace VP/FP/ATIfs _Enabled flags with helper functions
These are only used in the GL compatibility profile.
Reviewed-by: Nicolai Hähnle <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/mesa/main/state.h')
-rw-r--r-- | src/mesa/main/state.h | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/mesa/main/state.h b/src/mesa/main/state.h index 6d81c3f421b..b719f392965 100644 --- a/src/mesa/main/state.h +++ b/src/mesa/main/state.h @@ -72,12 +72,19 @@ _mesa_need_secondary_color(const struct gl_context *ctx) return GL_FALSE; } +static inline bool +_mesa_arb_vertex_program_enabled(const struct gl_context *ctx) +{ + return ctx->VertexProgram.Enabled && + ctx->VertexProgram.Current->arb.Instructions; +} + /** Compute two sided lighting state for fixed function or programs. */ static inline bool _mesa_vertex_program_two_side_enabled(const struct gl_context *ctx) { if (ctx->_Shader->CurrentProgram[MESA_SHADER_VERTEX] || - ctx->VertexProgram._Enabled) + _mesa_arb_vertex_program_enabled(ctx)) return ctx->VertexProgram.TwoSideEnabled; return ctx->Light.Enabled && ctx->Light.Model.TwoSide; @@ -93,4 +100,18 @@ _mesa_polygon_get_front_bit(const struct gl_context *ctx) return ctx->Polygon.FrontFace == GL_CCW; } +static inline bool +_mesa_arb_fragment_program_enabled(const struct gl_context *ctx) +{ + return ctx->FragmentProgram.Enabled && + ctx->FragmentProgram.Current->arb.Instructions; +} + +static inline bool +_mesa_ati_fragment_shader_enabled(const struct gl_context *ctx) +{ + return ctx->ATIFragmentShader.Enabled && + ctx->ATIFragmentShader.Current->Instructions[0]; +} + #endif |