From: Axel Davy Date: Sun, 14 Oct 2018 21:31:07 +0000 (+0200) Subject: st/nine: Reduce MaxSimultaneousTextures to 8 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3d975e98e4abac853fcbb35dbb1537d2069d5125;p=mesa.git st/nine: Reduce MaxSimultaneousTextures to 8 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 --- diff --git a/src/gallium/state_trackers/nine/adapter9.c b/src/gallium/state_trackers/nine/adapter9.c index 2fa92e4207b..0634d5918ce 100644 --- a/src/gallium/state_trackers/nine/adapter9.c +++ b/src/gallium/state_trackers/nine/adapter9.c @@ -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 | diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c index ae8733027e8..24c8ce062b3 100644 --- a/src/gallium/state_trackers/nine/device9.c +++ b/src/gallium/state_trackers/nine/device9.c @@ -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);