On Mon, 31 May 2021 at 21:13, Matteo Bruni mbruni@codeweavers.com wrote:
@@ -141,15 +141,15 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * WARN("Format %s cannot be used for texturing.\n", debug_d3dformat(format->id)); continue; }
}
if (((width & (width - 1)) || (height & (height - 1)))
if (((width & (width - 1)) || (height & (height - 1))) && !d3d_info->texture_npot && !gl_info->supported[WINED3D_GL_NORMALIZED_TEXRECT] && gl_type == WINED3D_GL_RES_TYPE_TEX_2D)
{
TRACE("Skipping 2D texture type to try texture rectangle.\n");
tex_2d_ok = TRUE;
continue;
{
TRACE("Skipping 2D texture type to try texture rectangle.\n");
tex_2d_ok = TRUE;
continue;
}} } break;
Does this make a difference? Buffer resources would fail the "gl_type == WINED3D_GL_RES_TYPE_TEX_2D" check, and in terms of performance, well, don't create resources in your rendering loop. Still, this would be fine, except that now you've messed up the indentation of the if-statement. Note that instead of the "if (type != WINED3D_RTYPE_BUFFER) { ... }" block above, you could just "if (type == WINED3D_RTYPE_BUFFER) break;", and save some indentation.