mesa/st: move get sample position code to static in mesa
Reviewed-by: Emma Anholt <emma@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14257>
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user