st/nine: Reduce MaxSimultaneousTextures to 8
authorAxel Davy <davyaxel0@gmail.com>
Sun, 14 Oct 2018 21:31:07 +0000 (23:31 +0200)
committerAxel Davy <davyaxel0@gmail.com>
Fri, 26 Oct 2018 20:16:16 +0000 (22:16 +0200)
Windows drivers don't set this flag (which affects ff) to more than 8.

Do the same in case some games check for 8.

v2: Remove any dependence on MaxSimultaneousTextures. For non-ff
the number of textures is 16 when the device is able of vs/ps3.
Add this requirement of 16 textures to the driver requirements.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
src/gallium/state_trackers/nine/adapter9.c
src/gallium/state_trackers/nine/device9.c

index 2fa92e4207b5380a0efb1ecd65e0ebc0c51035c9..0634d5918ce6df3d53cbd2f3717e32055551ee85 100644 (file)
@@ -77,7 +77,9 @@ NineAdapter9_ctor( struct NineAdapter9 *This,
         hal->get_shader_param(hal, PIPE_SHADER_VERTEX,
                               PIPE_SHADER_CAP_MAX_INPUTS) < 16 ||
         hal->get_shader_param(hal, PIPE_SHADER_FRAGMENT,
-                              PIPE_SHADER_CAP_MAX_INPUTS) < 10) {
+                              PIPE_SHADER_CAP_MAX_INPUTS) < 10 ||
+        hal->get_shader_param(hal, PIPE_SHADER_FRAGMENT,
+                              PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS) < 16) {
         ERR("Your card is not supported by Gallium Nine. Minimum requirement "
             "is >= r500, >= nv50, >= i965\n");
         return D3DERR_DRIVERINTERNALERROR;
@@ -789,10 +791,7 @@ NineAdapter9_GetDeviceCaps( struct NineAdapter9 *This,
 
     pCaps->MaxTextureBlendStages = 8; /* XXX wine */
         (DWORD)screen->get_param(screen, PIPE_CAP_BLEND_EQUATION_SEPARATE);
-    pCaps->MaxSimultaneousTextures = screen->get_shader_param(screen,
-        PIPE_SHADER_FRAGMENT, PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS);
-    if (pCaps->MaxSimultaneousTextures > NINE_MAX_SAMPLERS_PS)
-        pCaps->MaxSimultaneousTextures = NINE_MAX_SAMPLERS_PS;
+    pCaps->MaxSimultaneousTextures = 8;
 
     pCaps->VertexProcessingCaps = D3DVTXPCAPS_TEXGEN |
                                   D3DVTXPCAPS_TEXGEN_SPHEREMAP |
index ae8733027e8a05666145475d95f0f1a7b12f8e32..24c8ce062b33f22c845022cc4004143f33d0860e 100644 (file)
@@ -2451,7 +2451,7 @@ NineDevice9_GetTexture( struct NineDevice9 *This,
                         DWORD Stage,
                         IDirect3DBaseTexture9 **ppTexture )
 {
-    user_assert(Stage < This->caps.MaxSimultaneousTextures ||
+    user_assert(Stage < NINE_MAX_SAMPLERS_PS ||
                 Stage == D3DDMAPSAMPLER ||
                 (Stage >= D3DVERTEXTEXTURESAMPLER0 &&
                  Stage <= D3DVERTEXTEXTURESAMPLER3), D3DERR_INVALIDCALL);
@@ -2478,7 +2478,7 @@ NineDevice9_SetTexture( struct NineDevice9 *This,
 
     DBG("This=%p Stage=%u pTexture=%p\n", This, Stage, pTexture);
 
-    user_assert(Stage < This->caps.MaxSimultaneousTextures ||
+    user_assert(Stage < NINE_MAX_SAMPLERS_PS ||
                 Stage == D3DDMAPSAMPLER ||
                 (Stage >= D3DVERTEXTEXTURESAMPLER0 &&
                  Stage <= D3DVERTEXTEXTURESAMPLER3), D3DERR_INVALIDCALL);
@@ -2552,7 +2552,7 @@ NineDevice9_GetSamplerState( struct NineDevice9 *This,
                              D3DSAMPLERSTATETYPE Type,
                              DWORD *pValue )
 {
-    user_assert(Sampler < This->caps.MaxSimultaneousTextures ||
+    user_assert(Sampler < NINE_MAX_SAMPLERS_PS ||
                 Sampler == D3DDMAPSAMPLER ||
                 (Sampler >= D3DVERTEXTEXTURESAMPLER0 &&
                  Sampler <= D3DVERTEXTEXTURESAMPLER3), D3DERR_INVALIDCALL);
@@ -2575,7 +2575,7 @@ NineDevice9_SetSamplerState( struct NineDevice9 *This,
     DBG("This=%p Sampler=%u Type=%s Value=%08x\n", This,
         Sampler, nine_D3DSAMP_to_str(Type), Value);
 
-    user_assert(Sampler < This->caps.MaxSimultaneousTextures ||
+    user_assert(Sampler < NINE_MAX_SAMPLERS_PS ||
                 Sampler == D3DDMAPSAMPLER ||
                 (Sampler >= D3DVERTEXTEXTURESAMPLER0 &&
                  Sampler <= D3DVERTEXTEXTURESAMPLER3), D3DERR_INVALIDCALL);