More Ray tracing changes
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
#include "Enums.h"
|
||||
#include "Resources.h"
|
||||
#include <compare>
|
||||
#include "Initializer.h"
|
||||
|
||||
namespace Seele {
|
||||
namespace Gfx {
|
||||
@@ -19,17 +19,19 @@ DECLARE_REF(DescriptorPool)
|
||||
DECLARE_REF(DescriptorSet)
|
||||
class DescriptorLayout {
|
||||
public:
|
||||
DescriptorLayout(const std::string& name);
|
||||
DescriptorLayout(const DescriptorLayout& other);
|
||||
DescriptorLayout& operator=(const DescriptorLayout& other);
|
||||
DescriptorLayout(const std::string &name);
|
||||
DescriptorLayout(const DescriptorLayout &other);
|
||||
DescriptorLayout &operator=(const DescriptorLayout &other);
|
||||
virtual ~DescriptorLayout();
|
||||
void addDescriptorBinding(DescriptorBinding binding);
|
||||
void reset();
|
||||
PDescriptorSet allocateDescriptorSet();
|
||||
virtual void create() = 0;
|
||||
constexpr const Array<DescriptorBinding>& getBindings() const { return descriptorBindings; }
|
||||
constexpr const Array<DescriptorBinding> &getBindings() const {
|
||||
return descriptorBindings;
|
||||
}
|
||||
constexpr uint32 getHash() const { return hash; }
|
||||
constexpr const std::string& getName() const { return name; }
|
||||
constexpr const std::string &getName() const { return name; }
|
||||
|
||||
protected:
|
||||
Array<DescriptorBinding> descriptorBindings;
|
||||
@@ -61,40 +63,48 @@ public:
|
||||
virtual void writeChanges() = 0;
|
||||
virtual void updateBuffer(uint32 binding, PUniformBuffer uniformBuffer) = 0;
|
||||
virtual void updateBuffer(uint32 binding, PShaderBuffer ShaderBuffer) = 0;
|
||||
virtual void updateBuffer(uint32_t binding, uint32 index, Gfx::PShaderBuffer uniformBuffer) = 0;
|
||||
virtual void updateBuffer(uint32_t binding, uint32 index,
|
||||
Gfx::PShaderBuffer uniformBuffer) = 0;
|
||||
virtual void updateSampler(uint32 binding, PSampler sampler) = 0;
|
||||
virtual void updateTexture(uint32 binding, PTexture texture, PSampler samplerState = nullptr) = 0;
|
||||
virtual void updateTextureArray(uint32_t binding, Array<PTexture> texture) = 0;
|
||||
virtual void updateTexture(uint32 binding, PTexture texture,
|
||||
PSampler samplerState = nullptr) = 0;
|
||||
virtual void updateTextureArray(uint32_t binding,
|
||||
Array<PTexture> texture) = 0;
|
||||
bool operator<(PDescriptorSet other);
|
||||
|
||||
constexpr PDescriptorLayout getLayout() const { return layout; }
|
||||
constexpr const std::string& getName() const { return layout->getName(); }
|
||||
constexpr const std::string &getName() const { return layout->getName(); }
|
||||
|
||||
protected:
|
||||
PDescriptorLayout layout;
|
||||
};
|
||||
DEFINE_REF(DescriptorSet)
|
||||
|
||||
DECLARE_REF(PipelineLayout)
|
||||
class PipelineLayout {
|
||||
public:
|
||||
PipelineLayout(const std::string& name);
|
||||
PipelineLayout(const std::string& name, PPipelineLayout baseLayout);
|
||||
PipelineLayout(const std::string &name);
|
||||
PipelineLayout(const std::string &name, PPipelineLayout baseLayout);
|
||||
virtual ~PipelineLayout();
|
||||
virtual void create() = 0;
|
||||
void addDescriptorLayout(PDescriptorLayout layout);
|
||||
void addPushConstants(const SePushConstantRange& pushConstants);
|
||||
void addPushConstants(const SePushConstantRange &pushConstants);
|
||||
constexpr uint32 getHash() const { return layoutHash; }
|
||||
constexpr const Map<std::string, PDescriptorLayout>& getLayouts() const { return descriptorSetLayouts; }
|
||||
constexpr uint32 findParameter(const std::string& param) const { return parameterMapping[param]; }
|
||||
void addMapping(Map<std::string, uint32> mapping);
|
||||
constexpr std::string getName() const {return name;};
|
||||
constexpr const Map<std::string, PDescriptorLayout> &getLayouts() const {
|
||||
return descriptorSetLayouts;
|
||||
}
|
||||
constexpr uint32 findParameter(const std::string ¶m) const {
|
||||
return parameterMapping[param];
|
||||
}
|
||||
void addMapping(Map<std::string, uint32> mapping);
|
||||
constexpr std::string getName() const { return name; };
|
||||
|
||||
protected:
|
||||
uint32 layoutHash = 0;
|
||||
Map<std::string, PDescriptorLayout> descriptorSetLayouts;
|
||||
Map<std::string, uint32> parameterMapping;
|
||||
Map<std::string, uint32> parameterMapping;
|
||||
Array<SePushConstantRange> pushConstants;
|
||||
std::string name;
|
||||
std::string name;
|
||||
};
|
||||
DEFINE_REF(PipelineLayout)
|
||||
} // namespace Gfx
|
||||
|
||||
Reference in New Issue
Block a user