xash3d-fwgs/ref_vk/vk_rtx.h

66 lines
1.4 KiB
C
Raw Normal View History

2021-02-27 22:43:49 +01:00
#pragma once
#include "vk_core.h"
2021-04-09 23:59:04 +02:00
struct vk_render_model_s;
typedef struct {
struct vk_render_model_s *model;
VkBuffer buffer;
} vk_ray_model_init_t;
qboolean VK_RayModelInit( vk_ray_model_init_t model_init);
void VK_RayModelDestroy( struct vk_render_model_s *model );
2021-02-27 22:43:49 +01:00
typedef struct {
//int lightmap, texture;
//int render_mode;
int texture_id;
uint32_t max_vertex;
uint32_t element_count;
2021-02-27 22:43:49 +01:00
uint32_t index_offset, vertex_offset;
VkBuffer buffer;
2021-03-21 00:21:26 +01:00
const matrix3x4 *transform_row;
2021-03-15 18:49:45 +01:00
struct { float r,g,b; } emissive;
} vk_ray_model_dynamic_t;
2021-02-27 22:43:49 +01:00
2021-04-09 23:59:04 +02:00
void VK_RayFrameBegin( void );
void VK_RayFrameAddModel( const struct vk_render_model_s *model, const matrix3x4 *transform_row );
void VK_RayFrameAddModelDynamic(VkCommandBuffer cmdbuf, const vk_ray_model_dynamic_t* model);
typedef struct {
VkCommandBuffer cmdbuf;
struct {
VkImageView image_view;
VkImage image;
uint32_t width, height;
} dst;
// TODO inv_view/proj matrices
struct {
VkBuffer buffer;
uint32_t offset;
uint32_t size;
} ubo;
struct {
VkBuffer buffer;
uint32_t offset;
uint32_t size;
} dlights;
// Buffer holding vertex and index data
struct {
VkBuffer buffer; // must be the same as in vk_ray_model_create_t TODO: validate or make impossible to specify incorrectly
uint32_t size;
} geometry_data;
2021-04-09 23:59:04 +02:00
} vk_ray_frame_render_args_t;
void VK_RayFrameEnd(const vk_ray_frame_render_args_t* args);
void VK_RayNewMap( void );
2021-02-27 22:43:49 +01:00
qboolean VK_RayInit( void );
void VK_RayShutdown( void );