From: Henri Verbeet Subject: Re: [PATCH 3/3] wined3d: Factor out wined3d_texture_get_gl_internal_format(). Message-Id: Date: Fri, 14 Sep 2018 19:45:32 +0430 In-Reply-To: <20180914120058.21068-3-jkucia@codeweavers.com> References: <20180914120058.21068-3-jkucia@codeweavers.com> On 14 September 2018 at 16:30, Józef Kucia wrote: > +static GLenum wined3d_texture_get_gl_internal_format(struct wined3d_texture *texture, BOOL srgb) > +{ > + const struct wined3d_format *format = texture->resource.format; ... > @@ -2019,13 +2029,7 @@ void wined3d_texture_upload_data(struct wined3d_texture *texture, unsigned int s > - if (srgb) > - internal = format->glGammaInternal; > - else if (texture->resource.usage & WINED3DUSAGE_RENDERTARGET > - && wined3d_resource_is_offscreen(&texture->resource)) > - internal = format->rtInternal; > - else > - internal = format->glInternal; > + internal = wined3d_texture_get_gl_internal_format(texture, srgb); Unfortunately that's not necessarily the same format, and indeed the tests fail with this: 0009:err:d3d:wined3d_debug_callback 0x196440: "GL_INVALID_ENUM in glTexStorage3D(internalformat = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT)". 0009:err:d3d:wined3d_debug_callback 0x196440: "GL_INVALID_OPERATION in glTexSubImage3D(invalid texture level 0)". visual.c:5100: Test failed: Expected colour 0xffff0000, got 0xff000000, case 0. visual.c:5100: Test failed: Expected colour 0x00000000, got 0xff000000, case 1. visual.c:5100: Test failed: Expected colour 0xff00ff00, got 0xff000000, case 2. visual.c:5100: Test failed: Expected colour 0xff00ff00, got 0xff000000, case 3. visual.c:5100: Test failed: Expected colour 0xff0000ff, got 0xff000000, case 4. visual.c:5100: Test failed: Expected colour 0xff0000ff, got 0xff000000, case 5. visual.c:5100: Test failed: Expected colour 0xffffffff, got 0xff000000, case 6. visual.c:5100: Test failed: Expected colour 0xffffffff, got 0xff000000, case 7.