2023-10-20 18:39:14 +02:00
|
|
|
#pragma once
|
2023-10-24 17:32:42 +02:00
|
|
|
|
|
|
|
#include "r_textures.h"
|
2023-10-20 18:39:14 +02:00
|
|
|
#include "vk_core.h"
|
|
|
|
#include "vk_image.h"
|
|
|
|
#include "vk_const.h"
|
|
|
|
|
2023-10-24 20:02:32 +02:00
|
|
|
#include "unordered_roadmap.h"
|
|
|
|
|
2023-10-20 18:39:14 +02:00
|
|
|
typedef struct vk_texture_s
|
|
|
|
{
|
2023-10-24 20:02:32 +02:00
|
|
|
urmom_header_t hdr_;
|
|
|
|
|
2023-10-30 18:43:09 +01:00
|
|
|
int width, height, depth;
|
2023-10-20 19:04:33 +02:00
|
|
|
uint32_t flags;
|
2023-10-20 18:39:14 +02:00
|
|
|
int total_size;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
r_vk_image_t image;
|
2023-10-30 18:43:09 +01:00
|
|
|
|
|
|
|
// TODO external table
|
2023-10-20 18:39:14 +02:00
|
|
|
VkDescriptorSet descriptor_unorm;
|
|
|
|
} vk;
|
|
|
|
|
|
|
|
int refcount;
|
2023-10-27 15:33:01 +02:00
|
|
|
qboolean ref_interface_visible;
|
2023-10-20 18:39:14 +02:00
|
|
|
|
|
|
|
// TODO "cache" eviction
|
|
|
|
// int used_maps_ago;
|
|
|
|
} vk_texture_t;
|
|
|
|
|
2023-10-24 20:02:32 +02:00
|
|
|
#define TEX_NAME(tex) ((tex)->hdr_.key)
|
|
|
|
|
2023-10-20 18:39:14 +02:00
|
|
|
qboolean R_VkTexturesInit( void );
|
|
|
|
void R_VkTexturesShutdown( void );
|
|
|
|
|
2024-02-05 19:21:21 +01:00
|
|
|
qboolean R_VkTexturesSkyboxUpload( const char *name, const rgbdata_t *pic, colorspace_hint_e colorspace_hint, skybox_slot_e skybox_slot );
|
2023-12-14 16:33:26 +01:00
|
|
|
void R_VkTexturesSkyboxUnload(void);
|
2023-10-20 18:39:14 +02:00
|
|
|
|
2023-12-14 19:40:34 +01:00
|
|
|
qboolean R_VkTextureUpload(int index, vk_texture_t *tex, const rgbdata_t *pic, colorspace_hint_e colorspace_hint);
|
2023-10-24 18:24:14 +02:00
|
|
|
void R_VkTextureDestroy(int index, vk_texture_t *tex);
|
2023-10-20 18:39:14 +02:00
|
|
|
|
2024-02-05 19:21:21 +01:00
|
|
|
VkDescriptorImageInfo R_VkTexturesGetSkyboxDescriptorImageInfo( skybox_slot_e slot );
|
2023-10-24 17:32:42 +02:00
|
|
|
const VkDescriptorImageInfo* R_VkTexturesGetAllDescriptorsArray( void );
|
|
|
|
VkDescriptorSet R_VkTextureGetDescriptorUnorm( uint index );
|
2023-10-30 18:43:09 +01:00
|
|
|
|
|
|
|
VkDescriptorImageInfo R_VkTexturesGetBlueNoiseImageInfo( void );
|