wined3d: Don't bother setting a depth render buffer for WINED3DFMT_NULL render targets.

This commit is contained in:
Henri Verbeet 2011-04-04 17:46:01 +02:00 committed by Alexandre Julliard
parent 16d5737009
commit 0ce17ea27e
3 changed files with 15 additions and 7 deletions

View File

@ -455,10 +455,7 @@ static void context_apply_fbo_entry(struct wined3d_context *context, GLenum targ
/* Apply depth targets */ /* Apply depth targets */
if (entry->depth_stencil) if (entry->depth_stencil)
{ surface_set_compatible_renderbuffer(entry->depth_stencil, entry->render_targets[0]);
surface_set_compatible_renderbuffer(entry->depth_stencil,
entry->render_targets[0]->pow2Width, entry->render_targets[0]->pow2Height);
}
context_attach_depth_stencil_fbo(context, target, entry->depth_stencil, TRUE); context_attach_depth_stencil_fbo(context, target, entry->depth_stencil, TRUE);
entry->attached = TRUE; entry->attached = TRUE;

View File

@ -1104,12 +1104,24 @@ static void surface_allocate_surface(IWineD3DSurfaceImpl *This, const struct win
* render target dimensions. With FBOs, the dimensions have to be an exact match. */ * render target dimensions. With FBOs, the dimensions have to be an exact match. */
/* TODO: We should synchronize the renderbuffer's content with the texture's content. */ /* TODO: We should synchronize the renderbuffer's content with the texture's content. */
/* GL locking is done by the caller */ /* GL locking is done by the caller */
void surface_set_compatible_renderbuffer(IWineD3DSurfaceImpl *surface, unsigned int width, unsigned int height) void surface_set_compatible_renderbuffer(IWineD3DSurfaceImpl *surface, IWineD3DSurfaceImpl *rt)
{ {
const struct wined3d_gl_info *gl_info = &surface->resource.device->adapter->gl_info; const struct wined3d_gl_info *gl_info = &surface->resource.device->adapter->gl_info;
renderbuffer_entry_t *entry; renderbuffer_entry_t *entry;
GLuint renderbuffer = 0; GLuint renderbuffer = 0;
unsigned int src_width, src_height; unsigned int src_width, src_height;
unsigned int width, height;
if (rt->resource.format->id != WINED3DFMT_NULL)
{
width = rt->pow2Width;
height = rt->pow2Height;
}
else
{
width = surface->pow2Width;
height = surface->pow2Height;
}
src_width = surface->pow2Width; src_width = surface->pow2Width;
src_height = surface->pow2Height; src_height = surface->pow2Height;

View File

@ -2121,8 +2121,7 @@ void surface_modify_ds_location(IWineD3DSurfaceImpl *surface, DWORD location, UI
void surface_modify_location(IWineD3DSurfaceImpl *surface, DWORD flag, BOOL persistent) DECLSPEC_HIDDEN; void surface_modify_location(IWineD3DSurfaceImpl *surface, DWORD flag, BOOL persistent) DECLSPEC_HIDDEN;
void surface_prepare_texture(IWineD3DSurfaceImpl *surface, void surface_prepare_texture(IWineD3DSurfaceImpl *surface,
const struct wined3d_gl_info *gl_info, BOOL srgb) DECLSPEC_HIDDEN; const struct wined3d_gl_info *gl_info, BOOL srgb) DECLSPEC_HIDDEN;
void surface_set_compatible_renderbuffer(IWineD3DSurfaceImpl *surface, void surface_set_compatible_renderbuffer(IWineD3DSurfaceImpl *surface, IWineD3DSurfaceImpl *rt) DECLSPEC_HIDDEN;
unsigned int width, unsigned int height) DECLSPEC_HIDDEN;
void surface_set_container(IWineD3DSurfaceImpl *surface, void surface_set_container(IWineD3DSurfaceImpl *surface,
enum wined3d_container_type type, void *container) DECLSPEC_HIDDEN; enum wined3d_container_type type, void *container) DECLSPEC_HIDDEN;
void surface_set_texture_name(IWineD3DSurfaceImpl *surface, GLuint name, BOOL srgb_name) DECLSPEC_HIDDEN; void surface_set_texture_name(IWineD3DSurfaceImpl *surface, GLuint name, BOOL srgb_name) DECLSPEC_HIDDEN;