mesa/st: move viewport to direct call
Acked-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14100>
This commit is contained in:
@@ -63,6 +63,7 @@
|
||||
#include "util/u_memory.h"
|
||||
|
||||
#include "state_tracker/st_cb_texture.h"
|
||||
#include "state_tracker/st_cb_viewport.h"
|
||||
|
||||
static inline bool
|
||||
copy_texture_attribs(struct gl_texture_object *dst,
|
||||
@@ -1100,8 +1101,7 @@ _mesa_PopAttrib(void)
|
||||
|
||||
memcpy(&ctx->ViewportArray[i].X, &vp->X, sizeof(float) * 6);
|
||||
|
||||
if (ctx->Driver.Viewport)
|
||||
ctx->Driver.Viewport(ctx);
|
||||
st_viewport(ctx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -319,21 +319,6 @@ struct dd_function_table {
|
||||
struct gl_buffer_object *indexbuf,
|
||||
uint32_t enabled_attribs);
|
||||
|
||||
/**
|
||||
* \name State-changing functions.
|
||||
*
|
||||
* \note drawing functions are above.
|
||||
*
|
||||
* These functions are called by their corresponding OpenGL API functions.
|
||||
* They are \e also called by the gl_PopAttrib() function!!!
|
||||
* May add more functions like these to the device driver in the future.
|
||||
*/
|
||||
/*@{*/
|
||||
/** Set the viewport */
|
||||
void (*Viewport)(struct gl_context *ctx);
|
||||
/*@}*/
|
||||
|
||||
|
||||
/**
|
||||
* \name Vertex/pixel buffer object functions
|
||||
*/
|
||||
|
||||
@@ -35,6 +35,8 @@
|
||||
#include "mtypes.h"
|
||||
#include "viewport.h"
|
||||
|
||||
#include "state_tracker/st_cb_viewport.h"
|
||||
|
||||
static void
|
||||
clamp_viewport(struct gl_context *ctx, GLfloat *x, GLfloat *y,
|
||||
GLfloat *width, GLfloat *height)
|
||||
@@ -113,8 +115,7 @@ viewport(struct gl_context *ctx, GLint x, GLint y, GLsizei width,
|
||||
for (unsigned i = 0; i < ctx->Const.MaxViewports; i++)
|
||||
set_viewport_no_notify(ctx, i, input.X, input.Y, input.Width, input.Height);
|
||||
|
||||
if (ctx->Driver.Viewport)
|
||||
ctx->Driver.Viewport(ctx);
|
||||
st_viewport(ctx);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -166,8 +167,7 @@ _mesa_set_viewport(struct gl_context *ctx, unsigned idx, GLfloat x, GLfloat y,
|
||||
clamp_viewport(ctx, &x, &y, &width, &height);
|
||||
set_viewport_no_notify(ctx, idx, x, y, width, height);
|
||||
|
||||
if (ctx->Driver.Viewport)
|
||||
ctx->Driver.Viewport(ctx);
|
||||
st_viewport(ctx);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -182,8 +182,7 @@ viewport_array(struct gl_context *ctx, GLuint first, GLsizei count,
|
||||
inputs[i].Width, inputs[i].Height);
|
||||
}
|
||||
|
||||
if (ctx->Driver.Viewport)
|
||||
ctx->Driver.Viewport(ctx);
|
||||
st_viewport(ctx);
|
||||
}
|
||||
|
||||
void GLAPIENTRY
|
||||
|
||||
@@ -34,8 +34,7 @@
|
||||
#include "pipe/p_defines.h"
|
||||
#include "util/u_atomic.h"
|
||||
|
||||
|
||||
static void st_viewport(struct gl_context *ctx)
|
||||
void st_viewport(struct gl_context *ctx)
|
||||
{
|
||||
struct st_context *st = ctx->st;
|
||||
struct st_framebuffer *stdraw;
|
||||
@@ -59,8 +58,3 @@ static void st_viewport(struct gl_context *ctx)
|
||||
if (stread && stread != stdraw)
|
||||
stread->iface_stamp = p_atomic_read(&stread->iface->stamp) - 1;
|
||||
}
|
||||
|
||||
void st_init_viewport_functions(struct dd_function_table *functions)
|
||||
{
|
||||
functions->Viewport = st_viewport;
|
||||
}
|
||||
|
||||
@@ -28,9 +28,6 @@
|
||||
#ifndef ST_CB_VIEWPORT_H
|
||||
#define ST_CB_VIEWPORT_H
|
||||
|
||||
struct dd_function_table;
|
||||
|
||||
extern void
|
||||
st_init_viewport_functions(struct dd_function_table *functions);
|
||||
void st_viewport(struct gl_context *ctx);
|
||||
|
||||
#endif /* ST_CB_VIEW_PORT_H */
|
||||
|
||||
@@ -59,7 +59,6 @@
|
||||
#include "st_cb_program.h"
|
||||
#include "st_cb_queryobj.h"
|
||||
#include "st_cb_flush.h"
|
||||
#include "st_cb_viewport.h"
|
||||
#include "st_atom.h"
|
||||
#include "st_draw.h"
|
||||
#include "st_extensions.h"
|
||||
@@ -934,7 +933,6 @@ st_init_driver_functions(struct pipe_screen *screen,
|
||||
st_init_msaa_functions(functions);
|
||||
st_init_program_functions(functions);
|
||||
st_init_flush_functions(screen, functions);
|
||||
st_init_viewport_functions(functions);
|
||||
st_init_compute_functions(functions);
|
||||
|
||||
st_init_vdpau_functions(functions);
|
||||
|
||||
Reference in New Issue
Block a user