33#ifndef DVD_VK_WRAPPER_H_
34#define DVD_VK_WRAPPER_H_
60 static constexpr VkPipelineStageFlagBits2
ALL_SHADER_STAGES = VK_PIPELINE_STAGE_2_VERTEX_SHADER_BIT |
61 VK_PIPELINE_STAGE_2_TESSELLATION_CONTROL_SHADER_BIT |
62 VK_PIPELINE_STAGE_2_TESSELLATION_EVALUATION_SHADER_BIT |
63 VK_PIPELINE_STAGE_2_GEOMETRY_SHADER_BIT |
64 VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT |
65 VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT;
78 void idle(
bool fast) noexcept override;
91 void flushCommand( GFX::CommandBase* cmd ) noexcept override;
96 void onThreadCreated(const
std::thread::
id& threadID,
bool isMainRenderThread ) noexcept override;
100 [[nodiscard]] GenericVertexData_ptr
newGVD(
U32 ringBufferLength, const
std::string_view name ) const override;
Rough around the edges Adapter pattern abstracting the actual rendering API and access to the GPU.
Renderer Programming Interface.
static DepthFormatInformation s_depthFormatInformation
static bool s_hasDescriptorBufferSupport
static void PushDebugMessage(VkCommandBuffer cmdBuffer, const char *message, U32 id=U32_MAX)
static void RegisterTransferRequest(const VKTransferQueue::TransferRequest &request)
static void PopDebugMessage(VkCommandBuffer cmdBuffer)
bool drawToWindow(DisplayWindow &window) override
void closeRenderingAPI() override
static void RegisterCustomAPIDelete(DELEGATE< void, VkDevice > &&cbk, bool isResourceTransient)
static bool s_hasValidationFeaturesSupport
static bool s_hasDynamicBlendStateSupport
bool frameStarted() override
static eastl::stack< vkShaderProgram * > s_reloadedShaders
void flushCommand(GFX::CommandBase *cmd) noexcept override
void idle(bool fast) noexcept override
static SamplerObjectMap s_samplerMap
static constexpr VkPipelineStageFlagBits2 ALL_SHADER_STAGES
hashMap< size_t, CompiledPipeline > _compiledPipelines
static VKStateTracker & GetStateTracker() noexcept
static void OnShaderReloaded(vkShaderProgram *program)
static VKDeletionQueue s_transientDeleteQueue
void destroyStatePerWindow(VKPerWindowState &windowState)
std::array< VkDescriptorSetLayout, to_base(DescriptorSetUsage::COUNT)> _descriptorSetLayouts
bool setScissorInternal(const Rect< I32 > &newScissor) noexcept override
void onThreadCreated(const std::thread::id &threadID, bool isMainRenderThread) noexcept override
GenericVertexData_ptr newGVD(U32 ringBufferLength, const std::string_view name) const override
ErrorCode initRenderingAPI(I32 argc, char **argv, Configuration &config) noexcept override
bool bindShaderResources(const DescriptorSetEntries &descriptorSetEntries) override
void destroyPipeline(CompiledPipeline &pipeline, bool defer)
static void SubmitTransferRequest(const VKTransferQueue::TransferRequest &request, VkCommandBuffer cmd)
VkCommandBuffer getCurrentCommandBuffer() const noexcept
void postFlushCommandBuffer(Handle< GFX::CommandBuffer > commandBuffer) noexcept override
void preFlushCommandBuffer(Handle< GFX::CommandBuffer > commandBuffer) override
static VKStateTracker s_stateTracker
std::array< VkDescriptorSet, to_base(DescriptorSetUsage::COUNT)> _descriptorSets
static void FlushBufferTransferRequests()
void prepareFlushWindow(DisplayWindow &window) override
const GFXDevice & context() const noexcept
vkb::Instance _vkbInstance
std::array< DynamicBindings, to_base(DescriptorSetUsage::COUNT)> _descriptorDynamicBindings
bool setViewportInternal(const Rect< I32 > &newViewport) noexcept override
void flushPushConstantsLocks()
hashMap< I64, VKPerWindowState > _perWindowState
bool frameEnded() override
static bool s_hasDebugMarkerSupport
void initStatePerWindow(VKPerWindowState &windowState)
VkDescriptorSetLayout createLayoutFromBindings(const DescriptorSetUsage usage, const ShaderProgram::BindingsPerSetArray &bindings, DynamicBindings &dynamicBindings)
GFXDevice & context() noexcept
VkPipelineCache _pipelineCache
static VkSampler GetSamplerHandle(SamplerDescriptor sampler, size_t &samplerHashInOut)
Return the Vulkan sampler object's handle for the given hash value.
ShaderResult bindPipeline(const Pipeline &pipeline, VkCommandBuffer cmdBuffer)
RenderTarget_uptr newRT(const RenderTargetDescriptor &descriptor) const override
GFX::MemoryBarrierCommand _uniformsMemCommand
void onRenderThreadLoopStart() override
void bindDynamicState(const RenderStateBlock ¤tState, const RTBlendStates &blendStates, VkCommandBuffer cmdBuffer) noexcept
static bool s_hasPushDescriptorSupport
void flushWindow(DisplayWindow &window) override
static VKTransferQueue s_transferQueue
DescriptorLayoutCache_uptr _descriptorLayoutCache
void initDescriptorSets() override
ShaderBuffer_uptr newSB(const ShaderBufferDescriptor &descriptor) const override
hashMap< size_t, VkSampler, NoHash< size_t > > SamplerObjectMap
VkDescriptorSet _dummyDescriptorSet
static SharedMutex s_samplerMapLock
void recreateSwapChain(VKPerWindowState &windowState)
static VKDeletionQueue s_deviceDeleteQueue
void onRenderThreadLoopEnd() override
static void InsertDebugMessage(VkCommandBuffer cmdBuffer, const char *message, U32 id=U32_MAX)
void destroyPipelineCache()
Handle console commands that start with a forward slash.
std::array< DescriptorSetEntry, to_base(DescriptorSetUsage::COUNT)> DescriptorSetEntries
DELEGATE_STD< Ret, Args... > DELEGATE
eastl::fixed_vector< DynamicBinding, MAX_BINDINGS_PER_DESCRIPTOR_SET, false > DynamicBindings
std::shared_mutex SharedMutex
hashAlg::unordered_map< K, V, HashFun, Predicate > hashMap
constexpr auto to_base(const Type value) -> Type
VkCommandBuffer * _cmdBuffer