Renderer: Add support for storage buffers
This commit is contained in:
@@ -136,6 +136,7 @@ namespace Nz
|
||||
|
||||
enum class ShaderBindingType
|
||||
{
|
||||
StorageBuffer,
|
||||
Texture,
|
||||
UniformBuffer,
|
||||
|
||||
|
||||
@@ -18,11 +18,14 @@ namespace Nz
|
||||
bool anisotropicFiltering = false;
|
||||
bool depthClamping = false;
|
||||
bool nonSolidFaceFilling = false;
|
||||
bool storageBuffers = false;
|
||||
};
|
||||
|
||||
struct RenderDeviceLimits
|
||||
{
|
||||
UInt64 minUniformBufferOffsetAlignment;
|
||||
UInt64 maxStorageBufferSize;
|
||||
UInt64 maxUniformBufferSize;
|
||||
};
|
||||
|
||||
struct RenderDeviceInfo
|
||||
|
||||
@@ -40,6 +40,13 @@ namespace Nz
|
||||
ShaderBinding& operator=(const ShaderBinding&) = delete;
|
||||
ShaderBinding& operator=(ShaderBinding&&) = delete;
|
||||
|
||||
struct StorageBufferBinding
|
||||
{
|
||||
RenderBuffer* buffer;
|
||||
UInt64 offset;
|
||||
UInt64 range;
|
||||
};
|
||||
|
||||
struct TextureBinding
|
||||
{
|
||||
const Texture* texture;
|
||||
@@ -56,7 +63,7 @@ namespace Nz
|
||||
struct Binding
|
||||
{
|
||||
std::size_t bindingIndex;
|
||||
std::variant<TextureBinding, UniformBufferBinding> content;
|
||||
std::variant<StorageBufferBinding, TextureBinding, UniformBufferBinding> content;
|
||||
};
|
||||
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user