History

INtroducing the stream format and the Stream and making it work for the model mesh

Sam Gateau committed 12 years ago

Commit 23905591 parent 7b5d2ef9 files · +547 −73Browse files

Showing the changes to interface/src/gpu/GLBackend.cpp (1 of 9 files). Show all

Unified · Split

interface/src/gpu/GLBackend.cpp+301−44
@@ -18,6 +18,14 @@ using namespace gpu; · 17 unmodified lines
1818
1919 GLBackend::CommandCall GLBackend::_commandCalls[Batch::NUM_COMMANDS] =
2020 {
21+ (&::gpu::GLBackend::do_draw),
22+ (&::gpu::GLBackend::do_drawIndexed),
23+ (&::gpu::GLBackend::do_drawInstanced),
24+ (&::gpu::GLBackend::do_drawIndexedInstanced),
25+
26+ (&::gpu::GLBackend::do_setInputStream),
27+ (&::gpu::GLBackend::do_setInputFormat),
28+
2129 (&::gpu::GLBackend::do_glEnable),
2230 (&::gpu::GLBackend::do_glDisable),
2331
@@ -70,8 +78,42 @@ GLBackend::CommandCall GLBackend::_commandCalls[Batch::NUM_COMMANDS] = · 46 unmodified lines
7078 (&::gpu::GLBackend::do_glMaterialfv),
7179 };
7280
81+const GLenum GLBackend::_primitiveToGLmode[NUM_PRIMITIVES] = {
82+ GL_POINTS,
83+ GL_LINES,
84+ GL_LINE_STRIP,
85+ GL_TRIANGLES,
86+ GL_TRIANGLE_STRIP,
87+ GL_QUADS,
88+};
7389
74−GLBackend::GLBackend() {
90+static const GLenum _elementTypeToGLType[Element::NUM_TYPES]= {
91+ GL_FLOAT,
92+ GL_INT,
93+ GL_UNSIGNED_INT,
94+ GL_HALF_FLOAT,
95+ GL_SHORT,
96+ GL_UNSIGNED_SHORT,
97+ GL_BYTE,
98+ GL_UNSIGNED_BYTE,
99+ GL_FLOAT,
100+ GL_INT,
101+ GL_UNSIGNED_INT,
102+ GL_HALF_FLOAT,
103+ GL_SHORT,
104+ GL_UNSIGNED_SHORT,
105+ GL_BYTE,
106+ GL_UNSIGNED_BYTE
107+};
108+
109+
110+GLBackend::GLBackend() :
111+ _inputFormat(0),
112+ _inputStream(0),
113+ _needInputFormatUpdate(true),
114+ _needInputStreamUpdate(true),
115+ _inputAttributeActivation(0)
116+{
75117
76118 }
77119
@@ -87,7 +129,7 @@ void GLBackend::renderBatch(Batch& batch) { · 9 unmodified lines
87129 GLBackend backend;
88130
89131 for (int i = 0; i < numCommands; i++) {
90− CommandCall call = _commandCalls[((*command) - Batch::COMMAND_glEnable)];
132+ CommandCall call = _commandCalls[(*command)];
91133 (backend.*(call))(batch, *offset);
92134 command++;
93135 offset++;
@@ -126,24 +168,239 @@ void GLBackend::checkGLError() { · 32 unmodified lines
126168 }
127169 }
128170
171+#define CHECK_GL_ERROR() ::gpu::GLBackend::checkGLError()
172+//#define CHECK_GL_ERROR()
173+
174+void GLBackend::do_draw(Batch& batch, uint32 paramOffset) {
175+ updateInput();
176+
177+ Primitive primitiveType = (Primitive)batch._params[paramOffset + 2]._uint;
178+ GLenum mode = _primitiveToGLmode[primitiveType];
179+ uint32 numVertices = batch._params[paramOffset + 1]._uint;
180+ uint32 startVertex = batch._params[paramOffset + 0]._uint;
181+
182+ glDrawArrays(mode, startVertex, numVertices);
183+ CHECK_GL_ERROR();
184+}
185+
186+void GLBackend::do_drawIndexed(Batch& batch, uint32 paramOffset) {
187+ updateInput();
188+
189+ Primitive primitiveType = (Primitive)batch._params[paramOffset + 2]._uint;
190+ GLenum mode = _primitiveToGLmode[primitiveType];
191+ uint32 numIndices = batch._params[paramOffset + 1]._uint;
192+ uint32 startIndex = batch._params[paramOffset + 0]._uint;
193+
194+ glDrawElements(mode, numIndices, GL_UNSIGNED_INT, (GLvoid*) startIndex);
195+ CHECK_GL_ERROR();
196+}
197+
198+void GLBackend::do_drawInstanced(Batch& batch, uint32 paramOffset) {
199+ CHECK_GL_ERROR();
200+}
201+
202+void GLBackend::do_drawIndexedInstanced(Batch& batch, uint32 paramOffset) {
203+ CHECK_GL_ERROR();
204+}
205+
206+
207+void GLBackend::do_setInputStream(Batch& batch, uint32 paramOffset) {
208+ const Stream* stream = reinterpret_cast<const Stream*>(batch.editResource(batch._params[paramOffset]._uint)->_pointer);
209+
210+ if (stream != _inputStream) {
211+ _inputStream = stream;
212+ _needInputStreamUpdate = true;
213+ }
214+}
215+
216+void GLBackend::do_setInputFormat(Batch& batch, uint32 paramOffset) {
217+ const StreamFormat* format = reinterpret_cast<const StreamFormat*>(batch.editResource(batch._params[paramOffset]._uint)->_pointer);
218+
219+ if (format != _inputFormat) {
220+ _inputFormat = format;
221+ _needInputFormatUpdate = true;
222+ }
223+}
224+
225+#define SUPPORT_LEGACY_OPENGL
226+#if defined(SUPPORT_LEGACY_OPENGL)
227+static const int NUM_CLASSIC_ATTRIBS = StreamFormat::SLOT_TANGENT;
228+static const GLenum attributeSlotToClassicAttribName[NUM_CLASSIC_ATTRIBS] = {
229+ GL_VERTEX_ARRAY,
230+ GL_NORMAL_ARRAY,
231+ GL_TEXTURE_COORD_ARRAY,
232+ GL_COLOR_ARRAY
233+};
234+#endif
235+
236+void GLBackend::updateInput() {
237+ if (_needInputFormatUpdate || _needInputStreamUpdate) {
238+
239+ if (_needInputFormatUpdate) {
240+ InputActivationCache newActivation;
241+
242+ // Check expected activation
243+ if (_inputFormat) {
244+ const StreamFormat::AttributeMap& attributes = _inputFormat->getAttributes();
245+ for (StreamFormat::AttributeMap::const_iterator it = attributes.begin(); it != attributes.end(); it++) {
246+ const StreamFormat::Attribute& attrib = (*it).second;
247+ newActivation.set(attrib._slot);
248+ }
249+ }
250+
251+ // Manage Activation what was and what is expected now
252+ for (int i = 0; i < newActivation.size(); i++) {
253+ bool newState = newActivation[i];
254+ if (newState != _inputAttributeActivation[i]) {
255+#if defined(SUPPORT_LEGACY_OPENGL)
256+ if (i < NUM_CLASSIC_ATTRIBS) {
257+ if (newState) {
258+ glEnableClientState(attributeSlotToClassicAttribName[i]);
259+ }
260+ else {
261+ glDisableClientState(attributeSlotToClassicAttribName[i]);
262+ }
263+ } else {
264+#else
265+ {
266+#endif
267+ if (newState) {
268+ glEnableVertexAttribArray(i);
269+ } else {
270+ glDisableVertexAttribArray(i);
271+ }
272+ }
273+ CHECK_GL_ERROR();
274+
275+ _inputAttributeActivation.flip(i);
276+ }
277+ }
278+ }
279+
280+ // now we need to bind the buffers and assign the attrib pointers
281+ if (_inputStream && _inputFormat) {
282+ const Stream::Buffers& buffers = _inputStream->getBuffers();
283+ const Stream::Offsets& offsets = _inputStream->getOffsets();
284+ const Stream::Strides& strides = _inputStream->getStrides();
285+
286+ const StreamFormat::AttributeMap& attributes = _inputFormat->getAttributes();
287+
288+ for (StreamFormat::ChannelMap::const_iterator channelIt = _inputFormat->getChannels().begin();
289+ channelIt != _inputFormat->getChannels().end();
290+ channelIt++) {
291+ const StreamFormat::ChannelMap::value_type::second_type& channel = (*channelIt).second;
292+ if ((*channelIt).first < buffers.size()) {
293+ int bufferNum = (*channelIt).first;
294+ GLuint vbo = gpu::GLBackend::getBufferID((*buffers[bufferNum]));
295+ glBindBuffer(GL_ARRAY_BUFFER, vbo);
296+ CHECK_GL_ERROR();
297+
298+ for (int i = 0; i < channel._slots.size(); i++) {
299+ const StreamFormat::Attribute& attrib = attributes.at(channel._slots[i]);
300+ GLuint count = attrib._element.getDimensionCount();
301+ GLenum type = _elementTypeToGLType[attrib._element.getType()];
302+ GLuint stride = strides[bufferNum];
303+ GLuint pointer = attrib._offset + offsets[bufferNum];
304+#if defined(SUPPORT_LEGACY_OPENGL)
305+ if (attrib._slot < NUM_CLASSIC_ATTRIBS) {
306+ switch (attrib._slot) {
307+ case StreamFormat::SLOT_POSITION:
308+ glVertexPointer(count, type, stride, (GLvoid*)pointer);
309+ break;
310+ case StreamFormat::SLOT_COLOR:
311+ glColorPointer(count, type, stride, (GLvoid*)pointer);
312+ break;
313+ case StreamFormat::SLOT_TEXCOORD:
314+ glTexCoordPointer(count, type, stride, (GLvoid*)pointer);
315+ break;
316+ case StreamFormat::SLOT_NORMAL:
317+ glNormalPointer(type, stride, (GLvoid*)pointer);
318+ break;
319+ };
320+ } else {
321+#else
322+ {
323+#endif
324+ glVertexAttribPointer(attrib._slot, count, type, attrib._element.isNormalized(), stride, (GLvoid*)pointer);
325+ }
326+ CHECK_GL_ERROR();
327+ }
328+ }
329+ }
330+ }
331+
332+ _needInputStreamUpdate = false;
333+ _needInputFormatUpdate = false;
334+ }
335+
336+/* Fancy version GL4.4
337+ if (_needInputFormatUpdate) {
338+
339+ InputActivationCache newActivation;
340+
341+ // Assign the vertex format required
342+ if (_inputFormat) {
343+ const StreamFormat::AttributeMap& attributes = _inputFormat->getAttributes();
344+ for (StreamFormat::AttributeMap::const_iterator it = attributes.begin(); it != attributes.end(); it++) {
345+ const StreamFormat::Attribute& attrib = (*it).second;
346+ newActivation.set(attrib._slot);
347+ glVertexAttribFormat(
348+ attrib._slot,
349+ attrib._element.getDimensionCount(),
350+ _elementTypeToGLType[attrib._element.getType()],
351+ attrib._element.isNormalized(),
352+ attrib._stride);
353+ }
354+ CHECK_GL_ERROR();
355+ }
356+
357+ // Manage Activation what was and what is expected now
358+ for (int i = 0; i < newActivation.size(); i++) {
359+ bool newState = newActivation[i];
360+ if (newState != _inputAttributeActivation[i]) {
361+ if (newState) {
362+ glEnableVertexAttribArray(i);
363+ } else {
364+ glDisableVertexAttribArray(i);
365+ }
366+ _inputAttributeActivation.flip(i);
367+ }
368+ }
369+ CHECK_GL_ERROR();
370+
371+ _needInputFormatUpdate = false;
372+ }
373+
374+ if (_needInputStreamUpdate) {
375+ if (_inputStream) {
376+ const Stream::Buffers& buffers = _inputStream->getBuffers();
377+ const Stream::Offsets& offsets = _inputStream->getOffsets();
378+ const Stream::Strides& strides = _inputStream->getStrides();
379+
380+ for (int i = 0; i < buffers.size(); i++) {
381+ GLuint vbo = gpu::GLBackend::getBufferID((*buffers[i]));
382+ glBindVertexBuffer(i, vbo, offsets[i], strides[i]);
383+ }
384+
385+ CHECK_GL_ERROR();
386+ }
387+ _needInputStreamUpdate = false;
388+ }
389+*/
390+}
129391
130392 // TODO: As long as we have gl calls explicitely issued from interface
131393 // code, we need to be able to record and batch these calls. THe long
132394 // term strategy is to get rid of any GL calls in favor of the HIFI GPU API
133395
134−//#define ADD_COMMAND(call) _commands.push_back(COMMAND_##call); _commandCalls.push_back(&gpu::Batch::do_##call); _commandOffsets.push_back(_params.size());
135−#define ADD_COMMAND(call) _commands.push_back(COMMAND_##call); _commandOffsets.push_back(_params.size());
136−//#define ADD_COMMAND_GL(call) _commands.push_back(COMMAND_##call); _commandCalls.push_back(&gpu::GLBackend::do_##call); _commandOffsets.push_back(_params.size());
137396 #define ADD_COMMAND_GL(call) _commands.push_back(COMMAND_##call); _commandOffsets.push_back(_params.size());
138397
139398 //#define DO_IT_NOW(call, offset) runLastCommand();
140399 #define DO_IT_NOW(call, offset)
141400
142−//#define CHECK_GL_ERROR() ::gpu::backend::checkGLError()
143−#define CHECK_GL_ERROR()
144401
145402 void Batch::_glEnable(GLenum cap) {
146− ADD_COMMAND(glEnable);
403+ ADD_COMMAND_GL(glEnable);
147404
148405 _params.push_back(cap);
149406
@@ -155,7 +412,7 @@ void GLBackend::do_glEnable(Batch& batch, uint32 paramOffset) { · 5 unmodified lines
155412 }
156413
157414 void Batch::_glDisable(GLenum cap) {
158− ADD_COMMAND(glDisable);
415+ ADD_COMMAND_GL(glDisable);
159416
160417 _params.push_back(cap);
161418
@@ -167,7 +424,7 @@ void GLBackend::do_glDisable(Batch& batch, uint32 paramOffset) { · 5 unmodified lines
167424 }
168425
169426 void Batch::_glEnableClientState(GLenum array) {
170− ADD_COMMAND(glEnableClientState);
427+ ADD_COMMAND_GL(glEnableClientState);
171428
172429 _params.push_back(array);
173430
@@ -179,7 +436,7 @@ void GLBackend::do_glEnableClientState(Batch& batch, uint32 paramOffset) { · 5 unmodified lines
179436 }
180437
181438 void Batch::_glDisableClientState(GLenum array) {
182− ADD_COMMAND(glDisableClientState);
439+ ADD_COMMAND_GL(glDisableClientState);
183440
184441 _params.push_back(array);
185442
@@ -191,7 +448,7 @@ void GLBackend::do_glDisableClientState(Batch& batch, uint32 paramOffset) { · 5 unmodified lines
191448 }
192449
193450 void Batch::_glCullFace(GLenum mode) {
194− ADD_COMMAND(glCullFace);
451+ ADD_COMMAND_GL(glCullFace);
195452
196453 _params.push_back(mode);
197454
@@ -203,7 +460,7 @@ void GLBackend::do_glCullFace(Batch& batch, uint32 paramOffset) { · 5 unmodified lines
203460 }
204461
205462 void Batch::_glAlphaFunc(GLenum func, GLclampf ref) {
206− ADD_COMMAND(glAlphaFunc);
463+ ADD_COMMAND_GL(glAlphaFunc);
207464
208465 _params.push_back(ref);
209466 _params.push_back(func);
@@ -218,7 +475,7 @@ void GLBackend::do_glAlphaFunc(Batch& batch, uint32 paramOffset) { · 8 unmodified lines
218475 }
219476
220477 void Batch::_glDepthFunc(GLenum func) {
221− ADD_COMMAND(glDepthFunc);
478+ ADD_COMMAND_GL(glDepthFunc);
222479
223480 _params.push_back(func);
224481
@@ -230,7 +487,7 @@ void GLBackend::do_glDepthFunc(Batch& batch, uint32 paramOffset) { · 5 unmodified lines
230487 }
231488
232489 void Batch::_glDepthMask(GLboolean flag) {
233− ADD_COMMAND(glDepthMask);
490+ ADD_COMMAND_GL(glDepthMask);
234491
235492 _params.push_back(flag);
236493
@@ -242,7 +499,7 @@ void GLBackend::do_glDepthMask(Batch& batch, uint32 paramOffset) { · 5 unmodified lines
242499 }
243500
244501 void Batch::_glDepthRange(GLclampd zNear, GLclampd zFar) {
245− ADD_COMMAND(glDepthRange);
502+ ADD_COMMAND_GL(glDepthRange);
246503
247504 _params.push_back(zFar);
248505 _params.push_back(zNear);
@@ -257,7 +514,7 @@ void GLBackend::do_glDepthRange(Batch& batch, uint32 paramOffset) { · 8 unmodified lines
257514 }
258515
259516 void Batch::_glBindBuffer(GLenum target, GLuint buffer) {
260− ADD_COMMAND(glBindBuffer);
517+ ADD_COMMAND_GL(glBindBuffer);
261518
262519 _params.push_back(buffer);
263520 _params.push_back(target);
@@ -272,7 +529,7 @@ void GLBackend::do_glBindBuffer(Batch& batch, uint32 paramOffset) { · 8 unmodified lines
272529 }
273530
274531 void Batch::_glBindTexture(GLenum target, GLuint texture) {
275− ADD_COMMAND(glBindTexture);
532+ ADD_COMMAND_GL(glBindTexture);
276533
277534 _params.push_back(texture);
278535 _params.push_back(target);
@@ -287,7 +544,7 @@ void GLBackend::do_glBindTexture(Batch& batch, uint32 paramOffset) { · 8 unmodified lines
287544 }
288545
289546 void Batch::_glActiveTexture(GLenum texture) {
290− ADD_COMMAND(glActiveTexture);
547+ ADD_COMMAND_GL(glActiveTexture);
291548
292549 _params.push_back(texture);
293550
@@ -299,7 +556,7 @@ void GLBackend::do_glActiveTexture(Batch& batch, uint32 paramOffset) { · 5 unmodified lines
299556 }
300557
301558 void Batch::_glDrawBuffers(GLsizei n, const GLenum* bufs) {
302− ADD_COMMAND(glDrawBuffers);
559+ ADD_COMMAND_GL(glDrawBuffers);
303560
304561 _params.push_back(cacheData(n * sizeof(GLenum), bufs));
305562 _params.push_back(n);
@@ -314,7 +571,7 @@ void GLBackend::do_glDrawBuffers(Batch& batch, uint32 paramOffset) { · 8 unmodified lines
314571 }
315572
316573 void Batch::_glUseProgram(GLuint program) {
317− ADD_COMMAND(glUseProgram);
574+ ADD_COMMAND_GL(glUseProgram);
318575
319576 _params.push_back(program);
320577
@@ -326,7 +583,7 @@ void GLBackend::do_glUseProgram(Batch& batch, uint32 paramOffset) { · 5 unmodified lines
326583 }
327584
328585 void Batch::_glUniform1f(GLint location, GLfloat v0) {
329− ADD_COMMAND(glUniform1f);
586+ ADD_COMMAND_GL(glUniform1f);
330587
331588 _params.push_back(v0);
332589 _params.push_back(location);
@@ -341,7 +598,7 @@ void GLBackend::do_glUniform1f(Batch& batch, uint32 paramOffset) { · 8 unmodified lines
341598 }
342599
343600 void Batch::_glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) {
344− ADD_COMMAND(glUniformMatrix4fv);
601+ ADD_COMMAND_GL(glUniformMatrix4fv);
345602
346603 const int MATRIX4_SIZE = 16 * sizeof(float);
347604 _params.push_back(cacheData(count * MATRIX4_SIZE, value));
@@ -361,7 +618,7 @@ void GLBackend::do_glUniformMatrix4fv(Batch& batch, uint32 paramOffset) { · 13 unmodified lines
361618 }
362619
363620 void Batch::_glMatrixMode(GLenum mode) {
364− ADD_COMMAND(glMatrixMode);
621+ ADD_COMMAND_GL(glMatrixMode);
365622
366623 _params.push_back(mode);
367624
@@ -373,7 +630,7 @@ void GLBackend::do_glMatrixMode(Batch& batch, uint32 paramOffset) { · 5 unmodified lines
373630 }
374631
375632 void Batch::_glPushMatrix() {
376− ADD_COMMAND(glPushMatrix);
633+ ADD_COMMAND_GL(glPushMatrix);
377634
378635 DO_IT_NOW(_glPushMatrix, 0);
379636 }
@@ -383,7 +640,7 @@ void GLBackend::do_glPushMatrix(Batch& batch, uint32 paramOffset) { · 3 unmodified lines
383640 }
384641
385642 void Batch::_glPopMatrix() {
386− ADD_COMMAND(glPopMatrix);
643+ ADD_COMMAND_GL(glPopMatrix);
387644
388645 DO_IT_NOW(_glPopMatrix, 0);
389646 }
@@ -393,7 +650,7 @@ void GLBackend::do_glPopMatrix(Batch& batch, uint32 paramOffset) { · 3 unmodified lines
393650 }
394651
395652 void Batch::_glMultMatrixf(const GLfloat *m) {
396− ADD_COMMAND(glMultMatrixf);
653+ ADD_COMMAND_GL(glMultMatrixf);
397654
398655 const int MATRIX4_SIZE = 16 * sizeof(float);
399656 _params.push_back(cacheData(MATRIX4_SIZE, m));
@@ -406,7 +663,7 @@ void GLBackend::do_glMultMatrixf(Batch& batch, uint32 paramOffset) { · 6 unmodified lines
406663 }
407664
408665 void Batch::_glLoadMatrixf(const GLfloat *m) {
409− ADD_COMMAND(glLoadMatrixf);
666+ ADD_COMMAND_GL(glLoadMatrixf);
410667
411668 const int MATRIX4_SIZE = 16 * sizeof(float);
412669 _params.push_back(cacheData(MATRIX4_SIZE, m));
@@ -419,7 +676,7 @@ void GLBackend::do_glLoadMatrixf(Batch& batch, uint32 paramOffset) { · 6 unmodified lines
419676 }
420677
421678 void Batch::_glLoadIdentity(void) {
422− ADD_COMMAND(glLoadIdentity);
679+ ADD_COMMAND_GL(glLoadIdentity);
423680
424681 DO_IT_NOW(_glLoadIdentity, 0);
425682 }
@@ -429,7 +686,7 @@ void GLBackend::do_glLoadIdentity(Batch& batch, uint32 paramOffset) { · 3 unmodified lines
429686 }
430687
431688 void Batch::_glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z) {
432− ADD_COMMAND(glRotatef);
689+ ADD_COMMAND_GL(glRotatef);
433690
434691 _params.push_back(z);
435692 _params.push_back(y);
@@ -448,7 +705,7 @@ void GLBackend::do_glRotatef(Batch& batch, uint32 paramOffset) { · 12 unmodified lines
448705 }
449706
450707 void Batch::_glScalef(GLfloat x, GLfloat y, GLfloat z) {
451− ADD_COMMAND(glScalef);
708+ ADD_COMMAND_GL(glScalef);
452709
453710 _params.push_back(z);
454711 _params.push_back(y);
@@ -465,7 +722,7 @@ void GLBackend::do_glScalef(Batch& batch, uint32 paramOffset) { · 10 unmodified lines
465722 }
466723
467724 void Batch::_glTranslatef(GLfloat x, GLfloat y, GLfloat z) {
468− ADD_COMMAND(glTranslatef);
725+ ADD_COMMAND_GL(glTranslatef);
469726
470727 _params.push_back(z);
471728 _params.push_back(y);
@@ -482,7 +739,7 @@ void GLBackend::do_glTranslatef(Batch& batch, uint32 paramOffset) { · 10 unmodified lines
482739 }
483740
484741 void Batch::_glDrawArrays(GLenum mode, GLint first, GLsizei count) {
485− ADD_COMMAND(glDrawArrays);
742+ ADD_COMMAND_GL(glDrawArrays);
486743
487744 _params.push_back(count);
488745 _params.push_back(first);
@@ -499,7 +756,7 @@ void GLBackend::do_glDrawArrays(Batch& batch, uint32 paramOffset) { · 10 unmodified lines
499756 }
500757
501758 void Batch::_glDrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices) {
502− ADD_COMMAND(glDrawRangeElements);
759+ ADD_COMMAND_GL(glDrawRangeElements);
503760
504761 _params.push_back(cacheResource(indices));
505762 _params.push_back(type);
@@ -522,7 +779,7 @@ void GLBackend::do_glDrawRangeElements(Batch& batch, uint32 paramOffset) { · 16 unmodified lines
522779 }
523780
524781 void Batch::_glColorPointer(GLint size, GLenum type, GLsizei stride, const void *pointer) {
525− ADD_COMMAND(glColorPointer);
782+ ADD_COMMAND_GL(glColorPointer);
526783
527784 _params.push_back(cacheResource(pointer));
528785 _params.push_back(stride);
@@ -541,7 +798,7 @@ void GLBackend::do_glColorPointer(Batch& batch, uint32 paramOffset) { · 12 unmodified lines
541798 }
542799
543800 void Batch::_glNormalPointer(GLenum type, GLsizei stride, const void *pointer) {
544− ADD_COMMAND(glNormalPointer);
801+ ADD_COMMAND_GL(glNormalPointer);
545802
546803 _params.push_back(cacheResource(pointer));
547804 _params.push_back(stride);
@@ -558,7 +815,7 @@ void GLBackend::do_glNormalPointer(Batch& batch, uint32 paramOffset) { · 10 unmodified lines
558815 }
559816
560817 void Batch::_glTexCoordPointer(GLint size, GLenum type, GLsizei stride, const void *pointer) {
561− ADD_COMMAND(glTexCoordPointer);
818+ ADD_COMMAND_GL(glTexCoordPointer);
562819
563820 _params.push_back(cacheResource(pointer));
564821 _params.push_back(stride);
@@ -577,7 +834,7 @@ void GLBackend::do_glTexCoordPointer(Batch& batch, uint32 paramOffset) { · 12 unmodified lines
577834 }
578835
579836 void Batch::_glVertexPointer(GLint size, GLenum type, GLsizei stride, const void *pointer) {
580− ADD_COMMAND(glVertexPointer);
837+ ADD_COMMAND_GL(glVertexPointer);
581838
582839 _params.push_back(cacheResource(pointer));
583840 _params.push_back(stride);
@@ -597,7 +854,7 @@ void GLBackend::do_glVertexPointer(Batch& batch, uint32 paramOffset) { · 13 unmodified lines
597854
598855
599856 void Batch::_glVertexAttribPointer(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer) {
600− ADD_COMMAND(glVertexAttribPointer);
857+ ADD_COMMAND_GL(glVertexAttribPointer);
601858
602859 _params.push_back(cacheResource(pointer));
603860 _params.push_back(stride);
@@ -620,7 +877,7 @@ void GLBackend::do_glVertexAttribPointer(Batch& batch, uint32 paramOffset) { · 16 unmodified lines
620877 }
621878
622879 void Batch::_glEnableVertexAttribArray(GLint location) {
623− ADD_COMMAND(glEnableVertexAttribArray);
880+ ADD_COMMAND_GL(glEnableVertexAttribArray);
624881
625882 _params.push_back(location);
626883
@@ -632,7 +889,7 @@ void GLBackend::do_glEnableVertexAttribArray(Batch& batch, uint32 paramOffset) { · 5 unmodified lines
632889 }
633890
634891 void Batch::_glDisableVertexAttribArray(GLint location) {
635− ADD_COMMAND(glDisableVertexAttribArray);
892+ ADD_COMMAND_GL(glDisableVertexAttribArray);
636893
637894 _params.push_back(location);
638895
@@ -644,7 +901,7 @@ void GLBackend::do_glDisableVertexAttribArray(Batch& batch, uint32 paramOffset) · 5 unmodified lines
644901 }
645902
646903 void Batch::_glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) {
647− ADD_COMMAND(glColor4f);
904+ ADD_COMMAND_GL(glColor4f);
648905
649906 _params.push_back(alpha);
650907 _params.push_back(blue);
@@ -663,7 +920,7 @@ void GLBackend::do_glColor4f(Batch& batch, uint32 paramOffset) { · 12 unmodified lines
663920 }
664921
665922 void Batch::_glMaterialf(GLenum face, GLenum pname, GLfloat param) {
666− ADD_COMMAND(glMaterialf);
923+ ADD_COMMAND_GL(glMaterialf);
667924
668925 _params.push_back(param);
669926 _params.push_back(pname);
@@ -680,7 +937,7 @@ void GLBackend::do_glMaterialf(Batch& batch, uint32 paramOffset) { · 10 unmodified lines
680937 }
681938
682939 void Batch::_glMaterialfv(GLenum face, GLenum pname, const GLfloat *params) {
683− ADD_COMMAND(glMaterialfv);
940+ ADD_COMMAND_GL(glMaterialfv);
684941
685942 _params.push_back(cacheData(4 * sizeof(float), params));
686943 _params.push_back(pname);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t