Commit da1b4597 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Store the depth/stencil attachment as IWineD3DSurfaceImpl pointer in struct fbo_entry.

parent be993fc4
...@@ -308,7 +308,7 @@ static void context_check_fbo_status(struct wined3d_context *context) ...@@ -308,7 +308,7 @@ static void context_check_fbo_status(struct wined3d_context *context)
attachment->pow2Width, attachment->pow2Height); attachment->pow2Width, attachment->pow2Height);
} }
} }
attachment = (IWineD3DSurfaceImpl *)context->current_fbo->depth_stencil; attachment = context->current_fbo->depth_stencil;
if (attachment) if (attachment)
{ {
FIXME("\tDepth attachment: (%p) %s %ux%u\n", FIXME("\tDepth attachment: (%p) %s %ux%u\n",
...@@ -327,7 +327,7 @@ static struct fbo_entry *context_create_fbo_entry(struct wined3d_context *contex ...@@ -327,7 +327,7 @@ static struct fbo_entry *context_create_fbo_entry(struct wined3d_context *contex
entry = HeapAlloc(GetProcessHeap(), 0, sizeof(*entry)); entry = HeapAlloc(GetProcessHeap(), 0, sizeof(*entry));
entry->render_targets = HeapAlloc(GetProcessHeap(), 0, gl_info->limits.buffers * sizeof(*entry->render_targets)); entry->render_targets = HeapAlloc(GetProcessHeap(), 0, gl_info->limits.buffers * sizeof(*entry->render_targets));
memcpy(entry->render_targets, device->render_targets, gl_info->limits.buffers * sizeof(*entry->render_targets)); memcpy(entry->render_targets, device->render_targets, gl_info->limits.buffers * sizeof(*entry->render_targets));
entry->depth_stencil = device->stencilBufferTarget; entry->depth_stencil = (IWineD3DSurfaceImpl *)device->stencilBufferTarget;
entry->attached = FALSE; entry->attached = FALSE;
entry->id = 0; entry->id = 0;
...@@ -344,7 +344,7 @@ static void context_reuse_fbo_entry(struct wined3d_context *context, struct fbo_ ...@@ -344,7 +344,7 @@ static void context_reuse_fbo_entry(struct wined3d_context *context, struct fbo_
context_clean_fbo_attachments(gl_info); context_clean_fbo_attachments(gl_info);
memcpy(entry->render_targets, device->render_targets, gl_info->limits.buffers * sizeof(*entry->render_targets)); memcpy(entry->render_targets, device->render_targets, gl_info->limits.buffers * sizeof(*entry->render_targets));
entry->depth_stencil = device->stencilBufferTarget; entry->depth_stencil = (IWineD3DSurfaceImpl *)device->stencilBufferTarget;
entry->attached = FALSE; entry->attached = FALSE;
} }
...@@ -374,7 +374,7 @@ static struct fbo_entry *context_find_fbo_entry(struct wined3d_context *context) ...@@ -374,7 +374,7 @@ static struct fbo_entry *context_find_fbo_entry(struct wined3d_context *context)
{ {
if (!memcmp(entry->render_targets, if (!memcmp(entry->render_targets,
device->render_targets, gl_info->limits.buffers * sizeof(*entry->render_targets)) device->render_targets, gl_info->limits.buffers * sizeof(*entry->render_targets))
&& entry->depth_stencil == device->stencilBufferTarget) && entry->depth_stencil == (IWineD3DSurfaceImpl *)device->stencilBufferTarget)
{ {
list_remove(&entry->entry); list_remove(&entry->entry);
list_add_head(&context->fbo_list, &entry->entry); list_add_head(&context->fbo_list, &entry->entry);
...@@ -629,7 +629,7 @@ void context_resource_released(IWineD3DDevice *iface, IWineD3DResource *resource ...@@ -629,7 +629,7 @@ void context_resource_released(IWineD3DDevice *iface, IWineD3DResource *resource
{ {
UINT j; UINT j;
if (entry->depth_stencil == (IWineD3DSurface *)resource) if (entry->depth_stencil == (IWineD3DSurfaceImpl *)resource)
{ {
list_remove(&entry->entry); list_remove(&entry->entry);
list_add_head(&context->fbo_destroy_list, &entry->entry); list_add_head(&context->fbo_destroy_list, &entry->entry);
...@@ -674,7 +674,7 @@ void context_surface_update(struct wined3d_context *context, IWineD3DSurfaceImpl ...@@ -674,7 +674,7 @@ void context_surface_update(struct wined3d_context *context, IWineD3DSurfaceImpl
} }
} }
if (surface == (IWineD3DSurfaceImpl *)entry->depth_stencil) if (surface == entry->depth_stencil)
{ {
TRACE("Updated surface %p is bound as depth attachment to the current FBO.\n", surface); TRACE("Updated surface %p is bound as depth attachment to the current FBO.\n", surface);
context->rebind_fbo = TRUE; context->rebind_fbo = TRUE;
......
...@@ -2023,7 +2023,7 @@ struct fbo_entry ...@@ -2023,7 +2023,7 @@ struct fbo_entry
{ {
struct list entry; struct list entry;
IWineD3DSurfaceImpl **render_targets; IWineD3DSurfaceImpl **render_targets;
IWineD3DSurface *depth_stencil; IWineD3DSurfaceImpl *depth_stencil;
BOOL attached; BOOL attached;
GLuint id; GLuint id;
}; };
......
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