Files
armorpaint/base/sources/backends/vulkan_gpu.h
T

47 lines
1.1 KiB
C
Raw Normal View History

2025-02-26 13:24:16 +01:00
#pragma once
2025-10-15 13:06:40 +02:00
#include <assert.h>
2025-02-26 13:24:16 +01:00
#include <stdbool.h>
#include <stdint.h>
#include <vulkan/vulkan_core.h>
2025-03-16 19:49:13 +01:00
typedef struct gpu_pipeline_impl {
2025-10-15 13:06:40 +02:00
VkPipeline pipeline;
2025-02-26 13:24:16 +01:00
VkPipelineLayout pipeline_layout;
2026-02-12 22:59:14 +01:00
VkDescriptorSet descriptor_set;
VkDescriptorSetLayout descriptor_set_layout;
2025-03-16 19:49:13 +01:00
} gpu_pipeline_impl_t;
2025-02-26 13:24:16 +01:00
typedef struct {
char *source;
2025-10-15 13:06:40 +02:00
int length;
2025-03-16 19:49:13 +01:00
} gpu_shader_impl_t;
2025-02-26 13:24:16 +01:00
typedef struct {
2025-10-15 13:06:40 +02:00
VkImage image;
2025-03-04 11:05:01 +01:00
VkDeviceMemory mem;
2025-10-15 13:06:40 +02:00
VkImageView view;
2025-03-16 19:49:13 +01:00
} gpu_texture_impl_t;
typedef struct {
2025-10-15 13:06:40 +02:00
VkBuffer buf;
2025-03-16 19:49:13 +01:00
VkDeviceMemory mem;
2026-04-29 07:30:40 +02:00
VkBuffer cpu_buf;
VkDeviceMemory cpu_mem;
2025-03-18 10:39:23 +01:00
} gpu_buffer_impl_t;
2025-02-26 13:24:16 +01:00
typedef struct {
VkAccelerationStructureKHR top_level_acceleration_structure;
VkAccelerationStructureKHR bottom_level_acceleration_structure[16];
2025-10-15 13:06:40 +02:00
uint64_t top_level_acceleration_structure_handle;
uint64_t bottom_level_acceleration_structure_handle[16];
2025-02-26 13:24:16 +01:00
2025-10-15 13:06:40 +02:00
VkBuffer bottom_level_buffer[16];
2025-02-26 13:24:16 +01:00
VkDeviceMemory bottom_level_mem[16];
2025-10-15 13:06:40 +02:00
VkBuffer top_level_buffer;
2025-02-26 13:24:16 +01:00
VkDeviceMemory top_level_mem;
2025-10-15 13:06:40 +02:00
VkBuffer instances_buffer;
2025-02-26 13:24:16 +01:00
VkDeviceMemory instances_mem;
2026-02-12 22:59:14 +01:00
} gpu_acceleration_structure_impl_t;