diff options
author | Indrajit Kumar Das <[email protected]> | 2020-04-21 16:00:14 +0530 |
---|---|---|
committer | Indrajit Kumar Das <[email protected]> | 2020-04-23 12:02:45 +0530 |
commit | ede36a2efe4d40c0ec81f465fdde761a7c335290 (patch) | |
tree | 724b39cd740e1de97fc37533369f9f1cd8881dd8 /src/mesa/main/multisample.c | |
parent | d82f0572180a0d3f4bb87cf49c325439d38ab6e3 (diff) |
mesa: add support for AlphaToCoverageDitherControlNV
Reviewed-by: Marek Olšák <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4543>
Diffstat (limited to 'src/mesa/main/multisample.c')
-rw-r--r-- | src/mesa/main/multisample.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/mesa/main/multisample.c b/src/mesa/main/multisample.c index d494a43ac7d..66eb0c8b98e 100644 --- a/src/mesa/main/multisample.c +++ b/src/mesa/main/multisample.c @@ -63,6 +63,7 @@ _mesa_init_multisample(struct gl_context *ctx) { ctx->Multisample.Enabled = GL_TRUE; ctx->Multisample.SampleAlphaToCoverage = GL_FALSE; + ctx->Multisample.SampleAlphaToCoverageDitherControl = GL_ALPHA_TO_COVERAGE_DITHER_DEFAULT_NV; ctx->Multisample.SampleAlphaToOne = GL_FALSE; ctx->Multisample.SampleCoverage = GL_FALSE; ctx->Multisample.SampleCoverageValue = 1.0; @@ -351,3 +352,33 @@ _mesa_check_sample_count(struct gl_context *ctx, GLenum target, return (GLuint) samples > ctx->Const.MaxSamples ? GL_INVALID_VALUE : GL_NO_ERROR; } + +void GLAPIENTRY +_mesa_AlphaToCoverageDitherControlNV_no_error(GLenum mode) +{ + GET_CURRENT_CONTEXT(ctx); + + FLUSH_VERTICES(ctx, ctx->DriverFlags.NewSampleAlphaToXEnable ? 0 : + _NEW_MULTISAMPLE); + ctx->NewDriverState |= ctx->DriverFlags.NewSampleAlphaToXEnable; + ctx->Multisample.SampleAlphaToCoverageDitherControl = mode; +} + +void GLAPIENTRY +_mesa_AlphaToCoverageDitherControlNV(GLenum mode) +{ + GET_CURRENT_CONTEXT(ctx); + + FLUSH_VERTICES(ctx, ctx->DriverFlags.NewSampleAlphaToXEnable ? 0 : + _NEW_MULTISAMPLE); + ctx->NewDriverState |= ctx->DriverFlags.NewSampleAlphaToXEnable; + switch (mode) { + case GL_ALPHA_TO_COVERAGE_DITHER_DEFAULT_NV: + case GL_ALPHA_TO_COVERAGE_DITHER_ENABLE_NV: + case GL_ALPHA_TO_COVERAGE_DITHER_DISABLE_NV: + ctx->Multisample.SampleAlphaToCoverageDitherControl = mode; + break; + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glAlphaToCoverageDitherControlNV(invalid parameter)"); + } +} |