载入中...
搜索中...
未找到
ShaderSystem.cpp
浏览该文件的文档.
68 if (binding < 0 || binding >= kMaxBindings) throw Exception("ShaderSystem.attachBuffer: binding out of range");
102void ShaderSystem::downloadRange(int binding, float *out, int floatCount, int startFloat) const {
Backend-agnostic compute program. Bind storage buffers then dispatch via Gpgpu::dispatch....
Definition ComputeShader.h:15
virtual void bindBuffer(int binding, GpuBuffer *buffer)=0
Bind a storage buffer to set=0 binding. binding in [0, kMaxBindings).
GPGPU module — compute shaders + storage buffers via the active Graphics backend. Uses the graphics q...
Definition Gpgpu.h:23
ComputeShader * newShader(const std::string &source)
Compatibility-only raw-owning shader factory (Vulkan: GLSL; WebGPU: WGSL). Vulkan delegates to the ch...
Definition Gpgpu.cpp:324
void dispatch(ComputeShader *shader, int groupsX, int groupsY=1, int groupsZ=1)
Record + submit a compute dispatch and wait for completion (sync). groups*: workgroup counts (not thr...
Definition Gpgpu.cpp:396
GpuBuffer * newBuffer(int byteSize, const std::string &usage="storage")
Allocate a GPU buffer. usage: "storage" (SSBO, device-local) | "staging" (host-visible transfer).
Definition Gpgpu.cpp:372
Backend-agnostic GPU buffer for compute (storage) or CPU staging transfers. Squirrel-owned; derived c...
Definition GpuBuffer.h:18
virtual void writeFloat32s(const float *data, int count, int startIndex=0)=0
Bulk float upload/download (one transfer). startIndex is in floats.
virtual void readFloat32s(float *out, int count, int startIndex=0) const =0
Reads float 32 s.
void upload(int binding, const float *data, int floatCount)
Uploads upload.
Definition ShaderSystem.cpp:76
void downloadRange(int binding, float *out, int floatCount, int startFloat) const
Download floats from an existing resident buffer range.
Definition ShaderSystem.cpp:102
static constexpr int kDefaultLocalSize
Definition ShaderSystem.h:37
void download(int binding, float *out, int floatCount) const
Downloads download.
Definition ShaderSystem.cpp:83
void attachBuffer(int binding, GpuBuffer *buffer)
Attach a non-owning resident buffer produced by another GPU system.
Definition ShaderSystem.cpp:67
void resetStatistics()
Reset transfer and dispatch counters used for profiling.
Definition ShaderSystem.cpp:165
void setShader(ComputeShader *shader, bool takeOwnership=false)
Sets the shader.
Definition ShaderSystem.cpp:32
void uploadRange(int binding, const float *data, int floatCount, int startFloat)
Upload floats into an existing resident buffer range.
Definition ShaderSystem.cpp:91
void recordDispatch(Sequence *sequence, int entityCount, float dt=0.f)
Record this system into a caller-owned sequence without submitting or waiting. The sequence and all a...
Definition ShaderSystem.cpp:150