From 65807dbb419cd8d2f15af57ef27f6e4c82468e65 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Wed, 6 Sep 2017 00:14:18 +1000 Subject: [PATCH] spec.py: provide a less ambiguous handle definition --- device.cpp | 10 ---------- device.hpp | 3 --- framebuffer.cpp | 7 ------- framebuffer.hpp | 1 - tools/spec.py | 8 +++++--- 5 files changed, 5 insertions(+), 24 deletions(-) diff --git a/device.cpp b/device.cpp index 26c0eef..e2b9a03 100644 --- a/device.cpp +++ b/device.cpp @@ -33,16 +33,6 @@ device::device (const physical_device &phys, { ; } -/////////////////////////////////////////////////////////////////////////////// -VkPhysicalDeviceMemoryProperties -device::physical_properties (void) const -{ - VkPhysicalDeviceMemoryProperties props; - vkGetPhysicalDeviceMemoryProperties (id (), &props); - return props; -} - - /////////////////////////////////////////////////////////////////////////////// cruft::vk::queue device::queue (uint32_t id) diff --git a/device.hpp b/device.hpp index 4aeb96b..8d789e0 100644 --- a/device.hpp +++ b/device.hpp @@ -27,9 +27,6 @@ namespace cruft::vk { device (const physical_device&, const VkDeviceCreateInfo&); - VkPhysicalDeviceMemoryProperties - physical_properties (void) const; - struct queue queue (uint32_t id); void flush (const VkMappedMemoryRange *first, diff --git a/framebuffer.cpp b/framebuffer.cpp index 887cd82..a5afd27 100644 --- a/framebuffer.cpp +++ b/framebuffer.cpp @@ -23,10 +23,3 @@ using cruft::vk::framebuffer; /////////////////////////////////////////////////////////////////////////////// -VkExtent2D -framebuffer::area_granularity (const device &dev) const -{ - VkExtent2D extent; - vkGetRenderAreaGranularity (dev.id (), id (), &extent); - return extent; -} diff --git a/framebuffer.hpp b/framebuffer.hpp index 1a928f6..5367fdc 100644 --- a/framebuffer.hpp +++ b/framebuffer.hpp @@ -22,7 +22,6 @@ namespace cruft::vk { struct framebuffer : public owned { - VkExtent2D area_granularity (const device&) const; }; } diff --git a/tools/spec.py b/tools/spec.py index a30978c..4fb9256 100755 --- a/tools/spec.py +++ b/tools/spec.py @@ -45,7 +45,8 @@ class handle(type): super().__init__(node.find('name').text) def declare(self): - return "using %s = uintptr_t;" % self.name + return "typedef struct object_%(name)s* %(name)s;" % { 'name': self.name } + return "using %(name)s = struct object_%(name)s*;" % { 'name': self.name } ##----------------------------------------------------------------------------- @@ -220,7 +221,7 @@ class pod(type): return "%s %s;" % (self._category, self.name) def define(self): - return "%(category)s %(name)s { %(members)s };" % { + return "%(category)s %(name)s {\n%(members)s\n};" % { 'category': self._category, 'name': self.name, 'members': "\n".join(m['code'] + ';' for m in self._members) @@ -343,6 +344,7 @@ def write_type(dst, types, t): if t.name in types: dst.write(t.declare()) + dst.write('\n') dst.write(t.define()) dst.write('\n') del types[t.name] @@ -402,7 +404,7 @@ def write_root(dst, node): // because, in its wisdom, the spec doesn't actually allow us to // extract the value for VK_NULL_HANDLE from the XML we'll just // hard code it here. - #define VK_NULL_HANDLE uintptr_t(0) + #define VK_NULL_HANDLE nullptr // TODO: make this correspond to a required version #define VK_VERSION_1_0