MCPcopy Create free account
hub / github.com/ElectroZybr/LatticeLab / initPotentialFieldQuadBuffer

Method initPotentialFieldQuadBuffer

Rendering/layers/Field.cpp:124–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122}
123
124void RendererWGPU::initPotentialFieldQuadBuffer() {
125 static constexpr float quad[] = {
126 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f,
127 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f,
128 };
129 WGPUContext& ctx = WGPUContext::instance();
130 fieldLayer_.potentialFieldQuadVb = ctx.createBuffer(sizeof(quad), wgpu::BufferUsage::Vertex | wgpu::BufferUsage::CopyDst, "Potential_Field_Quad");
131 ctx.queue()->writeBuffer(*fieldLayer_.potentialFieldQuadVb, 0, quad, sizeof(quad));
132}
133
134void RendererWGPU::uploadPreparedFieldInstancesGpu() {
135 const uint64_t instBytes = fieldLayer_.fieldData.size() * sizeof(FieldInstance);

Callers

nothing calls this directly

Calls 1

createBufferMethod · 0.45

Tested by

no test coverage detected