Coder Social home page Coder Social logo

vk.net's Introduction

Auto-generated low level Vulkan bindings for .NET.

vk.net is designed to be used with vke.net to ease building vulkan applications in c#.

The nuget package is available under the name Vulkan.

Compiling Options:

-p:AutoSetSType=true

vk.net's People

Contributors

jpbruyere avatar techliam avatar

Stargazers

F34RTOX1C1TY avatar RedRing avatar david harvey avatar maunv avatar Jihad Khawaja avatar Piero Castillo avatar Gru avatar  avatar Nana Axel avatar Vicente Penades avatar Galli Davide Francesco Maria avatar MOCHIZUKI Natsune avatar Edgard David Iván Muñoz Chávez avatar zcstkhk avatar  avatar Robert Campbell avatar カメ子 avatar  avatar  avatar Paul Bittner avatar Pavel Erokhin avatar 秋 雨落 avatar Hasan Bayat avatar bperris avatar Jaanus Varus avatar Alré avatar MaximovInk avatar Dávid Szabó avatar 久永 avatar  avatar Michael Delz avatar  avatar

Watchers

James Cloos avatar  avatar  avatar  avatar

vk.net's Issues

Enum arrays are not blittable on windows.

Running vke on windows cause Unhandled exception when trying to allocate a GCHandle for enum arrays. This should be solve in future version of ms .net runtimes. But in current development version of ms runtime (5.0.0-dev), enum isn't already blittale.

vkEnumerateInstanceLayerProperties always gives AccessViolationException

So I will start by saying I'm not sure what I'm about to say is right but please stick with me.

This is the code I'm using to call the vkEnumerateInstanceLayerProperties

if (vkEnumerateInstanceLayerProperties(out var count, IntPtr.Zero) != VkResult.Success) return;
var sizeStruct = Marshal.SizeOf<VkLayerProperties>();
var ptrSupLayers = Marshal.AllocHGlobal(sizeStruct * (int) count);
if (vkEnumerateInstanceLayerProperties(out count, ptrSupLayers) != VkResult.Success) return;
var result = new string[count];
var tmp = ptrSupLayers;
for (var i = 0; i < count; i++) {
    result[i] = Marshal.PtrToStringAnsi(tmp);
    tmp += sizeStruct;
}
Marshal.FreeHGlobal(ptrSupLayers);

This is effectivally your code from VKE for vkEnumerateInstanceExtensionProperties but for Layers.

Looking at the generated code

[CalliRewrite]
public static unsafe VkResult vkEnumerateInstanceLayerProperties(out uint pPropertyCount, IntPtr pProperties)
{
    fixed (uint* numPtr = &pPropertyCount)
    {
        IntPtr num = pProperties;
        // ISSUE: cast to a function pointer type
        // ISSUE: function pointer call
        return __calli((__FnPtr<VkResult (uint*, IntPtr)>) Vk.vkEnumerateInstanceLayerProperties_ptr)((IntPtr) numPtr, (uint*) num);
    }
}

To my unaware of how such things work but learning mind this looks like things are the wrong cast in that

return __calli((__FnPtr<VkResult (uint*, IntPtr)>) Vk.vkEnumerateInstanceLayerProperties_ptr)((IntPtr) numPtr, (uint*) num);

should be

return __calli((__FnPtr<VkResult (uint*, IntPtr)>) Vk.vkEnumerateInstanceLayerProperties_ptr)((uint*) numPtr, (IntPtr) num);

But I'm happy to accept if I'm wrong please let me know

Crash on call to Vk.vkEnumeratePhysicalDevices

Hi, my code crashes when I try to use the Vk.vkEnumeratePhysicalDevices function.
Here is my code:


        VkInstance inst = CreateInstance();
        
        uint deviceCount = 0;
        Assert(Vk.vkEnumeratePhysicalDevices(inst, (IntPtr)(&deviceCount), IntPtr.Zero));

        VkPhysicalDevice[] physicalDevices = new VkPhysicalDevice[deviceCount];

        fixed (VkPhysicalDevice* devPtr = &physicalDevices[0])
        {
            Assert(Vk.vkEnumeratePhysicalDevices(inst, (IntPtr)(&deviceCount), (IntPtr)devPtr));
        }

        VkPhysicalDevice physicalDevice = _PickPhysicsDevice(physicalDevices, deviceCount);

Am I using the api the correct way? Or else why is it crashing inside of Vk.vkEnumeratePhysicalDevices?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.