radv: only use VkSamplerCreateInfo::compareOp if enabled
[mesa.git] / src / amd / vulkan / radv_device.c
index d56125d328e49f490d26a44007fe84010d2f8671..a7906919ecd9faf4857ce1afab9bf45a0a7fd4fb 100644 (file)
@@ -661,6 +661,10 @@ DRI_CONF_BEGIN
                DRI_CONF_VK_X11_OVERRIDE_MIN_IMAGE_COUNT(0)
                DRI_CONF_VK_X11_STRICT_IMAGE_COUNT("false")
        DRI_CONF_SECTION_END
+
+       DRI_CONF_SECTION_DEBUG
+               DRI_CONF_VK_WSI_FORCE_BGRA8_UNORM_FIRST("false")
+       DRI_CONF_SECTION_END
 DRI_CONF_END;
 
 static void  radv_init_dri_options(struct radv_instance *instance)
@@ -1323,7 +1327,7 @@ void radv_GetPhysicalDeviceProperties(
                .framebufferNoAttachmentsSampleCounts     = sample_counts,
                .maxColorAttachments                      = MAX_RTS,
                .sampledImageColorSampleCounts            = sample_counts,
-               .sampledImageIntegerSampleCounts          = VK_SAMPLE_COUNT_1_BIT,
+               .sampledImageIntegerSampleCounts          = sample_counts,
                .sampledImageDepthSampleCounts            = sample_counts,
                .sampledImageStencilSampleCounts          = sample_counts,
                .storageImageSampleCounts                 = pdevice->rad_info.chip_class >= GFX8 ? sample_counts : VK_SAMPLE_COUNT_1_BIT,
@@ -6696,6 +6700,7 @@ radv_init_sampler(struct radv_device *device,
        bool compat_mode = device->physical_device->rad_info.chip_class == GFX8 ||
                           device->physical_device->rad_info.chip_class == GFX9;
        unsigned filter_mode = V_008F30_SQ_IMG_FILTER_MODE_BLEND;
+       unsigned depth_compare_func = V_008F30_SQ_TEX_DEPTH_COMPARE_NEVER;
 
        const struct VkSamplerReductionModeCreateInfoEXT *sampler_reduction =
                vk_find_struct_const(pCreateInfo->pNext,
@@ -6703,11 +6708,14 @@ radv_init_sampler(struct radv_device *device,
        if (sampler_reduction)
                filter_mode = radv_tex_filter_mode(sampler_reduction->reductionMode);
 
+       if (pCreateInfo->compareEnable)
+               depth_compare_func = radv_tex_compare(pCreateInfo->compareOp);
+
        sampler->state[0] = (S_008F30_CLAMP_X(radv_tex_wrap(pCreateInfo->addressModeU)) |
                             S_008F30_CLAMP_Y(radv_tex_wrap(pCreateInfo->addressModeV)) |
                             S_008F30_CLAMP_Z(radv_tex_wrap(pCreateInfo->addressModeW)) |
                             S_008F30_MAX_ANISO_RATIO(max_aniso_ratio) |
-                            S_008F30_DEPTH_COMPARE_FUNC(radv_tex_compare(pCreateInfo->compareOp)) |
+                            S_008F30_DEPTH_COMPARE_FUNC(depth_compare_func) |
                             S_008F30_FORCE_UNNORMALIZED(pCreateInfo->unnormalizedCoordinates ? 1 : 0) |
                             S_008F30_ANISO_THRESHOLD(max_aniso_ratio >> 1) |
                             S_008F30_ANISO_BIAS(max_aniso_ratio) |