[PATCH 3/4] d3d9/tests: AMD r500 needs dummy texture output from vertex shaders for point sprites to work.

Stefan Dösinger stefandoesinger at gmx.at
Mon Feb 20 16:31:04 CST 2017


Similar to the fixed function case I guess. And no, this doesn't fix the
second texture coordinate on shader model 2/3 shaders that is mentioned
in the broken() lines below. It only fixes vs1 and TEXCOORD0 in vs2/3.

Signed-off-by: Stefan Dösinger <stefandoesinger at gmx.at>
---
 dlls/d3d9/tests/visual.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c
index 72005ff..15233d6 100644
--- a/dlls/d3d9/tests/visual.c
+++ b/dlls/d3d9/tests/visual.c
@@ -10445,6 +10445,8 @@ static void test_pointsize(void)
     vertex_pointsize = {64.0f, 64.0f, 0.1f, 48.0f},
     vertex_pointsize_scaled = {64.0f, 64.0f, 0.1f, 24.0f},
     vertex_pointsize_zero = {64.0f, 64.0f, 0.1f, 0.0f};
+    /* Writing a texture coordinate from the shader is technically unnecessary, but is required
+     * to make AMD drivers work. Without it, texture coordinates in the pixel shaders are 0. */
     static const DWORD vshader_code[] =
     {
         0xfffe0101,                                                 /* vs_1_1                 */
@@ -10453,6 +10455,8 @@ static void test_pointsize(void)
         0x00000004, 0x800f0000, 0x90550000, 0xa0e40001, 0x80e40000, /* mad r0, v0.y, c1, r0   */
         0x00000004, 0x800f0000, 0x90aa0000, 0xa0e40002, 0x80e40000, /* mad r0, v0.z, c2, r0   */
         0x00000004, 0xc00f0000, 0x90ff0000, 0xa0e40003, 0x80e40000, /* mad oPos, v0.w, c3, r0 */
+        0x00000001, 0xe00f0000, 0x90e40000,                         /* mov oT0, v0            */
+        0x00000001, 0xe00f0001, 0x90e40000,                         /* mov oT1, v0            */
         0x0000ffff
     };
     static const DWORD vshader_psize_code[] =
@@ -10464,7 +10468,9 @@ static void test_pointsize(void)
         0x00000004, 0x800f0000, 0x90550000, 0xa0e40001, 0x80e40000, /* mad r0, v0.y, c1, r0   */
         0x00000004, 0x800f0000, 0x90aa0000, 0xa0e40002, 0x80e40000, /* mad r0, v0.z, c2, r0   */
         0x00000004, 0xc00f0000, 0x90ff0000, 0xa0e40003, 0x80e40000, /* mad oPos, v0.w, c3, r0 */
-        0x00000001, 0xc00f0002, 0x90000001,                         /* mov oPts, v1.x */
+        0x00000001, 0xc00f0002, 0x90000001,                         /* mov oPts, v1.x         */
+        0x00000001, 0xe00f0000, 0x90e40000,                         /* mov oT0, v0            */
+        0x00000001, 0xe00f0001, 0x90e40000,                         /* mov oT1, v0            */
         0x0000ffff
     };
     static const DWORD pshader_code[] =
@@ -10508,10 +10514,14 @@ static void test_pointsize(void)
         0xfffe0300,                                                 /* vs_3_0                 */
         0x0200001f, 0x80000000, 0x900f0000,                         /* dcl_position v0        */
         0x0200001f, 0x80000000, 0xe00f0000,                         /* dcl_position o0        */
+        0x0200001f, 0x80000005, 0xe00f0001,                         /* dcl_texcoord0 o1       */
+        0x0200001f, 0x80010005, 0xe00f0002,                         /* dcl_texcoord1 o2       */
         0x03000005, 0x800f0000, 0x90000000, 0xa0e40000,             /* mul r0, v0.x, c0       */
         0x04000004, 0x800f0000, 0x90550000, 0xa0e40001, 0x80e40000, /* mad r0, v0.y, c1, r0   */
         0x04000004, 0x800f0000, 0x90aa0000, 0xa0e40002, 0x80e40000, /* mad r0, v0.z, c2, r0   */
         0x04000004, 0xe00f0000, 0x90ff0000, 0xa0e40003, 0x80e40000, /* mad o0, v0.w, c3, r0   */
+        0x02000001, 0xe00f0001, 0x90000000,                         /* mov o1, v0.x           */
+        0x02000001, 0xe00f0002, 0x90000000,                         /* mov o2, v0.x           */
         0x0000ffff
     };
     static const DWORD vshader3_psize_code[] =
@@ -10521,11 +10531,15 @@ static void test_pointsize(void)
         0x0200001f, 0x80000004, 0x90010001,                         /* dcl_psize v1.x         */
         0x0200001f, 0x80000000, 0xe00f0000,                         /* dcl_position o0        */
         0x0200001f, 0x80000004, 0xe00f0001,                         /* dcl_psize o1           */
+        0x0200001f, 0x80000005, 0xe00f0002,                         /* dcl_texcoord0 o2       */
+        0x0200001f, 0x80010005, 0xe00f0003,                         /* dcl_texcoord1 o3       */
         0x03000005, 0x800f0000, 0x90000000, 0xa0e40000,             /* mul r0, v0.x, c0       */
         0x04000004, 0x800f0000, 0x90550000, 0xa0e40001, 0x80e40000, /* mad r0, v0.y, c1, r0   */
         0x04000004, 0x800f0000, 0x90aa0000, 0xa0e40002, 0x80e40000, /* mad r0, v0.z, c2, r0   */
         0x04000004, 0xe00f0000, 0x90ff0000, 0xa0e40003, 0x80e40000, /* mad o0, v0.w, c3, r0   */
         0x02000001, 0xe00f0001, 0x90000001,                         /* mov o1, v1.x           */
+        0x02000001, 0xe00f0002, 0x90000000,                         /* mov o2, v0.x           */
+        0x02000001, 0xe00f0003, 0x90000000,                         /* mov o3, v0.x           */
         0x0000ffff
     };
     static const DWORD pshader3_code[] =
-- 
2.10.2




More information about the wine-patches mailing list