formatted license comment
This commit is contained in:
parent
db5a728846
commit
0ffdb8c3ac
30 changed files with 16218 additions and 14914 deletions
10
vk/device.c
10
vk/device.c
|
|
@ -1,4 +1,4 @@
|
|||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
/* SPDX-License-Identifier:BSD-3-Clause */
|
||||
#include "device.h"
|
||||
#include "physical_device.h"
|
||||
#include "../core/vector.h"
|
||||
|
|
@ -13,10 +13,10 @@ void vk_device_init(struct renderer_context *context)
|
|||
for (usize i = 0; i < physical_device_extensions->length; i++) {
|
||||
if (strcmp(((char **)physical_device_extensions->data)[i], "VK_KHR_portability_subset") == 0) {
|
||||
/*
|
||||
* The spec states that if VK_KHR_portability_subset
|
||||
* is present in the physical device extensions,
|
||||
* the device should also have that extension enabled.
|
||||
*/
|
||||
* The spec states that if VK_KHR_portability_subset is
|
||||
* present in the physical device extensions, the
|
||||
* device should also have that extension enabled.
|
||||
*/
|
||||
vector_push(device_extensions, char *, "VK_KHR_portability_subset");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
/* SPDX-License-Identifier:BSD-3-Clause */
|
||||
#ifndef DEVICE_H
|
||||
#define DEVICE_H
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// SPDX - License - Identifier:BSD - 3 - Clause
|
||||
/* SPDX-License-Identifier:BSD-3-Clause */
|
||||
#include "instance.h"
|
||||
#include "../core/log.h"
|
||||
#define RGFW_VULKAN
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
/* SPDX-License-Identifier:BSD-3-Clause */
|
||||
#ifndef INSTANCE_H
|
||||
#define INSTANCE_H
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
/* SPDX-License-Identifier:BSD-3-Clause */
|
||||
#include "physical_device.h"
|
||||
#include "../core/log.h"
|
||||
#include <stdio.h>
|
||||
|
|
@ -34,7 +34,7 @@ struct vector *vk_physical_device_get_extensions(struct renderer_context *contex
|
|||
VkExtensionProperties *properties = NULL;
|
||||
|
||||
vkEnumerateDeviceExtensionProperties(context->physical_device, NULL, &property_count, NULL);
|
||||
|
||||
|
||||
struct vector *extensions = vector_init(property_count, sizeof(char *));
|
||||
properties = (VkExtensionProperties *) malloc(sizeof(VkExtensionProperties) * property_count);
|
||||
|
||||
|
|
@ -50,7 +50,7 @@ struct vector *vk_physical_device_get_extensions(struct renderer_context *contex
|
|||
}
|
||||
|
||||
free(properties);
|
||||
|
||||
|
||||
return extensions;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
/* SPDX-License-Identifier:BSD-3-Clause */
|
||||
#ifndef PHYSICAL_DEVICE_H
|
||||
#define PHYSICAL_DEVICE_H
|
||||
|
||||
|
|
@ -8,21 +8,18 @@
|
|||
|
||||
|
||||
/*
|
||||
* Get the list of all available devices and
|
||||
* pick the best option.
|
||||
* Get the list of all available devices and pick the best option.
|
||||
*/
|
||||
void vk_physical_device_pick(struct renderer_context *context);
|
||||
/*
|
||||
* Get the list of all available device
|
||||
* extensions and return a vector containing
|
||||
* those.
|
||||
* Get the list of all available device extensions and return a vector
|
||||
* containing those.
|
||||
*/
|
||||
struct vector *vk_physical_device_get_extensions(struct renderer_context *context);
|
||||
/*
|
||||
* The physical device is responsible of selecting
|
||||
* the queue family indices, used later by the
|
||||
* device to create the queues. This function
|
||||
* sets the family indices in the renderer context.
|
||||
* The physical device is responsible of selecting the queue family indices,
|
||||
* used later by the device to create the queues. This function sets the family
|
||||
* indices in the renderer context.
|
||||
*/
|
||||
void vk_physical_device_select_family_indices(struct renderer_context *context);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
/* SPDX-License-Identifier:BSD-3-Clause */
|
||||
|
||||
#define RGFW_VULKAN
|
||||
#define RGFW_IMPLEMENTATION
|
||||
|
|
@ -14,18 +14,17 @@
|
|||
#include "../rendering/renderer.h"
|
||||
|
||||
/*
|
||||
* This function is the entrypoint for the whole
|
||||
* game. Its role is to initialize Vulkan, create
|
||||
* the renderer and start the game loop.
|
||||
* This function is the entrypoint for the whole game. Its role is to
|
||||
* initialize Vulkan, create the renderer and start the game loop.
|
||||
*/
|
||||
int platform_run(i32 argc, u8 **argv)
|
||||
int platform_run(i32 argc, u8 * *argv)
|
||||
{
|
||||
(void) argc;
|
||||
(void) argv;
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
|
||||
log_info("Using Vulkan as rendering backend.\n");
|
||||
|
||||
RGFW_window* win = RGFW_createWindow("topaz", 0, 0, 800, 600, RGFW_windowCenter | RGFW_windowNoResize | RGFW_windowHide);
|
||||
RGFW_window *win = RGFW_createWindow("topaz", 0, 0, 800, 600, RGFW_windowCenter | RGFW_windowNoResize | RGFW_windowHide);
|
||||
RGFW_window_show(win);
|
||||
RGFW_window_setExitKey(win, RGFW_escape);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
/* SPDX-License-Identifier:BSD-3-Clause */
|
||||
#include "../rendering/renderer.h"
|
||||
#include "instance.h"
|
||||
#include "physical_device.h"
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
struct renderer_context *renderer_context_init(void)
|
||||
{
|
||||
struct renderer_context *context = (struct renderer_context *) arena_alloc(global_arena, (sizeof(struct renderer_context)));
|
||||
struct renderer_context *context = (struct renderer_context *)arena_alloc(global_arena, (sizeof(struct renderer_context)));
|
||||
|
||||
vk_instance_init(context);
|
||||
vk_physical_device_pick(context);
|
||||
|
|
@ -32,10 +32,10 @@ struct mesh *renderer_build_chunk_mesh(void)
|
|||
|
||||
void renderer_draw_mesh(struct mesh mesh)
|
||||
{
|
||||
(void) mesh;
|
||||
(void)mesh;
|
||||
}
|
||||
|
||||
void renderer_draw_chunk(struct mesh mesh)
|
||||
{
|
||||
(void) mesh;
|
||||
(void)mesh;
|
||||
}
|
||||
|
|
|
|||
2
vk/vk.h
2
vk/vk.h
|
|
@ -1,4 +1,4 @@
|
|||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
/* SPDX-License-Identifier:BSD-3-Clause */
|
||||
#ifndef VK_H
|
||||
#define VK_H
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue