Module: Mesa Branch: main Commit: f5eda36760ccb78e6a9ac9253b9e2fc750eef233 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f5eda36760ccb78e6a9ac9253b9e2fc750eef233
Author: Dave Airlie <[email protected]> Date: Thu Dec 9 16:52:46 2021 +1000 mesa/st: move get sample position code to static in mesa Reviewed-by: Emma Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14257> --- src/mesa/main/multisample.c | 22 ++++++++++++++++++++-- src/mesa/state_tracker/st_cb_msaa.c | 20 -------------------- src/mesa/state_tracker/st_cb_msaa.h | 4 ---- 3 files changed, 20 insertions(+), 26 deletions(-) diff --git a/src/mesa/main/multisample.c b/src/mesa/main/multisample.c index 3c88e2bbad7..68763e314be 100644 --- a/src/mesa/main/multisample.c +++ b/src/mesa/main/multisample.c @@ -32,9 +32,10 @@ #include "main/glformats.h" #include "main/state.h" #include "api_exec_decl.h" +#include "main/framebuffer.h" #include "state_tracker/st_format.h" -#include "state_tracker/st_cb_msaa.h" +#include "state_tracker/st_context.h" /** * Called via glSampleCoverageARB @@ -80,6 +81,23 @@ _mesa_init_multisample(struct gl_context *ctx) ctx->Multisample.SampleMaskValue = ~(GLbitfield)0; } +static void +get_sample_position(struct gl_context *ctx, + struct gl_framebuffer *fb, + GLuint index, + GLfloat *outPos) +{ + struct st_context *st = st_context(ctx); + + st_validate_state(st, ST_PIPELINE_UPDATE_FRAMEBUFFER); + + if (ctx->pipe->get_sample_position) + ctx->pipe->get_sample_position(ctx->pipe, + _mesa_geometric_samples(fb), + index, outPos); + else + outPos[0] = outPos[1] = 0.5f; +} void GLAPIENTRY _mesa_GetMultisamplefv(GLenum pname, GLuint index, GLfloat * val) @@ -97,7 +115,7 @@ _mesa_GetMultisamplefv(GLenum pname, GLuint index, GLfloat * val) return; } - st_GetSamplePosition(ctx, ctx->DrawBuffer, index, val); + get_sample_position(ctx, ctx->DrawBuffer, index, val); /* FBOs can be upside down (winsys always are)*/ if (ctx->DrawBuffer->FlipY) diff --git a/src/mesa/state_tracker/st_cb_msaa.c b/src/mesa/state_tracker/st_cb_msaa.c index b85c9d8c16b..bf6ebbe69ba 100644 --- a/src/mesa/state_tracker/st_cb_msaa.c +++ b/src/mesa/state_tracker/st_cb_msaa.c @@ -36,26 +36,6 @@ #include "pipe/p_context.h" - -void -st_GetSamplePosition(struct gl_context *ctx, - struct gl_framebuffer *fb, - GLuint index, - GLfloat *outPos) -{ - struct st_context *st = st_context(ctx); - - st_validate_state(st, ST_PIPELINE_UPDATE_FRAMEBUFFER); - - if (st->pipe->get_sample_position) - st->pipe->get_sample_position(st->pipe, - _mesa_geometric_samples(fb), - index, outPos); - else - outPos[0] = outPos[1] = 0.5f; -} - - void st_GetProgrammableSampleCaps(struct gl_context *ctx, const struct gl_framebuffer *fb, GLuint *outBits, GLuint *outWidth, GLuint *outHeight) diff --git a/src/mesa/state_tracker/st_cb_msaa.h b/src/mesa/state_tracker/st_cb_msaa.h index d901a8df9a7..af38aba0294 100644 --- a/src/mesa/state_tracker/st_cb_msaa.h +++ b/src/mesa/state_tracker/st_cb_msaa.h @@ -31,10 +31,6 @@ #include "main/glheader.h" -void st_GetSamplePosition(struct gl_context *ctx, - struct gl_framebuffer *fb, - GLuint index, - GLfloat *outPos); void st_GetProgrammableSampleCaps(struct gl_context *ctx, const struct gl_framebuffer *fb, GLuint *outBits, GLuint *outWidth, GLuint *outHeight); #endif
