+static void
+anv_get_physical_device_properties_1_1(struct anv_physical_device *pdevice,
+ VkPhysicalDeviceVulkan11Properties *p)
+{
+ assert(p->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES);
+
+ memcpy(p->deviceUUID, pdevice->device_uuid, VK_UUID_SIZE);
+ memcpy(p->driverUUID, pdevice->driver_uuid, VK_UUID_SIZE);
+ memset(p->deviceLUID, 0, VK_LUID_SIZE);
+ p->deviceNodeMask = 0;
+ p->deviceLUIDValid = false;
+
+ p->subgroupSize = BRW_SUBGROUP_SIZE;
+ VkShaderStageFlags scalar_stages = 0;
+ for (unsigned stage = 0; stage < MESA_SHADER_STAGES; stage++) {
+ if (pdevice->compiler->scalar_stage[stage])
+ scalar_stages |= mesa_to_vk_shader_stage(stage);
+ }
+ p->subgroupSupportedStages = scalar_stages;
+ p->subgroupSupportedOperations = VK_SUBGROUP_FEATURE_BASIC_BIT |
+ VK_SUBGROUP_FEATURE_VOTE_BIT |
+ VK_SUBGROUP_FEATURE_BALLOT_BIT |
+ VK_SUBGROUP_FEATURE_SHUFFLE_BIT |
+ VK_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT |
+ VK_SUBGROUP_FEATURE_QUAD_BIT;
+ if (pdevice->info.gen >= 8) {
+ /* TODO: There's no technical reason why these can't be made to
+ * work on gen7 but they don't at the moment so it's best to leave
+ * the feature disabled than enabled and broken.
+ */
+ p->subgroupSupportedOperations |= VK_SUBGROUP_FEATURE_ARITHMETIC_BIT |
+ VK_SUBGROUP_FEATURE_CLUSTERED_BIT;
+ }
+ p->subgroupQuadOperationsInAllStages = pdevice->info.gen >= 8;
+
+ p->pointClippingBehavior = VK_POINT_CLIPPING_BEHAVIOR_USER_CLIP_PLANES_ONLY;
+ p->maxMultiviewViewCount = 16;
+ p->maxMultiviewInstanceIndex = UINT32_MAX / 16;
+ p->protectedNoFault = false;
+ /* This value doesn't matter for us today as our per-stage descriptors are
+ * the real limit.
+ */
+ p->maxPerSetDescriptors = 1024;
+ p->maxMemoryAllocationSize = MAX_MEMORY_ALLOCATION_SIZE;
+}
+
+static void
+anv_get_physical_device_properties_1_2(struct anv_physical_device *pdevice,
+ VkPhysicalDeviceVulkan12Properties *p)
+{
+ assert(p->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES);
+
+ p->driverID = VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA_KHR;
+ memset(p->driverName, 0, sizeof(p->driverName));
+ snprintf(p->driverName, VK_MAX_DRIVER_NAME_SIZE_KHR,
+ "Intel open-source Mesa driver");
+ memset(p->driverInfo, 0, sizeof(p->driverInfo));
+ snprintf(p->driverInfo, VK_MAX_DRIVER_INFO_SIZE_KHR,
+ "Mesa " PACKAGE_VERSION MESA_GIT_SHA1);
+ p->conformanceVersion = (VkConformanceVersionKHR) {
+ .major = 1,
+ .minor = 2,
+ .subminor = 0,
+ .patch = 0,
+ };
+
+ p->denormBehaviorIndependence =
+ VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_ALL_KHR;
+ p->roundingModeIndependence =
+ VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_NONE_KHR;
+
+ /* Broadwell does not support HF denorms and there are restrictions
+ * other gens. According to Kabylake's PRM:
+ *
+ * "math - Extended Math Function
+ * [...]
+ * Restriction : Half-float denorms are always retained."
+ */
+ p->shaderDenormFlushToZeroFloat16 = false;
+ p->shaderDenormPreserveFloat16 = pdevice->info.gen > 8;
+ p->shaderRoundingModeRTEFloat16 = true;
+ p->shaderRoundingModeRTZFloat16 = true;
+ p->shaderSignedZeroInfNanPreserveFloat16 = true;
+
+ p->shaderDenormFlushToZeroFloat32 = true;
+ p->shaderDenormPreserveFloat32 = true;
+ p->shaderRoundingModeRTEFloat32 = true;
+ p->shaderRoundingModeRTZFloat32 = true;
+ p->shaderSignedZeroInfNanPreserveFloat32 = true;
+
+ p->shaderDenormFlushToZeroFloat64 = true;
+ p->shaderDenormPreserveFloat64 = true;
+ p->shaderRoundingModeRTEFloat64 = true;
+ p->shaderRoundingModeRTZFloat64 = true;
+ p->shaderSignedZeroInfNanPreserveFloat64 = true;
+
+ /* It's a bit hard to exactly map our implementation to the limits
+ * described here. The bindless surface handle in the extended
+ * message descriptors is 20 bits and it's an index into the table of
+ * RENDER_SURFACE_STATE structs that starts at bindless surface base
+ * address. Given that most things consume two surface states per
+ * view (general/sampled for textures and write-only/read-write for
+ * images), we claim 2^19 things.
+ *
+ * For SSBOs, we just use A64 messages so there is no real limit
+ * there beyond the limit on the total size of a descriptor set.
+ */
+ const unsigned max_bindless_views = 1 << 19;
+ p->maxUpdateAfterBindDescriptorsInAllPools = max_bindless_views;
+ p->shaderUniformBufferArrayNonUniformIndexingNative = false;
+ p->shaderSampledImageArrayNonUniformIndexingNative = false;
+ p->shaderStorageBufferArrayNonUniformIndexingNative = true;
+ p->shaderStorageImageArrayNonUniformIndexingNative = false;
+ p->shaderInputAttachmentArrayNonUniformIndexingNative = false;
+ p->robustBufferAccessUpdateAfterBind = true;
+ p->quadDivergentImplicitLod = false;
+ p->maxPerStageDescriptorUpdateAfterBindSamplers = max_bindless_views;
+ p->maxPerStageDescriptorUpdateAfterBindUniformBuffers = MAX_PER_STAGE_DESCRIPTOR_UNIFORM_BUFFERS;
+ p->maxPerStageDescriptorUpdateAfterBindStorageBuffers = UINT32_MAX;
+ p->maxPerStageDescriptorUpdateAfterBindSampledImages = max_bindless_views;
+ p->maxPerStageDescriptorUpdateAfterBindStorageImages = max_bindless_views;
+ p->maxPerStageDescriptorUpdateAfterBindInputAttachments = MAX_PER_STAGE_DESCRIPTOR_INPUT_ATTACHMENTS;
+ p->maxPerStageUpdateAfterBindResources = UINT32_MAX;
+ p->maxDescriptorSetUpdateAfterBindSamplers = max_bindless_views;
+ p->maxDescriptorSetUpdateAfterBindUniformBuffers = 6 * MAX_PER_STAGE_DESCRIPTOR_UNIFORM_BUFFERS;
+ p->maxDescriptorSetUpdateAfterBindUniformBuffersDynamic = MAX_DYNAMIC_BUFFERS / 2;
+ p->maxDescriptorSetUpdateAfterBindStorageBuffers = UINT32_MAX;
+ p->maxDescriptorSetUpdateAfterBindStorageBuffersDynamic = MAX_DYNAMIC_BUFFERS / 2;
+ p->maxDescriptorSetUpdateAfterBindSampledImages = max_bindless_views;
+ p->maxDescriptorSetUpdateAfterBindStorageImages = max_bindless_views;
+ p->maxDescriptorSetUpdateAfterBindInputAttachments = MAX_DESCRIPTOR_SET_INPUT_ATTACHMENTS;
+
+ /* We support all of the depth resolve modes */
+ p->supportedDepthResolveModes = VK_RESOLVE_MODE_SAMPLE_ZERO_BIT_KHR |
+ VK_RESOLVE_MODE_AVERAGE_BIT_KHR |
+ VK_RESOLVE_MODE_MIN_BIT_KHR |
+ VK_RESOLVE_MODE_MAX_BIT_KHR;
+ /* Average doesn't make sense for stencil so we don't support that */
+ p->supportedStencilResolveModes = VK_RESOLVE_MODE_SAMPLE_ZERO_BIT_KHR;
+ if (pdevice->info.gen >= 8) {
+ /* The advanced stencil resolve modes currently require stencil
+ * sampling be supported by the hardware.
+ */
+ p->supportedStencilResolveModes |= VK_RESOLVE_MODE_MIN_BIT_KHR |
+ VK_RESOLVE_MODE_MAX_BIT_KHR;
+ }
+ p->independentResolveNone = true;
+ p->independentResolve = true;
+
+ p->filterMinmaxSingleComponentFormats = pdevice->info.gen >= 9;
+ p->filterMinmaxImageComponentMapping = pdevice->info.gen >= 9;
+
+ p->maxTimelineSemaphoreValueDifference = UINT64_MAX;
+
+ p->framebufferIntegerColorSampleCounts =
+ isl_device_get_sample_counts(&pdevice->isl_dev);
+}
+