27#include "TracyVulkan.hpp"
29#define GLFW_INCLUDE_VULKAN
30#include <GLFW/glfw3.h>
37#include "imgui_impl_glfw.h"
38#include "imgui_impl_vulkan.h"
43#include <unordered_map>
68 VkVertexInputBindingDescription bindingDescription{};
69 bindingDescription.binding = 0;
70 bindingDescription.stride =
sizeof(
LineVertex);
71 bindingDescription.inputRate = VK_VERTEX_INPUT_RATE_VERTEX;
73 return bindingDescription;
78 std::vector<VkVertexInputAttributeDescription> attributeDescriptions(1);
80 attributeDescriptions[0].binding = 0;
81 attributeDescriptions[0].location = 0;
82 attributeDescriptions[0].format = VK_FORMAT_R32G32B32_SFLOAT;
85 return attributeDescriptions;
96 VkVertexInputBindingDescription bindingDescription{};
97 bindingDescription.binding = 0;
99 bindingDescription.inputRate = VK_VERTEX_INPUT_RATE_VERTEX;
101 return bindingDescription;
106 std::vector<VkVertexInputAttributeDescription> attributeDescriptions(2);
108 attributeDescriptions[0].binding = 0;
109 attributeDescriptions[0].location = 0;
110 attributeDescriptions[0].format = VK_FORMAT_R32G32B32_SFLOAT;
113 attributeDescriptions[1].binding = 0;
114 attributeDescriptions[1].location = 1;
115 attributeDescriptions[1].format = VK_FORMAT_R32G32B32_SFLOAT;
118 return attributeDescriptions;
131 VkVertexInputBindingDescription bindingDescription{};
132 bindingDescription.binding = 0;
133 bindingDescription.stride =
sizeof(
ItemVertex);
134 bindingDescription.inputRate = VK_VERTEX_INPUT_RATE_VERTEX;
136 return bindingDescription;
141 std::vector<VkVertexInputAttributeDescription> attributeDescriptions(4);
143 attributeDescriptions[0].binding = 0;
144 attributeDescriptions[0].location = 0;
145 attributeDescriptions[0].format = VK_FORMAT_R32G32B32_SFLOAT;
148 attributeDescriptions[1].binding = 0;
149 attributeDescriptions[1].location = 1;
150 attributeDescriptions[1].format = VK_FORMAT_R32G32B32_SFLOAT;
153 attributeDescriptions[2].binding = 0;
154 attributeDescriptions[2].location = 2;
155 attributeDescriptions[2].format = VK_FORMAT_R32G32_SFLOAT;
158 attributeDescriptions[3].binding = 0;
159 attributeDescriptions[3].location = 3;
160 attributeDescriptions[3].format = VK_FORMAT_R32_UINT;
163 return attributeDescriptions;
232 void putPixel(uint32_t x, uint32_t y, uint8_t r, uint8_t g, uint8_t b, uint8_t a = 255)
307 void setTargetBlock(
const std::optional<glm::vec3> & target_block);
334 const void * vertices,
335 const uint32_t vertex_count,
336 const uint32_t vertex_size,
337 const void * indices,
338 const uint32_t index_count
346 const uint64_t texture_id,
352 const uint8_t a = 255
365 const std::vector<const char *> validation_layers = {
366 "VK_LAYER_KHRONOS_validation"
369 const std::vector<const char *> device_extensions = {
370 VK_KHR_SWAPCHAIN_EXTENSION_NAME,
371 VK_KHR_DYNAMIC_RENDERING_EXTENSION_NAME,
372 VK_EXT_CALIBRATED_TIMESTAMPS_EXTENSION_NAME,
373 VK_KHR_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME,
374 VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME,
375 VK_KHR_8BIT_STORAGE_EXTENSION_NAME,
376 VK_KHR_SHADER_NON_SEMANTIC_INFO_EXTENSION_NAME
382 VkDebugUtilsMessengerEXT debug_messenger;
383 VkPhysicalDevice physical_device = VK_NULL_HANDLE;
385 VkSurfaceKHR surface;
388 VkQueue graphics_queue;
389 VkQueue present_queue;
390 VkQueue transfer_queue;
393 mutable TracyLockableN (std::mutex, global_mutex,
"Vulkan Global Mutex");
396 PFN_vkCreateDebugUtilsMessengerEXT vkCreateDebugUtilsMessengerEXT;
397 PFN_vkDestroyDebugUtilsMessengerEXT vkDestroyDebugUtilsMessengerEXT;
399 PFN_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT vkGetPhysicalDeviceCalibrateableTimeDomainsEXT;
400 PFN_vkGetCalibratedTimestampsEXT vkGetCalibratedTimestampsEXT;
402 PFN_vkGetBufferDeviceAddress vkGetBufferDeviceAddress;
405 void _createInstance();
406 bool _checkValidationLayerSupport();
407 std::vector<const char *> _getRequiredExtensions();
409 void _loadVulkanFunctions();
411 void _createSurface(GLFWwindow * window);
413 void _setupDebugMessenger();
414 void _populateDebugMessengerCreateInfo(VkDebugUtilsMessengerCreateInfoEXT & create_info);
415 static VKAPI_ATTR VkBool32 VKAPI_CALL debugCallback(
416 VkDebugUtilsMessageSeverityFlagBitsEXT message_severity,
417 VkDebugUtilsMessageTypeFlagsEXT message_type,
418 const VkDebugUtilsMessengerCallbackDataEXT * callback_data,
422 void _pickPhysicalDevice();
423 bool _isDeviceSuitable(VkPhysicalDevice device);
424 int _ratePhysicalDevice(VkPhysicalDevice device);
426 bool _checkDeviceExtensionSupport(VkPhysicalDevice device);
428 void _createLogicalDevice();
438 std::vector<VkFramebuffer> lighting_framebuffers;
439 std::vector<VkFramebuffer> shadow_framebuffers;
440 std::vector<VkFramebuffer> water_framebuffers;
441 std::vector<VkFramebuffer> hud_framebuffers;
442 VkFramebuffer prerender_item_icon_framebuffer;
444 void _createSwapChain(GLFWwindow * window);
445 void _recreateSwapChain(GLFWwindow * window);
446 VkSurfaceFormatKHR _chooseSwapSurfaceFormat(
const std::vector<VkSurfaceFormatKHR> & available_formats);
447 VkPresentModeKHR _chooseSwapPresentMode(
const std::vector<VkPresentModeKHR> & available_present_modes);
448 VkExtent2D _chooseSwapExtent(
const VkSurfaceCapabilitiesKHR & capabilities, GLFWwindow * window);
450 void _createFramebuffers();
451 void _destroyFramebuffers();
459 VkCommandPool command_pool;
460 std::vector<VkCommandBuffer> draw_shadow_pass_command_buffers;
461 std::vector<VkCommandBuffer> draw_command_buffers;
462 std::vector<VkCommandBuffer> copy_command_buffers;
463 std::vector<VkCommandBuffer> compute_command_buffers;
464 std::vector<VkCommandBuffer> imgui_command_buffers;
466 VkCommandPool transfer_command_pool;
467 VkCommandBuffer transfer_command_buffers;
468 TracyLockableN (std::mutex, transfer_operation_mutex,
"Vulkan Transfer Operation");
470 void _createCommandPool();
471 void _createCommandBuffer();
479 std::vector<VkSemaphore> image_available_semaphores;
480 std::vector<VkSemaphore> shadow_pass_finished_semaphores;
481 std::vector<VkSemaphore> main_render_finished_semaphores;
482 std::vector<VkSemaphore> compute_finished_semaphores;
483 std::vector<VkSemaphore> copy_finished_semaphores;
484 std::vector<VkSemaphore> imgui_render_finished_semaphores;
485 std::vector<VkFence> in_flight_fences;
486 VkFence single_time_command_fence;
488 void _createSyncObjects();
497 const uint shadow_map_size;
499 Image shadow_map_depth_attachement;
501 std::vector<VkImageView> shadow_map_views;
503 void _createShadowMapRessources();
504 void _destroyShadowMapRessources();
512 Image output_attachement;
513 Image color_attachement;
514 Image depth_attachement;
515 Image block_textures;
516 Image skybox_cube_map;
518 Image crosshair_image;
520 Image toolbar_cursor_image;
521 Image player_skin_image;
522 Image item_icon_images;
524 Image debug_info_image;
525 std::vector<Buffer> debug_info_buffers;
531 void _createColorAttachement();
532 void _createDepthAttachement();
534 void _createUBO(
UBO & ubo,
const VkDeviceSize size,
const uint32_t count);
535 void _createUniformBuffers();
536 void _createTextureArray(
const std::vector<std::string> & file_paths, uint32_t size);
537 void _createCubeMap(
const std::array<std::string, 6> & file_paths, uint32_t size);
538 void _createHudImages(
539 const std::string & file_path,
542 void _createTextureImage();
550 uint32_t instance_data_size;
551 uint32_t instance_data_max_count;
552 std::vector<Buffer> instance_data_buffers;
554 void _createInstanceData();
555 void _destroyInstanceData();
557 void _updateInstancesData();
571 void _createHudDescriptors(
575 void _createDescriptors();
576 void _createGlobalDescriptor();
577 void _updateGlobalDescriptor();
585 VkRenderPass lighting_render_pass;
586 VkRenderPass shadow_render_pass;
587 VkRenderPass water_render_pass;
588 VkRenderPass hud_render_pass;
589 VkRenderPass prerender_item_icon_render_pass;
591 void _createRenderPass();
609 Pipeline prerender_item_icon_pipeline;
612 void _createPipelines();
620 VkDescriptorPool imgui_descriptor_pool;
621 std::unordered_map<uint64_t, ImGuiTexture> imgui_textures;
622 uint64_t next_imgui_texture_id = 1;
623 TracyLockableN (std::mutex, imgui_textures_mutex,
"Vulkan Imgui Texture Mutex");
628 void _destroyImGuiTextures();
631 void _destroyTracy();
639 std::unordered_map<uint64_t, Mesh> mesh_map;
640 uint64_t next_mesh_id = 1;
641 const uint64_t invalid_mesh_id = 0;
642 TracyLockableN (std::mutex, mesh_map_mutex,
"Vulkan Mesh Map Mutex");
643 std::vector<uint64_t> mesh_ids_to_destroy;
645 uint64_t cube_mesh_id;
646 uint64_t icosphere_mesh_id;
648 uint64_t player_chest_mesh_id;
649 uint64_t player_head_mesh_id;
650 uint64_t player_right_leg_mesh_id;
651 uint64_t player_left_leg_mesh_id;
652 uint64_t player_right_arm_mesh_id;
653 uint64_t player_left_arm_mesh_id;
655 void _createMeshes();
656 void _createItemMeshes();
657 void _destroyMesh(
const uint64_t & mesh_id);
658 void _destroyMeshes();
666 struct ChunkMeshesInfo
670 VkDeviceAddress block_vertex_address;
671 uint32_t block_index_offset;
672 uint32_t block_index_count;
674 VkDeviceAddress water_vertex_address;
675 uint32_t water_index_offset;
676 uint32_t water_index_count;
682 uint64_t is_used = 0;
683 uint8_t used_by_frame[8];
687 Buffer m_chunks_indices_buffer;
690 std::map<InstanceId, ChunkMeshesInfo> m_chunks_in_scene;
691 std::map<InstanceId, glm::dmat4> m_chunks_in_scene_rendered;
692 std::list<InstanceId> m_free_chunk_ids;
694 std::vector<InstanceId> m_chunk_instance_to_destroy;
695 mutable TracyLockableN(std::mutex, m_chunks_in_scene_mutex,
"Chunk Render Data");
697 void _setupChunksRessources();
698 void _resizeChunksIndicesBuffer(
const VkDeviceSize & size);
699 void _deleteUnusedChunks();
701 void _bindChunkIndexBuffer(VkCommandBuffer command_buffer);
702 void _drawChunksBlock(
703 VkCommandBuffer command_buffer,
705 const std::vector<InstanceId> & ids
707 void _drawChunkWater(VkCommandBuffer command_buffer,
const InstanceId &
id);
715 uint32_t m_max_draw_count;
716 std::vector<std::vector<Buffer>> m_draw_chunk_block_shadow_pass_buffer;
717 std::vector<Buffer> m_draw_chunk_block_light_pass_buffer;
719 void _createDrawBuffer();
720 void _destroyDrawBuffer();
722 void _drawChunkBlock(VkCommandBuffer command_buffer,
const InstanceId &
id);
732 void _setupTextRenderer();
733 void _destroyTextRenderer();
741 void _prerenderItemIconImages();
749 void _transitionImageLayout(
751 VkImageLayout oldLayout,
752 VkImageLayout newLayout,
753 VkImageAspectFlags aspectMask,
755 VkAccessFlags srcAccessMask,
756 VkAccessFlags dstAccessMask,
757 VkPipelineStageFlags srcStageMask,
758 VkPipelineStageFlags dstStageMask
760 void _setImageLayout(
761 VkCommandBuffer command_buffer,
763 VkImageLayout old_layout,
764 VkImageLayout new_layout,
765 VkImageSubresourceRange subresource_range,
766 VkAccessFlags srcAccessMask,
767 VkAccessFlags dstAccessMask,
768 VkPipelineStageFlags srcStageMask,
769 VkPipelineStageFlags dstStageMask
771 VkFormat _findSupportedFormat(
772 const std::vector<VkFormat> & candidates,
773 VkImageTiling tiling,
774 VkFormatFeatureFlags features
781 VkImageTiling tiling,
782 VkImageUsageFlags usage,
783 VkMemoryPropertyFlags properties,
785 VkDeviceMemory & image_memory
787 void _createImageView(
790 VkImageAspectFlags aspect_flags,
791 VkImageView & image_view
795 VkBufferUsageFlags usage,
796 VkMemoryPropertyFlags properties,
798 VkDeviceMemory & buffer_memory
803 const VkBufferCopy & copy_region
805 void _copyBufferToImage(
820 bool m_show_debug_text_update =
false;
822 std::optional<glm::vec3> m_target_block_update;
824 std::map<InstanceId, ChunkMeshCreateInfo> m_chunk_to_create;
825 std::map<InstanceId, ChunkMeshCreateInfo> m_chunk_to_delete;
827 std::list<std::function<void(
void)>> m_update_functions;
829 mutable TracyLockableN(std::mutex, m_render_data_update_mutex,
"Render Data Update");
831 void _updateRenderData();
833 void _updateChunksData();
834 void _updatePlayersData();
842 const int m_max_frames_in_flight = 2;
843 int m_current_frame = 0;
844 uint32_t m_current_image_index = 0;
846 std::chrono::nanoseconds m_start_time;
847 std::chrono::nanoseconds m_current_time;
848 std::chrono::nanoseconds m_last_frame_time;
849 std::chrono::nanoseconds m_delta_time;
853 std::chrono::nanoseconds m_start_time_counting_fps;
856 int m_window_width, m_window_height;
857 double m_aspect_ratio;
859 const glm::mat4 m_clip = glm::mat4(
860 1.0f, 0.0f, 0.0f, 0.0f,
861 0.0f,-1.0f, 0.0f, 0.0f,
862 0.0f, 0.0f, 0.5f, 0.0f,
863 0.0f, 0.0f, 0.5f, 1.0f
869 std::map<uint64_t, PlayerRenderData> m_players;
870 std::map<uint64_t, MeshRenderData> m_entities;
872 std::vector<InstanceId> m_visible_chunks;
873 std::vector<std::vector<InstanceId>> m_shadow_visible_chunks;
876 glm::dvec3 m_sun_position;
878 std::optional<glm::vec3> m_target_block;
879 mutable TracyLockableN(std::mutex, m_target_block_mutex,
"Target Block");
884 std::vector<glm::mat4> m_light_view_proj_matrices;
887 bool m_show_debug_text =
false;
888 std::string m_debug_text;
890 std::array<ItemInfo::Type, 9> m_toolbar_items;
891 int m_toolbar_cursor_index = 0;
893 void _createRenderFrameRessources();
895 void _prepareFrame();
897 void _updateDebugText();
898 void _updateVisibleChunks();
904 void _lightingPass();
906 void _drawPlayerBodyPart(
907 const uint64_t mesh_id,
908 const glm::mat4 & model
911 void _copyToSwapchain();
913 void _drawDebugGui();
916 std::vector<glm::mat4> _getCSMLightViewProjMatrices(
917 const glm::vec3 & light_dir,
918 const std::vector<float> & split,
919 const float blend_distance,
920 const glm::mat4 & camera_view,
922 const float cam_ratio,
923 const float cam_near_plane,
924 const float cam_far_plane,
925 std::vector<float> & far_plane_distances
928 bool _isInsideFrustum_ndcSpace(
const glm::mat4 & model,
const glm::vec3 & size)
const;
929 bool _isInsideFrustum_planes(
930 const glm::mat4 & view_proj,
931 const glm::mat4 & model,
932 const glm::vec3 & size
935 std::pair<bool, Mesh> _getMesh(
const uint64_t
id);
937 VkCommandBuffer command_buffer,
939 const uint64_t mesh_id,
940 const void * push_constants,
941 const uint32_t push_constants_size,
942 const VkShaderStageFlags push_constants_stage,
943 const uint32_t instance_id = 0
946 void _writeTextToDebugImage(
947 VkCommandBuffer command_buffer,
948 const std::string & text,
951 const uint32_t font_size
956 const VkViewport & viewport
959 const VkViewport & viewport,
#define SHADOW_MAP_MAX_COUNT
Definition: ShaderCommon.hpp:20
Definition: Buffer.hpp:11
A simple camera class.
Definition: Camera.hpp:41
Definition: Descriptor.hpp:8
Type
Definition: Item.hpp:14
Definition: MemoryRange.hpp:9
Definition: Pipeline.hpp:13
Definition: Model.hpp:154
Definition: RenderAPI.hpp:288
uint64_t storeMesh(const void *vertices, const uint32_t vertex_count, const uint32_t vertex_size, const void *indices, const uint32_t index_count)
Definition: mesh.cpp:8
void addEntity(const uint64_t id, const MeshRenderData &entity_data)
Definition: render_update.cpp:50
InstanceId addChunkToScene(const ChunkMeshCreateInfo &mesh_info)
Definition: chunk_mesh.cpp:6
void removeEntity(const uint64_t id)
Definition: render_update.cpp:59
void setToolbarCursor(const int index)
Definition: render_update.cpp:87
void setToolbarItem(const int index, const ItemInfo::Type type)
Definition: render_update.cpp:78
RenderAPI(RenderAPI &&)=delete
RenderAPI(const RenderAPI &)=delete
void ImGuiTextureClear(const uint64_t texture_id)
Definition: RenderAPI.cpp:2309
void renderFrame()
Definition: render_loop.cpp:55
void setCamera(const Camera &camera)
Definition: render_update.cpp:3
void removePlayer(const uint64_t id)
Definition: render_update.cpp:31
void addPlayer(const uint64_t id, const PlayerRenderData &player_data)
Definition: render_update.cpp:22
void updateEntity(const uint64_t id, std::function< void(MeshRenderData &)> fct)
Definition: render_update.cpp:68
RenderAPI & operator=(RenderAPI &&)=delete
void toggleDebugText()
Definition: render_update.cpp:9
RenderAPI & operator=(const RenderAPI &)=delete
~RenderAPI()
Definition: RenderAPI.cpp:73
void destroyMesh(const uint64_t &mesh_id)
Definition: mesh.cpp:92
uint64_t createImGuiTexture(const uint32_t width, const uint32_t height)
Definition: RenderAPI.cpp:2198
void ImGuiTexturePutPixel(const uint64_t texture_id, const uint32_t x, const uint32_t y, const uint8_t r, const uint8_t g, const uint8_t b, const uint8_t a=255)
Definition: RenderAPI.cpp:2294
void removeChunkFromScene(const uint64_t chunk_id)
Definition: chunk_mesh.cpp:33
uint32_t InstanceId
Definition: RenderAPI.hpp:292
uint64_t getCubeMeshId() const
Definition: RenderAPI.hpp:341
void setTargetBlock(const std::optional< glm::vec3 > &target_block)
Definition: render_update.cpp:15
void updatePlayer(const uint64_t id, std::function< void(PlayerRenderData &)> fct)
Definition: render_update.cpp:40
void ImGuiTextureDraw(const uint64_t texture_id)
Definition: RenderAPI.cpp:2316
Definition: Swapchain.hpp:8
Definition: TextRenderer.hpp:12
Definition: RenderAPI.hpp:195
glm::vec3 beta_mie
Definition: RenderAPI.hpp:207
float h_rayleigh
Definition: RenderAPI.hpp:200
float n_samples
Definition: RenderAPI.hpp:204
float atmosphere_radius
Definition: RenderAPI.hpp:198
glm::vec3 sun_direction
Definition: RenderAPI.hpp:196
float h_mie
Definition: RenderAPI.hpp:201
glm::vec3 beta_rayleigh
Definition: RenderAPI.hpp:206
float sun_intensity
Definition: RenderAPI.hpp:203
float g
Definition: RenderAPI.hpp:202
float player_height
Definition: RenderAPI.hpp:199
float n_light_samples
Definition: RenderAPI.hpp:205
float earth_radius
Definition: RenderAPI.hpp:197
Definition: CreateMeshData.hpp:46
Definition: Camera.hpp:46
Definition: RenderAPI.hpp:253
glm::dmat4 model
Definition: RenderAPI.hpp:256
uint64_t block_mesh_id
Definition: RenderAPI.hpp:254
uint64_t water_mesh_id
Definition: RenderAPI.hpp:255
Definition: RenderAPI.hpp:90
glm::vec3 pos
Definition: RenderAPI.hpp:91
static std::vector< VkVertexInputAttributeDescription > getAttributeDescriptions()
Definition: RenderAPI.hpp:104
glm::vec3 normal
Definition: RenderAPI.hpp:92
static VkVertexInputBindingDescription getBindingDescription()
Definition: RenderAPI.hpp:94
Definition: RenderAPI.hpp:243
uint32_t dst_binding
Definition: RenderAPI.hpp:244
VkDescriptorImageInfo image_info
Definition: RenderAPI.hpp:248
VkDescriptorType descriptor_type
Definition: RenderAPI.hpp:247
uint32_t dst_array_element
Definition: RenderAPI.hpp:245
uint32_t descriptor_count
Definition: RenderAPI.hpp:246
VkDescriptorBufferInfo buffer_info
Definition: RenderAPI.hpp:249
Definition: RenderAPI.hpp:211
void putPixel(uint32_t x, uint32_t y, uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)
Definition: RenderAPI.hpp:232
VkFormat format
Definition: RenderAPI.hpp:221
VkImageView view
Definition: RenderAPI.hpp:214
VkDescriptorSet descriptor_set
Definition: RenderAPI.hpp:219
uint32_t width() const
Definition: RenderAPI.hpp:224
uint32_t height() const
Definition: RenderAPI.hpp:225
VkExtent2D extent
Definition: RenderAPI.hpp:222
void * mapped_memory
Definition: RenderAPI.hpp:217
void clear()
Definition: RenderAPI.hpp:227
VkSampler sampler
Definition: RenderAPI.hpp:215
VkImage image
Definition: RenderAPI.hpp:212
VkDeviceMemory memory
Definition: RenderAPI.hpp:213
Definition: RenderAPI.hpp:278
mat4 matrice
Definition: RenderAPI.hpp:279
VkDeviceAddress water_vertex_buffer
Definition: RenderAPI.hpp:281
VkDeviceAddress block_vertex_buffer
Definition: RenderAPI.hpp:280
Definition: RenderAPI.hpp:123
glm::vec3 normal
Definition: RenderAPI.hpp:125
glm::vec2 tex_coord
Definition: RenderAPI.hpp:126
static VkVertexInputBindingDescription getBindingDescription()
Definition: RenderAPI.hpp:129
static std::vector< VkVertexInputAttributeDescription > getAttributeDescriptions()
Definition: RenderAPI.hpp:139
uint32_t texture_index
Definition: RenderAPI.hpp:127
glm::vec3 pos
Definition: RenderAPI.hpp:124
Definition: RenderAPI.hpp:63
glm::vec3 pos
Definition: RenderAPI.hpp:64
static std::vector< VkVertexInputAttributeDescription > getAttributeDescriptions()
Definition: RenderAPI.hpp:76
static VkVertexInputBindingDescription getBindingDescription()
Definition: RenderAPI.hpp:66
Definition: RenderAPI.hpp:260
uint64_t id
Definition: RenderAPI.hpp:261
glm::dmat4 model
Definition: RenderAPI.hpp:262
Definition: RenderAPI.hpp:168
uint32_t vertex_count
Definition: RenderAPI.hpp:171
VkDeviceSize index_offset
Definition: RenderAPI.hpp:173
uint32_t memory_size
Definition: RenderAPI.hpp:176
uint64_t is_used
Definition: RenderAPI.hpp:182
uint32_t vertex_size
Definition: RenderAPI.hpp:172
VkDeviceMemory buffer_memory
Definition: RenderAPI.hpp:170
uint32_t index_count
Definition: RenderAPI.hpp:174
VkDeviceAddress buffer_address
Definition: RenderAPI.hpp:178
uint8_t used_by_frame[8]
Definition: RenderAPI.hpp:183
VkBuffer buffer
Definition: RenderAPI.hpp:169
Definition: RenderAPI.hpp:266
glm::dvec3 position
Definition: RenderAPI.hpp:267
bool visible
Definition: RenderAPI.hpp:274
double yaw
Definition: RenderAPI.hpp:268
PlayerModel::WalkAnimation walk_animation
Definition: RenderAPI.hpp:271
double pitch
Definition: RenderAPI.hpp:269
PlayerModel::AttackAnimation attack_animation
Definition: RenderAPI.hpp:272
Definition: RenderAPI.hpp:51
std::optional< uint32_t > graphics_family
Definition: RenderAPI.hpp:52
std::optional< uint32_t > present_family
Definition: RenderAPI.hpp:53
std::optional< uint32_t > transfer_family
Definition: RenderAPI.hpp:54
bool isComplete()
Definition: RenderAPI.hpp:56
Definition: RenderAPI.hpp:321
std::vector< uint32_t > water_index
Definition: RenderAPI.hpp:326
std::vector< uint32_t > block_index
Definition: RenderAPI.hpp:323
std::vector< BlockVertex > water_vertex
Definition: RenderAPI.hpp:325
std::vector< BlockVertex > block_vertex
Definition: RenderAPI.hpp:322
glm::dmat4 model
Definition: RenderAPI.hpp:328
Definition: ShaderCommon.hpp:49
Definition: RenderAPI.hpp:188
std::vector< VkBuffer > buffers
Definition: RenderAPI.hpp:189
std::vector< VkDeviceMemory > memory
Definition: RenderAPI.hpp:190
std::vector< void * > mapped_memory
Definition: RenderAPI.hpp:191
Definition: ShaderCommon.hpp:43