spec.py: provide a less ambiguous handle definition
This commit is contained in:
parent
4189cf6a66
commit
65807dbb41
10
device.cpp
10
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)
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -22,7 +22,6 @@
|
||||
|
||||
namespace cruft::vk {
|
||||
struct framebuffer : public owned<framebuffer,device> {
|
||||
VkExtent2D area_granularity (const device&) const;
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user