/**************************************************************************
- *
+ *
* Copyright 2003 VMware, Inc.
* Copyright 2009 VMware, Inc.
* All Rights Reserved.
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
- *
+ *
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
+ *
**************************************************************************/
#include <stdio.h>
-#include "main/arrayobj.h"
-#include "main/glheader.h"
-#include "main/context.h"
-#include "main/state.h"
-#include "main/draw_validate.h"
-#include "main/dispatch.h"
-#include "main/varray.h"
-#include "main/bufferobj.h"
-#include "main/enums.h"
-#include "main/macros.h"
-#include "main/transformfeedback.h"
+#include "arrayobj.h"
+#include "glheader.h"
+#include "context.h"
+#include "state.h"
+#include "draw.h"
+#include "draw_validate.h"
+#include "dispatch.h"
+#include "varray.h"
+#include "bufferobj.h"
+#include "enums.h"
+#include "macros.h"
+#include "transformfeedback.h"
typedef struct {
GLuint count;
{
const struct gl_vertex_array_object *vao = ctx->Array.VAO;
- printf("vbo_exec_DrawArrays(mode 0x%x, start %d, count %d):\n",
+ printf("_mesa_exec_DrawArrays(mode 0x%x, start %d, count %d):\n",
mode, start, count);
unsigned i;
int offset = (int) (GLintptr)
_mesa_vertex_attrib_address(array, binding);
- unsigned multiplier;
- switch (array->Type) {
- case GL_DOUBLE:
- case GL_INT64_ARB:
- case GL_UNSIGNED_INT64_ARB:
- multiplier = 2;
- break;
- default:
- multiplier = 1;
- }
+ unsigned multiplier;
+ switch (array->Type) {
+ case GL_DOUBLE:
+ case GL_INT64_ARB:
+ case GL_UNSIGNED_INT64_ARB:
+ multiplier = 2;
+ break;
+ default:
+ multiplier = 1;
+ }
float *f = (float *) (p + offset);
int *k = (int *) f;
- int i = 0;
- int n = (count - 1) * (binding->Stride / (4 * multiplier))
- + array->Size;
+ int i = 0;
+ int n = (count - 1) * (binding->Stride / (4 * multiplier))
+ + array->Size;
if (n > 32)
n = 32;
printf(" Data at offset %d:\n", offset);
- do {
- if (multiplier == 2)
- printf(" double[%d] = 0x%016llx %lf\n", i,
- ((unsigned long long *) k)[i], ((double *) f)[i]);
- else
- printf(" float[%d] = 0x%08x %f\n", i, k[i], f[i]);
- i++;
- } while (i < n);
+ do {
+ if (multiplier == 2)
+ printf(" double[%d] = 0x%016llx %lf\n", i,
+ ((unsigned long long *) k)[i], ((double *) f)[i]);
+ else
+ printf(" float[%d] = 0x%08x %f\n", i, k[i], f[i]);
+ i++;
+ } while (i < n);
ctx->Driver.UnmapBuffer(ctx, bufObj, MAP_INTERNAL);
}
}
* splitting one DrawArrays() into two.
*/
static void
-vbo_draw_arrays(struct gl_context *ctx, GLenum mode, GLint start,
- GLsizei count, GLuint numInstances, GLuint baseInstance,
- GLuint drawID)
+_mesa_draw_arrays(struct gl_context *ctx, GLenum mode, GLint start,
+ GLsizei count, GLuint numInstances, GLuint baseInstance,
+ GLuint drawID)
{
struct _mesa_prim prim;
* Execute a glRectf() function.
*/
static void GLAPIENTRY
-vbo_exec_Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
+_mesa_exec_Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
static void GLAPIENTRY
-vbo_exec_EvalMesh1(GLenum mode, GLint i1, GLint i2)
+_mesa_exec_EvalMesh1(GLenum mode, GLint i1, GLint i2)
{
GET_CURRENT_CONTEXT(ctx);
GLint i;
static void GLAPIENTRY
-vbo_exec_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2)
+_mesa_exec_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2)
{
GET_CURRENT_CONTEXT(ctx);
GLfloat u, du, v, dv, v1, u1;
* Called from glDrawArrays when in immediate mode (not display list mode).
*/
static void GLAPIENTRY
-vbo_exec_DrawArrays(GLenum mode, GLint start, GLsizei count)
+_mesa_exec_DrawArrays(GLenum mode, GLint start, GLsizei count)
{
GET_CURRENT_CONTEXT(ctx);
if (0)
check_draw_arrays_data(ctx, start, count);
- vbo_draw_arrays(ctx, mode, start, count, 1, 0, 0);
+ _mesa_draw_arrays(ctx, mode, start, count, 1, 0, 0);
if (0)
print_draw_arrays(ctx, mode, start, count);
* display list mode).
*/
static void GLAPIENTRY
-vbo_exec_DrawArraysInstanced(GLenum mode, GLint start, GLsizei count,
- GLsizei numInstances)
+_mesa_exec_DrawArraysInstanced(GLenum mode, GLint start, GLsizei count,
+ GLsizei numInstances)
{
GET_CURRENT_CONTEXT(ctx);
if (0)
check_draw_arrays_data(ctx, start, count);
- vbo_draw_arrays(ctx, mode, start, count, numInstances, 0, 0);
+ _mesa_draw_arrays(ctx, mode, start, count, numInstances, 0, 0);
if (0)
print_draw_arrays(ctx, mode, start, count);
* Called from glDrawArraysInstancedBaseInstance when in immediate mode.
*/
static void GLAPIENTRY
-vbo_exec_DrawArraysInstancedBaseInstance(GLenum mode, GLint first,
- GLsizei count, GLsizei numInstances,
- GLuint baseInstance)
+_mesa_exec_DrawArraysInstancedBaseInstance(GLenum mode, GLint first,
+ GLsizei count, GLsizei numInstances,
+ GLuint baseInstance)
{
GET_CURRENT_CONTEXT(ctx);
if (0)
check_draw_arrays_data(ctx, first, count);
- vbo_draw_arrays(ctx, mode, first, count, numInstances, baseInstance, 0);
+ _mesa_draw_arrays(ctx, mode, first, count, numInstances, baseInstance, 0);
if (0)
print_draw_arrays(ctx, mode, first, count);
* Called from glMultiDrawArrays when in immediate mode.
*/
static void GLAPIENTRY
-vbo_exec_MultiDrawArrays(GLenum mode, const GLint *first,
- const GLsizei *count, GLsizei primcount)
+_mesa_exec_MultiDrawArrays(GLenum mode, const GLint *first,
+ const GLsizei *count, GLsizei primcount)
{
GET_CURRENT_CONTEXT(ctx);
GLint i;
* read by a vertex shader as <gl_DrawIDARB>, as described in
* Section 11.1.3.9."
*/
- vbo_draw_arrays(ctx, mode, first[i], count[i], 1, 0, i);
+ _mesa_draw_arrays(ctx, mode, first[i], count[i], 1, 0, i);
if (0)
print_draw_arrays(ctx, mode, first[i], count[i]);
* we've validated buffer bounds, etc.
*/
static void
-vbo_validated_drawrangeelements(struct gl_context *ctx, GLenum mode,
- GLboolean index_bounds_valid,
- GLuint start, GLuint end,
- GLsizei count, GLenum type,
- const GLvoid * indices,
- GLint basevertex, GLuint numInstances,
- GLuint baseInstance)
+_mesa_validated_drawrangeelements(struct gl_context *ctx, GLenum mode,
+ GLboolean index_bounds_valid,
+ GLuint start, GLuint end,
+ GLsizei count, GLenum type,
+ const GLvoid * indices,
+ GLint basevertex, GLuint numInstances,
+ GLuint baseInstance)
{
struct _mesa_index_buffer ib;
struct _mesa_prim prim;
* Called by glDrawRangeElementsBaseVertex() in immediate mode.
*/
static void GLAPIENTRY
-vbo_exec_DrawRangeElementsBaseVertex(GLenum mode, GLuint start, GLuint end,
- GLsizei count, GLenum type,
- const GLvoid * indices, GLint basevertex)
+_mesa_exec_DrawRangeElementsBaseVertex(GLenum mode, GLuint start, GLuint end,
+ GLsizei count, GLenum type,
+ const GLvoid * indices, GLint basevertex)
{
static GLuint warnCount = 0;
GLboolean index_bounds_valid = GL_TRUE;
end = ~0;
}
- vbo_validated_drawrangeelements(ctx, mode, index_bounds_valid, start, end,
- count, type, indices, basevertex, 1, 0);
+ _mesa_validated_drawrangeelements(ctx, mode, index_bounds_valid, start, end,
+ count, type, indices, basevertex, 1, 0);
}
* Called by glDrawRangeElements() in immediate mode.
*/
static void GLAPIENTRY
-vbo_exec_DrawRangeElements(GLenum mode, GLuint start, GLuint end,
- GLsizei count, GLenum type, const GLvoid * indices)
+_mesa_exec_DrawRangeElements(GLenum mode, GLuint start, GLuint end,
+ GLsizei count, GLenum type, const GLvoid * indices)
{
if (MESA_VERBOSE & VERBOSE_DRAW) {
GET_CURRENT_CONTEXT(ctx);
_mesa_enum_to_string(type), indices);
}
- vbo_exec_DrawRangeElementsBaseVertex(mode, start, end, count, type,
- indices, 0);
+ _mesa_exec_DrawRangeElementsBaseVertex(mode, start, end, count, type,
+ indices, 0);
}
* Called by glDrawElements() in immediate mode.
*/
static void GLAPIENTRY
-vbo_exec_DrawElements(GLenum mode, GLsizei count, GLenum type,
- const GLvoid * indices)
+_mesa_exec_DrawElements(GLenum mode, GLsizei count, GLenum type,
+ const GLvoid * indices)
{
GET_CURRENT_CONTEXT(ctx);
return;
}
- vbo_validated_drawrangeelements(ctx, mode, GL_FALSE, 0, ~0,
- count, type, indices, 0, 1, 0);
+ _mesa_validated_drawrangeelements(ctx, mode, GL_FALSE, 0, ~0,
+ count, type, indices, 0, 1, 0);
}
* Called by glDrawElementsBaseVertex() in immediate mode.
*/
static void GLAPIENTRY
-vbo_exec_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type,
- const GLvoid * indices, GLint basevertex)
+_mesa_exec_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type,
+ const GLvoid * indices, GLint basevertex)
{
GET_CURRENT_CONTEXT(ctx);
return;
}
- vbo_validated_drawrangeelements(ctx, mode, GL_FALSE, 0, ~0,
- count, type, indices, basevertex, 1, 0);
+ _mesa_validated_drawrangeelements(ctx, mode, GL_FALSE, 0, ~0,
+ count, type, indices, basevertex, 1, 0);
}
* Called by glDrawElementsInstanced() in immediate mode.
*/
static void GLAPIENTRY
-vbo_exec_DrawElementsInstanced(GLenum mode, GLsizei count, GLenum type,
- const GLvoid * indices, GLsizei numInstances)
+_mesa_exec_DrawElementsInstanced(GLenum mode, GLsizei count, GLenum type,
+ const GLvoid * indices, GLsizei numInstances)
{
GET_CURRENT_CONTEXT(ctx);
return;
}
- vbo_validated_drawrangeelements(ctx, mode, GL_FALSE, 0, ~0,
- count, type, indices, 0, numInstances, 0);
+ _mesa_validated_drawrangeelements(ctx, mode, GL_FALSE, 0, ~0,
+ count, type, indices, 0, numInstances, 0);
}
* Called by glDrawElementsInstancedBaseVertex() in immediate mode.
*/
static void GLAPIENTRY
-vbo_exec_DrawElementsInstancedBaseVertex(GLenum mode, GLsizei count,
- GLenum type, const GLvoid * indices,
- GLsizei numInstances,
- GLint basevertex)
+_mesa_exec_DrawElementsInstancedBaseVertex(GLenum mode, GLsizei count,
+ GLenum type, const GLvoid * indices,
+ GLsizei numInstances,
+ GLint basevertex)
{
GET_CURRENT_CONTEXT(ctx);
return;
}
- vbo_validated_drawrangeelements(ctx, mode, GL_FALSE, 0, ~0,
- count, type, indices,
- basevertex, numInstances, 0);
+ _mesa_validated_drawrangeelements(ctx, mode, GL_FALSE, 0, ~0,
+ count, type, indices,
+ basevertex, numInstances, 0);
}
* Called by glDrawElementsInstancedBaseInstance() in immediate mode.
*/
static void GLAPIENTRY
-vbo_exec_DrawElementsInstancedBaseInstance(GLenum mode, GLsizei count,
- GLenum type,
- const GLvoid *indices,
- GLsizei numInstances,
- GLuint baseInstance)
+_mesa_exec_DrawElementsInstancedBaseInstance(GLenum mode, GLsizei count,
+ GLenum type,
+ const GLvoid *indices,
+ GLsizei numInstances,
+ GLuint baseInstance)
{
GET_CURRENT_CONTEXT(ctx);
return;
}
- vbo_validated_drawrangeelements(ctx, mode, GL_FALSE, 0, ~0,
- count, type, indices, 0, numInstances,
- baseInstance);
+ _mesa_validated_drawrangeelements(ctx, mode, GL_FALSE, 0, ~0,
+ count, type, indices, 0, numInstances,
+ baseInstance);
}
* Called by glDrawElementsInstancedBaseVertexBaseInstance() in immediate mode.
*/
static void GLAPIENTRY
-vbo_exec_DrawElementsInstancedBaseVertexBaseInstance(GLenum mode,
- GLsizei count,
- GLenum type,
- const GLvoid *indices,
- GLsizei numInstances,
- GLint basevertex,
- GLuint baseInstance)
+_mesa_exec_DrawElementsInstancedBaseVertexBaseInstance(GLenum mode,
+ GLsizei count,
+ GLenum type,
+ const GLvoid *indices,
+ GLsizei numInstances,
+ GLint basevertex,
+ GLuint baseInstance)
{
GET_CURRENT_CONTEXT(ctx);
return;
}
- vbo_validated_drawrangeelements(ctx, mode, GL_FALSE, 0, ~0,
- count, type, indices, basevertex,
- numInstances, baseInstance);
+ _mesa_validated_drawrangeelements(ctx, mode, GL_FALSE, 0, ~0,
+ count, type, indices, basevertex,
+ numInstances, baseInstance);
}
* This does the actual rendering after we've checked array indexes, etc.
*/
static void
-vbo_validated_multidrawelements(struct gl_context *ctx, GLenum mode,
- const GLsizei *count, GLenum type,
- const GLvoid * const *indices,
- GLsizei primcount, const GLint *basevertex)
+_mesa_validated_multidrawelements(struct gl_context *ctx, GLenum mode,
+ const GLsizei *count, GLenum type,
+ const GLvoid * const *indices,
+ GLsizei primcount, const GLint *basevertex)
{
struct _mesa_index_buffer ib;
struct _mesa_prim *prim;
static void GLAPIENTRY
-vbo_exec_MultiDrawElements(GLenum mode,
- const GLsizei *count, GLenum type,
- const GLvoid * const *indices, GLsizei primcount)
+_mesa_exec_MultiDrawElements(GLenum mode,
+ const GLsizei *count, GLenum type,
+ const GLvoid * const *indices, GLsizei primcount)
{
GET_CURRENT_CONTEXT(ctx);
if (skip_validated_draw(ctx))
return;
- vbo_validated_multidrawelements(ctx, mode, count, type, indices, primcount,
- NULL);
+ _mesa_validated_multidrawelements(ctx, mode, count, type, indices, primcount,
+ NULL);
}
static void GLAPIENTRY
-vbo_exec_MultiDrawElementsBaseVertex(GLenum mode,
- const GLsizei *count, GLenum type,
- const GLvoid * const *indices,
- GLsizei primcount,
- const GLsizei *basevertex)
+_mesa_exec_MultiDrawElementsBaseVertex(GLenum mode,
+ const GLsizei *count, GLenum type,
+ const GLvoid * const *indices,
+ GLsizei primcount,
+ const GLsizei *basevertex)
{
GET_CURRENT_CONTEXT(ctx);
if (skip_validated_draw(ctx))
return;
- vbo_validated_multidrawelements(ctx, mode, count, type, indices, primcount,
- basevertex);
+ _mesa_validated_multidrawelements(ctx, mode, count, type, indices, primcount,
+ basevertex);
}
* \param numInstances number of instances to draw
*/
static void
-vbo_draw_transform_feedback(struct gl_context *ctx, GLenum mode,
- struct gl_transform_feedback_object *obj,
- GLuint stream, GLuint numInstances)
+_mesa_draw_transform_feedback(struct gl_context *ctx, GLenum mode,
+ struct gl_transform_feedback_object *obj,
+ GLuint stream, GLuint numInstances)
{
struct _mesa_prim prim;
!_mesa_all_varyings_in_vbos(ctx->Array.VAO))) {
GLsizei n =
ctx->Driver.GetTransformFeedbackVertexCount(ctx, obj, stream);
- vbo_draw_arrays(ctx, mode, 0, n, numInstances, 0, 0);
+ _mesa_draw_arrays(ctx, mode, 0, n, numInstances, 0, 0);
return;
}
* Part of GL_ARB_transform_feedback2.
*/
static void GLAPIENTRY
-vbo_exec_DrawTransformFeedback(GLenum mode, GLuint name)
+_mesa_exec_DrawTransformFeedback(GLenum mode, GLuint name)
{
GET_CURRENT_CONTEXT(ctx);
struct gl_transform_feedback_object *obj =
_mesa_debug(ctx, "glDrawTransformFeedback(%s, %d)\n",
_mesa_enum_to_string(mode), name);
- vbo_draw_transform_feedback(ctx, mode, obj, 0, 1);
+ _mesa_draw_transform_feedback(ctx, mode, obj, 0, 1);
}
static void GLAPIENTRY
-vbo_exec_DrawTransformFeedbackStream(GLenum mode, GLuint name, GLuint stream)
+_mesa_exec_DrawTransformFeedbackStream(GLenum mode, GLuint name, GLuint stream)
{
GET_CURRENT_CONTEXT(ctx);
struct gl_transform_feedback_object *obj =
_mesa_debug(ctx, "glDrawTransformFeedbackStream(%s, %u, %u)\n",
_mesa_enum_to_string(mode), name, stream);
- vbo_draw_transform_feedback(ctx, mode, obj, stream, 1);
+ _mesa_draw_transform_feedback(ctx, mode, obj, stream, 1);
}
static void GLAPIENTRY
-vbo_exec_DrawTransformFeedbackInstanced(GLenum mode, GLuint name,
- GLsizei primcount)
+_mesa_exec_DrawTransformFeedbackInstanced(GLenum mode, GLuint name,
+ GLsizei primcount)
{
GET_CURRENT_CONTEXT(ctx);
struct gl_transform_feedback_object *obj =
_mesa_debug(ctx, "glDrawTransformFeedbackInstanced(%s, %d)\n",
_mesa_enum_to_string(mode), name);
- vbo_draw_transform_feedback(ctx, mode, obj, 0, primcount);
+ _mesa_draw_transform_feedback(ctx, mode, obj, 0, primcount);
}
static void GLAPIENTRY
-vbo_exec_DrawTransformFeedbackStreamInstanced(GLenum mode, GLuint name,
- GLuint stream,
- GLsizei primcount)
+_mesa_exec_DrawTransformFeedbackStreamInstanced(GLenum mode, GLuint name,
+ GLuint stream,
+ GLsizei primcount)
{
GET_CURRENT_CONTEXT(ctx);
struct gl_transform_feedback_object *obj =
"(%s, %u, %u, %i)\n",
_mesa_enum_to_string(mode), name, stream, primcount);
- vbo_draw_transform_feedback(ctx, mode, obj, stream, primcount);
+ _mesa_draw_transform_feedback(ctx, mode, obj, stream, primcount);
}
static void
-vbo_validated_drawarraysindirect(struct gl_context *ctx,
- GLenum mode, const GLvoid *indirect)
+_mesa_validated_drawarraysindirect(struct gl_context *ctx,
+ GLenum mode, const GLvoid *indirect)
{
ctx->Driver.DrawIndirect(ctx, mode,
ctx->DrawIndirectBuffer, (GLsizeiptr) indirect,
static void
-vbo_validated_multidrawarraysindirect(struct gl_context *ctx,
- GLenum mode,
- const GLvoid *indirect,
- GLsizei primcount, GLsizei stride)
+_mesa_validated_multidrawarraysindirect(struct gl_context *ctx,
+ GLenum mode,
+ const GLvoid *indirect,
+ GLsizei primcount, GLsizei stride)
{
GLsizeiptr offset = (GLsizeiptr) indirect;
static void
-vbo_validated_drawelementsindirect(struct gl_context *ctx,
- GLenum mode, GLenum type,
- const GLvoid *indirect)
+_mesa_validated_drawelementsindirect(struct gl_context *ctx,
+ GLenum mode, GLenum type,
+ const GLvoid *indirect)
{
struct _mesa_index_buffer ib;
static void
-vbo_validated_multidrawelementsindirect(struct gl_context *ctx,
- GLenum mode, GLenum type,
- const GLvoid *indirect,
- GLsizei primcount, GLsizei stride)
+_mesa_validated_multidrawelementsindirect(struct gl_context *ctx,
+ GLenum mode, GLenum type,
+ const GLvoid *indirect,
+ GLsizei primcount, GLsizei stride)
{
struct _mesa_index_buffer ib;
GLsizeiptr offset = (GLsizeiptr) indirect;
* a buffer object.
*/
static void GLAPIENTRY
-vbo_exec_DrawArraysIndirect(GLenum mode, const GLvoid *indirect)
+_mesa_exec_DrawArraysIndirect(GLenum mode, const GLvoid *indirect)
{
GET_CURRENT_CONTEXT(ctx);
!_mesa_is_bufferobj(ctx->DrawIndirectBuffer)) {
DrawArraysIndirectCommand *cmd = (DrawArraysIndirectCommand *) indirect;
- vbo_exec_DrawArraysInstancedBaseInstance(mode, cmd->first, cmd->count,
- cmd->primCount,
- cmd->baseInstance);
+ _mesa_exec_DrawArraysInstancedBaseInstance(mode, cmd->first, cmd->count,
+ cmd->primCount,
+ cmd->baseInstance);
return;
}
if (skip_validated_draw(ctx))
return;
- vbo_validated_drawarraysindirect(ctx, mode, indirect);
+ _mesa_validated_drawarraysindirect(ctx, mode, indirect);
}
static void GLAPIENTRY
-vbo_exec_DrawElementsIndirect(GLenum mode, GLenum type, const GLvoid *indirect)
+_mesa_exec_DrawElementsIndirect(GLenum mode, GLenum type, const GLvoid *indirect)
{
GET_CURRENT_CONTEXT(ctx);
void *offset = (void *)
((cmd->firstIndex * _mesa_sizeof_type(type)) & 0xffffffffUL);
- vbo_exec_DrawElementsInstancedBaseVertexBaseInstance(mode, cmd->count,
- type, offset,
- cmd->primCount,
- cmd->baseVertex,
- cmd->baseInstance);
+ _mesa_exec_DrawElementsInstancedBaseVertexBaseInstance(mode, cmd->count,
+ type, offset,
+ cmd->primCount,
+ cmd->baseVertex,
+ cmd->baseInstance);
}
return;
if (skip_validated_draw(ctx))
return;
- vbo_validated_drawelementsindirect(ctx, mode, type, indirect);
+ _mesa_validated_drawelementsindirect(ctx, mode, type, indirect);
}
static void GLAPIENTRY
-vbo_exec_MultiDrawArraysIndirect(GLenum mode, const GLvoid *indirect,
- GLsizei primcount, GLsizei stride)
+_mesa_exec_MultiDrawArraysIndirect(GLenum mode, const GLvoid *indirect,
+ GLsizei primcount, GLsizei stride)
{
GET_CURRENT_CONTEXT(ctx);
const ubyte *ptr = (const ubyte *) indirect;
for (unsigned i = 0; i < primcount; i++) {
DrawArraysIndirectCommand *cmd = (DrawArraysIndirectCommand *) ptr;
- vbo_exec_DrawArraysInstancedBaseInstance(mode, cmd->first,
- cmd->count, cmd->primCount,
- cmd->baseInstance);
+ _mesa_exec_DrawArraysInstancedBaseInstance(mode, cmd->first,
+ cmd->count, cmd->primCount,
+ cmd->baseInstance);
if (stride == 0) {
ptr += sizeof(DrawArraysIndirectCommand);
if (skip_validated_draw(ctx))
return;
- vbo_validated_multidrawarraysindirect(ctx, mode, indirect,
- primcount, stride);
+ _mesa_validated_multidrawarraysindirect(ctx, mode, indirect,
+ primcount, stride);
}
static void GLAPIENTRY
-vbo_exec_MultiDrawElementsIndirect(GLenum mode, GLenum type,
- const GLvoid *indirect,
- GLsizei primcount, GLsizei stride)
+_mesa_exec_MultiDrawElementsIndirect(GLenum mode, GLenum type,
+ const GLvoid *indirect,
+ GLsizei primcount, GLsizei stride)
{
GET_CURRENT_CONTEXT(ctx);
const ubyte *ptr = (const ubyte *) indirect;
for (unsigned i = 0; i < primcount; i++) {
- vbo_exec_DrawElementsIndirect(mode, type, ptr);
+ _mesa_exec_DrawElementsIndirect(mode, type, ptr);
if (stride == 0) {
ptr += sizeof(DrawElementsIndirectCommand);
if (skip_validated_draw(ctx))
return;
- vbo_validated_multidrawelementsindirect(ctx, mode, type, indirect,
- primcount, stride);
+ _mesa_validated_multidrawelementsindirect(ctx, mode, type, indirect,
+ primcount, stride);
}
static void
-vbo_validated_multidrawarraysindirectcount(struct gl_context *ctx,
- GLenum mode,
- GLintptr indirect,
- GLintptr drawcount_offset,
- GLsizei maxdrawcount,
- GLsizei stride)
+_mesa_validated_multidrawarraysindirectcount(struct gl_context *ctx,
+ GLenum mode,
+ GLintptr indirect,
+ GLintptr drawcount_offset,
+ GLsizei maxdrawcount,
+ GLsizei stride)
{
GLsizeiptr offset = indirect;
static void
-vbo_validated_multidrawelementsindirectcount(struct gl_context *ctx,
- GLenum mode, GLenum type,
- GLintptr indirect,
- GLintptr drawcount_offset,
- GLsizei maxdrawcount,
- GLsizei stride)
+_mesa_validated_multidrawelementsindirectcount(struct gl_context *ctx,
+ GLenum mode, GLenum type,
+ GLintptr indirect,
+ GLintptr drawcount_offset,
+ GLsizei maxdrawcount,
+ GLsizei stride)
{
struct _mesa_index_buffer ib;
GLsizeiptr offset = (GLsizeiptr) indirect;
static void GLAPIENTRY
-vbo_exec_MultiDrawArraysIndirectCount(GLenum mode, GLintptr indirect,
- GLintptr drawcount_offset,
- GLsizei maxdrawcount, GLsizei stride)
+_mesa_exec_MultiDrawArraysIndirectCount(GLenum mode, GLintptr indirect,
+ GLintptr drawcount_offset,
+ GLsizei maxdrawcount, GLsizei stride)
{
GET_CURRENT_CONTEXT(ctx);
if (skip_validated_draw(ctx))
return;
- vbo_validated_multidrawarraysindirectcount(ctx, mode, indirect,
- drawcount_offset,
- maxdrawcount, stride);
+ _mesa_validated_multidrawarraysindirectcount(ctx, mode, indirect,
+ drawcount_offset,
+ maxdrawcount, stride);
}
static void GLAPIENTRY
-vbo_exec_MultiDrawElementsIndirectCount(GLenum mode, GLenum type,
- GLintptr indirect,
- GLintptr drawcount_offset,
- GLsizei maxdrawcount, GLsizei stride)
+_mesa_exec_MultiDrawElementsIndirectCount(GLenum mode, GLenum type,
+ GLintptr indirect,
+ GLintptr drawcount_offset,
+ GLsizei maxdrawcount, GLsizei stride)
{
GET_CURRENT_CONTEXT(ctx);
if (skip_validated_draw(ctx))
return;
- vbo_validated_multidrawelementsindirectcount(ctx, mode, type, indirect,
- drawcount_offset, maxdrawcount,
- stride);
+ _mesa_validated_multidrawelementsindirectcount(ctx, mode, type, indirect,
+ drawcount_offset, maxdrawcount,
+ stride);
}
* Initialize the dispatch table with the VBO functions for drawing.
*/
void
-vbo_initialize_exec_dispatch(const struct gl_context *ctx,
- struct _glapi_table *exec)
+_mesa_initialize_exec_dispatch(const struct gl_context *ctx,
+ struct _glapi_table *exec)
{
- SET_DrawArrays(exec, vbo_exec_DrawArrays);
- SET_DrawElements(exec, vbo_exec_DrawElements);
+ SET_DrawArrays(exec, _mesa_exec_DrawArrays);
+ SET_DrawElements(exec, _mesa_exec_DrawElements);
if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
- SET_DrawRangeElements(exec, vbo_exec_DrawRangeElements);
+ SET_DrawRangeElements(exec, _mesa_exec_DrawRangeElements);
}
- SET_MultiDrawArrays(exec, vbo_exec_MultiDrawArrays);
- SET_MultiDrawElementsEXT(exec, vbo_exec_MultiDrawElements);
+ SET_MultiDrawArrays(exec, _mesa_exec_MultiDrawArrays);
+ SET_MultiDrawElementsEXT(exec, _mesa_exec_MultiDrawElements);
if (ctx->API == API_OPENGL_COMPAT) {
- SET_Rectf(exec, vbo_exec_Rectf);
- SET_EvalMesh1(exec, vbo_exec_EvalMesh1);
- SET_EvalMesh2(exec, vbo_exec_EvalMesh2);
+ SET_Rectf(exec, _mesa_exec_Rectf);
+ SET_EvalMesh1(exec, _mesa_exec_EvalMesh1);
+ SET_EvalMesh2(exec, _mesa_exec_EvalMesh2);
}
if (ctx->API != API_OPENGLES &&
ctx->Extensions.ARB_draw_elements_base_vertex) {
- SET_DrawElementsBaseVertex(exec, vbo_exec_DrawElementsBaseVertex);
+ SET_DrawElementsBaseVertex(exec, _mesa_exec_DrawElementsBaseVertex);
SET_MultiDrawElementsBaseVertex(exec,
- vbo_exec_MultiDrawElementsBaseVertex);
+ _mesa_exec_MultiDrawElementsBaseVertex);
if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
SET_DrawRangeElementsBaseVertex(exec,
- vbo_exec_DrawRangeElementsBaseVertex);
+ _mesa_exec_DrawRangeElementsBaseVertex);
SET_DrawElementsInstancedBaseVertex(exec,
- vbo_exec_DrawElementsInstancedBaseVertex);
+ _mesa_exec_DrawElementsInstancedBaseVertex);
}
}
if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
SET_DrawArraysInstancedBaseInstance(exec,
- vbo_exec_DrawArraysInstancedBaseInstance);
+ _mesa_exec_DrawArraysInstancedBaseInstance);
SET_DrawElementsInstancedBaseInstance(exec,
- vbo_exec_DrawElementsInstancedBaseInstance);
+ _mesa_exec_DrawElementsInstancedBaseInstance);
SET_DrawElementsInstancedBaseVertexBaseInstance(exec,
- vbo_exec_DrawElementsInstancedBaseVertexBaseInstance);
+ _mesa_exec_DrawElementsInstancedBaseVertexBaseInstance);
}
if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles31(ctx)) {
- SET_DrawArraysIndirect(exec, vbo_exec_DrawArraysIndirect);
- SET_DrawElementsIndirect(exec, vbo_exec_DrawElementsIndirect);
+ SET_DrawArraysIndirect(exec, _mesa_exec_DrawArraysIndirect);
+ SET_DrawElementsIndirect(exec, _mesa_exec_DrawElementsIndirect);
}
if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
- SET_DrawArraysInstancedARB(exec, vbo_exec_DrawArraysInstanced);
- SET_DrawElementsInstancedARB(exec, vbo_exec_DrawElementsInstanced);
+ SET_DrawArraysInstancedARB(exec, _mesa_exec_DrawArraysInstanced);
+ SET_DrawElementsInstancedARB(exec, _mesa_exec_DrawElementsInstanced);
}
if (_mesa_is_desktop_gl(ctx)) {
- SET_DrawTransformFeedback(exec, vbo_exec_DrawTransformFeedback);
+ SET_DrawTransformFeedback(exec, _mesa_exec_DrawTransformFeedback);
SET_DrawTransformFeedbackStream(exec,
- vbo_exec_DrawTransformFeedbackStream);
+ _mesa_exec_DrawTransformFeedbackStream);
SET_DrawTransformFeedbackInstanced(exec,
- vbo_exec_DrawTransformFeedbackInstanced);
+ _mesa_exec_DrawTransformFeedbackInstanced);
SET_DrawTransformFeedbackStreamInstanced(exec,
- vbo_exec_DrawTransformFeedbackStreamInstanced);
- SET_MultiDrawArraysIndirect(exec, vbo_exec_MultiDrawArraysIndirect);
- SET_MultiDrawElementsIndirect(exec, vbo_exec_MultiDrawElementsIndirect);
+ _mesa_exec_DrawTransformFeedbackStreamInstanced);
+ SET_MultiDrawArraysIndirect(exec, _mesa_exec_MultiDrawArraysIndirect);
+ SET_MultiDrawElementsIndirect(exec, _mesa_exec_MultiDrawElementsIndirect);
SET_MultiDrawArraysIndirectCountARB(exec,
- vbo_exec_MultiDrawArraysIndirectCount);
+ _mesa_exec_MultiDrawArraysIndirectCount);
SET_MultiDrawElementsIndirectCountARB(exec,
- vbo_exec_MultiDrawElementsIndirectCount);
+ _mesa_exec_MultiDrawElementsIndirectCount);
}
}
void GLAPIENTRY
_mesa_DrawArrays(GLenum mode, GLint first, GLsizei count)
{
- vbo_exec_DrawArrays(mode, first, count);
+ _mesa_exec_DrawArrays(mode, first, count);
}
_mesa_DrawArraysInstanced(GLenum mode, GLint first, GLsizei count,
GLsizei primcount)
{
- vbo_exec_DrawArraysInstanced(mode, first, count, primcount);
+ _mesa_exec_DrawArraysInstanced(mode, first, count, primcount);
}
_mesa_DrawElements(GLenum mode, GLsizei count, GLenum type,
const GLvoid *indices)
{
- vbo_exec_DrawElements(mode, count, type, indices);
+ _mesa_exec_DrawElements(mode, count, type, indices);
}
_mesa_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type,
const GLvoid *indices, GLint basevertex)
{
- vbo_exec_DrawElementsBaseVertex(mode, count, type, indices, basevertex);
+ _mesa_exec_DrawElementsBaseVertex(mode, count, type, indices, basevertex);
}
_mesa_DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count,
GLenum type, const GLvoid * indices)
{
- vbo_exec_DrawRangeElements(mode, start, end, count, type, indices);
+ _mesa_exec_DrawRangeElements(mode, start, end, count, type, indices);
}
GLsizei count, GLenum type,
const GLvoid *indices, GLint basevertex)
{
- vbo_exec_DrawRangeElementsBaseVertex(mode, start, end, count, type,
- indices, basevertex);
+ _mesa_exec_DrawRangeElementsBaseVertex(mode, start, end, count, type,
+ indices, basevertex);
}
_mesa_MultiDrawElementsEXT(GLenum mode, const GLsizei *count, GLenum type,
const GLvoid ** indices, GLsizei primcount)
{
- vbo_exec_MultiDrawElements(mode, count, type, indices, primcount);
+ _mesa_exec_MultiDrawElements(mode, count, type, indices, primcount);
}
const GLvoid **indices, GLsizei primcount,
const GLint *basevertex)
{
- vbo_exec_MultiDrawElementsBaseVertex(mode, count, type, indices,
- primcount, basevertex);
+ _mesa_exec_MultiDrawElementsBaseVertex(mode, count, type, indices,
+ primcount, basevertex);
}
void GLAPIENTRY
_mesa_DrawTransformFeedback(GLenum mode, GLuint name)
{
- vbo_exec_DrawTransformFeedback(mode, name);
+ _mesa_exec_DrawTransformFeedback(mode, name);
}