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

Method SetNumActiveElements

GTE/Graphics/GL46/GL46StructuredBuffer.cpp:103–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103bool GL46StructuredBuffer::SetNumActiveElements()
104{
105 auto buffer = GetStructuredBuffer();
106 if (StructuredBuffer::CounterType::NONE == buffer->GetCounterType())
107 {
108 return false;
109 }
110
111 // Get count from front end structured buffer object.
112 if (!buffer->GetKeepInternalCount())
113 {
114 GLint count = buffer->GetNumActiveElements();
115
116 glBindBuffer(mType, mGLHandle);
117 glBufferSubData(mType, mCounterOffset, 4, &count);
118 glBindBuffer(mType, 0);
119 }
120
121 return true;
122}
123
124bool GL46StructuredBuffer::CopyGpuToCpu()
125{

Callers 3

GetNumActiveElementsMethod · 0.45
EnableSBuffersMethod · 0.45
GetNumActiveElementsMethod · 0.45

Calls 5

glBindBufferFunction · 0.85
glBufferSubDataFunction · 0.85
GetCounterTypeMethod · 0.80
GetKeepInternalCountMethod · 0.80
GetNumActiveElementsMethod · 0.45

Tested by

no test coverage detected