On 23 April 2015 at 11:28, Stefan Dösinger <stefan(a)codeweavers.com> wrote:
> +static GLenum wined3d_gl_type_to_enum(enum wined3d_gl_resource_type type)
> +{
> + switch (type)
> + {
> + case WINED3D_GL_RES_TYPE_TEX_1D:
> + return GL_TEXTURE_1D;
> + case WINED3D_GL_RES_TYPE_TEX_2D:
> + return GL_TEXTURE_2D;
> + case WINED3D_GL_RES_TYPE_TEX_3D:
> + return GL_TEXTURE_3D;
> + case WINED3D_GL_RES_TYPE_TEX_CUBE:
> + return GL_TEXTURE_CUBE_MAP_ARB;
> + case WINED3D_GL_RES_TYPE_TEX_RECT:
> + return GL_TEXTURE_RECTANGLE_ARB;
> + case WINED3D_GL_RES_TYPE_BUFFER:
> + return GL_TEXTURE_2D; /* TODO: GL_TEXTURE_BUFFER. */
> + case WINED3D_GL_RES_TYPE_COUNT:
> + break;
> + }
> + ERR("Unexpected GL resource type %u.\n", type);
> + return 0;
> +}
> +
> +
You have an extra newline here.
> + for (type = 0; type < sizeof(format->flags) / sizeof(*format->flags); ++type)
This isn't wrong as such, but you can use ARRAY_SIZE for this now.
> {
> - TRACE("Format %s doesn't support %s.\n", debug_d3dformat(format->id), string);
> - format_clear_flag(format, flag);
> + gl_info->gl_ops.ext.p_glGetInternalformativ(wined3d_gl_type_to_enum(type), internal, pname, 1, &value);
> + if (value == GL_FULL_SUPPORT)
> + {
> + TRACE("Format %s supports %s.\n", debug_d3dformat(format->id), string);
It would probably be helpful if this mentioned the resource type as well.