[PATCH 2/5] wined3d: Refuse to create textures with mipmap generation when unsupported.

Henri Verbeet hverbeet at gmail.com
Thu Feb 8 09:18:57 CST 2018


On 6 February 2018 at 22:06, Matteo Bruni <mbruni at codeweavers.com> wrote:
> @@ -2159,6 +2159,12 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3
>              return WINED3DERR_INVALIDCALL;
>          }
>      }
> +    if (flags & WINED3D_TEXTURE_GENERATE_MIPMAPS && !gl_info->supported[ARB_FRAMEBUFFER_OBJECT]
> +            && !gl_info->supported[EXT_FRAMEBUFFER_OBJECT])
> +    {
> +        WARN("No mipmap generation support, returning WINED3DERR_INVALIDCALL.\n");
> +        return WINED3DERR_INVALIDCALL;
> +    }
>
>      if (FAILED(hr = wined3d_texture_init(texture, &texture2d_ops, layer_count, level_count, desc,
>              flags, device, parent, parent_ops, &texture_resource_ops)))
Should that check be in wined3d_texture_init() instead? Also, note
that wined3d_check_device_format() uses a somewhat different check for
WINED3DUSAGE_AUTOGENMIPMAP and later WINED3DUSAGE_QUERY_GENMIPMAP. I'm
tempted to say we should introduce WINED3DFMT_FLAG_GEN_MIPMAP and use
that both here and in wined3d_check_device_format(). And perhaps
"!gl_info->fbo_ops.glGenerateMipmap" works just as well as checking
individual extensions.



More information about the wine-devel mailing list