wined3d: Retrieve the surface's texture name through a function.
This commit is contained in:
parent
ddc7a803e9
commit
d523dee76b
|
@ -273,20 +273,18 @@ static void context_attach_surface_fbo(const struct wined3d_context *context,
|
|||
|
||||
if (surface && surface->resource.format->id != WINED3DFMT_NULL)
|
||||
{
|
||||
BOOL srgb;
|
||||
|
||||
switch (location)
|
||||
{
|
||||
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:
|
||||
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);
|
||||
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;
|
||||
|
||||
default:
|
||||
|
|
|
@ -2155,6 +2155,11 @@ static inline IWineD3DSurfaceImpl *surface_from_resource(struct wined3d_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_bind(IWineD3DSurfaceImpl *surface, BOOL srgb) DECLSPEC_HIDDEN;
|
||||
HRESULT surface_color_fill(IWineD3DSurfaceImpl *s, const RECT *rect, const WINED3DCOLORVALUE *color) DECLSPEC_HIDDEN;
|
||||
|
|
Loading…
Reference in New Issue