From 07a2cf85ad579671c1d9610f9bfc4bb8b4e329d0 Mon Sep 17 00:00:00 2001 From: Gregory Wells Date: Mon, 28 Jul 2025 20:05:44 -0400 Subject: [PATCH] update gryphn to use GN_FALSE + GN_TRUE --- projects/apis/metal/loader/metal_extensions.m | 6 ++-- .../command_buffer/metal_command_buffer.m | 2 +- .../src/commands/commands/metal_commands.m | 2 +- .../metal/src/devices/metal_physical_device.m | 10 +----- .../src/framebuffers/metal_framebuffer.m | 4 +-- .../metal_graphics_pipeline.m | 2 +- projects/apis/metal/src/submit/metal_submit.m | 2 +- .../apis/metal/src/sync/fence/metal_fence.m | 2 +- .../apis/vulkan/loader/vulkan_extensions.c | 6 ++-- .../apis/vulkan/src/buffers/vulkan_buffer.c | 4 +-- .../src/commands/commands/vulkan_commands.c | 4 +-- .../vulkan/src/instance/vulkan_instance.c | 6 ++-- .../output_device/vulkan_device_extensions.c | 4 +-- .../src/output_device/vulkan_output_device.c | 4 +-- .../output_device/vulkan_physical_device.c | 34 +++++++------------ .../vulkan_graphics_pipeline.c | 6 ++-- .../apis/vulkan/src/textures/vulkan_texture.c | 6 ++-- .../vulkan/src/uniforms/vulkan_uniform_pool.c | 2 +- projects/core/src/instance/gryphn_instance.c | 12 +++---- .../core/src/window_surface/gryphn_surface.c | 4 +-- .../synchronization/fence/gryphn_fence.c | 8 ++--- projects/loader/src/gryphn_extension_loader.c | 4 +-- .../platform_macos/gryphn_platform_macos.m | 4 +-- .../function_loader/src/instance_functions.c | 2 +- 24 files changed, 62 insertions(+), 78 deletions(-) diff --git a/projects/apis/metal/loader/metal_extensions.m b/projects/apis/metal/loader/metal_extensions.m index 7ed3e36..86d9418 100644 --- a/projects/apis/metal/loader/metal_extensions.m +++ b/projects/apis/metal/loader/metal_extensions.m @@ -1,7 +1,7 @@ #include "metal_loader.h" gnBool metalIsExtensionSupported(gnExtension extension) { - if (extension == GN_EXT_SYNCHRONIZATION) return gnTrue; - if (extension == GN_EXT_QUEUES) return gnFalse; - return gnFalse; + if (extension == GN_EXT_SYNCHRONIZATION) return GN_TRUE; + if (extension == GN_EXT_QUEUES) return GN_FALSE; + return GN_FALSE; } diff --git a/projects/apis/metal/src/commands/command_buffer/metal_command_buffer.m b/projects/apis/metal/src/commands/command_buffer/metal_command_buffer.m index 4e571cb..45aa493 100644 --- a/projects/apis/metal/src/commands/command_buffer/metal_command_buffer.m +++ b/projects/apis/metal/src/commands/command_buffer/metal_command_buffer.m @@ -10,7 +10,7 @@ gnReturnCode allocateMetalCommandBuffers(gnCommandBufferHandle* commandBuffers, // write a command log at some point if ((pool->info.flags & GN_REUSE_COMMAND_BUFFERS) == GN_REUSE_COMMAND_BUFFERS) - commandBuffers[i]->commandBuffer->isIndirectCommandBuffer = gnTrue; + commandBuffers[i]->commandBuffer->isIndirectCommandBuffer = GN_TRUE; } return GN_SUCCESS; diff --git a/projects/apis/metal/src/commands/commands/metal_commands.m b/projects/apis/metal/src/commands/commands/metal_commands.m index 5571b9b..6facd54 100644 --- a/projects/apis/metal/src/commands/commands/metal_commands.m +++ b/projects/apis/metal/src/commands/commands/metal_commands.m @@ -117,7 +117,7 @@ void metalBindUniform(gnCommandBufferHandle buffer, gnUniform uniform, uint32_t if (uniform->uniform->isDynamic[c]) { gnBufferUniformInfo updateInfo = { .binding = c, - .dynamic = gnTrue, + .dynamic = GN_TRUE, .offset = dynamicOffsets[i], .size = 0 }; diff --git a/projects/apis/metal/src/devices/metal_physical_device.m b/projects/apis/metal/src/devices/metal_physical_device.m index 73d9026..e7d18c6 100644 --- a/projects/apis/metal/src/devices/metal_physical_device.m +++ b/projects/apis/metal/src/devices/metal_physical_device.m @@ -23,14 +23,6 @@ gnPhysicalDevice* getMetalDevices(gnInstanceHandle instance, uint32_t* deviceCou else if (deviceLocation == MTLDeviceLocationExternal) devicesList[i]->properties.deviceType = GN_EXTERNAL_DEVICE; - // below I am going to fake that there is one queue that can support graphics, compute, and transfer queues - // devicesList[i]->queueProperties.queueCount = 1; - // devicesList[i]->queueProperties.queueProperties = malloc(sizeof(gnQueueProperties)); - // devicesList[i]->queueProperties.queueProperties[0] = (gnQueueProperties){ - // .queueCount = 1, - // .queueType = GN_QUEUE_GRAPHICS | GN_QUEUE_COMPUTE | GN_QUEUE_TRANSFER - // }; - devicesList[i]->features.maxColorSamples = GN_SAMPLE_BIT_1; if ([device supportsTextureSampleCount:2]) { devicesList[i]->features.maxColorSamples |= GN_SAMPLE_BIT_2; } else {} if ([device supportsTextureSampleCount:4]) { devicesList[i]->features.maxColorSamples |= GN_SAMPLE_BIT_4; } else {} @@ -47,5 +39,5 @@ gnPhysicalDevice* getMetalDevices(gnInstanceHandle instance, uint32_t* deviceCou } gnBool metalCanDevicePresent(gnPhysicalDevice device, gnWindowSurface windowSurface) { - return gnTrue; // I belive that a window should always be able to present to a surface in metal + return GN_TRUE; // I belive that a window should always be able to present to a surface in metal } diff --git a/projects/apis/metal/src/framebuffers/metal_framebuffer.m b/projects/apis/metal/src/framebuffers/metal_framebuffer.m index 354a444..76778f1 100644 --- a/projects/apis/metal/src/framebuffers/metal_framebuffer.m +++ b/projects/apis/metal/src/framebuffers/metal_framebuffer.m @@ -10,7 +10,7 @@ gnReturnCode createMetalFramebuffer(gnFramebuffer framebuffer, gnOutputDevice de framebuffer->framebuffer->clearCopyCount = info.attachmentCount; framebuffer->framebuffer->clearCopies = malloc(sizeof(mtlClearCopy) * info.attachmentCount); for (int i = 0; i < info.attachmentCount; i++) { - framebuffer->framebuffer->clearCopies[i].clear = gnFalse; + framebuffer->framebuffer->clearCopies[i].clear = GN_FALSE; } framebuffer->framebuffer->subpassCount = info.renderPassDescriptor->renderPassDescriptor->subpassCount; @@ -27,7 +27,7 @@ gnReturnCode createMetalFramebuffer(gnFramebuffer framebuffer, gnOutputDevice de colorPass.texture = info.attachments[info.renderPassDescriptor->renderPassDescriptor->copyInfos[i].colorAttachments[c].attachmentIndex]->texture->texture; if (info.renderPassDescriptor->renderPassDescriptor->copyInfos[i].colorAttachments[c].resolveAttachmentIndex >= 0) colorPass.resolveTexture = info.attachments[info.renderPassDescriptor->renderPassDescriptor->copyInfos[i].colorAttachments[c].resolveAttachmentIndex]->texture->texture; - framebuffer->framebuffer->clearCopies[info.renderPassDescriptor->renderPassDescriptor->copyInfos[i].colorAttachments[c].attachmentIndex].clear = gnTrue; + framebuffer->framebuffer->clearCopies[info.renderPassDescriptor->renderPassDescriptor->copyInfos[i].colorAttachments[c].attachmentIndex].clear = GN_TRUE; framebuffer->framebuffer->clearCopies[info.renderPassDescriptor->renderPassDescriptor->copyInfos[i].colorAttachments[c].attachmentIndex].descriptor = colorPass; } diff --git a/projects/apis/metal/src/pipelines/graphics_pipeline/metal_graphics_pipeline.m b/projects/apis/metal/src/pipelines/graphics_pipeline/metal_graphics_pipeline.m index ad5521f..8805650 100644 --- a/projects/apis/metal/src/pipelines/graphics_pipeline/metal_graphics_pipeline.m +++ b/projects/apis/metal/src/pipelines/graphics_pipeline/metal_graphics_pipeline.m @@ -53,7 +53,7 @@ gnReturnCode createMetalGraphicsPipeline(gnGraphicsPipeline graphicsPipeline, gn MTLRenderPassColorAttachmentDescriptor* colorPass = subpass.colorAttachments[i]; descriptor.colorAttachments[i].pixelFormat = copyInfo.colorAttachments[i].format; - if (info.colorBlending.enable == gnTrue) { + if (info.colorBlending.enable == GN_TRUE) { [descriptor.colorAttachments objectAtIndexedSubscript:i].blendingEnabled = YES; [descriptor.colorAttachments objectAtIndexedSubscript:i].rgbBlendOperation = mtlGryphnBlendOperation(info.colorBlending.colorBlendOperation); [descriptor.colorAttachments objectAtIndexedSubscript:i].alphaBlendOperation = mtlGryphnBlendOperation(info.colorBlending.alphaBlendOperation); diff --git a/projects/apis/metal/src/submit/metal_submit.m b/projects/apis/metal/src/submit/metal_submit.m index 0a025f8..65b5829 100644 --- a/projects/apis/metal/src/submit/metal_submit.m +++ b/projects/apis/metal/src/submit/metal_submit.m @@ -22,7 +22,7 @@ gnReturnCode metalSyncSubmit(gnOutputDevice device, gnSubmitSyncInfo info) { NSLog(@"Command buffer error: %s", buffer.error.localizedDescription.UTF8String); } if (atomic_fetch_sub_explicit(&buffersLeft, 1, memory_order_acq_rel) == 1) { - fenceToSignal->signaled = gnTrue; + fenceToSignal->signaled = GN_TRUE; } }]; diff --git a/projects/apis/metal/src/sync/fence/metal_fence.m b/projects/apis/metal/src/sync/fence/metal_fence.m index 1ed16d4..ad7009f 100644 --- a/projects/apis/metal/src/sync/fence/metal_fence.m +++ b/projects/apis/metal/src/sync/fence/metal_fence.m @@ -15,7 +15,7 @@ void singalMetalFence(gnFence fence) { } void waitForMetalFence(gnFence fence, uint64_t timeout) { // dispatch_semaphore_wait(fence->fence->semaphore, timeout); - while (fence->signaled == gnFalse) {} + while (fence->signaled == GN_FALSE) {} } void resetMetalFence(gnFence fence) { // dispatch_semaphore_signal(fence->fence->semaphore); diff --git a/projects/apis/vulkan/loader/vulkan_extensions.c b/projects/apis/vulkan/loader/vulkan_extensions.c index 14e914d..f9a0c8f 100644 --- a/projects/apis/vulkan/loader/vulkan_extensions.c +++ b/projects/apis/vulkan/loader/vulkan_extensions.c @@ -1,7 +1,7 @@ #include "vulkan_loader.h" gnBool vulkanIsExtensionSupported(gnExtension extension){ - if (extension == GN_EXT_SYNCHRONIZATION) return gnTrue; - if (extension == GN_EXT_QUEUES) return gnTrue; - return gnFalse; + if (extension == GN_EXT_SYNCHRONIZATION) return GN_TRUE; + if (extension == GN_EXT_QUEUES) return GN_TRUE; + return GN_FALSE; } diff --git a/projects/apis/vulkan/src/buffers/vulkan_buffer.c b/projects/apis/vulkan/src/buffers/vulkan_buffer.c index e0c6e5d..3d46c37 100644 --- a/projects/apis/vulkan/src/buffers/vulkan_buffer.c +++ b/projects/apis/vulkan/src/buffers/vulkan_buffer.c @@ -20,7 +20,7 @@ uint32_t VkMemoryIndex(VkPhysicalDevice device, uint32_t memoryType, VkMemoryPro vkGetPhysicalDeviceMemoryProperties(device, &memoryProperties); for (uint32_t i = 0; i < memoryProperties.memoryTypeCount; i++) { if ((memoryType & (1 << i)) && (memoryProperties.memoryTypes[i].propertyFlags & flags) == flags) { - *foundMemory = gnTrue; + *foundMemory = GN_TRUE; return i; } } // this whole thing was adapted from vulkan-tutorial.com @@ -43,7 +43,7 @@ gnReturnCode VkCreateBuffer( VkMemoryRequirements bufferRequirements; vkGetBufferMemoryRequirements(device->outputDevice->device, buffer->buffer, &bufferRequirements); - gnBool foundMemory = gnFalse; + gnBool foundMemory = GN_FALSE; VkMemoryAllocateInfo memoryAllocateInfo = { .sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, .allocationSize = bufferRequirements.size, diff --git a/projects/apis/vulkan/src/commands/commands/vulkan_commands.c b/projects/apis/vulkan/src/commands/commands/vulkan_commands.c index 4ce2715..9defeff 100644 --- a/projects/apis/vulkan/src/commands/commands/vulkan_commands.c +++ b/projects/apis/vulkan/src/commands/commands/vulkan_commands.c @@ -56,7 +56,7 @@ void bindBuffer(gnCommandBufferHandle buffer, gnBufferHandle bufferToBind, gnBuf if (type == GN_VERTEX_BUFFER) vkCmdBindVertexBuffers(buffer->commandBuffer->buffer, 0, 1, &bufferToBind->buffer->buffer.buffer, offsets); else if (type == GN_INDEX_BUFFER) { - buffer->commandBuffer->changedBuffer = gnTrue; + buffer->commandBuffer->changedBuffer = GN_TRUE; buffer->commandBuffer->boundIndexBuffer = bufferToBind; } } @@ -66,7 +66,7 @@ void draw(gnCommandBuffer buffer, int vertexCount, int firstVertex, int instance void drawIndexed(gnCommandBufferHandle buffer, gnIndexType type, int indexCount, int firstIndex, int vertexOffset, int instanceCount, int firstInstance) { if (buffer->commandBuffer->changedBuffer) vkCmdBindIndexBuffer(buffer->commandBuffer->buffer, buffer->commandBuffer->boundIndexBuffer->buffer->buffer.buffer, 0, (type == GN_UINT32) ? VK_INDEX_TYPE_UINT32 : VK_INDEX_TYPE_UINT16); vkCmdDrawIndexed(buffer->commandBuffer->buffer, indexCount, instanceCount, firstIndex, vertexOffset, firstInstance); - buffer->commandBuffer->changedBuffer = gnFalse; + buffer->commandBuffer->changedBuffer = GN_FALSE; } void bindUniform(gnCommandBufferHandle buffer, gnUniform uniform, uint32_t set, uint32_t dynamicOffsetCount, uint32_t* dynamicOffsets) { diff --git a/projects/apis/vulkan/src/instance/vulkan_instance.c b/projects/apis/vulkan/src/instance/vulkan_instance.c index 303aa56..30b2991 100644 --- a/projects/apis/vulkan/src/instance/vulkan_instance.c +++ b/projects/apis/vulkan/src/instance/vulkan_instance.c @@ -36,7 +36,7 @@ static VKAPI_ATTR VkBool32 VKAPI_CALL vk_debuggerDebugCallback( vkUserData* userData = (vkUserData*)pUserData; gnDebuggerCallback callback = userData->debuggerCallback; gnBool result = callback(severity, type, data, userData->userData); - if (result == gnFalse) return VK_FALSE; + if (result == GN_FALSE) return VK_FALSE; return VK_TRUE; } @@ -110,12 +110,12 @@ gnReturnCode createInstance(gnInstanceHandle instance, gnInstanceInfo instanceIn VkResult result = vkCreateInstance(&createInfo, NULL, &instance->instance->vk_instance); if (result != VK_SUCCESS) return GN_FAILED_CREATE_INSTANCE; - instance->valid = gnTrue; + instance->valid = GN_TRUE; return GN_SUCCESS; } void destroyInstance(gnInstanceHandle instance) { - instance->valid = gnFalse; + instance->valid = GN_FALSE; vkDestroyInstance(instance->instance->vk_instance, NULL); } diff --git a/projects/apis/vulkan/src/output_device/vulkan_device_extensions.c b/projects/apis/vulkan/src/output_device/vulkan_device_extensions.c index 8c02f19..f892041 100644 --- a/projects/apis/vulkan/src/output_device/vulkan_device_extensions.c +++ b/projects/apis/vulkan/src/output_device/vulkan_device_extensions.c @@ -20,10 +20,10 @@ const char* *vkGetGryphnDeviceExtensions(uint32_t* outCount, VkPhysicalDevice de VkExtensionProperties* vkExtensions = malloc(sizeof(VkExtensionProperties) * extensionCount); vkEnumerateDeviceExtensionProperties(device, NULL, &extensionCount, vkExtensions); - gnBool supportsDescriptorPoolOverallocation = gnFalse; + gnBool supportsDescriptorPoolOverallocation = GN_FALSE; for (uint32_t i = 0; i < extensionCount; i++) { if (strcmp(VK_NV_DESCRIPTOR_POOL_OVERALLOCATION_EXTENSION_NAME, vkExtensions[i].extensionName) == 0) { - supportsDescriptorPoolOverallocation = gnTrue; + supportsDescriptorPoolOverallocation = GN_TRUE; break; } } diff --git a/projects/apis/vulkan/src/output_device/vulkan_output_device.c b/projects/apis/vulkan/src/output_device/vulkan_output_device.c index 56b9ea1..59f77c7 100644 --- a/projects/apis/vulkan/src/output_device/vulkan_output_device.c +++ b/projects/apis/vulkan/src/output_device/vulkan_output_device.c @@ -46,9 +46,9 @@ gnReturnCode createOutputDevice(gnOutputDeviceHandle outputDevice, gnInstanceHan }; deviceCreateInfo.ppEnabledExtensionNames = vkGetGryphnDeviceExtensions(&deviceCreateInfo.enabledExtensionCount, deviceInfo.physicalDevice->physicalDevice->device); - outputDevice->outputDevice->enabledOversizedDescriptorPools = gnFalse; + outputDevice->outputDevice->enabledOversizedDescriptorPools = GN_FALSE; for (int i = 0; i < deviceCreateInfo.enabledExtensionCount; i++) - if (strcmp(deviceCreateInfo.ppEnabledExtensionNames[i], VK_NV_DESCRIPTOR_POOL_OVERALLOCATION_EXTENSION_NAME) == 0) outputDevice->outputDevice->enabledOversizedDescriptorPools = gnTrue; + if (strcmp(deviceCreateInfo.ppEnabledExtensionNames[i], VK_NV_DESCRIPTOR_POOL_OVERALLOCATION_EXTENSION_NAME) == 0) outputDevice->outputDevice->enabledOversizedDescriptorPools = GN_TRUE; if (instance->hasDebugger) deviceCreateInfo.enabledLayerCount = 0; diff --git a/projects/apis/vulkan/src/output_device/vulkan_physical_device.c b/projects/apis/vulkan/src/output_device/vulkan_physical_device.c index 4784d86..2ae930e 100644 --- a/projects/apis/vulkan/src/output_device/vulkan_physical_device.c +++ b/projects/apis/vulkan/src/output_device/vulkan_physical_device.c @@ -38,24 +38,24 @@ void vulkanLoadNeededQueues(VkPhysicalDevice vulkanDevice, gnPhysicalDevice gryp vkGetPhysicalDeviceQueueFamilyProperties(vulkanDevice, &queueFamilyCount, queueFamilies); gryphnDevice->physicalDevice->neededQueues = malloc(sizeof(vulkanNeededQueue) * queueFamilyCount); - gnBool foundGraphicsQueueFamily = gnFalse, foundTransferQueueFamily = gnFalse; + gnBool foundGraphicsQueueFamily = GN_FALSE, foundTransferQueueFamily = GN_FALSE; for (int c = 0; c < queueFamilyCount; c++) { - gnBool hasNeededQueue = gnFalse; + gnBool hasNeededQueue = GN_FALSE; if ((queueFamilies[c].queueFlags & VK_QUEUE_GRAPHICS_BIT) == VK_QUEUE_GRAPHICS_BIT) { - foundGraphicsQueueFamily = true; - hasNeededQueue = gnTrue; + foundGraphicsQueueFamily = GN_TRUE; + hasNeededQueue = GN_TRUE; } if ((queueFamilies[c].queueFlags & VK_QUEUE_TRANSFER_BIT) == VK_QUEUE_TRANSFER_BIT) { - foundTransferQueueFamily = true; - hasNeededQueue = gnTrue; + foundTransferQueueFamily = GN_TRUE; + hasNeededQueue = GN_TRUE; } if (hasNeededQueue) { vulkanNeededQueue neededQueue = { .queueIndex = c, .createFlags = 0, - .usedForPresent = gnFalse + .usedForPresent = GN_FALSE }; if ((queueFamilies[c].queueFlags & VK_QUEUE_GRAPHICS_BIT)) neededQueue.createFlags |= VK_QUEUE_GRAPHICS_BIT; if ((queueFamilies[c].queueFlags & VK_QUEUE_TRANSFER_BIT)) neededQueue.createFlags |= VK_QUEUE_TRANSFER_BIT; @@ -94,7 +94,7 @@ gnPhysicalDevice* getPhysicalDevices(gnInstanceHandle instance, uint32_t* device case VK_PHYSICAL_DEVICE_TYPE_MAX_ENUM: outputDevices[i]->properties.deviceType = GN_INTEGRATED_DEVICE; } - if (instance->enabledExtensions[GN_EXT_QUEUES] == gnFalse) + if (instance->enabledExtensions[GN_EXT_QUEUES] == GN_FALSE) vulkanLoadNeededQueues(physicalDevices[i], outputDevices[i]); @@ -111,13 +111,13 @@ gnPhysicalDevice* getPhysicalDevices(gnInstanceHandle instance, uint32_t* device } gnBool deviceCanPresentToSurface(gnPhysicalDevice device, gnWindowSurface surface) { - gnBool foundQueue = gnFalse; + gnBool foundQueue = GN_FALSE; for (int i = 0; i < device->physicalDevice->neededQueueCount; i++) { VkBool32 supportsPresent = VK_FALSE; vkGetPhysicalDeviceSurfaceSupportKHR(device->physicalDevice->device, device->physicalDevice->neededQueues[i].queueIndex, surface->windowSurface->surface, &supportsPresent); if (supportsPresent) { - device->physicalDevice->neededQueues[i].usedForPresent = gnTrue; - foundQueue = gnTrue; + device->physicalDevice->neededQueues[i].usedForPresent = GN_TRUE; + foundQueue = GN_TRUE; break; } surface->windowSurface->presentQueueIndex = i; @@ -134,9 +134,9 @@ gnBool deviceCanPresentToSurface(gnPhysicalDevice device, gnWindowSurface surfac device->physicalDevice->neededQueues[device->physicalDevice->neededQueueCount] = (vulkanNeededQueue){ .queueIndex = i, .createFlags = 0, - .usedForPresent = gnTrue + .usedForPresent = GN_TRUE }; - foundQueue = gnTrue; + foundQueue = GN_TRUE; surface->windowSurface->presentQueueIndex = device->physicalDevice->neededQueueCount; device->physicalDevice->neededQueueCount++; break; @@ -146,11 +146,3 @@ gnBool deviceCanPresentToSurface(gnPhysicalDevice device, gnWindowSurface surfac return foundQueue; } - -// gnBool queueCanPresentToSurface(gnPhysicalDevice device, uint32_t queueIndex, gnWindowSurfaceHandle windowSurface) { -// VkBool32 supportsPresent = VK_FALSE; -// vkGetPhysicalDeviceSurfaceSupportKHR(device->physicalDevice->device, queueIndex, windowSurface->windowSurface->surface, &supportsPresent); -// if (supportsPresent) -// return gnTrue; -// return gnFalse; -// } diff --git a/projects/apis/vulkan/src/pipelines/graphics_pipeline/vulkan_graphics_pipeline.c b/projects/apis/vulkan/src/pipelines/graphics_pipeline/vulkan_graphics_pipeline.c index f4d6929..8681073 100644 --- a/projects/apis/vulkan/src/pipelines/graphics_pipeline/vulkan_graphics_pipeline.c +++ b/projects/apis/vulkan/src/pipelines/graphics_pipeline/vulkan_graphics_pipeline.c @@ -91,11 +91,11 @@ VkStencilOp vkGryphnStencilOperation(gnStencilOperation operation) { gnReturnCode createGraphicsPipeline(gnGraphicsPipeline graphicsPipeline, gnDevice device, gnGraphicsPipelineInfo info) { graphicsPipeline->graphicsPipeline = malloc(sizeof(gnPlatformGraphicsPipeline)); - for (int i = 0; i < GN_DYNAMIC_STATE_MAX; i++) graphicsPipeline->graphicsPipeline->isDynamic[i] = gnFalse; + for (int i = 0; i < GN_DYNAMIC_STATE_MAX; i++) graphicsPipeline->graphicsPipeline->isDynamic[i] = GN_FALSE; graphicsPipeline->graphicsPipeline->dynamicStates = malloc(sizeof(VkDynamicState) * info.dynamicState.dynamicStateCount); for (int i = 0; i < info.dynamicState.dynamicStateCount; i++) { - graphicsPipeline->graphicsPipeline->isDynamic[info.dynamicState.dynamicStates[i]] = gnTrue; + graphicsPipeline->graphicsPipeline->isDynamic[info.dynamicState.dynamicStates[i]] = GN_TRUE; graphicsPipeline->graphicsPipeline->dynamicStates[i] = vkGryphnDynamicStateToVulkanDynamicState(info.dynamicState.dynamicStates[i]); } @@ -184,7 +184,7 @@ gnReturnCode createGraphicsPipeline(gnGraphicsPipeline graphicsPipeline, gnDevic graphicsPipeline->graphicsPipeline->colorBlendAttachment = (VkPipelineColorBlendAttachmentState){ .colorWriteMask = VK_COLOR_COMPONENT_R_BIT | VK_COLOR_COMPONENT_G_BIT | VK_COLOR_COMPONENT_B_BIT | VK_COLOR_COMPONENT_A_BIT, - .blendEnable = ( info.colorBlending.enable == gnTrue ) ? VK_TRUE : VK_FALSE, + .blendEnable = ( info.colorBlending.enable == GN_TRUE ) ? VK_TRUE : VK_FALSE, .srcColorBlendFactor = vkGryphnBlendFactor(info.colorBlending.sourceColorBlendFactor), .dstColorBlendFactor = vkGryphnBlendFactor(info.colorBlending.destinationColorBlendFactor), .colorBlendOp = vkGryphnBlendOperation(info.colorBlending.colorBlendOperation), diff --git a/projects/apis/vulkan/src/textures/vulkan_texture.c b/projects/apis/vulkan/src/textures/vulkan_texture.c index a66d43f..f69c7b1 100644 --- a/projects/apis/vulkan/src/textures/vulkan_texture.c +++ b/projects/apis/vulkan/src/textures/vulkan_texture.c @@ -178,7 +178,7 @@ gnReturnCode createTexture(gnTexture texture, gnDevice device, const gnTextureIn VkMemoryRequirements memRequirements; vkGetImageMemoryRequirements(device->outputDevice->device, texture->texture->image.image, &memRequirements); - gnBool foundMemory = gnFalse; + gnBool foundMemory = GN_FALSE; VkMemoryAllocateInfo allocInfo = { .sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, .allocationSize = memRequirements.size, @@ -191,7 +191,7 @@ gnReturnCode createTexture(gnTexture texture, gnDevice device, const gnTextureIn vkBindImageMemory(device->outputDevice->device, texture->texture->image.image, texture->texture->image.memory, 0); - texture->texture->beenWrittenToo = gnFalse; + texture->texture->beenWrittenToo = GN_FALSE; VkImageViewCreateInfo viewInfo = { .sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO, @@ -255,7 +255,7 @@ void textureData(gnTextureHandle texture, void* pixelData) { VkCopyBufferToImage(texture->texture->buffer, texture->texture->image, texture->info.extent, texture->device); VkTransitionImageLayout(texture->device, texture->texture->image.image, texture->info.format, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL); - texture->texture->beenWrittenToo = gnTrue; + texture->texture->beenWrittenToo = GN_TRUE; } void gnDestroyVulkanImage(VkGryphnImage* image, VkDevice device) { diff --git a/projects/apis/vulkan/src/uniforms/vulkan_uniform_pool.c b/projects/apis/vulkan/src/uniforms/vulkan_uniform_pool.c index 4f6a20d..d009c7c 100644 --- a/projects/apis/vulkan/src/uniforms/vulkan_uniform_pool.c +++ b/projects/apis/vulkan/src/uniforms/vulkan_uniform_pool.c @@ -12,7 +12,7 @@ gnReturnCode createUniformPool(gnUniformPool pool, gnDeviceHandle device) { pool->uniformPool = malloc(sizeof(struct gnPlatformUniformPool_t)); pool->uniformPool->pools = VkGryphnUniformPoolArrayListCreate(); - if (device->outputDevice->enabledOversizedDescriptorPools == gnTrue) { + if (device->outputDevice->enabledOversizedDescriptorPools == GN_TRUE) { { VkGryphnUniformPool firstPool = { .pool = VK_NULL_HANDLE, diff --git a/projects/core/src/instance/gryphn_instance.c b/projects/core/src/instance/gryphn_instance.c index 12d97ef..6f986b5 100644 --- a/projects/core/src/instance/gryphn_instance.c +++ b/projects/core/src/instance/gryphn_instance.c @@ -6,7 +6,7 @@ gnReturnCode gnCreateInstance(gnInstanceHandle* instance, gnInstanceInfo info) { *instance = malloc(sizeof(struct gnInstance_t)); - (*instance)->hasDebugger = gnFalse; + (*instance)->hasDebugger = GN_FALSE; (*instance)->layers = loaderLayerArrayListCreate(); loaderLayerArrayListAdd(&(*instance)->layers, loadLayer((loaderInfo){ @@ -14,18 +14,18 @@ gnReturnCode gnCreateInstance(gnInstanceHandle* instance, gnInstanceInfo info) { .layerToLoad = api_layer })); - for (int c = 0; c < GN_EXT_MAX; c++) (*instance)->enabledExtensions[c] = gnFalse; - for (int i = 0; i < info.extensionCount; i++) (*instance)->enabledExtensions[info.extensions[i]] = gnTrue; + for (int c = 0; c < GN_EXT_MAX; c++) (*instance)->enabledExtensions[c] = GN_FALSE; + for (int i = 0; i < info.extensionCount; i++) (*instance)->enabledExtensions[info.extensions[i]] = GN_TRUE; if ((*instance)->enabledExtensions[GN_EXT_SYNCHRONIZATION]) (*instance)->layers.data[0].syncFunctions = loadAPISyncFunctions(info.renderingAPI); - gnBool loaderFunctionChecker = gnFalse; + gnBool loaderFunctionChecker = GN_FALSE; if (info.debugger != NULL) { for (int i = 0; i < info.debugger->layerCount; i++) { - if (info.debugger->layers[i] == GN_DEBUGGER_LAYER_FUNCTIONS) loaderFunctionChecker = gnTrue; + if (info.debugger->layers[i] == GN_DEBUGGER_LAYER_FUNCTIONS) loaderFunctionChecker = GN_TRUE; } (*instance)->debugger = *info.debugger; - (*instance)->hasDebugger = gnTrue; + (*instance)->hasDebugger = GN_TRUE; } if (loaderFunctionChecker) { diff --git a/projects/core/src/window_surface/gryphn_surface.c b/projects/core/src/window_surface/gryphn_surface.c index c0f1f42..1b9cc9f 100644 --- a/projects/core/src/window_surface/gryphn_surface.c +++ b/projects/core/src/window_surface/gryphn_surface.c @@ -23,10 +23,10 @@ gnBool gnIsSurfaceFormatSupported( gnSurfaceFormat* formats = gnGetSupportedSurfaceFormats(windowSurface, device, &formatCount); for (int i = 0; i < formatCount; i++) { if (formats[i].format == format.format && formats[i].colorSpace == format.colorSpace) { - return gnTrue; + return GN_TRUE; } } - return gnFalse; + return GN_FALSE; } gnSurfaceFormat gnGetPreferredSurfaceFormat( diff --git a/projects/extensions/synchronization/fence/gryphn_fence.c b/projects/extensions/synchronization/fence/gryphn_fence.c index 0462b83..b2ef360 100644 --- a/projects/extensions/synchronization/fence/gryphn_fence.c +++ b/projects/extensions/synchronization/fence/gryphn_fence.c @@ -7,18 +7,18 @@ gnReturnCode gnCreateFence(gnFenceHandle* fence, gnDevice device) { *fence = malloc(sizeof(struct gnFence_t)); (*fence)->device = device; - (*fence)->signaled = gnFalse; + (*fence)->signaled = GN_FALSE; return device->instance->callingLayer->syncFunctions._gnCreateFence(*fence, device); } void gnSignalFence(gnFenceHandle fence) { - fence->signaled = gnTrue; + fence->signaled = GN_TRUE; } void gnWaitForFence(gnFenceHandle fence, uint64_t timeout) { - if (fence->signaled == gnTrue) return; + if (fence->signaled == GN_TRUE) return; fence->device->instance->callingLayer->syncFunctions._gnWaitForFence(fence, timeout); } void gnResetFence(gnFenceHandle fence) { - fence->signaled = gnFalse; + fence->signaled = GN_FALSE; fence->device->instance->callingLayer->syncFunctions._gnResetFence(fence); } void gnDestroyFence(gnFenceHandle fence) { diff --git a/projects/loader/src/gryphn_extension_loader.c b/projects/loader/src/gryphn_extension_loader.c index 1d1d422..62146d6 100644 --- a/projects/loader/src/gryphn_extension_loader.c +++ b/projects/loader/src/gryphn_extension_loader.c @@ -12,7 +12,7 @@ gnBool gnIsExtensionSuppoted(gnRenderingAPI api, gnExtension extension) { switch (api) { - case GN_RENDERINGAPI_NONE: return gnFalse; + case GN_RENDERINGAPI_NONE: return GN_FALSE; #ifdef GN_API_VULKAN case GN_RENDERINGAPI_VULKAN: return vulkanIsExtensionSupported(extension); #endif @@ -31,6 +31,6 @@ gnBool gnIsExtensionSuppoted(gnRenderingAPI api, gnExtension extension) { #ifdef GN_API_METAL case GN_RENDERINGAPI_METAL: return metalIsExtensionSupported(extension); #endif - default: return gnFalse; + default: return GN_FALSE; } } diff --git a/projects/platform/platform_macos/gryphn_platform_macos.m b/projects/platform/platform_macos/gryphn_platform_macos.m index bf26e19..2e8688c 100644 --- a/projects/platform/platform_macos/gryphn_platform_macos.m +++ b/projects/platform/platform_macos/gryphn_platform_macos.m @@ -16,8 +16,8 @@ gnRenderingAPI* gnGetSupportedRenderingAPIs(int* count) { } gnBool gnSupportsRenderingAPI(gnRenderingAPI api) { - for (int i = 0; i < 3; i++) if (api == renderingAPIs[i]) return gnTrue; - return gnFalse; + for (int i = 0; i < 3; i++) if (api == renderingAPIs[i]) return GN_TRUE; + return GN_FALSE; } CAMetalLayer* gnCreateCAMetalLayer(NSWindow* window) { diff --git a/projects/validation_layers/function_loader/src/instance_functions.c b/projects/validation_layers/function_loader/src/instance_functions.c index 40ab1ef..5c1be9c 100644 --- a/projects/validation_layers/function_loader/src/instance_functions.c +++ b/projects/validation_layers/function_loader/src/instance_functions.c @@ -16,7 +16,7 @@ gnPhysicalDevice* checkGetPhysicalDevices(gnInstanceHandle instance, uint32_t* c CHECK_RETURNED_FUNCTION(instance, _gnGetPhysicalDevices, instanceFunctions, NULL, instance, count); } gnBool checkCanDevicePresent(gnPhysicalDevice device, gnWindowSurfaceHandle windowSurface) { - CHECK_RETURNED_FUNCTION(device->instance, _gnPhysicalDeviceCanPresentToSurface, instanceFunctions, gnFalse, device, windowSurface); + CHECK_RETURNED_FUNCTION(device->instance, _gnPhysicalDeviceCanPresentToSurface, instanceFunctions, GN_FALSE, device, windowSurface); } gnReturnCode checkCreateOutputDevice(gnOutputDeviceHandle device, gnInstanceHandle instance, gnOutputDeviceInfo deviceInfo) {