Comments (3)
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.
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.
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)
- Derelict loader needs libName for Linux HOT 3
- What makes you think that enums are not global? HOT 3
- Make DVulkanLoader.loadAllFunctions(VkDevice device) static HOT 1
- Loading vkDestroyInstance with vkGetDeviceProcAddr wrong? HOT 8
- Add platform APIs support HOT 6
- Specify extensions to load via versions HOT 1
- Deprecate VK_NULL_HANDLE since it is impossible to implement in D
- Load function pointers to struct HOT 1
- Function pointers in types.d should be extern(System)
- Remove @nogc from functions
- Support for VK_KHR_mir_surface should be removed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dvulkan.