aboutsummaryrefslogtreecommitdiff
path: root/src/Rendering/Shader.h
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2025-08-13 18:20:54 +0200
committerhachem <im@hachem.wtf>2025-08-13 18:20:54 +0200
commitf1517709556827fb8b7bab00bdee4a9794d88dd1 (patch)
treea1b2325c8bc693bff0ace1fd98ea7dac91f76286 /src/Rendering/Shader.h
parent1ad6bc34323f5b30d463ebe47a58d47ff9d4f328 (diff)
[add]: Compute shaders and Compute Textures
Diffstat (limited to 'src/Rendering/Shader.h')
-rw-r--r--src/Rendering/Shader.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Rendering/Shader.h b/src/Rendering/Shader.h
index a6b287a..aa46f07 100644
--- a/src/Rendering/Shader.h
+++ b/src/Rendering/Shader.h
@@ -5,6 +5,11 @@
#include <memory>
#include <glm/glm.hpp>
+#define SHADER_STORAGE_BARRIER_BIT 0x00002000
+#define UNIFORM_BARRIER_BIT 0x00000004
+#define TEXTURE_FETCH_BARRIER_BIT 0x00000008
+#define IMAGE_ACCESS_BARRIER_BIT 0x00000020
+
namespace Donut
{
class Shader
@@ -18,14 +23,20 @@ namespace Donut
virtual void SetInt(const std::string& name, int value) = 0;
virtual void SetIntArray(const std::string& name, int* values, uint32_t count) = 0;
virtual void SetFloat(const std::string& name, float value) = 0;
+ virtual void SetFloat2(const std::string& name, const glm::vec2& value) = 0;
virtual void SetFloat3(const std::string& name, const glm::vec3& value) = 0;
virtual void SetFloat4(const std::string& name, const glm::vec4& value) = 0;
virtual void SetMat4(const std::string& name, const glm::mat4& value) = 0;
+ virtual void Dispatch(uint32_t x, uint32_t y = 1, uint32_t z = 1) = 0;
+ virtual void DispatchIndirect(uint32_t offset = 0) = 0;
+ virtual void MemoryBarrier(uint32_t barriers) = 0;
+
virtual const std::string& GetName() const = 0;
static Shader* Create(const std::string& filepath);
static Shader* Create(const std::string& name, const std::string& vertexSrc, const std::string& fragmentSrc);
+ static Shader* CreateCompute(const std::string& name, const std::string& computeSrc);
};
class ShaderLibrary