wined3d: Get rid of context_bind_fbo() calls outside context.c.
This commit is contained in:
parent
dcc969c32c
commit
33fafc6166
|
@ -33,7 +33,7 @@ static DWORD wined3d_context_tls_idx;
|
|||
/* FBO helper functions */
|
||||
|
||||
/* GL locking is done by the caller */
|
||||
void context_bind_fbo(struct wined3d_context *context, GLenum target, GLuint *fbo)
|
||||
static void context_bind_fbo(struct wined3d_context *context, GLenum target, GLuint *fbo)
|
||||
{
|
||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
||||
GLuint f;
|
||||
|
|
|
@ -5010,6 +5010,7 @@ static void surface_blt_fbo(struct wined3d_device *device, const WINED3DTEXTUREF
|
|||
struct wined3d_context *context;
|
||||
RECT src_rect, dst_rect;
|
||||
GLenum gl_filter;
|
||||
GLenum buffer;
|
||||
|
||||
TRACE("device %p, filter %s,\n", device, debug_d3dtexturefiltertype(filter));
|
||||
TRACE("src_surface %p, src_location %s, src_rect %s,\n",
|
||||
|
@ -5062,48 +5063,38 @@ static void surface_blt_fbo(struct wined3d_device *device, const WINED3DTEXTUREF
|
|||
|
||||
if (src_location == SFLAG_INDRAWABLE)
|
||||
{
|
||||
GLenum buffer = surface_get_gl_buffer(src_surface);
|
||||
|
||||
TRACE("Source surface %p is onscreen.\n", src_surface);
|
||||
|
||||
buffer = surface_get_gl_buffer(src_surface);
|
||||
surface_translate_drawable_coords(src_surface, context->win_handle, &src_rect);
|
||||
|
||||
ENTER_GL();
|
||||
context_bind_fbo(context, GL_READ_FRAMEBUFFER, NULL);
|
||||
glReadBuffer(buffer);
|
||||
checkGLcall("glReadBuffer()");
|
||||
}
|
||||
else
|
||||
{
|
||||
TRACE("Source surface %p is offscreen.\n", src_surface);
|
||||
ENTER_GL();
|
||||
context_apply_fbo_state_blit(context, GL_READ_FRAMEBUFFER, src_surface, NULL, src_location);
|
||||
glReadBuffer(GL_COLOR_ATTACHMENT0);
|
||||
checkGLcall("glReadBuffer()");
|
||||
buffer = GL_COLOR_ATTACHMENT0;
|
||||
}
|
||||
|
||||
ENTER_GL();
|
||||
context_apply_fbo_state_blit(context, GL_READ_FRAMEBUFFER, src_surface, NULL, src_location);
|
||||
glReadBuffer(buffer);
|
||||
checkGLcall("glReadBuffer()");
|
||||
context_check_fbo_status(context, GL_READ_FRAMEBUFFER);
|
||||
LEAVE_GL();
|
||||
|
||||
if (dst_location == SFLAG_INDRAWABLE)
|
||||
{
|
||||
GLenum buffer = surface_get_gl_buffer(dst_surface);
|
||||
|
||||
TRACE("Destination surface %p is onscreen.\n", dst_surface);
|
||||
|
||||
buffer = surface_get_gl_buffer(dst_surface);
|
||||
surface_translate_drawable_coords(dst_surface, context->win_handle, &dst_rect);
|
||||
|
||||
ENTER_GL();
|
||||
context_bind_fbo(context, GL_DRAW_FRAMEBUFFER, NULL);
|
||||
context_set_draw_buffer(context, buffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
TRACE("Destination surface %p is offscreen.\n", dst_surface);
|
||||
|
||||
ENTER_GL();
|
||||
context_apply_fbo_state_blit(context, GL_DRAW_FRAMEBUFFER, dst_surface, NULL, dst_location);
|
||||
context_set_draw_buffer(context, GL_COLOR_ATTACHMENT0);
|
||||
buffer = GL_COLOR_ATTACHMENT0;
|
||||
}
|
||||
|
||||
ENTER_GL();
|
||||
context_apply_fbo_state_blit(context, GL_DRAW_FRAMEBUFFER, dst_surface, NULL, dst_location);
|
||||
context_set_draw_buffer(context, buffer);
|
||||
context_check_fbo_status(context, GL_DRAW_FRAMEBUFFER);
|
||||
context_invalidate_state(context, STATE_FRAMEBUFFER);
|
||||
|
||||
|
|
|
@ -306,7 +306,7 @@ static void swapchain_blit(const struct wined3d_swapchain *swapchain,
|
|||
glReadBuffer(GL_COLOR_ATTACHMENT0);
|
||||
context_check_fbo_status(context, GL_READ_FRAMEBUFFER);
|
||||
|
||||
context_bind_fbo(context, GL_DRAW_FRAMEBUFFER, NULL);
|
||||
context_apply_fbo_state_blit(context, GL_DRAW_FRAMEBUFFER, swapchain->front_buffer, NULL, SFLAG_INDRAWABLE);
|
||||
context_set_draw_buffer(context, GL_BACK);
|
||||
context_invalidate_state(context, STATE_FRAMEBUFFER);
|
||||
|
||||
|
@ -350,7 +350,7 @@ static void swapchain_blit(const struct wined3d_swapchain *swapchain,
|
|||
gl_filter = GL_NEAREST;
|
||||
|
||||
ENTER_GL();
|
||||
context_bind_fbo(context2, GL_FRAMEBUFFER, NULL);
|
||||
context_apply_fbo_state_blit(context2, GL_FRAMEBUFFER, swapchain->front_buffer, NULL, SFLAG_INDRAWABLE);
|
||||
|
||||
/* Set up the texture. The surface is not in a wined3d_texture
|
||||
* container, so there are no D3D texture settings to dirtify. */
|
||||
|
|
|
@ -1233,7 +1233,6 @@ BOOL context_apply_clear_state(struct wined3d_context *context, struct wined3d_d
|
|||
BOOL context_apply_draw_state(struct wined3d_context *context, struct wined3d_device *device) DECLSPEC_HIDDEN;
|
||||
void context_apply_fbo_state_blit(struct wined3d_context *context, GLenum target,
|
||||
struct wined3d_surface *render_target, struct wined3d_surface *depth_stencil, DWORD location) DECLSPEC_HIDDEN;
|
||||
void context_bind_fbo(struct wined3d_context *context, GLenum target, GLuint *fbo) DECLSPEC_HIDDEN;
|
||||
void context_check_fbo_status(const struct wined3d_context *context, GLenum target) DECLSPEC_HIDDEN;
|
||||
struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, struct wined3d_surface *target,
|
||||
const struct wined3d_format *ds_format) DECLSPEC_HIDDEN;
|
||||
|
|
Loading…
Reference in New Issue