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

Method GetNumActiveElements

GTE/Graphics/GL46/GL46StructuredBuffer.cpp:82–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80}
81
82bool GL46StructuredBuffer::GetNumActiveElements()
83{
84 auto buffer = GetStructuredBuffer();
85 if (StructuredBuffer::CounterType::NONE == buffer->GetCounterType())
86 {
87 return false;
88 }
89
90 // Read the count from the location in the buffer past the structured
91 // buffer data.
92 GLint count;
93 glBindBuffer(mType, mGLHandle);
94 glGetBufferSubData(mType, mCounterOffset, 4, &count);
95 glBindBuffer(mType, 0);
96
97 count = (std::max)(0, count);
98 buffer->SetNumActiveElements(count);
99
100 return true;
101}
102
103bool GL46StructuredBuffer::SetNumActiveElements()
104{

Callers 1

SetNumActiveElementsMethod · 0.45

Calls 4

glBindBufferFunction · 0.85
glGetBufferSubDataFunction · 0.85
GetCounterTypeMethod · 0.80
SetNumActiveElementsMethod · 0.45

Tested by

no test coverage detected