Commit 22eabf1d authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

wined3d: Add texture flag for mipmap generation.

parent 9f11f4ad
...@@ -384,6 +384,15 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc ...@@ -384,6 +384,15 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc
texture->flags |= WINED3D_TEXTURE_GET_DC; texture->flags |= WINED3D_TEXTURE_GET_DC;
if (flags & WINED3D_TEXTURE_CREATE_DISCARD) if (flags & WINED3D_TEXTURE_CREATE_DISCARD)
texture->flags |= WINED3D_TEXTURE_DISCARD; texture->flags |= WINED3D_TEXTURE_DISCARD;
if (flags & WINED3D_TEXTURE_CREATE_GENERATE_MIPMAPS)
{
if (~format->flags[WINED3D_GL_RES_TYPE_TEX_2D]
& (WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_FILTERING))
WARN("Format doesn't support mipmaps generation, "
"ignoring WINED3D_TEXTURE_CREATE_GENERATE_MIPMAPS flag.\n");
else
texture->flags |= WINED3D_TEXTURE_GENERATE_MIPMAPS;
}
return WINED3D_OK; return WINED3D_OK;
} }
...@@ -1573,8 +1582,13 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned ...@@ -1573,8 +1582,13 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned
void CDECL wined3d_texture_generate_mipmaps(struct wined3d_texture *texture) void CDECL wined3d_texture_generate_mipmaps(struct wined3d_texture *texture)
{ {
/* TODO: Implement filters using GL_SGI_generate_mipmaps. */
FIXME("texture %p stub!\n", texture); FIXME("texture %p stub!\n", texture);
if (!(texture->flags & WINED3D_TEXTURE_GENERATE_MIPMAPS))
{
WARN("Texture without the WINED3D_TEXTURE_GENERATE_MIPMAPS flag, ignoring.\n");
return;
}
} }
static struct wined3d_texture_sub_resource *wined3d_texture_get_sub_resource(struct wined3d_texture *texture, static struct wined3d_texture_sub_resource *wined3d_texture_get_sub_resource(struct wined3d_texture *texture,
......
...@@ -3074,6 +3074,7 @@ struct wined3d_texture_ops ...@@ -3074,6 +3074,7 @@ struct wined3d_texture_ops
#define WINED3D_TEXTURE_DC_IN_USE 0x00001000 #define WINED3D_TEXTURE_DC_IN_USE 0x00001000
#define WINED3D_TEXTURE_DISCARD 0x00002000 #define WINED3D_TEXTURE_DISCARD 0x00002000
#define WINED3D_TEXTURE_GET_DC 0x00004000 #define WINED3D_TEXTURE_GET_DC 0x00004000
#define WINED3D_TEXTURE_GENERATE_MIPMAPS 0x00008000
#define WINED3D_TEXTURE_ASYNC_COLOR_KEY 0x00000001 #define WINED3D_TEXTURE_ASYNC_COLOR_KEY 0x00000001
......
...@@ -1538,6 +1538,7 @@ enum wined3d_shader_byte_code_format ...@@ -1538,6 +1538,7 @@ enum wined3d_shader_byte_code_format
#define WINED3D_TEXTURE_CREATE_DISCARD 0x00000002 #define WINED3D_TEXTURE_CREATE_DISCARD 0x00000002
#define WINED3D_TEXTURE_CREATE_GET_DC_LENIENT 0x00000004 #define WINED3D_TEXTURE_CREATE_GET_DC_LENIENT 0x00000004
#define WINED3D_TEXTURE_CREATE_GET_DC 0x00000008 #define WINED3D_TEXTURE_CREATE_GET_DC 0x00000008
#define WINED3D_TEXTURE_CREATE_GENERATE_MIPMAPS 0x00000010
#define WINED3D_APPEND_ALIGNED_ELEMENT 0xffffffff #define WINED3D_APPEND_ALIGNED_ELEMENT 0xffffffff
......
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