MCPcopy Create free account
hub / github.com/davideberly/GeometricTools / AttachToUnit

Method AttachToUnit

GTE/Graphics/GL46/GL46StructuredBuffer.cpp:32–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30}
31
32void GL46StructuredBuffer::AttachToUnit(GLint shaderStorageBufferUnit)
33{
34 auto buffer = GetStructuredBuffer();
35
36 // Cannot use glBindBufferBase because if structured buffer has a counter
37 // associated with it, then there are extra bytes allocated in the buffer
38 // to store the counter value. The structured buffer data does start
39 // at offset=0, so all that is needed is the actual number of data bytes
40 // in the StructuredBuffer object.
41 glBindBufferRange(GL_SHADER_STORAGE_BUFFER, shaderStorageBufferUnit, mGLHandle, 0, buffer->GetNumBytes());
42}
43
44bool GL46StructuredBuffer::CopyCounterValueToBuffer(GL46Buffer* targetBuffer, GLint offset)
45{

Callers

nothing calls this directly

Calls 2

glBindBufferRangeFunction · 0.85
GetNumBytesMethod · 0.45

Tested by

no test coverage detected