mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-05 04:33:51 +00:00
Vulcan Nightmare
Experimentally bringing up vulcan support
This commit is contained in:
parent
863a786c48
commit
83b576e8d9
189 changed files with 12147 additions and 7820 deletions
|
|
@ -1,15 +1,20 @@
|
|||
#pragma once
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
#include <vulkan/vulkan.h>
|
||||
#include <vk_mem_alloc.h>
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "rendering/vk_texture.hpp"
|
||||
|
||||
namespace wowee {
|
||||
namespace pipeline { class AssetManager; }
|
||||
namespace rendering {
|
||||
|
||||
class Camera;
|
||||
class VkContext;
|
||||
|
||||
/**
|
||||
* Renders quest markers as billboarded sprites above NPCs
|
||||
|
|
@ -20,7 +25,7 @@ public:
|
|||
QuestMarkerRenderer();
|
||||
~QuestMarkerRenderer();
|
||||
|
||||
bool initialize(pipeline::AssetManager* assetManager);
|
||||
bool initialize(VkContext* ctx, VkDescriptorSetLayout perFrameLayout, pipeline::AssetManager* assetManager);
|
||||
void shutdown();
|
||||
|
||||
/**
|
||||
|
|
@ -44,8 +49,11 @@ public:
|
|||
|
||||
/**
|
||||
* Render all quest markers (call after world rendering, before UI)
|
||||
* @param cmd Command buffer to record into
|
||||
* @param perFrameSet Per-frame descriptor set (set 0, contains camera UBO)
|
||||
* @param camera Camera for billboard calculation (CPU-side view matrix)
|
||||
*/
|
||||
void render(const Camera& camera);
|
||||
void render(VkCommandBuffer cmd, VkDescriptorSet perFrameSet, const Camera& camera);
|
||||
|
||||
private:
|
||||
struct Marker {
|
||||
|
|
@ -55,16 +63,29 @@ private:
|
|||
};
|
||||
|
||||
std::unordered_map<uint64_t, Marker> markers_;
|
||||
|
||||
// OpenGL resources
|
||||
uint32_t vao_ = 0;
|
||||
uint32_t vbo_ = 0;
|
||||
uint32_t shaderProgram_ = 0;
|
||||
uint32_t textures_[3] = {0, 0, 0}; // available, turnin, incomplete
|
||||
|
||||
// Vulkan context
|
||||
VkContext* vkCtx_ = nullptr;
|
||||
|
||||
// Pipeline
|
||||
VkPipeline pipeline_ = VK_NULL_HANDLE;
|
||||
VkPipelineLayout pipelineLayout_ = VK_NULL_HANDLE;
|
||||
|
||||
// Descriptor resources for per-material texture (set 1)
|
||||
VkDescriptorSetLayout materialSetLayout_ = VK_NULL_HANDLE;
|
||||
VkDescriptorPool descriptorPool_ = VK_NULL_HANDLE;
|
||||
VkDescriptorSet texDescSets_[3] = {VK_NULL_HANDLE, VK_NULL_HANDLE, VK_NULL_HANDLE};
|
||||
|
||||
// Textures: available, turnin, incomplete
|
||||
VkTexture textures_[3];
|
||||
|
||||
// Quad vertex buffer
|
||||
VkBuffer quadVB_ = VK_NULL_HANDLE;
|
||||
VmaAllocation quadVBAlloc_ = VK_NULL_HANDLE;
|
||||
|
||||
void createQuad();
|
||||
void loadTextures(pipeline::AssetManager* assetManager);
|
||||
void createShader();
|
||||
void createDescriptorResources();
|
||||
};
|
||||
|
||||
} // namespace rendering
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue