Giter VIP home page Giter VIP logo

Comments (3)

ColonelThirtyTwo avatar ColonelThirtyTwo commented on August 28, 2024

It will still produce errors on 32-bit platforms.

Non-dispatchable handles are pointers on 64-bit targets but 64-bit integers on 32-bit systems, and since D makes comparing pointers and integers a type error, such a comparison will not compile on 32-bit targets.

Since the null handle is always zero (on any sane implementation) you can just use the handles as booleans - i.e. if(handle) and if(!handle), and use SomeHandle.init if you really need a null handle value. But unfortunately, it's not possible to implement VK_NULL_HANDLE 100% correctly in D.

from dvulkan.

ParticlePeter avatar ParticlePeter commented on August 28, 2024

Didn't face that problem till now, but on 32-bit windows:
VkDevice device = VK_NULL_HANDLE;
works with
enum VK_NULL_HANDLE = null;
but not with
enum VK_NULL_HANDLE = 0;

from dvulkan.

ColonelThirtyTwo avatar ColonelThirtyTwo commented on August 28, 2024

VkDevice is a dispatchable handle and thus always a pointer. Try it with, say, a VkFence.

There's unfortunately no good solution for this that works in all cases. I'm honestly considering removing VK_NULL_HANDLE (or at least deprecating it with a message) since it can hide issues in 64-bit systems.

from dvulkan.

Related Issues (12)

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.