rename gnPhysicalOutputDevice -> gnPhysicalDevice
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
// core functionality
|
// core functionality
|
||||||
#include <core/src/instance/gryphn_instance.h>
|
#include <core/src/instance/gryphn_instance.h>
|
||||||
#include <core/src/output_device/gryphn_physical_output_device.h>
|
#include <core/src/output_device/gryphn_physical_device.h>
|
||||||
#include <core/src/window_surface/gryphn_surface.h>
|
#include <core/src/window_surface/gryphn_surface.h>
|
||||||
#include <core/src/window_surface/gryphn_surface_create_functions.h>
|
#include <core/src/window_surface/gryphn_surface_create_functions.h>
|
||||||
#include <core/src/presentation_queue/gryphn_presentation_queue.h>
|
#include <core/src/presentation_queue/gryphn_presentation_queue.h>
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
#include <output_device/gryphn_physical_output_device.h>
|
#include <output_device/gryphn_physical_device.h>
|
||||||
#include <Metal/Metal.h>
|
#include <Metal/Metal.h>
|
||||||
#include "metal_output_devices.h"
|
#include "metal_output_devices.h"
|
||||||
#include "instance/metal_instance.h"
|
#include "instance/metal_instance.h"
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
#include <output_device/gryphn_physical_output_device.h>
|
#include <output_device/gryphn_physical_device.h>
|
||||||
#include <Metal/Metal.h>
|
#include <Metal/Metal.h>
|
||||||
#include "metal_output_devices.h"
|
#include "metal_output_devices.h"
|
||||||
#include "window_surface/gryphn_surface.h"
|
#include "window_surface/gryphn_surface.h"
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#include "vulkan_device_queues.h"
|
#include "vulkan_device_queues.h"
|
||||||
#include "output_device/vulkan_output_devices.h"
|
#include "output_device/vulkan_output_devices.h"
|
||||||
|
|
||||||
gnReturnCode vulkanPhysicalDeviceQueueProperties(gnPhysicalOutputDeviceHandle device, uint32_t queueFamilyCount, gnQueueFamilyProperties* queues) {
|
gnReturnCode vulkanPhysicalDeviceQueueProperties(gnPhysicalDeviceHandle device, uint32_t queueFamilyCount, gnQueueFamilyProperties* queues) {
|
||||||
vkGetPhysicalDeviceQueueFamilyProperties(device->physicalDevice->device, &queueFamilyCount, NULL);
|
vkGetPhysicalDeviceQueueFamilyProperties(device->physicalDevice->device, &queueFamilyCount, NULL);
|
||||||
if (queues == NULL) return GN_SUCCESS;
|
if (queues == NULL) return GN_SUCCESS;
|
||||||
|
|
||||||
|
@@ -4,5 +4,5 @@
|
|||||||
#include <output_device/vulkan_physical_device.h>
|
#include <output_device/vulkan_physical_device.h>
|
||||||
#include <extensions/queues/gryphn_physcial_device_queue.h>
|
#include <extensions/queues/gryphn_physcial_device_queue.h>
|
||||||
|
|
||||||
gnReturnCode vulkanPhysicalDeviceQueueProperties(gnPhysicalOutputDeviceHandle device, uint32_t queueFamilyCount, gnQueueFamilyProperties* queues);
|
gnReturnCode vulkanPhysicalDeviceQueueProperties(gnPhysicalDeviceHandle device, uint32_t queueFamilyCount, gnQueueFamilyProperties* queues);
|
||||||
void getVulkanDeviceQueue(gnOutputDevice device, uint32_t queueFamily, uint32_t queueIndex, gnQueue* queue);
|
void getVulkanDeviceQueue(gnOutputDevice device, uint32_t queueFamily, uint32_t queueIndex, gnQueue* queue);
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <vulkan/vulkan.h>
|
#include <vulkan/vulkan.h>
|
||||||
#include <output_device/gryphn_physical_output_device.h>
|
#include <output_device/gryphn_physical_device.h>
|
||||||
|
|
||||||
typedef struct vulkanNeededQueue {
|
typedef struct vulkanNeededQueue {
|
||||||
VkQueueFlags createFlags;
|
VkQueueFlags createFlags;
|
||||||
|
@@ -20,14 +20,12 @@ typedef struct handle##_t* alias##Handle; \
|
|||||||
typedef struct handle##_t* alias
|
typedef struct handle##_t* alias
|
||||||
|
|
||||||
GN_HANDLE(gnInstance);
|
GN_HANDLE(gnInstance);
|
||||||
|
GN_HANDLE(gnPhysicalDevice); // NOTE: needs to become a impl handle
|
||||||
|
|
||||||
GN_HANDLE(gnWindowSurface);
|
GN_HANDLE(gnWindowSurface);
|
||||||
GN_HANDLE(gnPresentationQueue);
|
GN_HANDLE(gnPresentationQueue);
|
||||||
GN_HANDLE(gnTexture);
|
GN_HANDLE(gnTexture);
|
||||||
GN_HANDLE(gnRenderPassDescriptor);
|
GN_HANDLE(gnRenderPassDescriptor);
|
||||||
GN_HANDLE(gnPhysicalOutputDevice);
|
|
||||||
GN_HANDLE_ALIAS(gnPhysicalOutputDevice, gnPhysicalDevice);
|
|
||||||
GN_HANDLE(gnOutputDevice);
|
GN_HANDLE(gnOutputDevice);
|
||||||
GN_HANDLE_ALIAS(gnOutputDevice, gnDevice);
|
GN_HANDLE_ALIAS(gnOutputDevice, gnDevice);
|
||||||
GN_HANDLE(gnShaderModule);
|
GN_HANDLE(gnShaderModule);
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <output_device/gryphn_physical_output_device.h>
|
#include <output_device/gryphn_physical_device.h>
|
||||||
#include <core/gryphn_return_code.h>
|
#include <core/gryphn_return_code.h>
|
||||||
|
|
||||||
typedef struct gnOutputDeviceEnabledFeatures {
|
typedef struct gnOutputDeviceEnabledFeatures {
|
||||||
|
17
projects/core/src/output_device/gryphn_physical_device.c
Normal file
17
projects/core/src/output_device/gryphn_physical_device.c
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
#include "gryphn_physical_device.h"
|
||||||
|
#include "instance/gryphn_instance.h"
|
||||||
|
#include "loader/src/gryphn_instance_functions.h"
|
||||||
|
|
||||||
|
gnPhysicalDeviceHandle* gnGetPhyscialDevices(gnInstanceHandle instance, uint32_t* count) {;
|
||||||
|
gnPhysicalDeviceHandle* devices = instance->callingLayer->instanceFunctions._gnGetPhysicalDevices(instance, count);
|
||||||
|
for (uint32_t i = 0; i < *count; i++)
|
||||||
|
devices[i]->instance = instance;
|
||||||
|
return devices;
|
||||||
|
}
|
||||||
|
|
||||||
|
gnBool gnPhysicalDeviceCanPresentToSurface(gnPhysicalDeviceHandle device, gnWindowSurfaceHandle windowSurface) {
|
||||||
|
return device->instance->callingLayer->instanceFunctions._gnPhysicalDeviceCanPresentToSurface(device, windowSurface);
|
||||||
|
}
|
||||||
|
|
||||||
|
gnPhysicalDeviceProperties gnGetPhysicalDeviceProperties(gnPhysicalDeviceHandle device) { return device->properties; }
|
||||||
|
gnPhysicalDeviceFeatures gnGetPhysicalDeviceFeatures(gnPhysicalDeviceHandle device) { return device->features; }
|
@@ -29,7 +29,7 @@ typedef struct gnPhysicalDeviceFeatures {
|
|||||||
} gnPhysicalDeviceFeatures;
|
} gnPhysicalDeviceFeatures;
|
||||||
|
|
||||||
#ifdef GN_REVEAL_IMPL
|
#ifdef GN_REVEAL_IMPL
|
||||||
typedef struct gnPhysicalOutputDevice_t {
|
typedef struct gnPhysicalDevice_t {
|
||||||
struct gnPlatformPhysicalDevice_t* physicalDevice;
|
struct gnPlatformPhysicalDevice_t* physicalDevice;
|
||||||
gnPhysicalDeviceProperties properties;
|
gnPhysicalDeviceProperties properties;
|
||||||
gnPhysicalDeviceFeatures features;
|
gnPhysicalDeviceFeatures features;
|
||||||
@@ -38,8 +38,8 @@ typedef struct gnPhysicalOutputDevice_t {
|
|||||||
} gnPhysicalOutputDevice_t;
|
} gnPhysicalOutputDevice_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
gnPhysicalOutputDeviceHandle* gnGetPhyscialDevices(gnInstanceHandle instance, uint32_t* count);
|
gnPhysicalDeviceHandle* gnGetPhyscialDevices(gnInstanceHandle instance, uint32_t* count);
|
||||||
gnBool gnPhysicalDeviceCanPresentToSurface(gnPhysicalOutputDeviceHandle device, gnWindowSurfaceHandle windowSurface);
|
gnBool gnPhysicalDeviceCanPresentToSurface(gnPhysicalDeviceHandle device, gnWindowSurfaceHandle windowSurface);
|
||||||
|
|
||||||
gnPhysicalDeviceProperties gnGetPhysicalDeviceProperties(gnPhysicalOutputDeviceHandle device);
|
gnPhysicalDeviceProperties gnGetPhysicalDeviceProperties(gnPhysicalDeviceHandle device);
|
||||||
gnPhysicalDeviceFeatures gnGetPhysicalDeviceFeatures(gnPhysicalOutputDeviceHandle device);
|
gnPhysicalDeviceFeatures gnGetPhysicalDeviceFeatures(gnPhysicalDeviceHandle device);
|
@@ -1,17 +0,0 @@
|
|||||||
#include "gryphn_physical_output_device.h"
|
|
||||||
#include "instance/gryphn_instance.h"
|
|
||||||
#include "loader/src/gryphn_instance_functions.h"
|
|
||||||
|
|
||||||
gnPhysicalOutputDeviceHandle* gnGetPhyscialDevices(gnInstanceHandle instance, uint32_t* count) {;
|
|
||||||
gnPhysicalOutputDeviceHandle* devices = instance->callingLayer->instanceFunctions._gnGetPhysicalDevices(instance, count);
|
|
||||||
for (uint32_t i = 0; i < *count; i++)
|
|
||||||
devices[i]->instance = instance;
|
|
||||||
return devices;
|
|
||||||
}
|
|
||||||
|
|
||||||
gnBool gnPhysicalDeviceCanPresentToSurface(gnPhysicalOutputDeviceHandle device, gnWindowSurfaceHandle windowSurface) {
|
|
||||||
return device->instance->callingLayer->instanceFunctions._gnPhysicalDeviceCanPresentToSurface(device, windowSurface);
|
|
||||||
}
|
|
||||||
|
|
||||||
gnPhysicalDeviceProperties gnGetPhysicalDeviceProperties(gnPhysicalOutputDeviceHandle device) { return device->properties; }
|
|
||||||
gnPhysicalDeviceFeatures gnGetPhysicalDeviceFeatures(gnPhysicalOutputDeviceHandle device) { return device->features; }
|
|
@@ -2,7 +2,7 @@
|
|||||||
#include "stdint.h"
|
#include "stdint.h"
|
||||||
#include "core/gryphn_image_format.h"
|
#include "core/gryphn_image_format.h"
|
||||||
#include "core/gryphn_return_code.h"
|
#include "core/gryphn_return_code.h"
|
||||||
#include "core/src/output_device/gryphn_physical_output_device.h"
|
#include "core/src/output_device/gryphn_physical_device.h"
|
||||||
#include "gryphn_handles.h"
|
#include "gryphn_handles.h"
|
||||||
|
|
||||||
typedef enum gnRenderPassStage {
|
typedef enum gnRenderPassStage {
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
#include "core/gryphn_image_format.h"
|
#include "core/gryphn_image_format.h"
|
||||||
#include "core/gryphn_return_code.h"
|
#include "core/gryphn_return_code.h"
|
||||||
#include "utils/math/gryphn_vec3.h"
|
#include "utils/math/gryphn_vec3.h"
|
||||||
#include "core/src/output_device/gryphn_physical_output_device.h"
|
#include "core/src/output_device/gryphn_physical_device.h"
|
||||||
#include <gryphn_handles.h>
|
#include <gryphn_handles.h>
|
||||||
|
|
||||||
typedef enum gnTextureType {
|
typedef enum gnTextureType {
|
||||||
|
@@ -16,4 +16,4 @@ typedef struct gnQueueFamilyProperties {
|
|||||||
gnQueueTypeFlags queueTypeFlags;
|
gnQueueTypeFlags queueTypeFlags;
|
||||||
} gnQueueFamilyProperties;
|
} gnQueueFamilyProperties;
|
||||||
|
|
||||||
gnReturnCode gnGetPhysicalDeviceQueueProperties(gnPhysicalOutputDeviceHandle device, uint32_t queueCount, gnQueueFamilyProperties* queues);
|
gnReturnCode gnGetPhysicalDeviceQueueProperties(gnPhysicalDeviceHandle device, uint32_t queueCount, gnQueueFamilyProperties* queues);
|
||||||
|
@@ -10,7 +10,7 @@ typedef struct gnPresentInfo gnPresentInfo;
|
|||||||
typedef struct gnPresentSyncInfo gnPresentSyncInfo;
|
typedef struct gnPresentSyncInfo gnPresentSyncInfo;
|
||||||
|
|
||||||
typedef struct gnQueueExtFunctions {
|
typedef struct gnQueueExtFunctions {
|
||||||
gnReturnCode (*_gnGetPhysicalDeviceQueueProperties)(gnPhysicalOutputDeviceHandle device, uint32_t queueCount, gnQueueFamilyProperties* queues);
|
gnReturnCode (*_gnGetPhysicalDeviceQueueProperties)(gnPhysicalDeviceHandle device, uint32_t queueCount, gnQueueFamilyProperties* queues);
|
||||||
void (*_gnGetDeviceQueue)(gnOutputDevice device, uint32_t queueFamily, uint32_t queueIndex, gnQueue* queue);
|
void (*_gnGetDeviceQueue)(gnOutputDevice device, uint32_t queueFamily, uint32_t queueIndex, gnQueue* queue);
|
||||||
|
|
||||||
gnReturnCode (*_gnQueueSubmit)(gnOutputDevice device, gnQueue queue, gnSubmitInfo info);
|
gnReturnCode (*_gnQueueSubmit)(gnOutputDevice device, gnQueue queue, gnSubmitInfo info);
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
#include "queue_functions.h"
|
#include "queue_functions.h"
|
||||||
#include "loader_utils.h"
|
#include "loader_utils.h"
|
||||||
#include "core/src/output_device/gryphn_physical_output_device.h"
|
#include "core/src/output_device/gryphn_physical_device.h"
|
||||||
#include "core/src/output_device/gryphn_output_device.h"
|
#include "core/src/output_device/gryphn_output_device.h"
|
||||||
#include <core/src/instance/gryphn_debugger.h>
|
#include <core/src/instance/gryphn_debugger.h>
|
||||||
#include <core/src/instance/gryphn_instance.h>
|
#include <core/src/instance/gryphn_instance.h>
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
#include "extensions/synchronization/commands/gryphn_sync_submit.h"
|
#include "extensions/synchronization/commands/gryphn_sync_submit.h"
|
||||||
#include "extensions/synchronization/commands/gryphn_sync_present.h"
|
#include "extensions/synchronization/commands/gryphn_sync_present.h"
|
||||||
|
|
||||||
gnReturnCode checkGetPhysicalDeviceQueueProperties(gnPhysicalOutputDeviceHandle device, uint32_t queueCount, gnQueueFamilyProperties* queues) {
|
gnReturnCode checkGetPhysicalDeviceQueueProperties(gnPhysicalDeviceHandle device, uint32_t queueCount, gnQueueFamilyProperties* queues) {
|
||||||
CHECK_FUNCTION_WITH_RETURN_CODE(device->instance, _gnGetPhysicalDeviceQueueProperties, queueFunctions, device, queueCount, queues);
|
CHECK_FUNCTION_WITH_RETURN_CODE(device->instance, _gnGetPhysicalDeviceQueueProperties, queueFunctions, device, queueCount, queues);
|
||||||
}
|
}
|
||||||
void checkGetDeviceQueue(gnOutputDevice device, uint32_t queueFamily, uint32_t queueIndex, gnQueue* queue) {
|
void checkGetDeviceQueue(gnOutputDevice device, uint32_t queueFamily, uint32_t queueIndex, gnQueue* queue) {
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
#include <loader/src/gryphn_loader.h>
|
#include <loader/src/gryphn_loader.h>
|
||||||
|
|
||||||
gnReturnCode checkGetPhysicalDeviceQueueProperties(gnPhysicalOutputDeviceHandle device, uint32_t queueCount, gnQueueFamilyProperties* queues);
|
gnReturnCode checkGetPhysicalDeviceQueueProperties(gnPhysicalDeviceHandle device, uint32_t queueCount, gnQueueFamilyProperties* queues);
|
||||||
void checkGetDeviceQueue(gnOutputDevice device, uint32_t queueFamily, uint32_t queueIndex, gnQueue* queue);
|
void checkGetDeviceQueue(gnOutputDevice device, uint32_t queueFamily, uint32_t queueIndex, gnQueue* queue);
|
||||||
|
|
||||||
gnReturnCode checkQueueSubmit(gnOutputDevice device, gnQueue queue, gnSubmitInfo info);
|
gnReturnCode checkQueueSubmit(gnOutputDevice device, gnQueue queue, gnSubmitInfo info);
|
||||||
|
Reference in New Issue
Block a user