wined3d: Simply pass an IWineD3DSurfaceImpl pointer to surface_set_compatible_renderbuffer().
This commit is contained in:
parent
03dc612c9c
commit
92a44884c7
|
@ -423,7 +423,7 @@ static void context_apply_fbo_entry(struct wined3d_context *context, struct fbo_
|
||||||
unsigned int w = ((IWineD3DSurfaceImpl *)device->render_targets[0])->pow2Width;
|
unsigned int w = ((IWineD3DSurfaceImpl *)device->render_targets[0])->pow2Width;
|
||||||
unsigned int h = ((IWineD3DSurfaceImpl *)device->render_targets[0])->pow2Height;
|
unsigned int h = ((IWineD3DSurfaceImpl *)device->render_targets[0])->pow2Height;
|
||||||
|
|
||||||
surface_set_compatible_renderbuffer(device->stencilBufferTarget, w, h);
|
surface_set_compatible_renderbuffer((IWineD3DSurfaceImpl *)device->stencilBufferTarget, w, h);
|
||||||
}
|
}
|
||||||
context_attach_depth_stencil_fbo(context, GL_FRAMEBUFFER, (IWineD3DSurfaceImpl *)device->stencilBufferTarget, TRUE);
|
context_attach_depth_stencil_fbo(context, GL_FRAMEBUFFER, (IWineD3DSurfaceImpl *)device->stencilBufferTarget, TRUE);
|
||||||
|
|
||||||
|
|
|
@ -873,15 +873,15 @@ 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(IWineD3DSurface *iface, unsigned int width, unsigned int height) {
|
void surface_set_compatible_renderbuffer(IWineD3DSurfaceImpl *surface, unsigned int width, unsigned int height)
|
||||||
IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface;
|
{
|
||||||
const struct wined3d_gl_info *gl_info = &This->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;
|
||||||
|
|
||||||
src_width = This->pow2Width;
|
src_width = surface->pow2Width;
|
||||||
src_height = This->pow2Height;
|
src_height = surface->pow2Height;
|
||||||
|
|
||||||
/* A depth stencil smaller than the render target is not valid */
|
/* A depth stencil smaller than the render target is not valid */
|
||||||
if (width > src_width || height > src_height) return;
|
if (width > src_width || height > src_height) return;
|
||||||
|
@ -890,32 +890,35 @@ void surface_set_compatible_renderbuffer(IWineD3DSurface *iface, unsigned int wi
|
||||||
if (gl_info->supported[ARB_FRAMEBUFFER_OBJECT]
|
if (gl_info->supported[ARB_FRAMEBUFFER_OBJECT]
|
||||||
|| (width == src_width && height == src_height))
|
|| (width == src_width && height == src_height))
|
||||||
{
|
{
|
||||||
This->current_renderbuffer = NULL;
|
surface->current_renderbuffer = NULL;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Look if we've already got a renderbuffer of the correct dimensions */
|
/* Look if we've already got a renderbuffer of the correct dimensions */
|
||||||
LIST_FOR_EACH_ENTRY(entry, &This->renderbuffers, renderbuffer_entry_t, entry) {
|
LIST_FOR_EACH_ENTRY(entry, &surface->renderbuffers, renderbuffer_entry_t, entry)
|
||||||
if (entry->width == width && entry->height == height) {
|
{
|
||||||
|
if (entry->width == width && entry->height == height)
|
||||||
|
{
|
||||||
renderbuffer = entry->id;
|
renderbuffer = entry->id;
|
||||||
This->current_renderbuffer = entry;
|
surface->current_renderbuffer = entry;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!renderbuffer) {
|
if (!renderbuffer)
|
||||||
|
{
|
||||||
gl_info->fbo_ops.glGenRenderbuffers(1, &renderbuffer);
|
gl_info->fbo_ops.glGenRenderbuffers(1, &renderbuffer);
|
||||||
gl_info->fbo_ops.glBindRenderbuffer(GL_RENDERBUFFER, renderbuffer);
|
gl_info->fbo_ops.glBindRenderbuffer(GL_RENDERBUFFER, renderbuffer);
|
||||||
gl_info->fbo_ops.glRenderbufferStorage(GL_RENDERBUFFER,
|
gl_info->fbo_ops.glRenderbufferStorage(GL_RENDERBUFFER,
|
||||||
This->resource.format_desc->glInternal, width, height);
|
surface->resource.format_desc->glInternal, width, height);
|
||||||
|
|
||||||
entry = HeapAlloc(GetProcessHeap(), 0, sizeof(renderbuffer_entry_t));
|
entry = HeapAlloc(GetProcessHeap(), 0, sizeof(renderbuffer_entry_t));
|
||||||
entry->width = width;
|
entry->width = width;
|
||||||
entry->height = height;
|
entry->height = height;
|
||||||
entry->id = renderbuffer;
|
entry->id = renderbuffer;
|
||||||
list_add_head(&This->renderbuffers, &entry->entry);
|
list_add_head(&surface->renderbuffers, &entry->entry);
|
||||||
|
|
||||||
This->current_renderbuffer = entry;
|
surface->current_renderbuffer = entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
checkGLcall("set_compatible_renderbuffer");
|
checkGLcall("set_compatible_renderbuffer");
|
||||||
|
|
|
@ -2680,7 +2680,7 @@ GLenum surface_get_gl_buffer(IWineD3DSurface *iface) DECLSPEC_HIDDEN;
|
||||||
void surface_load_ds_location(IWineD3DSurfaceImpl *surface,
|
void surface_load_ds_location(IWineD3DSurfaceImpl *surface,
|
||||||
struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN;
|
struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN;
|
||||||
void surface_modify_ds_location(IWineD3DSurfaceImpl *surface, DWORD location) DECLSPEC_HIDDEN;
|
void surface_modify_ds_location(IWineD3DSurfaceImpl *surface, DWORD location) DECLSPEC_HIDDEN;
|
||||||
void surface_set_compatible_renderbuffer(IWineD3DSurface *iface,
|
void surface_set_compatible_renderbuffer(IWineD3DSurfaceImpl *surface,
|
||||||
unsigned int width, unsigned int height) DECLSPEC_HIDDEN;
|
unsigned int width, unsigned int height) DECLSPEC_HIDDEN;
|
||||||
void surface_set_texture_name(IWineD3DSurface *iface, GLuint name, BOOL srgb_name) DECLSPEC_HIDDEN;
|
void surface_set_texture_name(IWineD3DSurface *iface, GLuint name, BOOL srgb_name) DECLSPEC_HIDDEN;
|
||||||
void surface_set_texture_target(IWineD3DSurface *iface, GLenum target) DECLSPEC_HIDDEN;
|
void surface_set_texture_target(IWineD3DSurface *iface, GLenum target) DECLSPEC_HIDDEN;
|
||||||
|
|
Loading…
Reference in New Issue