Add depth bias config to shader

This commit is contained in:
Georg Hagen
2025-01-05 17:36:19 +01:00
parent 56cb508002
commit 4f1d730e30
4 changed files with 41 additions and 26 deletions

View File

@@ -11,39 +11,36 @@
#include <vulkan/vulkan.hpp>
#include <vector>
namespace OpenVulkano
namespace OpenVulkano::Vulkan
{
namespace Vulkan
{
class Context;
class IShaderOwner;
class Context;
class IShaderOwner;
class VulkanShader final : public IRenderResource<Scene::Shader>, public IRecordable
{
public:
vk::Device device;
std::vector<vk::ShaderModule> shaderModules; // TODO manage live time somewhere else to allow sharing of shader programs
std::vector<vk::PipelineShaderStageCreateInfo> shaderStageCreateInfo;
vk::Pipeline pipeline; // TODO pipeline and shader config should be split
std::vector<vk::DescriptorSetLayout> descriptorSetLayouts;
vk::PipelineLayout pipelineLayout;
IShaderOwner* owner = nullptr;
Context* context = nullptr;
{
public:
vk::Device device;
std::vector<vk::ShaderModule> shaderModules; // TODO manage live time somewhere else to allow sharing of shader programs
std::vector<vk::PipelineShaderStageCreateInfo> shaderStageCreateInfo;
vk::Pipeline pipeline; // TODO pipeline and shader config should be split
std::vector<vk::DescriptorSetLayout> descriptorSetLayouts;
vk::PipelineLayout pipelineLayout;
IShaderOwner* owner = nullptr;
Context* context = nullptr;
VulkanShader(Context* context, Scene::Shader* shader, IShaderOwner* owner);
VulkanShader(Context* context, Scene::Shader* shader, IShaderOwner* owner);
~VulkanShader() override;
~VulkanShader() override;
void Resize();
void Resize();
void Record(VulkanDrawContext* context) override;
void Record(VulkanDrawContext* context) override;
void Release() override;
void Release() override;
private:
void BuildPipeline();
private:
void BuildPipeline();
void CreatePipelineLayout();
};
}
void CreatePipelineLayout();
};
}