@@ -1101,13 +1101,9 @@ static void create_texture(PGRAPHState *pg, int texture_idx)
1101
1101
pgraph_reg_r (pg , NV_PGRAPH_BORDERCOLOR0 + texture_idx * 4 );
1102
1102
bool is_indexed = (state .color_format ==
1103
1103
NV097_SET_TEXTURE_FORMAT_COLOR_SZ_I8_A8R8G8B8 );
1104
- uint32_t xbox_max_anisotropy =
1104
+ uint32_t max_anisotropy =
1105
1105
1 << (GET_MASK (pgraph_reg_r (pg , NV_PGRAPH_TEXCTL0_0 + texture_idx * 4 ),
1106
1106
NV_PGRAPH_TEXCTL0_0_MAX_ANISOTROPY ));
1107
- uint32_t max_anisotropy =
1108
- xbox_max_anisotropy <= r -> device_props .limits .maxSamplerAnisotropy ?
1109
- xbox_max_anisotropy :
1110
- r -> device_props .limits .maxSamplerAnisotropy ;
1111
1107
1112
1108
TextureKey key ;
1113
1109
memset (& key , 0 , sizeof (key ));
@@ -1127,6 +1123,7 @@ static void create_texture(PGRAPHState *pg, int texture_idx)
1127
1123
key .filter = filter ;
1128
1124
key .address = address ;
1129
1125
key .border_color = border_color_pack32 ;
1126
+ key .max_anisotropy = max_anisotropy ;
1130
1127
1131
1128
bool possibly_dirty = false;
1132
1129
bool possibly_dirty_checked = false;
@@ -1350,6 +1347,8 @@ static void create_texture(PGRAPHState *pg, int texture_idx)
1350
1347
} else if (lod_bias < - r -> device_props .limits .maxSamplerLodBias ) {
1351
1348
lod_bias = - r -> device_props .limits .maxSamplerLodBias ;
1352
1349
}
1350
+ uint32_t sampler_max_anisotropy =
1351
+ MIN (r -> device_props .limits .maxSamplerAnisotropy , max_anisotropy );
1353
1352
1354
1353
VkSamplerCreateInfo sampler_create_info = {
1355
1354
.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO ,
@@ -1361,8 +1360,9 @@ static void create_texture(PGRAPHState *pg, int texture_idx)
1361
1360
GET_MASK (address , NV_PGRAPH_TEXADDRESS0_ADDRV )),
1362
1361
.addressModeW = (state .dimensionality > 2 ) ? lookup_texture_address_mode (
1363
1362
GET_MASK (address , NV_PGRAPH_TEXADDRESS0_ADDRP )) : 0 ,
1364
- .anisotropyEnable = max_anisotropy > 1 ,
1365
- .maxAnisotropy = max_anisotropy ,
1363
+ .anisotropyEnable = r -> enabled_physical_device_features .wideLines &&
1364
+ sampler_max_anisotropy > 1 ,
1365
+ .maxAnisotropy = sampler_max_anisotropy ,
1366
1366
.borderColor = vk_border_color ,
1367
1367
.compareEnable = VK_FALSE ,
1368
1368
.compareOp = VK_COMPARE_OP_ALWAYS ,
0 commit comments