From 8017ac0e7973f2e4d514b05cdf843f7a640293a5 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 15 Aug 2022 11:56:28 +1000 Subject: [PATCH] nvk: add some limits/features from binary driver. These are just copied from nvidia vulkaninfo for my tu104. I've left geom/tess stuff out for now. Part-of: --- src/nouveau/vulkan/nvk_physical_device.c | 87 +++++++++++++++++++++++- 1 file changed, 86 insertions(+), 1 deletion(-) diff --git a/src/nouveau/vulkan/nvk_physical_device.c b/src/nouveau/vulkan/nvk_physical_device.c index 918707cfd7d..4160f4a4060 100644 --- a/src/nouveau/vulkan/nvk_physical_device.c +++ b/src/nouveau/vulkan/nvk_physical_device.c @@ -31,6 +31,29 @@ nvk_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice, pFeatures->features = (VkPhysicalDeviceFeatures) { .robustBufferAccess = true, + .fullDrawIndexUint32 = true, + .independentBlend = true, + .logicOp = true, + .multiViewport = true, + .samplerAnisotropy = true, + .shaderClipDistance = true, + .shaderCullDistance = true, + .shaderResourceMinLod = true, + .imageCubeArray = true, + .dualSrcBlend = true, + .multiDrawIndirect = true, + .drawIndirectFirstInstance = true, + .depthClamp = true, + .depthBiasClamp = true, + .fillModeNonSolid = true, + .depthBounds = true, + .fragmentStoresAndAtomics = true, + .alphaToOne = true, + .occlusionQueryPrecise = true, + .sampleRateShading = true, + .textureCompressionBC = true, + .vertexPipelineStoresAndAtomics = true, + .wideLines = true, /* More features */ .shaderStorageImageExtendedFormats = true, .shaderStorageImageWriteWithoutFormat = true, @@ -104,7 +127,8 @@ nvk_GetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2 *pProperties) { VK_FROM_HANDLE(nvk_physical_device, pdevice, physicalDevice); - + VkSampleCountFlagBits sample_count = VK_SAMPLE_COUNT_1_BIT | + VK_SAMPLE_COUNT_2_BIT | VK_SAMPLE_COUNT_4_BIT | VK_SAMPLE_COUNT_8_BIT; pProperties->properties = (VkPhysicalDeviceProperties) { .apiVersion = VK_MAKE_VERSION(1, 0, VK_HEADER_VERSION), .driverVersion = vk_get_driver_version(), @@ -116,8 +140,38 @@ nvk_GetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice, .maxImageArrayLayers = 2048, .maxImageDimension1D = pdevice->dev->chipset >= 0x130 ? 0x8000 : 0x4000, .maxImageDimension2D = pdevice->dev->chipset >= 0x130 ? 0x8000 : 0x4000, + .maxImageDimension3D = 0x4000, + .maxImageDimensionCube = 0x8000, .maxPushConstantsSize = NVK_MAX_PUSH_SIZE, + .maxFramebufferHeight = pdevice->dev->chipset >= 0x130 ? 0x8000 : 0x4000, + .maxFramebufferWidth = pdevice->dev->chipset >= 0x130 ? 0x8000 : 0x4000, + .maxFramebufferLayers = 2048, + .maxColorAttachments = NVK_MAX_RTS, + .maxClipDistances = 8, + .maxCullDistances = 8, + .maxCombinedClipAndCullDistances = 8, + .maxFragmentCombinedOutputResources = 16, + .maxFragmentInputComponents = 128, + .maxFragmentOutputAttachments = NVK_MAX_RTS, + .maxFragmentDualSrcAttachments = 1, .maxSamplerAllocationCount = 4096, + .maxSamplerLodBias = 15, + .maxSamplerAnisotropy = 16, + .maxSampleMaskWords = 1, + .minTexelGatherOffset = -32, + .minTexelOffset = -8, + .maxTexelGatherOffset = 31, + .maxTexelOffset = 7, + .minInterpolationOffset = -0.5, + .maxInterpolationOffset = 0.4375, + .mipmapPrecisionBits = 8, + .subPixelInterpolationOffsetBits = 4, + .subPixelPrecisionBits = 8, + .subTexelPrecisionBits = 8, + .viewportSubPixelBits = 8, + .maxUniformBufferRange = 65536, + .maxStorageBufferRange = UINT32_MAX, + .maxTexelBufferElements = 128 * 1024 * 1024, .maxBoundDescriptorSets = NVK_MAX_SETS, .maxPerStageDescriptorSamplers = UINT32_MAX, .maxPerStageDescriptorUniformBuffers = UINT32_MAX, @@ -139,8 +193,39 @@ nvk_GetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice, .maxComputeWorkGroupInvocations = 1024, .maxComputeWorkGroupSize = {1024, 1024, 64}, .maxStorageBufferRange = UINT32_MAX, + .maxViewports = NVK_MAX_VIEWPORTS, + .maxViewportDimensions = { 32768, 32768 }, + .viewportBoundsRange = { -65536, 65536 }, + .pointSizeRange = { 1.0, 2047.94 }, + .pointSizeGranularity = 0.0625, + .lineWidthRange = { 1, 64 }, + .lineWidthGranularity = 0.0625, .nonCoherentAtomSize = 64, + .minMemoryMapAlignment = 64, .minUniformBufferOffsetAlignment = NVK_MIN_UBO_ALIGNMENT, + .minTexelBufferOffsetAlignment = NVK_MIN_UBO_ALIGNMENT, + .minStorageBufferOffsetAlignment = NVK_MIN_UBO_ALIGNMENT, + .maxVertexInputAttributeOffset = 2047, + .maxVertexInputAttributes = 32, + .maxVertexInputBindingStride = 2048, + .maxVertexInputBindings = 32, + .maxVertexOutputComponents = 128, + .maxDrawIndexedIndexValue = UINT32_MAX, + .maxDrawIndirectCount = UINT32_MAX, + .timestampComputeAndGraphics = true, + .timestampPeriod = 1, + .framebufferColorSampleCounts = sample_count, + .framebufferDepthSampleCounts = sample_count, + .framebufferNoAttachmentsSampleCounts = sample_count | VK_SAMPLE_COUNT_16_BIT, + .framebufferStencilSampleCounts = sample_count, + .sampledImageColorSampleCounts = sample_count, + .sampledImageDepthSampleCounts = sample_count, + .sampledImageIntegerSampleCounts = sample_count, + .sampledImageStencilSampleCounts = sample_count, + .storageImageSampleCounts = sample_count, + .standardSampleLocations = true, + .optimalBufferCopyOffsetAlignment = 1, + .optimalBufferCopyRowPitchAlignment = 1, }, /* More properties */