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

wined3d: Retrieve the surface's texture name through a function.

parent ddc7a803
...@@ -273,20 +273,18 @@ static void context_attach_surface_fbo(const struct wined3d_context *context, ...@@ -273,20 +273,18 @@ static void context_attach_surface_fbo(const struct wined3d_context *context,
if (surface && surface->resource.format->id != WINED3DFMT_NULL) if (surface && surface->resource.format->id != WINED3DFMT_NULL)
{ {
BOOL srgb;
switch (location) switch (location)
{ {
case SFLAG_INTEXTURE: case SFLAG_INTEXTURE:
surface_prepare_texture(surface, gl_info, FALSE);
context_apply_attachment_filter_states(surface, location);
gl_info->fbo_ops.glFramebufferTexture2D(fbo_target, GL_COLOR_ATTACHMENT0 + idx,
surface->texture_target, surface->texture_name, surface->texture_level);
break;
case SFLAG_INSRGBTEX: case SFLAG_INSRGBTEX:
surface_prepare_texture(surface, gl_info, TRUE); srgb = location == SFLAG_INSRGBTEX;
surface_prepare_texture(surface, gl_info, srgb);
context_apply_attachment_filter_states(surface, location); context_apply_attachment_filter_states(surface, location);
gl_info->fbo_ops.glFramebufferTexture2D(fbo_target, GL_COLOR_ATTACHMENT0 + idx, gl_info->fbo_ops.glFramebufferTexture2D(fbo_target, GL_COLOR_ATTACHMENT0 + idx,
surface->texture_target, surface->texture_name_srgb, surface->texture_level); surface->texture_target, surface_get_texture_name(surface, srgb),
surface->texture_level);
break; break;
default: default:
......
...@@ -2155,6 +2155,11 @@ static inline IWineD3DSurfaceImpl *surface_from_resource(struct wined3d_resource ...@@ -2155,6 +2155,11 @@ static inline IWineD3DSurfaceImpl *surface_from_resource(struct wined3d_resource
return CONTAINING_RECORD(resource, IWineD3DSurfaceImpl, resource); return CONTAINING_RECORD(resource, IWineD3DSurfaceImpl, resource);
} }
static inline GLuint surface_get_texture_name(IWineD3DSurfaceImpl *surface, BOOL srgb)
{
return srgb ? surface->texture_name_srgb : surface->texture_name;
}
void surface_add_dirty_rect(IWineD3DSurfaceImpl *surface, const RECT *dirty_rect) DECLSPEC_HIDDEN; void surface_add_dirty_rect(IWineD3DSurfaceImpl *surface, const RECT *dirty_rect) DECLSPEC_HIDDEN;
void surface_bind(IWineD3DSurfaceImpl *surface, BOOL srgb) DECLSPEC_HIDDEN; void surface_bind(IWineD3DSurfaceImpl *surface, BOOL srgb) DECLSPEC_HIDDEN;
HRESULT surface_color_fill(IWineD3DSurfaceImpl *s, const RECT *rect, const WINED3DCOLORVALUE *color) DECLSPEC_HIDDEN; HRESULT surface_color_fill(IWineD3DSurfaceImpl *s, const RECT *rect, const WINED3DCOLORVALUE *color) DECLSPEC_HIDDEN;
......
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