wined3d: Make wined3d_context_gl_set_draw_buffer() static.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2022-04-19 20:20:38 -05:00 committed by Alexandre Julliard
parent 68cd60436c
commit 6fc2799bd0
2 changed files with 18 additions and 19 deletions

View File

@ -466,6 +466,24 @@ static inline DWORD context_generate_rt_mask_from_resource(struct wined3d_resour
return (1u << 31) | wined3d_texture_get_gl_buffer(texture_from_resource(resource)); return (1u << 31) | wined3d_texture_get_gl_buffer(texture_from_resource(resource));
} }
/* Context activation is done by the caller. */
static void wined3d_context_gl_set_draw_buffer(struct wined3d_context_gl *context_gl, GLenum buffer)
{
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
struct fbo_entry *current_fbo = context_gl->current_fbo;
uint32_t new_mask = context_generate_rt_mask(buffer);
uint32_t *current_mask;
current_mask = current_fbo ? &current_fbo->rt_mask : &context_gl->draw_buffers_mask;
if (new_mask == *current_mask)
return;
gl_info->gl_ops.gl.p_glDrawBuffer(buffer);
checkGLcall("glDrawBuffer()");
*current_mask = new_mask;
}
static inline void wined3d_context_gl_set_fbo_key_for_render_target(const struct wined3d_context_gl *context_gl, static inline void wined3d_context_gl_set_fbo_key_for_render_target(const struct wined3d_context_gl *context_gl,
struct wined3d_fbo_entry_key *key, unsigned int idx, const struct wined3d_rendertarget_info *render_target, struct wined3d_fbo_entry_key *key, unsigned int idx, const struct wined3d_rendertarget_info *render_target,
DWORD location) DWORD location)
@ -2502,24 +2520,6 @@ static void wined3d_context_gl_apply_draw_buffers(struct wined3d_context_gl *con
checkGLcall("apply draw buffers"); checkGLcall("apply draw buffers");
} }
/* Context activation is done by the caller. */
void wined3d_context_gl_set_draw_buffer(struct wined3d_context_gl *context_gl, GLenum buffer)
{
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
struct fbo_entry *current_fbo = context_gl->current_fbo;
uint32_t new_mask = context_generate_rt_mask(buffer);
uint32_t *current_mask;
current_mask = current_fbo ? &current_fbo->rt_mask : &context_gl->draw_buffers_mask;
if (new_mask == *current_mask)
return;
gl_info->gl_ops.gl.p_glDrawBuffer(buffer);
checkGLcall("glDrawBuffer()");
*current_mask = new_mask;
}
/* Context activation is done by the caller. */ /* Context activation is done by the caller. */
void wined3d_context_gl_active_texture(struct wined3d_context_gl *context_gl, void wined3d_context_gl_active_texture(struct wined3d_context_gl *context_gl,
const struct wined3d_gl_info *gl_info, unsigned int unit) const struct wined3d_gl_info *gl_info, unsigned int unit)

View File

@ -2383,7 +2383,6 @@ void *wined3d_context_gl_map_bo_address(struct wined3d_context_gl *context_gl,
struct wined3d_context_gl *wined3d_context_gl_reacquire(struct wined3d_context_gl *context_gl) DECLSPEC_HIDDEN; struct wined3d_context_gl *wined3d_context_gl_reacquire(struct wined3d_context_gl *context_gl) DECLSPEC_HIDDEN;
void wined3d_context_gl_release(struct wined3d_context_gl *context_gl) DECLSPEC_HIDDEN; void wined3d_context_gl_release(struct wined3d_context_gl *context_gl) DECLSPEC_HIDDEN;
BOOL wined3d_context_gl_set_current(struct wined3d_context_gl *context_gl) DECLSPEC_HIDDEN; BOOL wined3d_context_gl_set_current(struct wined3d_context_gl *context_gl) DECLSPEC_HIDDEN;
void wined3d_context_gl_set_draw_buffer(struct wined3d_context_gl *context_gl, GLenum buffer) DECLSPEC_HIDDEN;
void wined3d_context_gl_submit_command_fence(struct wined3d_context_gl *context_gl) DECLSPEC_HIDDEN; void wined3d_context_gl_submit_command_fence(struct wined3d_context_gl *context_gl) DECLSPEC_HIDDEN;
void wined3d_context_gl_texture_update(struct wined3d_context_gl *context_gl, void wined3d_context_gl_texture_update(struct wined3d_context_gl *context_gl,
const struct wined3d_texture_gl *texture_gl) DECLSPEC_HIDDEN; const struct wined3d_texture_gl *texture_gl) DECLSPEC_HIDDEN;