internal static unsafe PhysicalDeviceProperties MarshalFrom(Interop.PhysicalDeviceProperties *value)
        {
            PhysicalDeviceProperties result = new PhysicalDeviceProperties();

            result.ApiVersion    = value->ApiVersion;
            result.DriverVersion = value->DriverVersion;
            int DeviceNameActualLength;

            result.DeviceName        = System.Text.Encoding.UTF8.GetString(Interop.HeapUtil.MarshalFrom(value->DeviceName, Constants.MaxPhysicalDeviceNameSize, out DeviceNameActualLength, true), 0, DeviceNameActualLength);
            result.PipelineCacheUUID = new Guid(Interop.HeapUtil.MarshalFrom(value->PipelineCacheUUID, Constants.UuidSize));
            result.Limits            = PhysicalDeviceLimits.MarshalFrom(&value->Limits);
            result.VendorID          = value->VendorID;
            result.DeviceID          = value->DeviceID;
            result.DeviceType        = value->DeviceType;
            result.SparseProperties  = value->SparseProperties;
            return(result);
        }
Exemplo n.º 2
0
        internal static unsafe PhysicalDeviceLimits MarshalFrom(SharpVk.Interop.PhysicalDeviceLimits *pointer)
        {
            PhysicalDeviceLimits result = default(PhysicalDeviceLimits);

            result.MaxImageDimension1D                             = pointer->MaxImageDimension1D;
            result.MaxImageDimension2D                             = pointer->MaxImageDimension2D;
            result.MaxImageDimension3D                             = pointer->MaxImageDimension3D;
            result.MaxImageDimensionCube                           = pointer->MaxImageDimensionCube;
            result.MaxImageArrayLayers                             = pointer->MaxImageArrayLayers;
            result.MaxTexelBufferElements                          = pointer->MaxTexelBufferElements;
            result.MaxUniformBufferRange                           = pointer->MaxUniformBufferRange;
            result.MaxStorageBufferRange                           = pointer->MaxStorageBufferRange;
            result.MaxPushConstantsSize                            = pointer->MaxPushConstantsSize;
            result.MaxMemoryAllocationCount                        = pointer->MaxMemoryAllocationCount;
            result.MaxSamplerAllocationCount                       = pointer->MaxSamplerAllocationCount;
            result.BufferImageGranularity                          = pointer->BufferImageGranularity;
            result.SparseAddressSpaceSize                          = pointer->SparseAddressSpaceSize;
            result.MaxBoundDescriptorSets                          = pointer->MaxBoundDescriptorSets;
            result.MaxPerStageDescriptorSamplers                   = pointer->MaxPerStageDescriptorSamplers;
            result.MaxPerStageDescriptorUniformBuffers             = pointer->MaxPerStageDescriptorUniformBuffers;
            result.MaxPerStageDescriptorStorageBuffers             = pointer->MaxPerStageDescriptorStorageBuffers;
            result.MaxPerStageDescriptorSampledImages              = pointer->MaxPerStageDescriptorSampledImages;
            result.MaxPerStageDescriptorStorageImages              = pointer->MaxPerStageDescriptorStorageImages;
            result.MaxPerStageDescriptorInputAttachments           = pointer->MaxPerStageDescriptorInputAttachments;
            result.MaxPerStageResources                            = pointer->MaxPerStageResources;
            result.MaxDescriptorSetSamplers                        = pointer->MaxDescriptorSetSamplers;
            result.MaxDescriptorSetUniformBuffers                  = pointer->MaxDescriptorSetUniformBuffers;
            result.MaxDescriptorSetUniformBuffersDynamic           = pointer->MaxDescriptorSetUniformBuffersDynamic;
            result.MaxDescriptorSetStorageBuffers                  = pointer->MaxDescriptorSetStorageBuffers;
            result.MaxDescriptorSetStorageBuffersDynamic           = pointer->MaxDescriptorSetStorageBuffersDynamic;
            result.MaxDescriptorSetSampledImages                   = pointer->MaxDescriptorSetSampledImages;
            result.MaxDescriptorSetStorageImages                   = pointer->MaxDescriptorSetStorageImages;
            result.MaxDescriptorSetInputAttachments                = pointer->MaxDescriptorSetInputAttachments;
            result.MaxVertexInputAttributes                        = pointer->MaxVertexInputAttributes;
            result.MaxVertexInputBindings                          = pointer->MaxVertexInputBindings;
            result.MaxVertexInputAttributeOffset                   = pointer->MaxVertexInputAttributeOffset;
            result.MaxVertexInputBindingStride                     = pointer->MaxVertexInputBindingStride;
            result.MaxVertexOutputComponents                       = pointer->MaxVertexOutputComponents;
            result.MaxTessellationGenerationLevel                  = pointer->MaxTessellationGenerationLevel;
            result.MaxTessellationPatchSize                        = pointer->MaxTessellationPatchSize;
            result.MaxTessellationControlPerVertexInputComponents  = pointer->MaxTessellationControlPerVertexInputComponents;
            result.MaxTessellationControlPerVertexOutputComponents = pointer->MaxTessellationControlPerVertexOutputComponents;
            result.MaxTessellationControlPerPatchOutputComponents  = pointer->MaxTessellationControlPerPatchOutputComponents;
            result.MaxTessellationControlTotalOutputComponents     = pointer->MaxTessellationControlTotalOutputComponents;
            result.MaxTessellationEvaluationInputComponents        = pointer->MaxTessellationEvaluationInputComponents;
            result.MaxTessellationEvaluationOutputComponents       = pointer->MaxTessellationEvaluationOutputComponents;
            result.MaxGeometryShaderInvocations                    = pointer->MaxGeometryShaderInvocations;
            result.MaxGeometryInputComponents                      = pointer->MaxGeometryInputComponents;
            result.MaxGeometryOutputComponents                     = pointer->MaxGeometryOutputComponents;
            result.MaxGeometryOutputVertices                       = pointer->MaxGeometryOutputVertices;
            result.MaxGeometryTotalOutputComponents                = pointer->MaxGeometryTotalOutputComponents;
            result.MaxFragmentInputComponents                      = pointer->MaxFragmentInputComponents;
            result.MaxFragmentOutputAttachments                    = pointer->MaxFragmentOutputAttachments;
            result.MaxFragmentDualSourceAttachments                = pointer->MaxFragmentDualSourceAttachments;
            result.MaxFragmentCombinedOutputResources              = pointer->MaxFragmentCombinedOutputResources;
            result.MaxComputeSharedMemorySize                      = pointer->MaxComputeSharedMemorySize;
            result.MaxComputeWorkGroupCount                        = Interop.HeapUtil.MarshalFrom(pointer->MaxComputeWorkGroupCount, 3);
            result.MaxComputeWorkGroupInvocations                  = pointer->MaxComputeWorkGroupInvocations;
            result.MaxComputeWorkGroupSize                         = Interop.HeapUtil.MarshalFrom(pointer->MaxComputeWorkGroupSize, 3);
            result.SubPixelPrecisionBits                           = pointer->SubPixelPrecisionBits;
            result.SubTexelPrecisionBits                           = pointer->SubTexelPrecisionBits;
            result.MipmapPrecisionBits                             = pointer->MipmapPrecisionBits;
            result.MaxDrawIndexedIndexValue                        = pointer->MaxDrawIndexedIndexValue;
            result.MaxDrawIndirectCount                            = pointer->MaxDrawIndirectCount;
            result.MaxSamplerLodBias                    = pointer->MaxSamplerLodBias;
            result.MaxSamplerAnisotropy                 = pointer->MaxSamplerAnisotropy;
            result.MaxViewports                         = pointer->MaxViewports;
            result.MaxViewportDimensions                = Interop.HeapUtil.MarshalFrom(pointer->MaxViewportDimensions, 2);
            result.ViewportBoundsRange                  = Interop.HeapUtil.MarshalFrom(pointer->ViewportBoundsRange, 2);
            result.ViewportSubPixelBits                 = pointer->ViewportSubPixelBits;
            result.MinMemoryMapAlignment                = pointer->MinMemoryMapAlignment;
            result.MinTexelBufferOffsetAlignment        = pointer->MinTexelBufferOffsetAlignment;
            result.MinUniformBufferOffsetAlignment      = pointer->MinUniformBufferOffsetAlignment;
            result.MinStorageBufferOffsetAlignment      = pointer->MinStorageBufferOffsetAlignment;
            result.MinTexelOffset                       = pointer->MinTexelOffset;
            result.MaxTexelOffset                       = pointer->MaxTexelOffset;
            result.MinTexelGatherOffset                 = pointer->MinTexelGatherOffset;
            result.MaxTexelGatherOffset                 = pointer->MaxTexelGatherOffset;
            result.MinInterpolationOffset               = pointer->MinInterpolationOffset;
            result.MaxInterpolationOffset               = pointer->MaxInterpolationOffset;
            result.SubPixelInterpolationOffsetBits      = pointer->SubPixelInterpolationOffsetBits;
            result.MaxFramebufferWidth                  = pointer->MaxFramebufferWidth;
            result.MaxFramebufferHeight                 = pointer->MaxFramebufferHeight;
            result.MaxFramebufferLayers                 = pointer->MaxFramebufferLayers;
            result.FramebufferColorSampleCounts         = pointer->FramebufferColorSampleCounts;
            result.FramebufferDepthSampleCounts         = pointer->FramebufferDepthSampleCounts;
            result.FramebufferStencilSampleCounts       = pointer->FramebufferStencilSampleCounts;
            result.FramebufferNoAttachmentsSampleCounts = pointer->FramebufferNoAttachmentsSampleCounts;
            result.MaxColorAttachments                  = pointer->MaxColorAttachments;
            result.SampledImageColorSampleCounts        = pointer->SampledImageColorSampleCounts;
            result.SampledImageIntegerSampleCounts      = pointer->SampledImageIntegerSampleCounts;
            result.SampledImageDepthSampleCounts        = pointer->SampledImageDepthSampleCounts;
            result.SampledImageStencilSampleCounts      = pointer->SampledImageStencilSampleCounts;
            result.StorageImageSampleCounts             = pointer->StorageImageSampleCounts;
            result.MaxSampleMaskWords                   = pointer->MaxSampleMaskWords;
            result.TimestampComputeAndGraphics          = pointer->TimestampComputeAndGraphics;
            result.TimestampPeriod                      = pointer->TimestampPeriod;
            result.MaxClipDistances                     = pointer->MaxClipDistances;
            result.MaxCullDistances                     = pointer->MaxCullDistances;
            result.MaxCombinedClipAndCullDistances      = pointer->MaxCombinedClipAndCullDistances;
            result.DiscreteQueuePriorities              = pointer->DiscreteQueuePriorities;
            result.PointSizeRange                       = Interop.HeapUtil.MarshalFrom(pointer->PointSizeRange, 2);
            result.LineWidthRange                       = Interop.HeapUtil.MarshalFrom(pointer->LineWidthRange, 2);
            result.PointSizeGranularity                 = pointer->PointSizeGranularity;
            result.LineWidthGranularity                 = pointer->LineWidthGranularity;
            result.StrictLines                        = pointer->StrictLines;
            result.StandardSampleLocations            = pointer->StandardSampleLocations;
            result.OptimalBufferCopyOffsetAlignment   = pointer->OptimalBufferCopyOffsetAlignment;
            result.OptimalBufferCopyRowPitchAlignment = pointer->OptimalBufferCopyRowPitchAlignment;
            result.NonCoherentAtomSize                = pointer->NonCoherentAtomSize;
            return(result);
        }