internal unsafe void __MarshalTo(ref __Native @ref) { @ref.NumParameters = Parameters?.Length ?? 0; @ref.PParameters = Interop.AllocToPointer(Parameters); @ref.NumStaticSamplers = StaticSamplers?.Length ?? 0; @ref.PStaticSamplers = Interop.AllocToPointer(StaticSamplers); @ref.Flags = Flags; }
internal unsafe void __MarshalTo(ref __Native @ref) { @ref.NumCategories = Categories?.Length ?? 0; @ref.PCategoryList = Interop.AllocToPointer(Categories); @ref.NumSeverities = Severities?.Length ?? 0; @ref.PSeverityList = Interop.AllocToPointer(Severities); @ref.NumIDs = Ids?.Length ?? 0; @ref.PIDList = Interop.AllocToPointer(Ids); }
internal unsafe void __MarshalTo(ref __Native @ref) { if (Data?.Length > 0) { @ref.Bytecode = Interop.AllocToPointer(Data); @ref.Length = Data.Length; } else { @ref.Bytecode = IntPtr.Zero; @ref.Length = 0; } }
internal unsafe void __MarshalTo(ref __Native @ref) { @ref.inputCount = InputCount; @ref.usage = Usage; if (Data?.Length > 0) { @ref.data = Interop.AllocToPointer(Data); } else { @ref.data = IntPtr.Zero; } @ref.byteWidth = ByteWidth; }
internal unsafe void __MarshalTo(ref __Native @ref) { @ref.Type = Type; @ref.Flags = Flags; @ref.NumDescs = DescriptorsCount; @ref.DescsLayout = Layout; if (GeometryDescriptions != null && GeometryDescriptions.Length > 0) { @ref.Union.pGeometryDescs = Interop.AllocToPointer(GeometryDescriptions); } else { @ref.Union.InstanceDescs = InstanceDescriptions; } }
public void Present() { VkSemaphore Semaphore = NativeDevice.RenderFinishedSemaphore; VkSwapchainKHR swapchain = SwapChain; CommandList commandList = NativeDevice.NativeCommandList; VkPresentInfoKHR presentInfo = new VkPresentInfoKHR() { sType = VkStructureType.PresentInfoKHR, waitSemaphoreCount = 1, pWaitSemaphores = &Semaphore, swapchainCount = 1, pSwapchains = &swapchain, pImageIndices = Interop.AllocToPointer(ref commandList.imageIndex), }; vkQueuePresentKHR(NativeDevice.NativeCommandQueue, &presentInfo); }
internal unsafe void __MarshalTo(ref __Native @ref) { @ref.shaderBufferSize = ShaderBufferWithInputSignature?.Length ?? 0; if (@ref.shaderBufferSize > 0) { @ref.shaderBufferWithInputSignature = Interop.AllocToPointer(ShaderBufferWithInputSignature); } @ref.elementCount = Elements?.Length ?? 0; if (@ref.elementCount > 0) { var nativeElements = (InputElementDescription.__Native *)Interop.Alloc <InputElementDescription.__Native>(@ref.elementCount); for (int i = 0; i < @ref.elementCount; i++) { Elements[i].__MarshalTo(ref nativeElements[i]); } @ref.inputElements = nativeElements; } @ref.stride = Stride; }
internal void CreateFrameBuffers() { var SwapChainImageViews = NativeDevice.NativeSwapChain.SwapChainImageViews; SwapChainFramebuffers = new VkFramebuffer[SwapChainImageViews.Length]; for (uint i = 0; i < SwapChainImageViews.Length; i++) { VkFramebufferCreateInfo frameBufferInfo = new VkFramebufferCreateInfo() { sType = VkStructureType.FramebufferCreateInfo, renderPass = NativeRenderPass, attachmentCount = 1, pAttachments = Interop.AllocToPointer(ref SwapChainImageViews[i]), width = (uint)NativeDevice.NativeParameters.BackBufferWidth, height = (uint)NativeDevice.NativeParameters.BackBufferWidth, layers = 1, }; vkCreateFramebuffer(NativeDevice.Device, ref frameBufferInfo, null, out SwapChainFramebuffers[i]); } }
internal unsafe void __MarshalTo(ref __Native @ref) { @ref.NumDescriptorRanges = Ranges?.Length ?? 0; @ref.PDescriptorRanges = Interop.AllocToPointer(Ranges); }