2
3
4
5
16 RendererPassBuilder{
"PreRenderer",
this }
26 DescriptorSetBuilder{
"PreRenderer",
this }
27 .AddUniformBuffer(0, 0,
sizeof(SpicesShader::View), VK_SHADER_STAGE_ALL)
28 .AddUniformBuffer(0, 1,
sizeof(SpicesShader::Input), VK_SHADER_STAGE_ALL)
29 .AddBindLessTexture<Texture2D>(SpicesShader::BINDLESS_TEXTURE_SET, SpicesShader::BINDLESS_TEXTURE_BINDING, VK_SHADER_STAGE_ALL, {
"default.jpg" })
35 VkPipelineLayout& layout ,
53 builder.UpdateUniformBuffer<SpicesShader::View>(0, 0, [&](
auto& ubo) {
54 auto [ invViewMatrix, projectionMatrix, stableFrames, fov ] = GetActiveCameraMatrix(frameInfo);
55 ImVec2 sceneTextureSize = SlateSystem::GetRegister()->GetViewPort()->GetPanelSize();
56 const VkExtent2D windowSize = m_Device->GetSwapChainSupport().surfaceSize;
58 ubo.projection = projectionMatrix;
60 ubo.nprojection = projectionMatrix;
61 ubo.nprojection[1][1] *= -1.0f;
63 ubo.view = glm::inverse(invViewMatrix);
65 ubo.inView = invViewMatrix;
67 ubo.sceneTextureSize = {
70 1.0f / sceneTextureSize.x,
71 1.0f / sceneTextureSize.y
75 static_cast<
float>(windowSize.width),
76 static_cast<
float>(windowSize.height),
77 1.0f /
static_cast<
float>(windowSize.width),
78 1.0f /
static_cast<
float>(windowSize.height)
81 ubo.stableFrames = stableFrames;
86 builder.UpdateUniformBuffer<SpicesShader::Input>(0, 1, [&](
auto& ubo) {
87 auto [x, y] = SlateSystem::GetRegister()->GetViewPort()->GetMousePosInViewport();
89 ubo.gameTime = ts
.gt();
90 ubo.frameTime = ts
.ft();
91 ubo.mousePos = glm::vec4(
92 static_cast<
float>(x),
93 static_cast<
float>(y),
94 1.0f /
static_cast<
float>(x),
95 1.0f /
static_cast<
float>(y)
#define SPICES_PROFILE_ZONE
static void UnLoadForce(const std::string &name)
Forcing UnLoad a VulkanDescriptorSet.
This Class manages all descriptor sets this project.
uint32_t m_FrameIndex
FrameIndex, varying during 0 - (MaxFrameInFlight - 1). Used almost anywhere.
uint32_t m_ImageIndex
ImageIndex, varying during 0 - (MaxFrameInFlight - 1). Used in swapchain index and framebuffer index.
FrameInfo Class. This class defines the FrameInfo data.
Material Class. This class contains a branch of parameter and shader, also descriptor.
virtual void CreateRendererPass() override
The interface is inherited from Renderer. Create specific render pass.
virtual ~PreRenderer() override
Destructor Function.
virtual void Render(TimeStep &ts, FrameInfo &frameInfo) override
The interface is inherited from Renderer.
virtual void CreateDescriptorSet() override
The interface is inherited from Renderer. Create specific descriptor set for sub pass.
virtual void CreatePipeline(std::shared_ptr< Material > material, VkPipelineLayout &layout, std::shared_ptr< RendererSubPass > subPass) override
The interface is inherited from Renderer. Create Material Specific Pipeline.
PreRenderer Class. This class defines the global descriptor set.
Basic interface of Queries.
This Class Combines some data relative to sub pass. Usually as a member variable of RendererPass.
virtual void BeginRenderPass()
Begin this Renderer's RenderPass.
virtual void EndRenderPass()
End this Renderer's RenderPass.
This class helps to bind pipeline and bind buffer. Only instanced during Render().
RendererPassBuilder & EndSubPass()
End recording a sub pass.
void Build() const
Build the RendererPass.
RendererPassBuilder & AddSubPass(const std::string &subPassName, Querier::StatisticsFlags flags=Querier::ALL)
Add a new SubPass to Renderer Pass.
std::string m_RendererName
Specific renderer name, Passed by instanced.
const float & ft() const
Get time step during frames.
const float & gt() const
Get time step since Engine Start.
This Class handles our engine time step during frames. Global Unique.