WINED3DFMT_RESZ in wined3d.

lorenzo Skotos lorenzofersteam at live.it
Wed Aug 30 09:51:32 CDT 2017


Hi.


I was investigating a regression that cause the CheckDeviceFormat function to return WINED3DERR_NOTAVAILABLE when quering for RESZ surfaces. (WINED3DFMT_RESZ). This is causing OblivionReloaded (that worked properly until wine 2.5) to not work properly (it detect an incompatible hardware in wine or NVIDIA in wine-staging).


I tacked the regression to this commit : https://github.com/wine-mirror/wine/commit/8c98be4791f18f31b04a4a0f08d18979aa0d06df

[https://camo.githubusercontent.com/db3db2bf09d082a1f4244859890e83954d8410ab/68747470733a2f2f312e67726176617461722e636f6d2f6176617461722f34313339353630393536343437316339386536313437396538333061383138623f643d68747470732533412532462532466173736574732d63646e2e6769746875622e636f6d253246696d6167657325324667726176617461727325324667726176617461722d757365722d3432302e706e6726723d7826733d323030]<https://github.com/wine-mirror/wine/commit/8c98be4791f18f31b04a4a0f08d18979aa0d06df>

wined3d: Allow all formats with "glInternal" set in CheckSurfaceCapab… · wine-mirror/wine at 8c98be4<https://github.com/wine-mirror/wine/commit/8c98be4791f18f31b04a4a0f08d18979aa0d06df>
github.com
…ility(). Rendertarget, depth/stencil and texturing restrictions are applied later in wined3d_check_device_format(), so to the extent this make a difference it mostly affects off-screen plain surf...

I  tried to fix this issue.


The last patch I made in my local branch is adding a wined3d_format_texture_info in the format_texture_info array:


+    {WINED3DFMT_RESZ,                   GL_DEPTH24_STENCIL8,              GL_DEPTH24_STENCIL8,                    0,
+            GL_DEPTH_STENCIL,           GL_UNSIGNED_INT,                  0,
+            WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL  | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_FBO_ATTACHABLE,
+            ARB_FRAMEBUFFER_OBJECT,     NULL},


However I know almost nothing about the internal work of wined3d and opengl and don't know if this kind of addition is correct. OblivionReloaded works and can properly use the RESZ depth texture.

I based this patch on the INTZ and RAWZ surfaces that are somewhat reported to be similar in scope in some docs.


Also I don't know if the flags are correct or even meaningful in this scope. I could not find any documentation about the internal meaning of these flags. As the good Jon Snow  I know nothing.


Note I never did a patch in wine before (except adding some debug message). So please tell me if I'm in a completly wrong direction.

Also note that I didn't run the test suite. Using make test is failing hard on an advapi32 test even without this patch applied.

I attached the full patch file.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20170830/1c18e096/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Added-WINED3DFMT_RESZ-on-format_texture_info-array.-.patch
Type: text/x-patch
Size: 1914 bytes
Desc: 0001-Added-WINED3DFMT_RESZ-on-format_texture_info-array.-.patch
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20170830/1c18e096/attachment.bin>


More information about the wine-devel mailing list