示例#1
0
 public ImageCreateInfo
 (
     StructureType sType        = StructureType.ImageCreateInfo,
     void *pNext                = default,
     ImageCreateFlags flags     = default,
     ImageType imageType        = default,
     Format format              = default,
     Extent3D extent            = default,
     uint mipLevels             = default,
     uint arrayLayers           = default,
     SampleCountFlags samples   = default,
     ImageTiling tiling         = default,
     ImageUsageFlags usage      = default,
     SharingMode sharingMode    = default,
     uint queueFamilyIndexCount = default,
     uint *pQueueFamilyIndices  = default,
     ImageLayout initialLayout  = default
 )
 {
     SType                 = sType;
     PNext                 = pNext;
     Flags                 = flags;
     ImageType             = imageType;
     Format                = format;
     Extent                = extent;
     MipLevels             = mipLevels;
     ArrayLayers           = arrayLayers;
     Samples               = samples;
     Tiling                = tiling;
     Usage                 = usage;
     SharingMode           = sharingMode;
     QueueFamilyIndexCount = queueFamilyIndexCount;
     PQueueFamilyIndices   = pQueueFamilyIndices;
     InitialLayout         = initialLayout;
 }
示例#2
0
 public AttachmentDescription2KHR
 (
     StructureType sType = StructureType.AttachmentDescription2,
     void *pNext         = default,
     AttachmentDescriptionFlags flags = default,
     Format format                    = default,
     SampleCountFlags samples         = default,
     AttachmentLoadOp loadOp          = default,
     AttachmentStoreOp storeOp        = default,
     AttachmentLoadOp stencilLoadOp   = default,
     AttachmentStoreOp stencilStoreOp = default,
     ImageLayout initialLayout        = default,
     ImageLayout finalLayout          = default
 )
 {
     SType          = sType;
     PNext          = pNext;
     Flags          = flags;
     Format         = format;
     Samples        = samples;
     LoadOp         = loadOp;
     StoreOp        = storeOp;
     StencilLoadOp  = stencilLoadOp;
     StencilStoreOp = stencilStoreOp;
     InitialLayout  = initialLayout;
     FinalLayout    = finalLayout;
 }
 /// <param name="RasterizationSamples">Number of samples used for rasterization</param>
 /// <param name="SampleShadingEnable">Optional (GL45)</param>
 /// <param name="MinSampleShading">Optional (GL45)</param>
 public PipelineMultisampleStateCreateInfo(SampleCountFlags RasterizationSamples, Bool32 SampleShadingEnable, Single MinSampleShading, Bool32 AlphaToCoverageEnable, Bool32 AlphaToOneEnable) : this()
 {
     this.RasterizationSamples  = RasterizationSamples;
     this.SampleShadingEnable   = SampleShadingEnable;
     this.MinSampleShading      = MinSampleShading;
     this.AlphaToCoverageEnable = AlphaToCoverageEnable;
     this.AlphaToOneEnable      = AlphaToOneEnable;
 }
示例#4
0
        public static ImageWithMemory CreateSampledImageWithMemory(
            uint width,
            uint height,
            ImageUsageFlags imageUsageFlags,
            SampleCountFlags samples,
            Format format,
            ImageAspectFlags imageAspectFlags)
        {
            ImageWithMemory imageWithMemory = new ImageWithMemory
            {
                Image = VContext.Instance.device.CreateImage
                        (
                    new ImageCreateInfo()
                {
                    ImageType = ImageType.Image2D,
                    Format    = format,
                    Extent    = new Extent3D()
                    {
                        Width  = width,
                        Height = height,
                        Depth  = 1
                    },
                    MipLevels     = 1,
                    ArrayLayers   = 1,
                    Samples       = samples,
                    Tiling        = ImageTiling.Optimal,
                    Usage         = imageUsageFlags,
                    SharingMode   = SharingMode.Exclusive,
                    InitialLayout = ImageLayout.Undefined
                }
                        )
            };

            MemoryRequirements textureMemoryRequirements = VContext.Instance.device.GetImageMemoryRequirements(imageWithMemory.Image);
            uint memoryTypeIndex = Util.GetMemoryTypeIndex(textureMemoryRequirements.MemoryTypeBits, MemoryPropertyFlags.DeviceLocal);

            imageWithMemory.Memory = VContext.Instance.device.AllocateMemory
                                     (
                new MemoryAllocateInfo()
            {
                AllocationSize  = textureMemoryRequirements.Size,
                MemoryTypeIndex = memoryTypeIndex
            }
                                     );
            VContext.Instance.device.BindImageMemory(imageWithMemory.Image, imageWithMemory.Memory, 0);

            imageWithMemory.ImageView = VContext.Instance.CreateImageView(imageWithMemory.Image, format, imageAspectFlags);

            return(imageWithMemory);
        }
示例#5
0
 public ImageFormatProperties
 (
     Extent3D maxExtent            = default,
     uint maxMipLevels             = default,
     uint maxArrayLayers           = default,
     SampleCountFlags sampleCounts = default,
     ulong maxResourceSize         = default
 )
 {
     MaxExtent       = maxExtent;
     MaxMipLevels    = maxMipLevels;
     MaxArrayLayers  = maxArrayLayers;
     SampleCounts    = sampleCounts;
     MaxResourceSize = maxResourceSize;
 }
示例#6
0
 public FramebufferMixedSamplesCombinationNV
 (
     StructureType sType = StructureType.FramebufferMixedSamplesCombinationNV,
     void *pNext         = default,
     CoverageReductionModeNV coverageReductionMode = default,
     SampleCountFlags rasterizationSamples         = default,
     SampleCountFlags depthStencilSamples          = default,
     SampleCountFlags colorSamples = default
 )
 {
     SType = sType;
     PNext = pNext;
     CoverageReductionMode = coverageReductionMode;
     RasterizationSamples  = rasterizationSamples;
     DepthStencilSamples   = depthStencilSamples;
     ColorSamples          = colorSamples;
 }
 public SampleLocationsInfoEXT
 (
     StructureType sType = StructureType.SampleLocationsInfoExt,
     void *pNext         = default,
     SampleCountFlags sampleLocationsPerPixel = default,
     Extent2D sampleLocationGridSize          = default,
     uint sampleLocationsCount           = default,
     SampleLocationEXT *pSampleLocations = default
 )
 {
     SType = sType;
     PNext = pNext;
     SampleLocationsPerPixel = sampleLocationsPerPixel;
     SampleLocationGridSize  = sampleLocationGridSize;
     SampleLocationsCount    = sampleLocationsCount;
     PSampleLocations        = pSampleLocations;
 }
 public PhysicalDeviceSampleLocationsPropertiesEXT
 (
     StructureType sType = StructureType.PhysicalDeviceSampleLocationsPropertiesExt,
     void *pNext         = default,
     SampleCountFlags sampleLocationSampleCounts = default,
     Extent2D maxSampleLocationGridSize          = default,
     uint sampleLocationSubPixelBits             = default,
     Bool32 variableSampleLocations = default
 )
 {
     SType = sType;
     PNext = pNext;
     SampleLocationSampleCounts = sampleLocationSampleCounts;
     MaxSampleLocationGridSize  = maxSampleLocationGridSize;
     SampleLocationSubPixelBits = sampleLocationSubPixelBits;
     VariableSampleLocations    = variableSampleLocations;
 }
示例#9
0
 public PhysicalDeviceSparseImageFormatInfo2KHR
 (
     StructureType sType      = StructureType.PhysicalDeviceSparseImageFormatInfo2,
     void *pNext              = default,
     Format format            = default,
     ImageType type           = default,
     SampleCountFlags samples = default,
     ImageUsageFlags usage    = default,
     ImageTiling tiling       = default
 )
 {
     SType   = sType;
     PNext   = pNext;
     Format  = format;
     Type    = type;
     Samples = samples;
     Usage   = usage;
     Tiling  = tiling;
 }
示例#10
0
 public AttachmentDescription
 (
     AttachmentDescriptionFlags flags = default,
     Format format                    = default,
     SampleCountFlags samples         = default,
     AttachmentLoadOp loadOp          = default,
     AttachmentStoreOp storeOp        = default,
     AttachmentLoadOp stencilLoadOp   = default,
     AttachmentStoreOp stencilStoreOp = default,
     ImageLayout initialLayout        = default,
     ImageLayout finalLayout          = default
 )
 {
     Flags          = flags;
     Format         = format;
     Samples        = samples;
     LoadOp         = loadOp;
     StoreOp        = storeOp;
     StencilLoadOp  = stencilLoadOp;
     StencilStoreOp = stencilStoreOp;
     InitialLayout  = initialLayout;
     FinalLayout    = finalLayout;
 }
 public PipelineMultisampleStateCreateInfo
 (
     StructureType sType = StructureType.PipelineMultisampleStateCreateInfo,
     void *pNext         = default,
     uint flags          = default,
     SampleCountFlags rasterizationSamples = default,
     Bool32 sampleShadingEnable            = default,
     float minSampleShading       = default,
     uint *pSampleMask            = default,
     Bool32 alphaToCoverageEnable = default,
     Bool32 alphaToOneEnable      = default
 )
 {
     SType = sType;
     PNext = pNext;
     Flags = flags;
     RasterizationSamples  = rasterizationSamples;
     SampleShadingEnable   = sampleShadingEnable;
     MinSampleShading      = minSampleShading;
     PSampleMask           = pSampleMask;
     AlphaToCoverageEnable = alphaToCoverageEnable;
     AlphaToOneEnable      = alphaToOneEnable;
 }
示例#12
0
 /// <summary>
 ///
 /// </summary>
 public ImageFormatProperties(Extent3D maxExtent, uint maxMipLevels, uint maxArrayLayers, SampleCountFlags sampleCounts, DeviceSize maxResourceSize)
 {
     this.MaxExtent       = maxExtent;
     this.MaxMipLevels    = maxMipLevels;
     this.MaxArrayLayers  = maxArrayLayers;
     this.SampleCounts    = sampleCounts;
     this.MaxResourceSize = maxResourceSize;
 }
示例#13
0
 public static extern unsafe void vkGetPhysicalDeviceSparseImageFormatProperties(IntPtr physicalDevice, Format format, ImageType type, SampleCountFlags samples, ImageUsageFlags usage, ImageTiling tiling, uint *pPropertyCount, SparseImageFormatProperties *pProperties);
 public static unsafe void GetPhysicalDeviceMultisampleProperties(this ExtSampleLocations thisApi, [Count(Count = 0)] PhysicalDevice physicalDevice, [Count(Count = 0)] SampleCountFlags samples, [Count(Count = 0), Flow(FlowDirection.Out)] Span <MultisamplePropertiesEXT> pMultisampleProperties)
 {
     // SpanOverloader
     thisApi.GetPhysicalDeviceMultisampleProperties(physicalDevice, samples, out pMultisampleProperties.GetPinnableReference());
 }
 public PhysicalDeviceLimits
 (
     uint maxImageDimension1D                             = default,
     uint maxImageDimension2D                             = default,
     uint maxImageDimension3D                             = default,
     uint maxImageDimensionCube                           = default,
     uint maxImageArrayLayers                             = default,
     uint maxTexelBufferElements                          = default,
     uint maxUniformBufferRange                           = default,
     uint maxStorageBufferRange                           = default,
     uint maxPushConstantsSize                            = default,
     uint maxMemoryAllocationCount                        = default,
     uint maxSamplerAllocationCount                       = default,
     ulong bufferImageGranularity                         = default,
     ulong sparseAddressSpaceSize                         = default,
     uint maxBoundDescriptorSets                          = default,
     uint maxPerStageDescriptorSamplers                   = default,
     uint maxPerStageDescriptorUniformBuffers             = default,
     uint maxPerStageDescriptorStorageBuffers             = default,
     uint maxPerStageDescriptorSampledImages              = default,
     uint maxPerStageDescriptorStorageImages              = default,
     uint maxPerStageDescriptorInputAttachments           = default,
     uint maxPerStageResources                            = default,
     uint maxDescriptorSetSamplers                        = default,
     uint maxDescriptorSetUniformBuffers                  = default,
     uint maxDescriptorSetUniformBuffersDynamic           = default,
     uint maxDescriptorSetStorageBuffers                  = default,
     uint maxDescriptorSetStorageBuffersDynamic           = default,
     uint maxDescriptorSetSampledImages                   = default,
     uint maxDescriptorSetStorageImages                   = default,
     uint maxDescriptorSetInputAttachments                = default,
     uint maxVertexInputAttributes                        = default,
     uint maxVertexInputBindings                          = default,
     uint maxVertexInputAttributeOffset                   = default,
     uint maxVertexInputBindingStride                     = default,
     uint maxVertexOutputComponents                       = default,
     uint maxTessellationGenerationLevel                  = default,
     uint maxTessellationPatchSize                        = default,
     uint maxTessellationControlPerVertexInputComponents  = default,
     uint maxTessellationControlPerVertexOutputComponents = default,
     uint maxTessellationControlPerPatchOutputComponents  = default,
     uint maxTessellationControlTotalOutputComponents     = default,
     uint maxTessellationEvaluationInputComponents        = default,
     uint maxTessellationEvaluationOutputComponents       = default,
     uint maxGeometryShaderInvocations                    = default,
     uint maxGeometryInputComponents                      = default,
     uint maxGeometryOutputComponents                     = default,
     uint maxGeometryOutputVertices                       = default,
     uint maxGeometryTotalOutputComponents                = default,
     uint maxFragmentInputComponents                      = default,
     uint maxFragmentOutputAttachments                    = default,
     uint maxFragmentDualSrcAttachments                   = default,
     uint maxFragmentCombinedOutputResources              = default,
     uint maxComputeSharedMemorySize                      = default,
     uint maxComputeWorkGroupInvocations                  = default,
     uint subPixelPrecisionBits                           = default,
     uint subTexelPrecisionBits                           = default,
     uint mipmapPrecisionBits                             = default,
     uint maxDrawIndexedIndexValue                        = default,
     uint maxDrawIndirectCount                            = default,
     float maxSamplerLodBias                               = default,
     float maxSamplerAnisotropy                            = default,
     uint maxViewports                                     = default,
     uint viewportSubPixelBits                             = default,
     UIntPtr minMemoryMapAlignment                         = default,
     ulong minTexelBufferOffsetAlignment                   = default,
     ulong minUniformBufferOffsetAlignment                 = default,
     ulong minStorageBufferOffsetAlignment                 = default,
     int minTexelOffset                                    = default,
     uint maxTexelOffset                                   = default,
     int minTexelGatherOffset                              = default,
     uint maxTexelGatherOffset                             = default,
     float minInterpolationOffset                          = default,
     float maxInterpolationOffset                          = default,
     uint subPixelInterpolationOffsetBits                  = default,
     uint maxFramebufferWidth                              = default,
     uint maxFramebufferHeight                             = default,
     uint maxFramebufferLayers                             = default,
     SampleCountFlags framebufferColorSampleCounts         = default,
     SampleCountFlags framebufferDepthSampleCounts         = default,
     SampleCountFlags framebufferStencilSampleCounts       = default,
     SampleCountFlags framebufferNoAttachmentsSampleCounts = default,
     uint maxColorAttachments                              = default,
     SampleCountFlags sampledImageColorSampleCounts        = default,
     SampleCountFlags sampledImageIntegerSampleCounts      = default,
     SampleCountFlags sampledImageDepthSampleCounts        = default,
     SampleCountFlags sampledImageStencilSampleCounts      = default,
     SampleCountFlags storageImageSampleCounts             = default,
     uint maxSampleMaskWords                               = default,
     Bool32 timestampComputeAndGraphics                    = default,
     float timestampPeriod                                 = default,
     uint maxClipDistances                                 = default,
     uint maxCullDistances                                 = default,
     uint maxCombinedClipAndCullDistances                  = default,
     uint discreteQueuePriorities                          = default,
     float pointSizeGranularity                            = default,
     float lineWidthGranularity                            = default,
     Bool32 strictLines                                    = default,
     Bool32 standardSampleLocations                        = default,
     ulong optimalBufferCopyOffsetAlignment                = default,
     ulong optimalBufferCopyRowPitchAlignment              = default,
     ulong nonCoherentAtomSize                             = default
 )
 {
     MaxImageDimension1D                             = maxImageDimension1D;
     MaxImageDimension2D                             = maxImageDimension2D;
     MaxImageDimension3D                             = maxImageDimension3D;
     MaxImageDimensionCube                           = maxImageDimensionCube;
     MaxImageArrayLayers                             = maxImageArrayLayers;
     MaxTexelBufferElements                          = maxTexelBufferElements;
     MaxUniformBufferRange                           = maxUniformBufferRange;
     MaxStorageBufferRange                           = maxStorageBufferRange;
     MaxPushConstantsSize                            = maxPushConstantsSize;
     MaxMemoryAllocationCount                        = maxMemoryAllocationCount;
     MaxSamplerAllocationCount                       = maxSamplerAllocationCount;
     BufferImageGranularity                          = bufferImageGranularity;
     SparseAddressSpaceSize                          = sparseAddressSpaceSize;
     MaxBoundDescriptorSets                          = maxBoundDescriptorSets;
     MaxPerStageDescriptorSamplers                   = maxPerStageDescriptorSamplers;
     MaxPerStageDescriptorUniformBuffers             = maxPerStageDescriptorUniformBuffers;
     MaxPerStageDescriptorStorageBuffers             = maxPerStageDescriptorStorageBuffers;
     MaxPerStageDescriptorSampledImages              = maxPerStageDescriptorSampledImages;
     MaxPerStageDescriptorStorageImages              = maxPerStageDescriptorStorageImages;
     MaxPerStageDescriptorInputAttachments           = maxPerStageDescriptorInputAttachments;
     MaxPerStageResources                            = maxPerStageResources;
     MaxDescriptorSetSamplers                        = maxDescriptorSetSamplers;
     MaxDescriptorSetUniformBuffers                  = maxDescriptorSetUniformBuffers;
     MaxDescriptorSetUniformBuffersDynamic           = maxDescriptorSetUniformBuffersDynamic;
     MaxDescriptorSetStorageBuffers                  = maxDescriptorSetStorageBuffers;
     MaxDescriptorSetStorageBuffersDynamic           = maxDescriptorSetStorageBuffersDynamic;
     MaxDescriptorSetSampledImages                   = maxDescriptorSetSampledImages;
     MaxDescriptorSetStorageImages                   = maxDescriptorSetStorageImages;
     MaxDescriptorSetInputAttachments                = maxDescriptorSetInputAttachments;
     MaxVertexInputAttributes                        = maxVertexInputAttributes;
     MaxVertexInputBindings                          = maxVertexInputBindings;
     MaxVertexInputAttributeOffset                   = maxVertexInputAttributeOffset;
     MaxVertexInputBindingStride                     = maxVertexInputBindingStride;
     MaxVertexOutputComponents                       = maxVertexOutputComponents;
     MaxTessellationGenerationLevel                  = maxTessellationGenerationLevel;
     MaxTessellationPatchSize                        = maxTessellationPatchSize;
     MaxTessellationControlPerVertexInputComponents  = maxTessellationControlPerVertexInputComponents;
     MaxTessellationControlPerVertexOutputComponents = maxTessellationControlPerVertexOutputComponents;
     MaxTessellationControlPerPatchOutputComponents  = maxTessellationControlPerPatchOutputComponents;
     MaxTessellationControlTotalOutputComponents     = maxTessellationControlTotalOutputComponents;
     MaxTessellationEvaluationInputComponents        = maxTessellationEvaluationInputComponents;
     MaxTessellationEvaluationOutputComponents       = maxTessellationEvaluationOutputComponents;
     MaxGeometryShaderInvocations                    = maxGeometryShaderInvocations;
     MaxGeometryInputComponents                      = maxGeometryInputComponents;
     MaxGeometryOutputComponents                     = maxGeometryOutputComponents;
     MaxGeometryOutputVertices                       = maxGeometryOutputVertices;
     MaxGeometryTotalOutputComponents                = maxGeometryTotalOutputComponents;
     MaxFragmentInputComponents                      = maxFragmentInputComponents;
     MaxFragmentOutputAttachments                    = maxFragmentOutputAttachments;
     MaxFragmentDualSrcAttachments                   = maxFragmentDualSrcAttachments;
     MaxFragmentCombinedOutputResources              = maxFragmentCombinedOutputResources;
     MaxComputeSharedMemorySize                      = maxComputeSharedMemorySize;
     MaxComputeWorkGroupInvocations                  = maxComputeWorkGroupInvocations;
     SubPixelPrecisionBits                           = subPixelPrecisionBits;
     SubTexelPrecisionBits                           = subTexelPrecisionBits;
     MipmapPrecisionBits                             = mipmapPrecisionBits;
     MaxDrawIndexedIndexValue                        = maxDrawIndexedIndexValue;
     MaxDrawIndirectCount                            = maxDrawIndirectCount;
     MaxSamplerLodBias                    = maxSamplerLodBias;
     MaxSamplerAnisotropy                 = maxSamplerAnisotropy;
     MaxViewports                         = maxViewports;
     ViewportSubPixelBits                 = viewportSubPixelBits;
     MinMemoryMapAlignment                = minMemoryMapAlignment;
     MinTexelBufferOffsetAlignment        = minTexelBufferOffsetAlignment;
     MinUniformBufferOffsetAlignment      = minUniformBufferOffsetAlignment;
     MinStorageBufferOffsetAlignment      = minStorageBufferOffsetAlignment;
     MinTexelOffset                       = minTexelOffset;
     MaxTexelOffset                       = maxTexelOffset;
     MinTexelGatherOffset                 = minTexelGatherOffset;
     MaxTexelGatherOffset                 = maxTexelGatherOffset;
     MinInterpolationOffset               = minInterpolationOffset;
     MaxInterpolationOffset               = maxInterpolationOffset;
     SubPixelInterpolationOffsetBits      = subPixelInterpolationOffsetBits;
     MaxFramebufferWidth                  = maxFramebufferWidth;
     MaxFramebufferHeight                 = maxFramebufferHeight;
     MaxFramebufferLayers                 = maxFramebufferLayers;
     FramebufferColorSampleCounts         = framebufferColorSampleCounts;
     FramebufferDepthSampleCounts         = framebufferDepthSampleCounts;
     FramebufferStencilSampleCounts       = framebufferStencilSampleCounts;
     FramebufferNoAttachmentsSampleCounts = framebufferNoAttachmentsSampleCounts;
     MaxColorAttachments                  = maxColorAttachments;
     SampledImageColorSampleCounts        = sampledImageColorSampleCounts;
     SampledImageIntegerSampleCounts      = sampledImageIntegerSampleCounts;
     SampledImageDepthSampleCounts        = sampledImageDepthSampleCounts;
     SampledImageStencilSampleCounts      = sampledImageStencilSampleCounts;
     StorageImageSampleCounts             = storageImageSampleCounts;
     MaxSampleMaskWords                   = maxSampleMaskWords;
     TimestampComputeAndGraphics          = timestampComputeAndGraphics;
     TimestampPeriod                      = timestampPeriod;
     MaxClipDistances                     = maxClipDistances;
     MaxCullDistances                     = maxCullDistances;
     MaxCombinedClipAndCullDistances      = maxCombinedClipAndCullDistances;
     DiscreteQueuePriorities              = discreteQueuePriorities;
     PointSizeGranularity                 = pointSizeGranularity;
     LineWidthGranularity                 = lineWidthGranularity;
     StrictLines                        = strictLines;
     StandardSampleLocations            = standardSampleLocations;
     OptimalBufferCopyOffsetAlignment   = optimalBufferCopyOffsetAlignment;
     OptimalBufferCopyRowPitchAlignment = optimalBufferCopyRowPitchAlignment;
     NonCoherentAtomSize                = nonCoherentAtomSize;
 }
示例#16
0
 internal static unsafe extern void vkGetPhysicalDeviceSparseImageFormatProperties(PhysicalDevice physicalDevice, Format format, ImageType type, SampleCountFlags samples, ImageUsageFlags usage, ImageTiling tiling, uint* propertyCount, SparseImageFormatProperties* properties);
示例#17
0
 public PhysicalDeviceVulkan12Properties
 (
     StructureType sType = StructureType.PhysicalDeviceVulkan12Properties,
     void *pNext         = default,
     DriverId driverID   = default,
     ConformanceVersion conformanceVersion = default,
     ShaderFloatControlsIndependence denormBehaviorIndependence = default,
     ShaderFloatControlsIndependence roundingModeIndependence   = default,
     Bool32 shaderSignedZeroInfNanPreserveFloat16              = default,
     Bool32 shaderSignedZeroInfNanPreserveFloat32              = default,
     Bool32 shaderSignedZeroInfNanPreserveFloat64              = default,
     Bool32 shaderDenormPreserveFloat16                        = default,
     Bool32 shaderDenormPreserveFloat32                        = default,
     Bool32 shaderDenormPreserveFloat64                        = default,
     Bool32 shaderDenormFlushToZeroFloat16                     = default,
     Bool32 shaderDenormFlushToZeroFloat32                     = default,
     Bool32 shaderDenormFlushToZeroFloat64                     = default,
     Bool32 shaderRoundingModeRtefloat16                       = default,
     Bool32 shaderRoundingModeRtefloat32                       = default,
     Bool32 shaderRoundingModeRtefloat64                       = default,
     Bool32 shaderRoundingModeRtzfloat16                       = default,
     Bool32 shaderRoundingModeRtzfloat32                       = default,
     Bool32 shaderRoundingModeRtzfloat64                       = default,
     uint maxUpdateAfterBindDescriptorsInAllPools              = default,
     Bool32 shaderUniformBufferArrayNonUniformIndexingNative   = default,
     Bool32 shaderSampledImageArrayNonUniformIndexingNative    = default,
     Bool32 shaderStorageBufferArrayNonUniformIndexingNative   = default,
     Bool32 shaderStorageImageArrayNonUniformIndexingNative    = default,
     Bool32 shaderInputAttachmentArrayNonUniformIndexingNative = default,
     Bool32 robustBufferAccessUpdateAfterBind                  = default,
     Bool32 quadDivergentImplicitLod = default,
     uint maxPerStageDescriptorUpdateAfterBindSamplers         = default,
     uint maxPerStageDescriptorUpdateAfterBindUniformBuffers   = default,
     uint maxPerStageDescriptorUpdateAfterBindStorageBuffers   = default,
     uint maxPerStageDescriptorUpdateAfterBindSampledImages    = default,
     uint maxPerStageDescriptorUpdateAfterBindStorageImages    = default,
     uint maxPerStageDescriptorUpdateAfterBindInputAttachments = default,
     uint maxPerStageUpdateAfterBindResources                  = default,
     uint maxDescriptorSetUpdateAfterBindSamplers              = default,
     uint maxDescriptorSetUpdateAfterBindUniformBuffers        = default,
     uint maxDescriptorSetUpdateAfterBindUniformBuffersDynamic = default,
     uint maxDescriptorSetUpdateAfterBindStorageBuffers        = default,
     uint maxDescriptorSetUpdateAfterBindStorageBuffersDynamic = default,
     uint maxDescriptorSetUpdateAfterBindSampledImages         = default,
     uint maxDescriptorSetUpdateAfterBindStorageImages         = default,
     uint maxDescriptorSetUpdateAfterBindInputAttachments      = default,
     ResolveModeFlags supportedDepthResolveModes               = default,
     ResolveModeFlags supportedStencilResolveModes             = default,
     Bool32 independentResolveNone                        = default,
     Bool32 independentResolve                            = default,
     Bool32 filterMinmaxSingleComponentFormats            = default,
     Bool32 filterMinmaxImageComponentMapping             = default,
     ulong maxTimelineSemaphoreValueDifference            = default,
     SampleCountFlags framebufferIntegerColorSampleCounts = default
 )
 {
     SType                                                = sType;
     PNext                                                = pNext;
     DriverID                                             = driverID;
     ConformanceVersion                                   = conformanceVersion;
     DenormBehaviorIndependence                           = denormBehaviorIndependence;
     RoundingModeIndependence                             = roundingModeIndependence;
     ShaderSignedZeroInfNanPreserveFloat16                = shaderSignedZeroInfNanPreserveFloat16;
     ShaderSignedZeroInfNanPreserveFloat32                = shaderSignedZeroInfNanPreserveFloat32;
     ShaderSignedZeroInfNanPreserveFloat64                = shaderSignedZeroInfNanPreserveFloat64;
     ShaderDenormPreserveFloat16                          = shaderDenormPreserveFloat16;
     ShaderDenormPreserveFloat32                          = shaderDenormPreserveFloat32;
     ShaderDenormPreserveFloat64                          = shaderDenormPreserveFloat64;
     ShaderDenormFlushToZeroFloat16                       = shaderDenormFlushToZeroFloat16;
     ShaderDenormFlushToZeroFloat32                       = shaderDenormFlushToZeroFloat32;
     ShaderDenormFlushToZeroFloat64                       = shaderDenormFlushToZeroFloat64;
     ShaderRoundingModeRtefloat16                         = shaderRoundingModeRtefloat16;
     ShaderRoundingModeRtefloat32                         = shaderRoundingModeRtefloat32;
     ShaderRoundingModeRtefloat64                         = shaderRoundingModeRtefloat64;
     ShaderRoundingModeRtzfloat16                         = shaderRoundingModeRtzfloat16;
     ShaderRoundingModeRtzfloat32                         = shaderRoundingModeRtzfloat32;
     ShaderRoundingModeRtzfloat64                         = shaderRoundingModeRtzfloat64;
     MaxUpdateAfterBindDescriptorsInAllPools              = maxUpdateAfterBindDescriptorsInAllPools;
     ShaderUniformBufferArrayNonUniformIndexingNative     = shaderUniformBufferArrayNonUniformIndexingNative;
     ShaderSampledImageArrayNonUniformIndexingNative      = shaderSampledImageArrayNonUniformIndexingNative;
     ShaderStorageBufferArrayNonUniformIndexingNative     = shaderStorageBufferArrayNonUniformIndexingNative;
     ShaderStorageImageArrayNonUniformIndexingNative      = shaderStorageImageArrayNonUniformIndexingNative;
     ShaderInputAttachmentArrayNonUniformIndexingNative   = shaderInputAttachmentArrayNonUniformIndexingNative;
     RobustBufferAccessUpdateAfterBind                    = robustBufferAccessUpdateAfterBind;
     QuadDivergentImplicitLod                             = quadDivergentImplicitLod;
     MaxPerStageDescriptorUpdateAfterBindSamplers         = maxPerStageDescriptorUpdateAfterBindSamplers;
     MaxPerStageDescriptorUpdateAfterBindUniformBuffers   = maxPerStageDescriptorUpdateAfterBindUniformBuffers;
     MaxPerStageDescriptorUpdateAfterBindStorageBuffers   = maxPerStageDescriptorUpdateAfterBindStorageBuffers;
     MaxPerStageDescriptorUpdateAfterBindSampledImages    = maxPerStageDescriptorUpdateAfterBindSampledImages;
     MaxPerStageDescriptorUpdateAfterBindStorageImages    = maxPerStageDescriptorUpdateAfterBindStorageImages;
     MaxPerStageDescriptorUpdateAfterBindInputAttachments = maxPerStageDescriptorUpdateAfterBindInputAttachments;
     MaxPerStageUpdateAfterBindResources                  = maxPerStageUpdateAfterBindResources;
     MaxDescriptorSetUpdateAfterBindSamplers              = maxDescriptorSetUpdateAfterBindSamplers;
     MaxDescriptorSetUpdateAfterBindUniformBuffers        = maxDescriptorSetUpdateAfterBindUniformBuffers;
     MaxDescriptorSetUpdateAfterBindUniformBuffersDynamic = maxDescriptorSetUpdateAfterBindUniformBuffersDynamic;
     MaxDescriptorSetUpdateAfterBindStorageBuffers        = maxDescriptorSetUpdateAfterBindStorageBuffers;
     MaxDescriptorSetUpdateAfterBindStorageBuffersDynamic = maxDescriptorSetUpdateAfterBindStorageBuffersDynamic;
     MaxDescriptorSetUpdateAfterBindSampledImages         = maxDescriptorSetUpdateAfterBindSampledImages;
     MaxDescriptorSetUpdateAfterBindStorageImages         = maxDescriptorSetUpdateAfterBindStorageImages;
     MaxDescriptorSetUpdateAfterBindInputAttachments      = maxDescriptorSetUpdateAfterBindInputAttachments;
     SupportedDepthResolveModes                           = supportedDepthResolveModes;
     SupportedStencilResolveModes                         = supportedStencilResolveModes;
     IndependentResolveNone                               = independentResolveNone;
     IndependentResolve                                   = independentResolve;
     FilterMinmaxSingleComponentFormats                   = filterMinmaxSingleComponentFormats;
     FilterMinmaxImageComponentMapping                    = filterMinmaxImageComponentMapping;
     MaxTimelineSemaphoreValueDifference                  = maxTimelineSemaphoreValueDifference;
     FramebufferIntegerColorSampleCounts                  = framebufferIntegerColorSampleCounts;
 }
示例#18
0
 /// <param name="Usage">Image usage flags</param>
 /// <param name="SharingMode">Cross-queue-family sharing mode</param>
 /// <param name="QueueFamilyIndices">Array of queue family indices to share across</param>
 /// <param name="InitialLayout">Initial image layout for all subresources</param>
 public ImageCreateInfo(ImageType ImageType, Format Format, Extent3D Extent, UInt32 MipLevels, UInt32 ArrayLayers, SampleCountFlags Samples, ImageTiling Tiling, ImageUsageFlags Usage, SharingMode SharingMode, UInt32[] QueueFamilyIndices, ImageLayout InitialLayout) : this()
 {
     this.ImageType          = ImageType;
     this.Format             = Format;
     this.Extent             = Extent;
     this.MipLevels          = MipLevels;
     this.ArrayLayers        = ArrayLayers;
     this.Samples            = Samples;
     this.Tiling             = Tiling;
     this.Usage              = Usage;
     this.SharingMode        = SharingMode;
     this.QueueFamilyIndices = QueueFamilyIndices;
     this.InitialLayout      = InitialLayout;
 }
示例#19
0
 /// <summary>
 ///
 /// </summary>
 public AttachmentDescription(AttachmentDescriptionFlags flags, Format format, SampleCountFlags samples, AttachmentLoadOp loadOp, AttachmentStoreOp storeOp, AttachmentLoadOp stencilLoadOp, AttachmentStoreOp stencilStoreOp, ImageLayout initialLayout, ImageLayout finalLayout)
 {
     this.Flags          = flags;
     this.Format         = format;
     this.Samples        = samples;
     this.LoadOp         = loadOp;
     this.StoreOp        = storeOp;
     this.StencilLoadOp  = stencilLoadOp;
     this.StencilStoreOp = stencilStoreOp;
     this.InitialLayout  = initialLayout;
     this.FinalLayout    = finalLayout;
 }
示例#20
0
 internal static unsafe extern void vkGetPhysicalDeviceSparseImageFormatProperties(PhysicalDevice physicalDevice, Format format, ImageType type, SampleCountFlags samples, ImageUsageFlags usage, ImageTiling tiling, out UInt32 *PropertyCount, SparseImageFormatProperties *Properties);
示例#21
0
        public static ImageWithMemory CreateImageWithMemory(
            uint width,
            uint height,
            ImageUsageFlags imageUsageFlags,
            ImageLayout imageLayout,
            AccessFlags accessMask,
            SampleCountFlags samples = SampleCountFlags.Count1)
        {
            ImageWithMemory imageWithMemory = new ImageWithMemory
            {
                Image = VContext.Instance.device.CreateImage
                        (
                    new ImageCreateInfo()
                {
                    ImageType = ImageType.Image2D,
                    Format    = VContext.ColorFormat,
                    Extent    = new Extent3D()
                    {
                        Width  = width,
                        Height = height,
                        Depth  = 1
                    },
                    MipLevels     = 1,
                    ArrayLayers   = 1,
                    Samples       = samples,
                    Tiling        = ImageTiling.Optimal,
                    Usage         = imageUsageFlags,
                    SharingMode   = SharingMode.Exclusive,
                    InitialLayout = ImageLayout.Undefined
                }
                        )
            };

            MemoryRequirements textureMemoryRequirements = VContext.Instance.device.GetImageMemoryRequirements(imageWithMemory.Image);
            uint memoryTypeIndex = Util.GetMemoryTypeIndex(textureMemoryRequirements.MemoryTypeBits, MemoryPropertyFlags.DeviceLocal);

            imageWithMemory.Memory = VContext.Instance.device.AllocateMemory
                                     (
                new MemoryAllocateInfo()
            {
                AllocationSize  = textureMemoryRequirements.Size,
                MemoryTypeIndex = memoryTypeIndex
            }
                                     );
            VContext.Instance.device.BindImageMemory(imageWithMemory.Image, imageWithMemory.Memory, 0);

            if (imageLayout != ImageLayout.Undefined)
            {
                CommandBuffer commandBuffer = _commandBuffer.Value;
                commandBuffer.Begin(new CommandBufferBeginInfo());

                ImageSubresourceRange subresourceRange = new ImageSubresourceRange()
                {
                    AspectMask   = ImageAspectFlags.Color,
                    BaseMipLevel = 0,
                    LevelCount   = 1,
                    LayerCount   = 1,
                };

                ImageMemoryBarrier undefinedToTranserDstBarrier = new ImageMemoryBarrier()
                {
                    OldLayout        = ImageLayout.Undefined,
                    NewLayout        = imageLayout,
                    Image            = imageWithMemory.Image,
                    SubresourceRange = subresourceRange,
                    SrcAccessMask    = 0,
                    DstAccessMask    = accessMask
                };


                commandBuffer.CmdPipelineBarrier(
                    PipelineStageFlags.AllCommands,
                    PipelineStageFlags.AllCommands,
                    0,
                    null,
                    null,
                    undefinedToTranserDstBarrier);



                commandBuffer.CmdPipelineBarrier(
                    PipelineStageFlags.AllCommands,
                    PipelineStageFlags.AllCommands,
                    0,
                    null,
                    null,
                    undefinedToTranserDstBarrier);

                commandBuffer.End();


                Fence fence = VContext.Instance.device.CreateFence(new FenceCreateInfo());

                SubmitInfo submitInfo = new SubmitInfo()
                {
                    CommandBuffers = new CommandBuffer[] { commandBuffer }
                };


                VContext.Instance.deviceQueue.Submit(submitInfo, fence);

                VContext.Instance.device.WaitForFences(new Fence[] { fence }, true, ulong.MaxValue);
                commandBuffer.Reset(CommandBufferResetFlags.ReleaseResources);

                VContext.Instance.device.DestroyFence(fence);
            }

            imageWithMemory.ImageView = VContext.Instance.CreateImageView(imageWithMemory.Image, VContext.ColorFormat, ImageAspectFlags.Color);

            return(imageWithMemory);
        }
示例#22
0
        public FrameBufferAttachment CreateAttachment(string AttachmentLookupID, Format myFormat, ImageType myType, ImageViewType view2D, ImageUsageFlags myImageFlag, ImageAspectFlags color, ImageTiling myTiles, SampleCountFlags mySampleCount, uint levelCount, uint layercount)
        {        //TODO: Write exception class
            if (Initialized)
            {
                throw new Exception("Attempted to add attachment to initialized Framebuffer!");
            }
            if (myAttachments.ContainsKey(AttachmentLookupID))
            {
                throw new Exception("A framebuffer attachment with ID: " + AttachmentLookupID + " was added to frame buffer twice.");
            }
            ImageCreateInfo myInfo = new ImageCreateInfo()
            {
                ImageType = myType, MipLevels = 1, Format = myFormat, Extent = new Extent3D()
                {
                    Width = myFramebufferInfo.Width, Height = myFramebufferInfo.Height, Depth = 1
                }, ArrayLayers = layercount, Samples = mySampleCount, Tiling = myTiles, Usage = myImageFlag
            };

            myImage = new Image(myInfo);
            var Return = this.CreateAttachment(AttachmentLookupID, myFormat, view2D, myImage, color, levelCount, layercount);

            myAttachments[AttachmentLookupID] = Return;
            myInfo.Dispose(false);
            return(Return);
        }
示例#23
0
 public abstract void GetPhysicalDeviceMultisampleProperties([Count(Count = 0)] PhysicalDevice physicalDevice, [Count(Count = 0)] SampleCountFlags samples, [Count(Count = 0), Flow(FlowDirection.Out)] out MultisamplePropertiesEXT pMultisampleProperties);
示例#24
0
        public unsafe SparseImageFormatProperties[] GetSparseImageFormatProperties(Format format, ImageType type, SampleCountFlags samples, ImageUsageFlags usage, ImageTiling tiling)
        {
            uint count = 0;
            GetSparseImageFormatProperties(format, type, samples, usage, tiling, ref count, null);

            var result = new SparseImageFormatProperties[count];
            if (count > 0)
            {
                fixed (SparseImageFormatProperties* resultPointer = &result[0])
                    GetSparseImageFormatProperties(format, type, samples, usage, tiling, ref count, resultPointer);
            }

            return result;
        }
示例#25
0
 internal unsafe void GetSparseImageFormatProperties(Format format, ImageType type, SampleCountFlags samples, ImageUsageFlags usage, ImageTiling tiling, ref uint propertyCount, SparseImageFormatProperties* properties)
 {
     fixed (uint* __propertyCount__ = &propertyCount)
     {
         vkGetPhysicalDeviceSparseImageFormatProperties(this, format, type, samples, usage, tiling, __propertyCount__, properties);
     }
 }
示例#26
0
 /// <summary>
 /// Retrieve properties of an image format applied to sparse images.
 /// </summary>
 public SparseImageFormatProperties[] GetSparseImageFormatProperties(Format format, ImageType type, SampleCountFlags samples, ImageUsageFlags usage, ImageTiling tiling)
 {
     unsafe
     {
         try
         {
             SparseImageFormatProperties[] result = default(SparseImageFormatProperties[]);
             uint propertyCount;
             SparseImageFormatProperties *marshalledProperties = null;
             Interop.Commands.vkGetPhysicalDeviceSparseImageFormatProperties(this.handle, format, type, samples, usage, tiling, &propertyCount, null);
             marshalledProperties = (SparseImageFormatProperties *)Interop.HeapUtil.Allocate <SparseImageFormatProperties>((uint)propertyCount);
             Interop.Commands.vkGetPhysicalDeviceSparseImageFormatProperties(this.handle, format, type, samples, usage, tiling, &propertyCount, marshalledProperties);
             result = new SparseImageFormatProperties[(uint)propertyCount];
             for (int index = 0; index < (uint)propertyCount; index++)
             {
                 result[index] = marshalledProperties[index];
             }
             return(result);
         }
         finally
         {
             Interop.HeapUtil.FreeLog();
         }
     }
 }
示例#27
0
        public unsafe SparseImageFormatProperties[] GetSparseImageFormatProperties(Format format, ImageType type, SampleCountFlags samples, ImageUsageFlags usage, ImageTiling tiling)
        {
            uint count = 0;

            GetSparseImageFormatProperties(format, type, samples, usage, tiling, ref count, null);

            var result = new SparseImageFormatProperties[count];

            if (count > 0)
            {
                fixed(SparseImageFormatProperties *resultPointer = &result[0])
                GetSparseImageFormatProperties(format, type, samples, usage, tiling, ref count, resultPointer);
            }

            return(result);
        }