[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    WINED3DFMT_RESZ in wined3d.
From:       lorenzo Skotos <lorenzofersteam () live ! it>
Date:       2017-08-30 14:51:32
Message-ID: DBXPR03MB5439E95CA53556483091DF8AF9C0 () DBXPR03MB543 ! eurprd03 ! prod ! outlook ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi.


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


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

[https://camo.githubusercontent.com/db3db2bf09d082a1f4244859890e83954d8410a=
b/68747470733a2f2f312e67726176617461722e636f6d2f6176617461722f3431333935363=
0393536343437316339386536313437396538333061383138623f643d687474707325334125=
32462532466173736574732d63646e2e6769746875622e636f6d253246696d6167657325324=
667726176617461727325324667726176617461722d757365722d3432302e706e6726723d78=
26733d323030]<https://github.com/wine-mirror/wine/commit/8c98be4791f18f31b0=
4a4a0f08d18979aa0d06df>

wined3d: Allow all formats with "glInternal" set in CheckSurfaceCapab=85 =
=B7 wine-mirror/wine@8c98be4<https://github.com/wine-mirror/wine/commit/8c9=
8be4791f18f31b04a4a0f08d18979aa0d06df>
github.com
=85ility(). Rendertarget, depth/stencil and texturing restrictions are appl=
ied later in wined3d_check_device_format(), so to the extent this make a di=
fference 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_F=
LAG_STENCIL  | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_FBO_ATTACHABL=
E,
+            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 fl=
ags. 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.

[Attachment #5 (text/html)]

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} \
--></style> </head>
<body dir="ltr">
<div id="divtagdefaultwrapper" \
style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" \
dir="ltr"> <p>Hi. <br>
</p>
<p><br>
</p>
<p>I was investigating a regression that cause the CheckDeviceFormat function to \
return <span>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).</span></p> <p><span><br>
</span></p>
<p><span>I tacked the regression to this commit : <a \
href="https://github.com/wine-mirror/wine/commit/8c98be4791f18f31b04a4a0f08d18979aa0d06df" \
class="OWAAutoLink" id="LPlnk105153" previewremoved="true"> \
https://github.com/wine-mirror/wine/commit/8c98be4791f18f31b04a4a0f08d18979aa0d06df</a></p>
 <div id="LPBorder_GT_15041036765520.11592611293308264" style="margin-bottom: 20px; \
overflow: auto; width: 100%; text-indent: 0px;"> <table \
id="LPContainer_15041036765290.5887521363301994" style="width: 90%; background-color: \
rgb(255, 255, 255); position: relative; overflow: auto; padding-top: 20px; \
padding-bottom: 20px; margin-top: 20px; border-top: 1px dotted rgb(200, 200, 200); \
border-bottom: 1px dotted rgb(200, 200, 200);" role="presentation" cellspacing="0"> \
<tbody> <tr style="border-spacing: 0px;" valign="top">
<td id="ImageCell_15041036765340.1276099335691624" style="width: 250px; position: \
relative; display: table-cell; padding-right: 20px;" colspan="1"> <div \
id="LPImageContainer_15041036765340.41937162724768506" style="background-color: \
rgb(255, 255, 255); height: 250px; position: relative; margin: auto; display: table; \
width: 250px;"> <a id="LPImageAnchor_15041036765370.5224502716373448" style="display: \
table-cell; text-align: center;" \
href="https://github.com/wine-mirror/wine/commit/8c98be4791f18f31b04a4a0f08d18979aa0d06df" \
target="_blank"><img style="display: inline-block; max-width: 250px; max-height: \
250px; height: 250px; width: 250px; border-width: 0px; vertical-align: bottom;" \
id="LPThumbnailImageID_15041036765380.923803169399159" width="250" height="250" \
src="https://camo.githubusercontent.com/db3db2bf09d082a1f4244859890e83954d8410ab/68747 \
470733a2f2f312e67726176617461722e636f6d2f6176617461722f3431333935363039353634343731633 \
9386536313437396538333061383138623f643d68747470732533412532462532466173736574732d63646 \
e2e6769746875622e636f6d253246696d6167657325324667726176617461727325324667726176617461722d757365722d3432302e706e6726723d7826733d323030"></a></div>
 </td>
<td id="TextCell_15041036765410.9456734156730484" style="vertical-align: top; \
position: relative; padding: 0px; display: table-cell;" colspan="2"> <div \
id="LPRemovePreviewContainer_15041036765420.6175316059921808"></div> <div \
id="LPTitle_15041036765420.3829272207683506" style="top: 0px; color: rgb(0, 120, \
215); font-weight: 400; font-size: 21px; font-family: sans-serif, \
&quot;wf_segoe-ui_light&quot;, &quot;Segoe UI Light&quot;, &quot;Segoe WP \
Light&quot;, &quot;Segoe UI&quot;, &quot;Segoe WP&quot;, Tahoma, Arial; line-height: \
21px;"> <a id="LPUrlAnchor_15041036765430.46660351108865095" style="text-decoration: \
none;" href="https://github.com/wine-mirror/wine/commit/8c98be4791f18f31b04a4a0f08d18979aa0d06df" \
target="_blank">wined3d: Allow all formats with &quot;glInternal&quot; set in \
CheckSurfaceCapab…  · wine-mirror/wine@8c98be4</a></div>
<div id="LPMetadata_15041036765470.36215358887548565" style="margin: 10px 0px 16px; \
color: rgb(102, 102, 102); font-weight: 400; font-family: sans-serif, \
&quot;wf_segoe-ui_normal&quot;, &quot;Segoe UI&quot;, &quot;Segoe WP&quot;, Tahoma, \
Arial; font-size: 14px; line-height: 14px;"> github.com</div>
<div id="LPDescription_15041036765500.9781035264868412" style="display: block; color: \
rgb(102, 102, 102); font-weight: 400; font-family: sans-serif, \
&quot;wf_segoe-ui_normal&quot;, &quot;Segoe UI&quot;, &quot;Segoe WP&quot;, Tahoma, \
Arial; font-size: 14px; line-height: 20px; max-height: 100px; overflow: hidden;"> \
…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...</div> </td>
</tr>
</tbody>
</table>
</div>
I&nbsp; tried to fix this issue. <br>
</span>
<p></p>
<p><br>
</p>
<p>The last patch I made in my local branch is adding a \
<span>wined3d_format_texture_info</span> in the <span>format_texture_info</span> \
array:</p> <p><br>
</p>
<p></p>
<div>&#43;&nbsp;&nbsp;&nbsp; \
{WINED3DFMT_RESZ,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
GL_DEPTH24_STENCIL8,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
GL_DEPTH24_STENCIL8,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
0,<br> &#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
GL_DEPTH_STENCIL,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
GL_UNSIGNED_INT,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
0,<br> &#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL&nbsp; | \
WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_FBO_ATTACHABLE,<br> \
&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
ARB_FRAMEBUFFER_OBJECT,&nbsp;&nbsp;&nbsp;&nbsp; NULL},</div> <p></p>
<p><br>
</p>
<p>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. <br>
</p>
<p>I based this patch on the INTZ and RAWZ surfaces that are somewhat reported to be \
similar in scope in some docs.</p> <p><br>
</p>
<p>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&nbsp; I know nothing.</p> <p><br>
</p>
<p>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. <br>
</p>
<p>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.<br> </p>
<p>I attached the full patch file.<br>
</p>
</div>
</body>
</html>


["0001-Added-WINED3DFMT_RESZ-on-format_texture_info-array.-.patch" (text/x-patch)]

From c3c3a099ce855399d02dd9a1c2afe3ec01492bbd Mon Sep 17 00:00:00 2001
From: lorenzo <lorenzofersteam@live.it>
Date: Wed, 30 Aug 2017 16:23:51 +0200
Subject: [PATCH] Added WINED3DFMT_RESZ on format_texture_info array. \n This
 allow CheckDeviceFormat to return the correct aviability of FOURCC(RESZ).

---
 dlls/wined3d/utils.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index 5e29e7cd7a5..635597493ef 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -1678,6 +1678,10 @@ static const struct wined3d_format_texture_info \
                format_texture_info[] =
             WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | \
WINED3DFMT_FLAG_FILTERING  | WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL,
             ARB_FRAMEBUFFER_OBJECT,     NULL},
+    {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},
     {WINED3DFMT_NULL,                   0,                                0,         \
                0,
             GL_RGBA,                    GL_UNSIGNED_INT_8_8_8_8_REV,      0,
             WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | \
WINED3DFMT_FLAG_FBO_ATTACHABLE, @@ -1687,6 +1691,7 @@ static const struct \
                wined3d_format_texture_info format_texture_info[] =
             GL_RGB,                     GL_UNSIGNED_INT_5_9_9_9_REV_EXT,  0,
             WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | \
WINED3DFMT_FLAG_FILTERING,  EXT_TEXTURE_SHARED_EXPONENT, NULL},
+
 };
 
 struct wined3d_format_srgb_info
-- 
2.14.1


[Attachment #7 (text/plain)]




[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic