36 static constexpr int kMaxBindings = ComputeShader::kMaxBindings;
37 static constexpr int kDefaultLocalSize = 64;
48 void setGpgpu(
Gpgpu *gpu);
54 void setShaderSource(
const std::string &glsl);
67 void setLocalSize(
int localSize);
87 void upload(
int binding,
const float *data,
int floatCount);
89 void download(
int binding,
float *out,
int floatCount)
const;
92 void uploadRange(
int binding,
const float *data,
int floatCount,
int startFloat);
94 void downloadRange(
int binding,
float *out,
int floatCount,
int startFloat)
const;
103 void resetStatistics();
107 void upload(
int binding,
const std::vector<float> &data);
109 std::vector<float> download(
int binding,
int floatCount)
const;
114 float getFloat(
int index)
const;
121 void dispatch(
int entityCount,
float dt = 0.f);
133 Gpgpu *gpu_ =
nullptr;
135 bool ownsShader_ =
false;
136 int localSize_ = kDefaultLocalSize;
138 bool ownsBuffer_[kMaxBindings]{};
139 uint64_t uploadCount_ = 0;
140 mutable uint64_t downloadCount_ = 0;
141 uint64_t dispatchCount_ = 0;
#define EVENGINE_API_WORLD
std::unique_ptr< gpgpu::GpuBuffer > buffer
std::unique_ptr< gpgpu::Sequence > sequence
eve::action::ActionVfxBinding binding
Backend-agnostic compute program. Bind storage buffers then dispatch via Gpgpu::dispatch....
GPGPU module — compute shaders + storage buffers via the active Graphics backend. Uses the graphics q...
Backend-agnostic GPU buffer for compute (storage) or CPU staging transfers. Squirrel-owned; derived c...
EVENGINE_API_WORLD public API.
EVENGINE_API_WORLD public API.
Gpgpu * getGpgpu() const
Returns the gpgpu.
ShaderSystem()=default
Shader system.
uint64_t getDispatchCount() const
Number of compute dispatches issued through this system.
int getLocalSize() const
Returns the local size.
ShaderSystem & operator=(const ShaderSystem &)=delete
ShaderSystem(const ShaderSystem &)=delete
ComputeShader * getShader() const
Returns the shader.
uint64_t getDownloadCount() const
Number of device-to-host downloads issued through this system.
uint64_t getUploadCount() const
Number of host-to-device uploads issued through this system.
Fluids module — interactive surface fluid simulation.