[PATCH 1/5] wined3d: Don't bother setting a depth render buffer for WINED3DFMT_NULL render targets.
Henri Verbeet
hverbeet at codeweavers.com
Mon Apr 4 10:46:01 CDT 2011
---
dlls/wined3d/context.c | 5 +----
dlls/wined3d/surface.c | 14 +++++++++++++-
dlls/wined3d/wined3d_private.h | 3 +--
3 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 7d029db..8ffb30c 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -455,10 +455,7 @@ static void context_apply_fbo_entry(struct wined3d_context *context, GLenum targ
/* Apply depth targets */
if (entry->depth_stencil)
- {
- surface_set_compatible_renderbuffer(entry->depth_stencil,
- entry->render_targets[0]->pow2Width, entry->render_targets[0]->pow2Height);
- }
+ surface_set_compatible_renderbuffer(entry->depth_stencil, entry->render_targets[0]);
context_attach_depth_stencil_fbo(context, target, entry->depth_stencil, TRUE);
entry->attached = TRUE;
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 5d4dfa7..59f5aa7 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -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. */
/* TODO: We should synchronize the renderbuffer's content with the texture's content. */
/* 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;
renderbuffer_entry_t *entry;
GLuint renderbuffer = 0;
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_height = surface->pow2Height;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index c985378..117909a 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -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_prepare_texture(IWineD3DSurfaceImpl *surface,
const struct wined3d_gl_info *gl_info, BOOL srgb) DECLSPEC_HIDDEN;
-void surface_set_compatible_renderbuffer(IWineD3DSurfaceImpl *surface,
- unsigned int width, unsigned int height) DECLSPEC_HIDDEN;
+void surface_set_compatible_renderbuffer(IWineD3DSurfaceImpl *surface, IWineD3DSurfaceImpl *rt) DECLSPEC_HIDDEN;
void surface_set_container(IWineD3DSurfaceImpl *surface,
enum wined3d_container_type type, void *container) DECLSPEC_HIDDEN;
void surface_set_texture_name(IWineD3DSurfaceImpl *surface, GLuint name, BOOL srgb_name) DECLSPEC_HIDDEN;
--
1.7.3.4
More information about the wine-patches
mailing list