void AppDumpLimits(PhysicalDeviceLimits limits, StreamWriter output) { output.WriteLine("\tVkPhysicalDeviceLimits:"); output.WriteLine("\t-----------------------"); output.WriteLine("\t\tmaxImageDimension1D = 0x{0:x}", limits.MaxImageDimension1D); output.WriteLine("\t\tmaxImageDimension2D = 0x{0:x}", limits.MaxImageDimension2D); output.WriteLine("\t\tmaxImageDimension3D = 0x{0:x}", limits.MaxImageDimension3D); output.WriteLine("\t\tmaxImageDimensionCube = 0x{0:x}", limits.MaxImageDimensionCube); output.WriteLine("\t\tmaxImageArrayLayers = 0x{0:x}", limits.MaxImageArrayLayers); output.WriteLine("\t\tmaxTexelBufferElements = 0x{0:x}", limits.MaxTexelBufferElements); output.WriteLine("\t\tmaxUniformBufferRange = 0x{0:x}", limits.MaxUniformBufferRange); output.WriteLine("\t\tmaxStorageBufferRange = 0x{0:x}", limits.MaxStorageBufferRange); output.WriteLine("\t\tmaxPushConstantsSize = 0x{0:x}", limits.MaxPushConstantsSize); output.WriteLine("\t\tmaxMemoryAllocationCount = 0x{0:x}", limits.MaxMemoryAllocationCount); output.WriteLine("\t\tmaxSamplerAllocationCount = 0x{0:x}", limits.MaxSamplerAllocationCount); output.WriteLine("\t\tbufferImageGranularity = 0x{0:x}", limits.BufferImageGranularity); output.WriteLine("\t\tsparseAddressSpaceSize = 0x{0:x}", (ulong)limits.SparseAddressSpaceSize); output.WriteLine("\t\tmaxBoundDescriptorSets = 0x{0:x}", limits.MaxBoundDescriptorSets); output.WriteLine("\t\tmaxPerStageDescriptorSamplers = 0x{0:x}", limits.MaxPerStageDescriptorSamplers); output.WriteLine("\t\tmaxPerStageDescriptorUniformBuffers = 0x{0:x}", limits.MaxPerStageDescriptorUniformBuffers); output.WriteLine("\t\tmaxPerStageDescriptorStorageBuffers = 0x{0:x}", limits.MaxPerStageDescriptorStorageBuffers); output.WriteLine("\t\tmaxPerStageDescriptorSampledImages = 0x{0:x}", limits.MaxPerStageDescriptorSampledImages); output.WriteLine("\t\tmaxPerStageDescriptorStorageImages = 0x{0:x}", limits.MaxPerStageDescriptorStorageImages); output.WriteLine("\t\tmaxPerStageDescriptorInputAttachments = 0x{0:x}", limits.MaxPerStageDescriptorInputAttachments); output.WriteLine("\t\tmaxPerStageResources = 0x{0:x}", limits.MaxPerStageResources); output.WriteLine("\t\tmaxDescriptorSetSamplers = 0x{0:x}", limits.MaxDescriptorSetSamplers); output.WriteLine("\t\tmaxDescriptorSetUniformBuffers = 0x{0:x}", limits.MaxDescriptorSetUniformBuffers); output.WriteLine("\t\tmaxDescriptorSetUniformBuffersDynamic = 0x{0:x}", limits.MaxDescriptorSetUniformBuffersDynamic); output.WriteLine("\t\tmaxDescriptorSetStorageBuffers = 0x{0:x}", limits.MaxDescriptorSetStorageBuffers); output.WriteLine("\t\tmaxDescriptorSetStorageBuffersDynamic = 0x{0:x}", limits.MaxDescriptorSetStorageBuffersDynamic); output.WriteLine("\t\tmaxDescriptorSetSampledImages = 0x{0:x}", limits.MaxDescriptorSetSampledImages); output.WriteLine("\t\tmaxDescriptorSetStorageImages = 0x{0:x}", limits.MaxDescriptorSetStorageImages); output.WriteLine("\t\tmaxDescriptorSetInputAttachments = 0x{0:x}", limits.MaxDescriptorSetInputAttachments); output.WriteLine("\t\tmaxVertexInputAttributes = 0x{0:x}", limits.MaxVertexInputAttributes); output.WriteLine("\t\tmaxVertexInputBindings = 0x{0:x}", limits.MaxVertexInputBindings); output.WriteLine("\t\tmaxVertexInputAttributeOffset = 0x{0:x}", limits.MaxVertexInputAttributeOffset); output.WriteLine("\t\tmaxVertexInputBindingStride = 0x{0:x}", limits.MaxVertexInputBindingStride); output.WriteLine("\t\tmaxVertexOutputComponents = 0x{0:x}", limits.MaxVertexOutputComponents); output.WriteLine("\t\tmaxTessellationGenerationLevel = 0x{0:x}", limits.MaxTessellationGenerationLevel); output.WriteLine("\t\tmaxTessellationPatchSize = 0x{0:x}", limits.MaxTessellationPatchSize); output.WriteLine("\t\tmaxTessellationControlPerVertexInputComponents = 0x{0:x}", limits.MaxTessellationControlPerVertexInputComponents); output.WriteLine("\t\tmaxTessellationControlPerVertexOutputComponents = 0x{0:x}", limits.MaxTessellationControlPerVertexOutputComponents); output.WriteLine("\t\tmaxTessellationControlPerPatchOutputComponents = 0x{0:x}", limits.MaxTessellationControlPerPatchOutputComponents); output.WriteLine("\t\tmaxTessellationControlTotalOutputComponents = 0x{0:x}", limits.MaxTessellationControlTotalOutputComponents); output.WriteLine("\t\tmaxTessellationEvaluationInputComponents = 0x{0:x}", limits.MaxTessellationEvaluationInputComponents); output.WriteLine("\t\tmaxTessellationEvaluationOutputComponents = 0x{0:x}", limits.MaxTessellationEvaluationOutputComponents); output.WriteLine("\t\tmaxGeometryShaderInvocations = 0x{0:x}", limits.MaxGeometryShaderInvocations); output.WriteLine("\t\tmaxGeometryInputComponents = 0x{0:x}", limits.MaxGeometryInputComponents); output.WriteLine("\t\tmaxGeometryOutputComponents = 0x{0:x}", limits.MaxGeometryOutputComponents); output.WriteLine("\t\tmaxGeometryOutputVertices = 0x{0:x}", limits.MaxGeometryOutputVertices); output.WriteLine("\t\tmaxGeometryTotalOutputComponents = 0x{0:x}", limits.MaxGeometryTotalOutputComponents); output.WriteLine("\t\tmaxFragmentInputComponents = 0x{0:x}", limits.MaxFragmentInputComponents); output.WriteLine("\t\tmaxFragmentOutputAttachments = 0x{0:x}", limits.MaxFragmentOutputAttachments); output.WriteLine("\t\tmaxFragmentDualSrcAttachments = 0x{0:x}", limits.MaxFragmentDualSrcAttachments); output.WriteLine("\t\tmaxFragmentCombinedOutputResources = 0x{0:x}", limits.MaxFragmentCombinedOutputResources); output.WriteLine("\t\tmaxComputeSharedMemorySize = 0x{0:x}", limits.MaxComputeSharedMemorySize); output.WriteLine("\t\tmaxComputeWorkGroupCount[0] = 0x{0:x}", limits.MaxComputeWorkGroupCount[0]); output.WriteLine("\t\tmaxComputeWorkGroupCount[1] = 0x{0:x}", limits.MaxComputeWorkGroupCount[1]); output.WriteLine("\t\tmaxComputeWorkGroupCount[2] = 0x{0:x}", limits.MaxComputeWorkGroupCount[2]); output.WriteLine("\t\tmaxComputeWorkGroupInvocations = 0x{0:x}", limits.MaxComputeWorkGroupInvocations); output.WriteLine("\t\tmaxComputeWorkGroupSize[0] = 0x{0:x}", limits.MaxComputeWorkGroupSize[0]); output.WriteLine("\t\tmaxComputeWorkGroupSize[1] = 0x{0:x}", limits.MaxComputeWorkGroupSize[1]); output.WriteLine("\t\tmaxComputeWorkGroupSize[2] = 0x{0:x}", limits.MaxComputeWorkGroupSize[2]); output.WriteLine("\t\tsubPixelPrecisionBits = 0x{0:x}", limits.SubPixelPrecisionBits); output.WriteLine("\t\tsubTexelPrecisionBits = 0x{0:x}", limits.SubTexelPrecisionBits); output.WriteLine("\t\tmipmapPrecisionBits = 0x{0:x}", limits.MipmapPrecisionBits); output.WriteLine("\t\tmaxDrawIndexedIndexValue = 0x{0:x}", limits.MaxDrawIndexedIndexValue); output.WriteLine("\t\tmaxDrawIndirectCount = 0x{0:x}", limits.MaxDrawIndirectCount); output.WriteLine("\t\tmaxSamplerLodBias = {0:0.000000}", limits.MaxSamplerLodBias); output.WriteLine("\t\tmaxSamplerAnisotropy = {0:0.000000}", limits.MaxSamplerAnisotropy); output.WriteLine("\t\tmaxViewports = 0x{0:x}", limits.MaxViewports); output.WriteLine("\t\tmaxViewportDimensions[0] = 0x{0:x}", limits.MaxViewportDimensions[0]); output.WriteLine("\t\tmaxViewportDimensions[1] = 0x{0:x}", limits.MaxViewportDimensions[1]); output.WriteLine("\t\tviewportBoundsRange[0] = {0:0.000000}", limits.ViewportBoundsRange[0]); output.WriteLine("\t\tviewportBoundsRange[1] = {0:0.000000}", limits.ViewportBoundsRange[1]); output.WriteLine("\t\tviewportSubPixelBits = 0x{0:x}", limits.ViewportSubPixelBits); output.WriteLine("\t\tminMemoryMapAlignment = {0}", limits.MinMemoryMapAlignment); output.WriteLine("\t\tminTexelBufferOffsetAlignment = 0x{0:x}", limits.MinTexelBufferOffsetAlignment); output.WriteLine("\t\tminUniformBufferOffsetAlignment = 0x{0:x}", limits.MinUniformBufferOffsetAlignment); output.WriteLine("\t\tminStorageBufferOffsetAlignment = 0x{0:x}", limits.MinStorageBufferOffsetAlignment); output.WriteLine("\t\tminTexelOffset = 0x{0:x}", limits.MinTexelOffset); output.WriteLine("\t\tmaxTexelOffset = 0x{0:x}", limits.MaxTexelOffset); output.WriteLine("\t\tminTexelGatherOffset = 0x{0:x}", limits.MinTexelGatherOffset); output.WriteLine("\t\tmaxTexelGatherOffset = 0x{0:x}", limits.MaxTexelGatherOffset); output.WriteLine("\t\tminInterpolationOffset = {0:0.000000}", limits.MinInterpolationOffset); output.WriteLine("\t\tmaxInterpolationOffset = {0:0.000000}", limits.MaxInterpolationOffset); output.WriteLine("\t\tsubPixelInterpolationOffsetBits = 0x{0:x}", limits.SubPixelInterpolationOffsetBits); output.WriteLine("\t\tmaxFramebufferWidth = 0x{0:x}", limits.MaxFramebufferWidth); output.WriteLine("\t\tmaxFramebufferHeight = 0x{0:x}", limits.MaxFramebufferHeight); output.WriteLine("\t\tmaxFramebufferLayers = 0x{0:x}", limits.MaxFramebufferLayers); output.WriteLine("\t\tframebufferColorSampleCounts = 0x{0:x}", limits.FramebufferColorSampleCounts); output.WriteLine("\t\tframebufferDepthSampleCounts = 0x{0:x}", limits.FramebufferDepthSampleCounts); output.WriteLine("\t\tframebufferStencilSampleCounts = 0x{0:x}", limits.FramebufferStencilSampleCounts); output.WriteLine("\t\tmaxColorAttachments = 0x{0:x}", limits.MaxColorAttachments); output.WriteLine("\t\tsampledImageColorSampleCounts = 0x{0:x}", limits.SampledImageColorSampleCounts); output.WriteLine("\t\tsampledImageDepthSampleCounts = 0x{0:x}", limits.SampledImageDepthSampleCounts); output.WriteLine("\t\tsampledImageStencilSampleCounts = 0x{0:x}", limits.SampledImageStencilSampleCounts); output.WriteLine("\t\tsampledImageIntegerSampleCounts = 0x{0:x}", limits.SampledImageIntegerSampleCounts); output.WriteLine("\t\tstorageImageSampleCounts = 0x{0:x}", limits.StorageImageSampleCounts); output.WriteLine("\t\tmaxSampleMaskWords = 0x{0:x}", limits.MaxSampleMaskWords); output.WriteLine("\t\ttimestampComputeAndGraphics = {0}", Convert.ToInt32(limits.TimestampComputeAndGraphics)); output.WriteLine("\t\ttimestampPeriod = {0:0.000000}", limits.TimestampPeriod); output.WriteLine("\t\tmaxClipDistances = 0x{0:x}", limits.MaxClipDistances); output.WriteLine("\t\tmaxCullDistances = 0x{0:x}", limits.MaxCullDistances); output.WriteLine("\t\tmaxCombinedClipAndCullDistances = 0x{0:x}", limits.MaxCombinedClipAndCullDistances); output.WriteLine("\t\tpointSizeRange[0] = {0:0.000000}", limits.PointSizeRange[0]); output.WriteLine("\t\tpointSizeRange[1] = {0:0.000000}", limits.PointSizeRange[1]); output.WriteLine("\t\tlineWidthRange[0] = {0:0.000000}", limits.LineWidthRange[0]); output.WriteLine("\t\tlineWidthRange[1] = {0:0.000000}", limits.LineWidthRange[1]); output.WriteLine("\t\tpointSizeGranularity = {0:0.000000}", limits.PointSizeGranularity); output.WriteLine("\t\tlineWidthGranularity = {0:0.000000}", limits.LineWidthGranularity); output.WriteLine("\t\tstrictLines = {0}", Convert.ToInt32(limits.StrictLines)); output.WriteLine("\t\tstandardSampleLocations = {0}", Convert.ToInt32(limits.StandardSampleLocations)); output.WriteLine("\t\toptimalBufferCopyOffsetAlignment = 0x{0:x}", limits.OptimalBufferCopyOffsetAlignment); output.WriteLine("\t\toptimalBufferCopyRowPitchAlignment = 0x{0:x}", limits.OptimalBufferCopyRowPitchAlignment); output.WriteLine("\t\tnonCoherentAtomSize = 0x{0:x}", limits.NonCoherentAtomSize); }
void PhysicalDeviceLimits(PhysicalDeviceLimits physicalDeviceLimits) { var type = physicalDeviceLimits.GetType(); var members = type.GetFields(); foreach (var member in members) { if (!member.FieldType.IsArray) { if (member.FieldType == typeof(UInt32)) { var integerValue = (UInt32)member.GetValue(physicalDeviceLimits); if (member.Name.Length < 39 && member.Name != "MaxTessellationPatchSize") { WriteLine($"{member.Name,-39} = 0x{integerValue.ToString("X")}"); } else { WriteLine($"{member.Name,-47} = 0x{integerValue.ToString("X")}"); } } else if (member.FieldType == typeof(Int32)) { var integerValue = (Int32)member.GetValue(physicalDeviceLimits); WriteLine($"{member.Name,-39} = 0x{integerValue.ToString("X")}"); } else if (member.FieldType == typeof(Single)) { var singleValue = (Single)member.GetValue(physicalDeviceLimits); WriteLine($"{member.Name,-39} = {singleValue.ToString("F6")}"); } else if (member.FieldType == typeof(DeviceSize)) { var integerValue = (DeviceSize)member.GetValue(physicalDeviceLimits); WriteLine($"{member.Name,-39} = 0x{integerValue.ToString("X")}"); } else if (member.FieldType == typeof(PhysicalDeviceLimits.MaxComputeWorkGroupCountInfo)) { var info = (PhysicalDeviceLimits.MaxComputeWorkGroupCountInfo)member.GetValue(physicalDeviceLimits); WriteLine($"{member.Name,-39} = ({info.X}, {info.Y}, {info.Z})"); } else if (member.FieldType == typeof(PhysicalDeviceLimits.MaxComputeWorkGroupSizeInfo)) { var info = (PhysicalDeviceLimits.MaxComputeWorkGroupSizeInfo)member.GetValue(physicalDeviceLimits); WriteLine($"{member.Name,-39} = ({info.X}, {info.Y}, {info.Z})"); } else if (member.FieldType == typeof(PhysicalDeviceLimits.MaxViewportDimensionsInfo)) { var info = (PhysicalDeviceLimits.MaxViewportDimensionsInfo)member.GetValue(physicalDeviceLimits); WriteLine($"{member.Name,-39} = ({info.X}, {info.Y})"); } else if (member.FieldType == typeof(PhysicalDeviceLimits.ViewportBoundsRangeInfo)) { var info = (PhysicalDeviceLimits.ViewportBoundsRangeInfo)member.GetValue(physicalDeviceLimits); WriteLine($"{member.Name,-39} = Min:{info.Min}, Max:{info.Max}"); } else if (member.FieldType == typeof(PhysicalDeviceLimits.PointSizeRangeInfo)) { var info = (PhysicalDeviceLimits.PointSizeRangeInfo)member.GetValue(physicalDeviceLimits); WriteLine($"{member.Name,-39} = Min:{info.Min}, Max:{info.Max}"); } else if (member.FieldType == typeof(PhysicalDeviceLimits.LineWidthRangeInfo)) { var info = (PhysicalDeviceLimits.LineWidthRangeInfo)member.GetValue(physicalDeviceLimits); WriteLine($"{member.Name,-39} = Min:{info.Min}, Max:{info.Max}"); } } } }