wined3d: Handle CTXUSAGE_BLIT with offscreen targets and FBO ORM.
This is mostly for correctness, in practice we should always be able to avoid using CTXUSAGE_BLIT for offscreen targets when FBO ORM is used.
This commit is contained in:
parent
b685b84e66
commit
2d6d879562
|
@ -1065,16 +1065,22 @@ static void apply_draw_buffer(IWineD3DDeviceImpl *This, IWineD3DSurface *target,
|
|||
}
|
||||
else
|
||||
{
|
||||
if (!blit && wined3d_settings.offscreen_rendering_mode == ORM_FBO)
|
||||
if (wined3d_settings.offscreen_rendering_mode == ORM_FBO)
|
||||
{
|
||||
if (GL_SUPPORT(ARB_DRAW_BUFFERS))
|
||||
if (!blit)
|
||||
{
|
||||
GL_EXTCALL(glDrawBuffersARB(GL_LIMITS(buffers), This->draw_buffers));
|
||||
checkGLcall("glDrawBuffers()");
|
||||
}
|
||||
else
|
||||
{
|
||||
glDrawBuffer(This->draw_buffers[0]);
|
||||
if (GL_SUPPORT(ARB_DRAW_BUFFERS))
|
||||
{
|
||||
GL_EXTCALL(glDrawBuffersARB(GL_LIMITS(buffers), This->draw_buffers));
|
||||
checkGLcall("glDrawBuffers()");
|
||||
}
|
||||
else
|
||||
{
|
||||
glDrawBuffer(This->draw_buffers[0]);
|
||||
checkGLcall("glDrawBuffer()");
|
||||
}
|
||||
} else {
|
||||
glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT);
|
||||
checkGLcall("glDrawBuffer()");
|
||||
}
|
||||
}
|
||||
|
@ -1165,7 +1171,16 @@ void ActivateContext(IWineD3DDeviceImpl *This, IWineD3DSurface *target, ContextU
|
|||
|
||||
case CTXUSAGE_BLIT:
|
||||
if (wined3d_settings.offscreen_rendering_mode == ORM_FBO) {
|
||||
GL_EXTCALL(glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0));
|
||||
if (This->render_offscreen) {
|
||||
FIXME("Activating for CTXUSAGE_BLIT for an offscreen target with ORM_FBO. This should be avoided.\n");
|
||||
bind_fbo((IWineD3DDevice *)This, GL_FRAMEBUFFER_EXT, &This->dst_fbo);
|
||||
attach_surface_fbo(This, GL_FRAMEBUFFER_EXT, 0, target);
|
||||
GL_EXTCALL(glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, 0));
|
||||
checkGLcall("glFramebufferRenderbufferEXT");
|
||||
} else {
|
||||
GL_EXTCALL(glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0));
|
||||
checkGLcall("glFramebufferRenderbufferEXT");
|
||||
}
|
||||
context->draw_buffer_dirty = TRUE;
|
||||
}
|
||||
if (context->draw_buffer_dirty) {
|
||||
|
|
|
@ -6127,7 +6127,7 @@ void attach_depth_stencil_fbo(IWineD3DDeviceImpl *This, GLenum fbo_target, IWine
|
|||
}
|
||||
}
|
||||
|
||||
static void attach_surface_fbo(IWineD3DDeviceImpl *This, GLenum fbo_target, DWORD idx, IWineD3DSurface *surface) {
|
||||
void attach_surface_fbo(IWineD3DDeviceImpl *This, GLenum fbo_target, DWORD idx, IWineD3DSurface *surface) {
|
||||
const IWineD3DSurfaceImpl *surface_impl = (IWineD3DSurfaceImpl *)surface;
|
||||
IWineD3DBaseTextureImpl *texture_impl;
|
||||
GLenum texttarget, target;
|
||||
|
|
|
@ -2469,6 +2469,7 @@ void stretch_rect_fbo(IWineD3DDevice *iface, IWineD3DSurface *src_surface, WINED
|
|||
IWineD3DSurface *dst_surface, WINED3DRECT *dst_rect, const WINED3DTEXTUREFILTERTYPE filter, BOOL flip);
|
||||
void bind_fbo(IWineD3DDevice *iface, GLenum target, GLuint *fbo);
|
||||
void attach_depth_stencil_fbo(IWineD3DDeviceImpl *This, GLenum fbo_target, IWineD3DSurface *depth_stencil, BOOL use_render_buffer);
|
||||
void attach_surface_fbo(IWineD3DDeviceImpl *This, GLenum fbo_target, DWORD idx, IWineD3DSurface *surface);
|
||||
void depth_blt(IWineD3DDevice *iface, GLuint texture);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue