Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

safestruct: Add QNX platform types to abstract_types list #197

Merged
merged 1 commit into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions scripts/generators/safe_struct_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ def __init__(self):
# since we cannot make a copy.
self.abstract_types = [
'AHardwareBuffer',
'_screen_context',
'_screen_window',
'_screen_buffer'
]

# These 'data' union are decided by the 'type' in the same parent struct
Expand Down
102 changes: 17 additions & 85 deletions src/vulkan/vk_safe_struct_vendor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10040,13 +10040,8 @@ safe_VkScreenSurfaceCreateInfoQNX::safe_VkScreenSurfaceCreateInfoQNX(const VkScr
if (copy_pnext) {
pNext = SafePnextCopy(in_struct->pNext, copy_state);
}
if (in_struct->context) {
context = new _screen_context(*in_struct->context);
}

if (in_struct->window) {
window = new _screen_window(*in_struct->window);
}
context = in_struct->context;
window = in_struct->window;
}

safe_VkScreenSurfaceCreateInfoQNX::safe_VkScreenSurfaceCreateInfoQNX()
Expand All @@ -10055,84 +10050,44 @@ safe_VkScreenSurfaceCreateInfoQNX::safe_VkScreenSurfaceCreateInfoQNX()
safe_VkScreenSurfaceCreateInfoQNX::safe_VkScreenSurfaceCreateInfoQNX(const safe_VkScreenSurfaceCreateInfoQNX& copy_src) {
sType = copy_src.sType;
flags = copy_src.flags;
context = nullptr;
window = nullptr;
pNext = SafePnextCopy(copy_src.pNext);

if (copy_src.context) {
context = new _screen_context(*copy_src.context);
}

if (copy_src.window) {
window = new _screen_window(*copy_src.window);
}
context = copy_src.context;
window = copy_src.window;
}

safe_VkScreenSurfaceCreateInfoQNX& safe_VkScreenSurfaceCreateInfoQNX::operator=(const safe_VkScreenSurfaceCreateInfoQNX& copy_src) {
if (&copy_src == this) return *this;

if (context) delete context;
if (window) delete window;
FreePnextChain(pNext);

sType = copy_src.sType;
flags = copy_src.flags;
context = nullptr;
window = nullptr;
pNext = SafePnextCopy(copy_src.pNext);

if (copy_src.context) {
context = new _screen_context(*copy_src.context);
}

if (copy_src.window) {
window = new _screen_window(*copy_src.window);
}
context = copy_src.context;
window = copy_src.window;

return *this;
}

safe_VkScreenSurfaceCreateInfoQNX::~safe_VkScreenSurfaceCreateInfoQNX() {
if (context) delete context;
if (window) delete window;
FreePnextChain(pNext);
}
safe_VkScreenSurfaceCreateInfoQNX::~safe_VkScreenSurfaceCreateInfoQNX() { FreePnextChain(pNext); }

void safe_VkScreenSurfaceCreateInfoQNX::initialize(const VkScreenSurfaceCreateInfoQNX* in_struct,
[[maybe_unused]] PNextCopyState* copy_state) {
if (context) delete context;
if (window) delete window;
FreePnextChain(pNext);
sType = in_struct->sType;
flags = in_struct->flags;
context = nullptr;
window = nullptr;
pNext = SafePnextCopy(in_struct->pNext, copy_state);

if (in_struct->context) {
context = new _screen_context(*in_struct->context);
}

if (in_struct->window) {
window = new _screen_window(*in_struct->window);
}
context = in_struct->context;
window = in_struct->window;
}

void safe_VkScreenSurfaceCreateInfoQNX::initialize(const safe_VkScreenSurfaceCreateInfoQNX* copy_src,
[[maybe_unused]] PNextCopyState* copy_state) {
sType = copy_src->sType;
flags = copy_src->flags;
context = nullptr;
window = nullptr;
pNext = SafePnextCopy(copy_src->pNext);

if (copy_src->context) {
context = new _screen_context(*copy_src->context);
}

if (copy_src->window) {
window = new _screen_window(*copy_src->window);
}
context = copy_src->context;
window = copy_src->window;
}
#endif // VK_USE_PLATFORM_SCREEN_QNX
#ifdef VK_ENABLE_BETA_EXTENSIONS
Expand Down Expand Up @@ -14774,68 +14729,45 @@ safe_VkImportScreenBufferInfoQNX::safe_VkImportScreenBufferInfoQNX(const VkImpor
if (copy_pnext) {
pNext = SafePnextCopy(in_struct->pNext, copy_state);
}
if (in_struct->buffer) {
buffer = new _screen_buffer(*in_struct->buffer);
}
buffer = in_struct->buffer;
}

safe_VkImportScreenBufferInfoQNX::safe_VkImportScreenBufferInfoQNX()
: sType(VK_STRUCTURE_TYPE_IMPORT_SCREEN_BUFFER_INFO_QNX), pNext(nullptr), buffer(nullptr) {}

safe_VkImportScreenBufferInfoQNX::safe_VkImportScreenBufferInfoQNX(const safe_VkImportScreenBufferInfoQNX& copy_src) {
sType = copy_src.sType;
buffer = nullptr;
pNext = SafePnextCopy(copy_src.pNext);

if (copy_src.buffer) {
buffer = new _screen_buffer(*copy_src.buffer);
}
buffer = copy_src.buffer;
}

safe_VkImportScreenBufferInfoQNX& safe_VkImportScreenBufferInfoQNX::operator=(const safe_VkImportScreenBufferInfoQNX& copy_src) {
if (&copy_src == this) return *this;

if (buffer) delete buffer;
FreePnextChain(pNext);

sType = copy_src.sType;
buffer = nullptr;
pNext = SafePnextCopy(copy_src.pNext);

if (copy_src.buffer) {
buffer = new _screen_buffer(*copy_src.buffer);
}
buffer = copy_src.buffer;

return *this;
}

safe_VkImportScreenBufferInfoQNX::~safe_VkImportScreenBufferInfoQNX() {
if (buffer) delete buffer;
FreePnextChain(pNext);
}
safe_VkImportScreenBufferInfoQNX::~safe_VkImportScreenBufferInfoQNX() { FreePnextChain(pNext); }

void safe_VkImportScreenBufferInfoQNX::initialize(const VkImportScreenBufferInfoQNX* in_struct,
[[maybe_unused]] PNextCopyState* copy_state) {
if (buffer) delete buffer;
FreePnextChain(pNext);
sType = in_struct->sType;
buffer = nullptr;
pNext = SafePnextCopy(in_struct->pNext, copy_state);

if (in_struct->buffer) {
buffer = new _screen_buffer(*in_struct->buffer);
}
buffer = in_struct->buffer;
}

void safe_VkImportScreenBufferInfoQNX::initialize(const safe_VkImportScreenBufferInfoQNX* copy_src,
[[maybe_unused]] PNextCopyState* copy_state) {
sType = copy_src->sType;
buffer = nullptr;
pNext = SafePnextCopy(copy_src->pNext);

if (copy_src->buffer) {
buffer = new _screen_buffer(*copy_src->buffer);
}
buffer = copy_src->buffer;
}

safe_VkExternalFormatQNX::safe_VkExternalFormatQNX(const VkExternalFormatQNX* in_struct,
Expand Down