diff options
author | Rhys Perry <[email protected]> | 2018-06-14 19:56:28 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2018-06-14 20:09:45 -0600 |
commit | 67f40dadaa6666dacd90d1540eaadef20b9d48ba (patch) | |
tree | a070a32006510b483b9710ef6acb7356f6c94b01 /src/mesa/main/multisample.c | |
parent | cd2e673abc436d71e304fd5ad577054197041c7f (diff) |
mesa: add support for ARB_sample_locations
Signed-off-by: Rhys Perry <[email protected]>
Reviewed-by: Brian Paul <[email protected]> (v2)
Reviewed-by: Marek Olšák <[email protected]> (v2)
Diffstat (limited to 'src/mesa/main/multisample.c')
-rw-r--r-- | src/mesa/main/multisample.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/mesa/main/multisample.c b/src/mesa/main/multisample.c index dfe6a371427..f93a18832da 100644 --- a/src/mesa/main/multisample.c +++ b/src/mesa/main/multisample.c @@ -101,6 +101,24 @@ _mesa_GetMultisamplefv(GLenum pname, GLuint index, GLfloat * val) return; } + case GL_PROGRAMMABLE_SAMPLE_LOCATION_ARB: + if (!ctx->Extensions.ARB_sample_locations) { + _mesa_error( ctx, GL_INVALID_ENUM, "glGetMultisamplefv(pname)" ); + return; + } + + if (index >= MAX_SAMPLE_LOCATION_TABLE_SIZE * 2) { + _mesa_error( ctx, GL_INVALID_VALUE, "glGetMultisamplefv(index)" ); + return; + } + + if (ctx->DrawBuffer->SampleLocationTable) + *val = ctx->DrawBuffer->SampleLocationTable[index]; + else + *val = 0.5f; + + return; + default: _mesa_error( ctx, GL_INVALID_ENUM, "glGetMultisamplefv(pname)" ); return; |