Commit 9cb572cb authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Pass a wined3d_context_gl structure to context_set_draw_buffer().

parent 49889f72
......@@ -7899,7 +7899,7 @@ static DWORD arbfp_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_bl
}
wined3d_context_gl_apply_fbo_state_blit(context_gl, GL_DRAW_FRAMEBUFFER,
&dst_texture->resource, dst_sub_resource_idx, NULL, 0, dst_location);
context_set_draw_buffer(context, buffer);
wined3d_context_gl_set_draw_buffer(context_gl, buffer);
wined3d_context_gl_check_fbo_status(context_gl, GL_DRAW_FRAMEBUFFER);
context_invalidate_state(context, STATE_FRAMEBUFFER);
}
......
......@@ -702,6 +702,7 @@ static struct fbo_entry *context_find_fbo_entry(struct wined3d_context *context,
/* Context activation is done by the caller. */
static void context_apply_fbo_entry(struct wined3d_context *context, GLenum target, struct fbo_entry *entry)
{
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
const struct wined3d_gl_info *gl_info = context->gl_info;
GLuint read_binding, draw_binding;
unsigned int i;
......@@ -739,7 +740,7 @@ static void context_apply_fbo_entry(struct wined3d_context *context, GLenum targ
/* Set valid read and draw buffer bindings to satisfy pedantic pre-ES2_compatibility
* GL contexts requirements. */
gl_info->gl_ops.gl.p_glReadBuffer(GL_NONE);
context_set_draw_buffer(context, GL_NONE);
wined3d_context_gl_set_draw_buffer(context_gl, GL_NONE);
if (target != GL_FRAMEBUFFER)
{
if (target == GL_READ_FRAMEBUFFER)
......@@ -2504,12 +2505,14 @@ static void context_apply_draw_buffers(struct wined3d_context *context, DWORD rt
}
/* Context activation is done by the caller. */
void context_set_draw_buffer(struct wined3d_context *context, GLenum buffer)
void wined3d_context_gl_set_draw_buffer(struct wined3d_context_gl *context_gl, GLenum buffer)
{
const struct wined3d_gl_info *gl_info = context->gl_info;
DWORD *current_mask = context->current_fbo ? &context->current_fbo->rt_mask : &context->draw_buffers_mask;
DWORD new_mask = context_generate_rt_mask(buffer);
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
struct fbo_entry *current_fbo = context_gl->c.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->c.draw_buffers_mask;
if (new_mask == *current_mask)
return;
......
......@@ -13333,7 +13333,7 @@ static DWORD glsl_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_bli
}
wined3d_context_gl_apply_fbo_state_blit(context_gl, GL_DRAW_FRAMEBUFFER,
&dst_texture->resource, dst_sub_resource_idx, NULL, 0, dst_location);
context_set_draw_buffer(context, buffer);
wined3d_context_gl_set_draw_buffer(context_gl, buffer);
wined3d_context_gl_check_fbo_status(context_gl, GL_DRAW_FRAMEBUFFER);
context_invalidate_state(context, STATE_FRAMEBUFFER);
}
......
......@@ -110,7 +110,7 @@ static void texture2d_depth_blt_fbo(const struct wined3d_device *device, struct
wined3d_context_gl_apply_fbo_state_blit(context_gl, GL_DRAW_FRAMEBUFFER, NULL, 0,
&dst_texture->resource, dst_sub_resource_idx, dst_location);
context_set_draw_buffer(context, GL_NONE);
wined3d_context_gl_set_draw_buffer(context_gl, GL_NONE);
wined3d_context_gl_check_fbo_status(context_gl, GL_DRAW_FRAMEBUFFER);
context_invalidate_state(context, STATE_FRAMEBUFFER);
......@@ -270,7 +270,7 @@ static void texture2d_blt_fbo(const struct wined3d_device *device, struct wined3
wined3d_context_gl_apply_fbo_state_blit(context_gl, GL_DRAW_FRAMEBUFFER,
&dst_texture->resource, dst_sub_resource_idx, NULL, 0, dst_location);
context_set_draw_buffer(context, buffer);
wined3d_context_gl_set_draw_buffer(context_gl, buffer);
wined3d_context_gl_check_fbo_status(context_gl, GL_DRAW_FRAMEBUFFER);
context_invalidate_state(context, STATE_FRAMEBUFFER);
......@@ -1183,7 +1183,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_texture_gl *dst_texture,
gl_info->gl_ops.gl.p_glTexParameteri(texture_target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
gl_info->gl_ops.gl.p_glTexParameteri(texture_target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
context_set_draw_buffer(context, drawBuffer);
wined3d_context_gl_set_draw_buffer(context_gl, drawBuffer);
gl_info->gl_ops.gl.p_glReadBuffer(drawBuffer);
gl_info->gl_ops.gl.p_glBegin(GL_QUADS);
......@@ -2259,7 +2259,7 @@ static DWORD ffp_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit
}
wined3d_context_gl_apply_fbo_state_blit(context_gl, GL_DRAW_FRAMEBUFFER,
dst_resource, dst_sub_resource_idx, NULL, 0, dst_location);
context_set_draw_buffer(context, buffer);
wined3d_context_gl_set_draw_buffer(context_gl, buffer);
wined3d_context_gl_check_fbo_status(context_gl, GL_DRAW_FRAMEBUFFER);
context_invalidate_state(context, STATE_FRAMEBUFFER);
}
......
......@@ -2087,6 +2087,7 @@ HRESULT wined3d_context_gl_init(struct wined3d_context_gl *context_gl,
struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
void wined3d_context_gl_load_tex_coords(const struct wined3d_context_gl *context_gl,
const struct wined3d_stream_info *si, GLuint *current_bo, const struct wined3d_state *state) DECLSPEC_HIDDEN;
void wined3d_context_gl_set_draw_buffer(struct wined3d_context_gl *context_gl, GLenum buffer) DECLSPEC_HIDDEN;
void wined3d_context_gl_update_stream_sources(struct wined3d_context_gl *context_gl,
const struct wined3d_state *state) DECLSPEC_HIDDEN;
......@@ -2258,7 +2259,6 @@ void context_resource_released(const struct wined3d_device *device, struct wined
void context_restore(struct wined3d_context *context, struct wined3d_texture *texture,
unsigned int sub_resource_idx) DECLSPEC_HIDDEN;
BOOL context_set_current(struct wined3d_context *ctx) DECLSPEC_HIDDEN;
void context_set_draw_buffer(struct wined3d_context *context, GLenum buffer) DECLSPEC_HIDDEN;
void context_set_tls_idx(DWORD idx) DECLSPEC_HIDDEN;
void context_state_drawbuf(struct wined3d_context *context,
const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment