gen7/state: Apply min/mag filters individually for samplers
authorJason Ekstrand <jason.ekstrand@intel.com>
Mon, 25 Jan 2016 23:33:08 +0000 (15:33 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Mon, 25 Jan 2016 23:33:08 +0000 (15:33 -0800)
This fixes tests which apply different min and mag filters, and depend on
the min filter to be correct.

src/vulkan/gen7_state.c

index 55cff90a723da300c77d8ba3843e2502ac18d4a8..b3abe74090db80434c7bd63ca8e5db6f7474ed07 100644 (file)
@@ -81,17 +81,16 @@ 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);
-
    struct GEN7_SAMPLER_STATE sampler_state = {
       .SamplerDisable = false,
       .TextureBorderColorMode = DX10OGL,
       .LODPreClampEnable = OGL,
       .BaseMipLevel = 0.0,
       .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 = pCreateInfo->mipLodBias * 256,
       .AnisotropicAlgorithm = EWAApproximation,
       .MinLOD = pCreateInfo->minLod,