From 193fe6348cc0e348a3b1c39b97544a8e8ea95aef Mon Sep 17 00:00:00 2001 From: Gregory Wells Date: Sun, 3 Aug 2025 11:47:59 -0400 Subject: [PATCH] move image format over to core --- .../src/framebuffers/metal_framebuffer.h | 2 +- .../src/framebuffers/metal_framebuffer.m | 2 +- projects/core/gryphn_image_format.h | 27 +++++++++++++++++++ .../gryphn_presentation_queue.h | 2 +- .../gryphn_render_pass_descriptor.h | 2 +- projects/core/src/textures/gryphn_texture.h | 2 +- .../core/src/window_surface/gryphn_surface.h | 2 +- projects/utils | 2 +- 8 files changed, 34 insertions(+), 7 deletions(-) create mode 100644 projects/core/gryphn_image_format.h diff --git a/projects/apis/metal/src/framebuffers/metal_framebuffer.h b/projects/apis/metal/src/framebuffers/metal_framebuffer.h index 00d3929..89f7a07 100644 --- a/projects/apis/metal/src/framebuffers/metal_framebuffer.h +++ b/projects/apis/metal/src/framebuffers/metal_framebuffer.h @@ -1,7 +1,7 @@ #pragma once #include "framebuffer/gryphn_framebuffer.h" #include "utils/gryphn_bool.h" -#include "utils/gryphn_image_format.h" +#include "core/gryphn_image_format.h" #include "utils/lists/gryphn_array_list.h" #include "renderpass/metal_render_pass.h" #import diff --git a/projects/apis/metal/src/framebuffers/metal_framebuffer.m b/projects/apis/metal/src/framebuffers/metal_framebuffer.m index 76778f1..2cf3dfd 100644 --- a/projects/apis/metal/src/framebuffers/metal_framebuffer.m +++ b/projects/apis/metal/src/framebuffers/metal_framebuffer.m @@ -3,7 +3,7 @@ #include "renderpass/gryphn_render_pass_descriptor.h" #include "instance/gryphn_instance.h" #include "output_device/gryphn_output_device.h" -#include "utils/gryphn_image_format.h" +#include "core/gryphn_image_format.h" gnReturnCode createMetalFramebuffer(gnFramebuffer framebuffer, gnOutputDevice device, gnFramebufferInfo info) { framebuffer->framebuffer = malloc(sizeof(struct gnPlatformFramebuffer_t)); diff --git a/projects/core/gryphn_image_format.h b/projects/core/gryphn_image_format.h new file mode 100644 index 0000000..1a1b708 --- /dev/null +++ b/projects/core/gryphn_image_format.h @@ -0,0 +1,27 @@ +#pragma once + +typedef enum gnImageFormat { + GN_FORMAT_NONE, + GN_FORMAT_BGRA8_SRGB, + GN_FORMAT_BGRA8, + GN_FORMAT_RGBA8_SRGB, + GN_FORMAT_D24S8_UINT, + GN_FORMAT_D32S8_UINT, +} gnImageFormat; + +typedef enum gnColorSpace { + GN_COLOR_SPACE_NONE, + GN_COLOR_SPACE_SRGB_NONLINEAR +} gnColorSpace; + +typedef enum gnImageSharingMode { + GN_SHARING_MODE_EXCLUSIVE, GN_SHARING_MODE_CONCURRENT +} gnImageSharingMode; + +typedef enum gnImageLayout { + GN_LAYOUT_UNDEFINED, + GN_LAYOUT_PRESENTATION_QUEUE_IMAGE, + GN_LAYOUT_TRANSFER_DESTINATION, + GN_LAYOUT_DEPTH_STENCIL, + GN_LAYOUT_COLOR_ATTACHMENT +} gnImageLayout; diff --git a/projects/core/src/presentation_queue/gryphn_presentation_queue.h b/projects/core/src/presentation_queue/gryphn_presentation_queue.h index 3327046..99c18d1 100644 --- a/projects/core/src/presentation_queue/gryphn_presentation_queue.h +++ b/projects/core/src/presentation_queue/gryphn_presentation_queue.h @@ -1,5 +1,5 @@ #pragma once -#include +#include #include #include #include "gryphn_handles.h" diff --git a/projects/core/src/renderpass/gryphn_render_pass_descriptor.h b/projects/core/src/renderpass/gryphn_render_pass_descriptor.h index 6e11edd..61290cb 100644 --- a/projects/core/src/renderpass/gryphn_render_pass_descriptor.h +++ b/projects/core/src/renderpass/gryphn_render_pass_descriptor.h @@ -1,6 +1,6 @@ #pragma once #include "stdint.h" -#include "utils/gryphn_image_format.h" +#include "core/gryphn_image_format.h" #include "core/gryphn_return_code.h" #include "core/src/output_device/gryphn_physical_output_device.h" #include "gryphn_handles.h" diff --git a/projects/core/src/textures/gryphn_texture.h b/projects/core/src/textures/gryphn_texture.h index ffa6c04..a414d6b 100644 --- a/projects/core/src/textures/gryphn_texture.h +++ b/projects/core/src/textures/gryphn_texture.h @@ -1,5 +1,5 @@ #pragma once -#include "utils/gryphn_image_format.h" +#include "core/gryphn_image_format.h" #include "core/gryphn_return_code.h" #include "utils/math/gryphn_vec3.h" #include "core/src/output_device/gryphn_physical_output_device.h" diff --git a/projects/core/src/window_surface/gryphn_surface.h b/projects/core/src/window_surface/gryphn_surface.h index f3fb9f0..edfff74 100644 --- a/projects/core/src/window_surface/gryphn_surface.h +++ b/projects/core/src/window_surface/gryphn_surface.h @@ -1,6 +1,6 @@ #pragma once #include -#include +#include #include #include "utils/math/gryphn_vec2.h" diff --git a/projects/utils b/projects/utils index 0e6b2dd..ccfbc89 160000 --- a/projects/utils +++ b/projects/utils @@ -1 +1 @@ -Subproject commit 0e6b2dd8c5a0005939a220ec2fe2d795505d7862 +Subproject commit ccfbc896b377972eafa32b581b44a9cafd1761ac