| 101 | } |
| 102 | |
| 103 | bool 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 | |
| 124 | bool GL46StructuredBuffer::CopyGpuToCpu() |
| 125 | { |
no test coverage detected