platform loaders take in loader info
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
#include <commands/command_buffer/vulkan_command_buffer.h>
|
||||
#include <commands/commands/vulkan_commands.h>
|
||||
|
||||
gnCommandFunctions loadVulkanCommandFunctions() {
|
||||
gnCommandFunctions loadVulkanCommandFunctions(loaderInfo info) {
|
||||
return (gnCommandFunctions){
|
||||
._gnCommandPoolAllocateCommandBuffers = allocateCommandBuffers,
|
||||
._gnBeginCommandBuffer = beginCommandBuffer,
|
||||
|
@@ -15,7 +15,7 @@
|
||||
#include <submit/vulkan_submit.h>
|
||||
#include <output_device/vulkan_output_devices.h>
|
||||
|
||||
gnDeviceFunctions loadVulkanDeviceFunctions() {
|
||||
gnDeviceFunctions loadVulkanDeviceFunctions(loaderInfo info) {
|
||||
return (gnDeviceFunctions){
|
||||
._gnCreatePresentationQueue = createPresentationQueue,
|
||||
._gnPresentationQueueGetImage = getPresentQueueImage,
|
||||
|
@@ -4,7 +4,7 @@
|
||||
#include <output_device/vulkan_output_devices.h>
|
||||
#include <vulkan_surface/vulkan_surface.h>
|
||||
|
||||
gnInstanceFunctions loadVulkanInstanceFunctions() {
|
||||
gnInstanceFunctions loadVulkanInstanceFunctions(loaderInfo info) {
|
||||
return (gnInstanceFunctions){
|
||||
._gnCreateInstance = createInstance,
|
||||
._gnDestroyInstance = destroyInstance,
|
||||
|
@@ -2,7 +2,8 @@
|
||||
#include "loader/src/gryphn_instance_functions.h"
|
||||
#include "loader/src/gryphn_device_functions.h"
|
||||
#include "loader/src/gryphn_command_functions.h"
|
||||
#include "loader/src/gryphn_loader_info.h"
|
||||
|
||||
gnInstanceFunctions loadVulkanInstanceFunctions();
|
||||
gnDeviceFunctions loadVulkanDeviceFunctions();
|
||||
gnCommandFunctions loadVulkanCommandFunctions();
|
||||
gnInstanceFunctions loadVulkanInstanceFunctions(loaderInfo info);
|
||||
gnDeviceFunctions loadVulkanDeviceFunctions(loaderInfo info);
|
||||
gnCommandFunctions loadVulkanCommandFunctions(loaderInfo info);
|
||||
|
@@ -4,7 +4,7 @@
|
||||
gnInstanceFunctions loadInstanceFunctions(loaderInfo info) {
|
||||
switch (info.api) {
|
||||
case GN_RENDERINGAPI_NONE: return (gnInstanceFunctions){ NULL };
|
||||
case GN_RENDERINGAPI_VULKAN: return loadVulkanInstanceFunctions();
|
||||
case GN_RENDERINGAPI_VULKAN: return loadVulkanInstanceFunctions(info);
|
||||
|
||||
case GN_RENDERINGAPI_SOFTWARE: return (gnInstanceFunctions){ NULL };
|
||||
case GN_RENDERINGAPI_DIRECTX11: return (gnInstanceFunctions){ NULL };
|
||||
@@ -17,7 +17,7 @@ gnInstanceFunctions loadInstanceFunctions(loaderInfo info) {
|
||||
gnDeviceFunctions loadDeviceFunctions(loaderInfo info) {
|
||||
switch (info.api) {
|
||||
case GN_RENDERINGAPI_NONE: return (gnDeviceFunctions){ NULL };
|
||||
case GN_RENDERINGAPI_VULKAN: return loadVulkanDeviceFunctions();
|
||||
case GN_RENDERINGAPI_VULKAN: return loadVulkanDeviceFunctions(info);
|
||||
|
||||
case GN_RENDERINGAPI_SOFTWARE: return (gnDeviceFunctions){ NULL };
|
||||
case GN_RENDERINGAPI_DIRECTX11: return (gnDeviceFunctions){ NULL };
|
||||
@@ -30,7 +30,7 @@ gnDeviceFunctions loadDeviceFunctions(loaderInfo info) {
|
||||
gnCommandFunctions loadCommandFunctions(loaderInfo info) {
|
||||
switch (info.api) {
|
||||
case GN_RENDERINGAPI_NONE: return (gnCommandFunctions){ NULL };
|
||||
case GN_RENDERINGAPI_VULKAN: return loadVulkanCommandFunctions();
|
||||
case GN_RENDERINGAPI_VULKAN: return loadVulkanCommandFunctions(info);
|
||||
|
||||
case GN_RENDERINGAPI_SOFTWARE: return (gnCommandFunctions){ NULL };
|
||||
case GN_RENDERINGAPI_DIRECTX11: return (gnCommandFunctions){ NULL };
|
||||
|
@@ -1,12 +1,8 @@
|
||||
#pragma once
|
||||
#include "gryphn_rendering_api.h"
|
||||
#include "gryphn_instance_functions.h"
|
||||
#include "gryphn_device_functions.h"
|
||||
#include "gryphn_command_functions.h"
|
||||
|
||||
typedef struct loaderInfo {
|
||||
gnRenderingAPI api;
|
||||
} loaderInfo;
|
||||
#include "gryphn_loader_info.h"
|
||||
|
||||
gnInstanceFunctions loadInstanceFunctions(loaderInfo info);
|
||||
gnDeviceFunctions loadDeviceFunctions(loaderInfo info);
|
||||
|
6
projects/loader/src/gryphn_loader_info.h
Normal file
6
projects/loader/src/gryphn_loader_info.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#pragma once
|
||||
#include "gryphn_rendering_api.h"
|
||||
|
||||
typedef struct loaderInfo {
|
||||
gnRenderingAPI api;
|
||||
} loaderInfo;
|
Reference in New Issue
Block a user