gen8/state: Apply min/mag filters individually for samplers
authorBen Widawsky <benjamin.widawsky@intel.com>
Mon, 25 Jan 2016 23:26:25 +0000 (15:26 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Mon, 25 Jan 2016 23:29:18 +0000 (15:29 -0800)
This fixes tests which apply different min and mag filters, and depend on the
min filter to be correct.

src/vulkan/gen8_state.c

index ce142e6fb266094e2a0e873193466c8a708eeabf..6e4c3eafe111e02273965b5aa44aaf27a5e0b4d8 100644 (file)
@@ -324,9 +324,6 @@ VkResult genX(CreateSampler)(
    if (!sampler)
       return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
 
-   uint32_t filter = vk_to_gen_tex_filter(pCreateInfo->magFilter,
-                                          pCreateInfo->anisotropyEnable);
-
    uint32_t border_color_offset = device->border_colors.offset +
                                   pCreateInfo->borderColor * 64;
 
@@ -338,8 +335,8 @@ VkResult genX(CreateSampler)(
       .BaseMipLevel = 0.0,
 #endif
       .MipModeFilter = vk_to_gen_mipmap_mode[pCreateInfo->mipmapMode],
-      .MagModeFilter = filter,
-      .MinModeFilter = filter,
+      .MagModeFilter = vk_to_gen_tex_filter(pCreateInfo->magFilter, pCreateInfo->anisotropyEnable),
+      .MinModeFilter = vk_to_gen_tex_filter(pCreateInfo->minFilter, pCreateInfo->anisotropyEnable),
       .TextureLODBias = anv_clamp_f(pCreateInfo->mipLodBias, -16, 15.996),
       .AnisotropicAlgorithm = EWAApproximation,
       .MinLOD = anv_clamp_f(pCreateInfo->minLod, 0, 14),