From: Erik Faye-Lund Date: Thu, 4 Jul 2019 08:07:27 +0000 (+0200) Subject: mesa: expose alpha-ref as a state-variable X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fdc4450c285d21251a6a1de3f0765a934ea0567c;p=mesa.git mesa: expose alpha-ref as a state-variable Reviewed-by: Marek Olšák --- diff --git a/src/mesa/program/prog_statevars.c b/src/mesa/program/prog_statevars.c index 5178b61ec4a..1b35979d633 100644 --- a/src/mesa/program/prog_statevars.c +++ b/src/mesa/program/prog_statevars.c @@ -602,6 +602,10 @@ _mesa_fetch_state(struct gl_context *ctx, const gl_state_index16 state[], ctx->Color.BlendEnabled, ctx->Color._AdvancedBlendMode); return; + case STATE_ALPHA_REF: + value[0] = ctx->Color.AlphaRefUnclamped; + return; + /* XXX: make sure new tokens added here are also handled in the * _mesa_program_state_flags() switch, below. */ @@ -713,6 +717,9 @@ _mesa_program_state_flags(const gl_state_index16 state[STATE_LENGTH]) case STATE_ADVANCED_BLENDING_MODE: return _NEW_COLOR; + case STATE_ALPHA_REF: + return _NEW_COLOR; + default: /* unknown state indexes are silently ignored and * no flag set, since it is handled by the driver. @@ -919,6 +926,9 @@ append_token(char *dst, gl_state_index k) case STATE_ADVANCED_BLENDING_MODE: append(dst, "AdvancedBlendingMode"); break; + case STATE_ALPHA_REF: + append(dst, "alphaRef"); + break; default: /* probably STATE_INTERNAL_DRIVER+i (driver private state) */ append(dst, "driverState"); diff --git a/src/mesa/program/prog_statevars.h b/src/mesa/program/prog_statevars.h index f28d2bb4a37..1418f84f630 100644 --- a/src/mesa/program/prog_statevars.h +++ b/src/mesa/program/prog_statevars.h @@ -129,6 +129,7 @@ typedef enum gl_state_index_ { * currently active advanced blending equation, or zero if disabled. */ STATE_ADVANCED_BLENDING_MODE, + STATE_ALPHA_REF, /* alpha-test reference value */ STATE_INTERNAL_DRIVER /* first available state index for drivers (must be last) */ } gl_state_index;