[Mesa-dev] [PATCH 14/17] glsl: Remove ADD_VARYING macro
Ilia Mirkin
imirkin at alum.mit.edu
Wed Aug 26 10:30:05 PDT 2015
Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>
On Wed, Aug 26, 2015 at 1:20 PM, Ian Romanick <idr at freedesktop.org> wrote:
> From: Ian Romanick <ian.d.romanick at intel.com>
>
> The purpose of the macro was to create the name_as_gs_input from name.
> The previous commit removed the name_as_gs_input from add_varying, so
> the macro is unnecessary.
>
> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
> ---
> src/glsl/builtin_variables.cpp | 27 ++++++++++++---------------
> 1 file changed, 12 insertions(+), 15 deletions(-)
>
> diff --git a/src/glsl/builtin_variables.cpp b/src/glsl/builtin_variables.cpp
> index 30faaa4..2628434 100644
> --- a/src/glsl/builtin_variables.cpp
> +++ b/src/glsl/builtin_variables.cpp
> @@ -1085,32 +1085,29 @@ builtin_variable_generator::add_varying(int slot, const glsl_type *type,
> void
> builtin_variable_generator::generate_varyings()
> {
> -#define ADD_VARYING(loc, type, name) \
> - add_varying(loc, type, name)
> -
> /* gl_Position and gl_PointSize are not visible from fragment shaders. */
> if (state->stage != MESA_SHADER_FRAGMENT) {
> - ADD_VARYING(VARYING_SLOT_POS, vec4_t, "gl_Position");
> - ADD_VARYING(VARYING_SLOT_PSIZ, float_t, "gl_PointSize");
> + add_varying(VARYING_SLOT_POS, vec4_t, "gl_Position");
> + add_varying(VARYING_SLOT_PSIZ, float_t, "gl_PointSize");
> }
>
> if (state->is_version(130, 0)) {
> - ADD_VARYING(VARYING_SLOT_CLIP_DIST0, array(float_t, 0),
> + add_varying(VARYING_SLOT_CLIP_DIST0, array(float_t, 0),
> "gl_ClipDistance");
> }
>
> if (compatibility) {
> - ADD_VARYING(VARYING_SLOT_TEX0, array(vec4_t, 0), "gl_TexCoord");
> - ADD_VARYING(VARYING_SLOT_FOGC, float_t, "gl_FogFragCoord");
> + add_varying(VARYING_SLOT_TEX0, array(vec4_t, 0), "gl_TexCoord");
> + add_varying(VARYING_SLOT_FOGC, float_t, "gl_FogFragCoord");
> if (state->stage == MESA_SHADER_FRAGMENT) {
> - ADD_VARYING(VARYING_SLOT_COL0, vec4_t, "gl_Color");
> - ADD_VARYING(VARYING_SLOT_COL1, vec4_t, "gl_SecondaryColor");
> + add_varying(VARYING_SLOT_COL0, vec4_t, "gl_Color");
> + add_varying(VARYING_SLOT_COL1, vec4_t, "gl_SecondaryColor");
> } else {
> - ADD_VARYING(VARYING_SLOT_CLIP_VERTEX, vec4_t, "gl_ClipVertex");
> - ADD_VARYING(VARYING_SLOT_COL0, vec4_t, "gl_FrontColor");
> - ADD_VARYING(VARYING_SLOT_BFC0, vec4_t, "gl_BackColor");
> - ADD_VARYING(VARYING_SLOT_COL1, vec4_t, "gl_FrontSecondaryColor");
> - ADD_VARYING(VARYING_SLOT_BFC1, vec4_t, "gl_BackSecondaryColor");
> + add_varying(VARYING_SLOT_CLIP_VERTEX, vec4_t, "gl_ClipVertex");
> + add_varying(VARYING_SLOT_COL0, vec4_t, "gl_FrontColor");
> + add_varying(VARYING_SLOT_BFC0, vec4_t, "gl_BackColor");
> + add_varying(VARYING_SLOT_COL1, vec4_t, "gl_FrontSecondaryColor");
> + add_varying(VARYING_SLOT_BFC1, vec4_t, "gl_BackSecondaryColor");
> }
> }
>
> --
> 2.1.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list