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

Method initGridLineBuffer

Rendering/layers/Grid.cpp:8–16  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6
7
8void RendererWGPU::initGridLineBuffer() {
9 const float lines[] = {
10 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1,
11 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1,
12 };
13 WGPUContext& ctx = WGPUContext::instance();
14 gridLayer_.gridLineVb = ctx.createBuffer(sizeof(lines), wgpu::BufferUsage::Vertex | wgpu::BufferUsage::CopyDst, "Grid_Cell_Unit_Lines");
15 ctx.queue()->writeBuffer(*gridLayer_.gridLineVb, 0, lines, sizeof(lines));
16}
17
18bool RendererWGPU::prepareGridCpuData(const View::RenderRectGridView& grid) {
19 struct GridBuildContext {

Callers

nothing calls this directly

Calls 1

createBufferMethod · 0.45

Tested by

no test coverage detected