#include "c99_alloca.h"
+#include "api_exec_decl.h"
#include "main/glthread_marshal.h"
#include "main/dispatch.h"
#include "main/varray.h"
return true;
}
-/* DrawArrays non-instanced and NOT supporting user buffers. Ignore the name. */
+/* DrawArrays without user buffers. */
struct marshal_cmd_DrawArrays
{
struct marshal_cmd_base cmd_base;
const struct marshal_cmd_DrawArrays *cmd,
const uint64_t *last)
{
- /* Ignore the function name. We use DISPATCH_CMD_DrawArrays{Instanced}
- * for all DrawArrays variants without user buffers, and
- * DISPATCH_CMD_DrawArraysInstancedBaseInstance for all DrawArrays
- * variants with user buffers.
- */
const GLenum mode = cmd->mode;
const GLint first = cmd->first;
const GLsizei count = cmd->count;
return cmd_size;
}
-/* DrawArraysInstancedBaseInstance and NOT supporting user buffers. Ignore the name. */
-struct marshal_cmd_DrawArraysInstanced
+/* DrawArraysInstancedBaseInstance without user buffers. */
+struct marshal_cmd_DrawArraysInstancedBaseInstance
{
struct marshal_cmd_base cmd_base;
GLenum mode;
};
uint32_t
-_mesa_unmarshal_DrawArraysInstanced(struct gl_context *ctx,
- const struct marshal_cmd_DrawArraysInstanced *cmd,
- const uint64_t *last)
+_mesa_unmarshal_DrawArraysInstancedBaseInstance(struct gl_context *ctx,
+ const struct marshal_cmd_DrawArraysInstancedBaseInstance *cmd,
+ const uint64_t *last)
{
- /* Ignore the function name. We use DISPATCH_CMD_DrawArrays{Instanced}
- * for all DrawArrays variants without user buffers, and
- * DISPATCH_CMD_DrawArraysInstancedBaseInstance for all DrawArrays
- * variants with user buffers.
- */
const GLenum mode = cmd->mode;
const GLint first = cmd->first;
const GLsizei count = cmd->count;
cmd->first = first;
cmd->count = count;
} else {
- int cmd_size = sizeof(struct marshal_cmd_DrawArraysInstanced);
- struct marshal_cmd_DrawArraysInstanced *cmd =
- _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawArraysInstanced, cmd_size);
+ int cmd_size = sizeof(struct marshal_cmd_DrawArraysInstancedBaseInstance);
+ struct marshal_cmd_DrawArraysInstancedBaseInstance *cmd =
+ _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawArraysInstancedBaseInstance, cmd_size);
cmd->mode = mode;
cmd->first = first;
}
}
-/* Generic DrawArrays structure supporting user buffers. Ignore the name. */
-struct marshal_cmd_DrawArraysInstancedBaseInstance
+/* DrawArraysInstancedBaseInstance with user buffers. */
+struct marshal_cmd_DrawArraysUserBuf
{
struct marshal_cmd_base cmd_base;
GLenum mode;
};
uint32_t
-_mesa_unmarshal_DrawArraysInstancedBaseInstance(struct gl_context *ctx,
- const struct marshal_cmd_DrawArraysInstancedBaseInstance *cmd,
- const uint64_t *last)
+_mesa_unmarshal_DrawArraysUserBuf(struct gl_context *ctx,
+ const struct marshal_cmd_DrawArraysUserBuf *cmd,
+ const uint64_t *last)
{
- /* Ignore the function name. We use DISPATCH_CMD_DrawArrays{Instanced}
- * for all DrawArrays variants without user buffers, and
- * DISPATCH_CMD_DrawArraysInstancedBaseInstance for all DrawArrays
- * variants with user buffers.
- */
const GLenum mode = cmd->mode;
const GLint first = cmd->first;
const GLsizei count = cmd->count;
const struct glthread_attrib_binding *buffers)
{
int buffers_size = util_bitcount(user_buffer_mask) * sizeof(buffers[0]);
- int cmd_size = sizeof(struct marshal_cmd_DrawArraysInstancedBaseInstance) +
+ int cmd_size = sizeof(struct marshal_cmd_DrawArraysUserBuf) +
buffers_size;
- struct marshal_cmd_DrawArraysInstancedBaseInstance *cmd;
+ struct marshal_cmd_DrawArraysUserBuf *cmd;
- cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawArraysInstancedBaseInstance,
+ cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawArraysUserBuf,
cmd_size);
cmd->mode = mode;
cmd->first = first;
user_buffer_mask, buffers);
}
-struct marshal_cmd_MultiDrawArrays
+/* MultiDrawArrays with user buffers. */
+struct marshal_cmd_MultiDrawArraysUserBuf
{
struct marshal_cmd_base cmd_base;
GLenum mode;
};
uint32_t
-_mesa_unmarshal_MultiDrawArrays(struct gl_context *ctx,
- const struct marshal_cmd_MultiDrawArrays *cmd,
- const uint64_t *last)
+_mesa_unmarshal_MultiDrawArraysUserBuf(struct gl_context *ctx,
+ const struct marshal_cmd_MultiDrawArraysUserBuf *cmd,
+ const uint64_t *last)
{
const GLenum mode = cmd->mode;
const GLsizei draw_count = cmd->draw_count;
int first_size = sizeof(GLint) * draw_count;
int count_size = sizeof(GLsizei) * draw_count;
int buffers_size = util_bitcount(user_buffer_mask) * sizeof(buffers[0]);
- int cmd_size = sizeof(struct marshal_cmd_MultiDrawArrays) +
+ int cmd_size = sizeof(struct marshal_cmd_MultiDrawArraysUserBuf) +
first_size + count_size + buffers_size;
- struct marshal_cmd_MultiDrawArrays *cmd;
+ struct marshal_cmd_MultiDrawArraysUserBuf *cmd;
/* Make sure cmd can fit the queue buffer */
if (cmd_size > MARSHAL_MAX_CMD_SIZE) {
return false;
}
- cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiDrawArrays,
+ cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiDrawArraysUserBuf,
cmd_size);
cmd->mode = mode;
cmd->draw_count = draw_count;
(mode, first, count, draw_count));
}
-/* DrawElementsInstanced not supporting user buffers. */
+/* DrawElementsInstanced without user buffers. */
struct marshal_cmd_DrawElementsInstanced
{
struct marshal_cmd_base cmd_base;
const GLvoid *indices;
};
-/* DrawElementsInstancedBaseVertexBaseInstance not supporting user buffers.
- * Ignore the name.
- */
-
uint32_t
_mesa_unmarshal_DrawElementsInstanced(struct gl_context *ctx,
const struct marshal_cmd_DrawElementsInstanced *cmd,
const uint64_t *last)
{
- /* Ignore the function name. We use DISPATCH_CMD_DrawElementsInstanced-
- * BaseVertexBaseInstance for all DrawElements variants with user buffers,
- * and DISPATCH_CMD_{DrawElementsInstancedARB,DrawElementsBaseVertex,
- * DrawElementsInstancedBaseVertex,DrawRangeElementsBaseVertex} for all
- * draw elements variants without user buffers.
- */
const GLenum mode = cmd->mode;
const GLsizei count = cmd->count;
const GLenum type = cmd->type;
return cmd_size;
}
-/* DrawElementsBaseVertex not supporting user buffers. */
+/* DrawElementsBaseVertex without user buffers. */
struct marshal_cmd_DrawElementsBaseVertex
{
struct marshal_cmd_base cmd_base;
const struct marshal_cmd_DrawElementsBaseVertex *cmd,
const uint64_t *last)
{
- /* Ignore the function name. We use DISPATCH_CMD_DrawElementsInstanced-
- * BaseVertexBaseInstance for all DrawElements variants with user buffers,
- * and DISPATCH_CMD_{DrawElementsInstancedARB,DrawElementsBaseVertex,
- * DrawElementsInstancedBaseVertex,DrawRangeElementsBaseVertex} for all
- * draw elements variants without user buffers.
- */
const GLenum mode = cmd->mode;
const GLsizei count = cmd->count;
const GLenum type = cmd->type;
return cmd_size;
}
-/* DrawElementsInstancedBaseVertexBaseInstance not supporting user buffers.
- * Ignore the name.
- */
-struct marshal_cmd_DrawElementsInstancedBaseVertex
+/* DrawElementsInstancedBaseVertexBaseInstance without user buffers. */
+struct marshal_cmd_DrawElementsInstancedBaseVertexBaseInstance
{
struct marshal_cmd_base cmd_base;
GLenum16 mode;
};
uint32_t
-_mesa_unmarshal_DrawElementsInstancedBaseVertex(struct gl_context *ctx,
- const struct marshal_cmd_DrawElementsInstancedBaseVertex *cmd,
- const uint64_t *last)
+_mesa_unmarshal_DrawElementsInstancedBaseVertexBaseInstance(struct gl_context *ctx,
+ const struct marshal_cmd_DrawElementsInstancedBaseVertexBaseInstance *cmd,
+ const uint64_t *last)
{
- /* Ignore the function name. We use DISPATCH_CMD_DrawElementsInstanced-
- * BaseVertexBaseInstance for all DrawElements variants with user buffers,
- * and DISPATCH_CMD_{DrawElementsInstancedARB,DrawElementsBaseVertex,
- * DrawElementsInstancedBaseVertex,DrawRangeElementsBaseVertex} for all
- * draw elements variants without user buffers.
- */
const GLenum mode = cmd->mode;
const GLsizei count = cmd->count;
const GLenum type = cmd->type;
cmd->instance_count = instance_count;
cmd->indices = indices;
} else {
- int cmd_size = sizeof(struct marshal_cmd_DrawElementsInstancedBaseVertex);
- struct marshal_cmd_DrawElementsInstancedBaseVertex *cmd =
- _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawElementsInstancedBaseVertex, cmd_size);
+ int cmd_size = sizeof(struct marshal_cmd_DrawElementsInstancedBaseVertexBaseInstance);
+ struct marshal_cmd_DrawElementsInstancedBaseVertexBaseInstance *cmd =
+ _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawElementsInstancedBaseVertexBaseInstance, cmd_size);
cmd->mode = MIN2(mode, 0xffff);
cmd->type = MIN2(type, 0xffff);
}
}
-struct marshal_cmd_DrawElementsInstancedBaseVertexBaseInstance
+struct marshal_cmd_DrawElementsUserBuf
{
struct marshal_cmd_base cmd_base;
bool index_bounds_valid;
};
uint32_t
-_mesa_unmarshal_DrawElementsInstancedBaseVertexBaseInstance(struct gl_context *ctx,
- const struct marshal_cmd_DrawElementsInstancedBaseVertexBaseInstance *cmd,
- const uint64_t *last)
+_mesa_unmarshal_DrawElementsUserBuf(struct gl_context *ctx,
+ const struct marshal_cmd_DrawElementsUserBuf *cmd,
+ const uint64_t *last)
{
- /* Ignore the function name. We use DISPATCH_CMD_DrawElementsInstanced-
- * BaseVertexBaseInstance for all DrawElements variants with user buffers,
- * and both DISPATCH_CMD_DrawElementsInstancedARB and DISPATCH_CMD_Draw-
- * RangeElementsBaseVertex for all draw elements variants without user
- * buffers.
- */
const GLenum mode = cmd->mode;
const GLsizei count = cmd->count;
const GLenum type = cmd->type;
const struct glthread_attrib_binding *buffers)
{
int buffers_size = util_bitcount(user_buffer_mask) * sizeof(buffers[0]);
- int cmd_size = sizeof(struct marshal_cmd_DrawElementsInstancedBaseVertexBaseInstance) +
+ int cmd_size = sizeof(struct marshal_cmd_DrawElementsUserBuf) +
buffers_size;
- struct marshal_cmd_DrawElementsInstancedBaseVertexBaseInstance *cmd;
+ struct marshal_cmd_DrawElementsUserBuf *cmd;
- cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawElementsInstancedBaseVertexBaseInstance, cmd_size);
+ cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawElementsUserBuf, cmd_size);
cmd->mode = MIN2(mode, 0xff); /* primitive types go from 0 to 14 */
cmd->type = MIN2(type, 0xffff);
cmd->count = count;
}
}
-struct marshal_cmd_MultiDrawElementsBaseVertex
+struct marshal_cmd_MultiDrawElementsUserBuf
{
struct marshal_cmd_base cmd_base;
bool has_base_vertex;
};
uint32_t
-_mesa_unmarshal_MultiDrawElementsBaseVertex(struct gl_context *ctx,
- const struct marshal_cmd_MultiDrawElementsBaseVertex *cmd,
- const uint64_t *last)
+_mesa_unmarshal_MultiDrawElementsUserBuf(struct gl_context *ctx,
+ const struct marshal_cmd_MultiDrawElementsUserBuf *cmd,
+ const uint64_t *last)
{
const GLenum mode = cmd->mode;
const GLenum type = cmd->type;
int indices_size = sizeof(indices[0]) * draw_count;
int basevertex_size = basevertex ? sizeof(GLsizei) * draw_count : 0;
int buffers_size = util_bitcount(user_buffer_mask) * sizeof(buffers[0]);
- int cmd_size = sizeof(struct marshal_cmd_MultiDrawElementsBaseVertex) +
+ int cmd_size = sizeof(struct marshal_cmd_MultiDrawElementsUserBuf) +
count_size + indices_size + basevertex_size + buffers_size;
- struct marshal_cmd_MultiDrawElementsBaseVertex *cmd;
+ struct marshal_cmd_MultiDrawElementsUserBuf *cmd;
/* Make sure cmd can fit the queue buffer */
if (cmd_size > MARSHAL_MAX_CMD_SIZE) {
return false;
}
- cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiDrawElementsBaseVertex, cmd_size);
+ cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiDrawElementsUserBuf, cmd_size);
cmd->mode = MIN2(mode, 0xff); /* primitive types go from 0 to 14 */
cmd->type = MIN2(type, 0xffff);
cmd->draw_count = draw_count;
}
uint32_t
-_mesa_unmarshal_DrawElements(struct gl_context *ctx, const struct marshal_cmd_DrawElements *cmd, const uint64_t *last)
+_mesa_unmarshal_DrawArraysInstanced(struct gl_context *ctx,
+ const struct marshal_cmd_DrawArraysInstanced *cmd,
+ const uint64_t *last)
+{
+ unreachable("should never end up here");
+ return 0;
+}
+
+uint32_t
+_mesa_unmarshal_MultiDrawArrays(struct gl_context *ctx,
+ const struct marshal_cmd_MultiDrawArrays *cmd,
+ const uint64_t *last)
+{
+ unreachable("should never end up here");
+ return 0;
+}
+
+uint32_t
+_mesa_unmarshal_DrawElements(struct gl_context *ctx,
+ const struct marshal_cmd_DrawElements *cmd,
+ const uint64_t *last)
+{
+ unreachable("should never end up here");
+ return 0;
+}
+
+uint32_t
+_mesa_unmarshal_DrawRangeElements(struct gl_context *ctx,
+ const struct marshal_cmd_DrawRangeElements *cmd,
+ const uint64_t *last)
+{
+ unreachable("should never end up here");
+ return 0;
+}
+
+uint32_t
+_mesa_unmarshal_DrawElementsInstancedBaseVertex(struct gl_context *ctx,
+ const struct marshal_cmd_DrawElementsInstancedBaseVertex *cmd,
+ const uint64_t *last)
{
- unreachable("never used - DrawElementsInstancedBaseVertexBaseInstance is used instead");
+ unreachable("should never end up here");
return 0;
}
uint32_t
-_mesa_unmarshal_DrawRangeElements(struct gl_context *ctx, const struct marshal_cmd_DrawRangeElements *cmd, const uint64_t *last)
+_mesa_unmarshal_DrawElementsInstancedBaseInstance(struct gl_context *ctx,
+ const struct marshal_cmd_DrawElementsInstancedBaseInstance *cmd,
+ const uint64_t *last)
{
- unreachable("never used - DrawElementsInstancedBaseVertexBaseInstance is used instead");
+ unreachable("should never end up here");
return 0;
}
uint32_t
-_mesa_unmarshal_DrawElementsInstancedBaseInstance(struct gl_context *ctx, const struct marshal_cmd_DrawElementsInstancedBaseInstance *cmd, const uint64_t *last)
+_mesa_unmarshal_MultiDrawElements(struct gl_context *ctx,
+ const struct marshal_cmd_MultiDrawElements *cmd,
+ const uint64_t *last)
{
- unreachable("never used - DrawElementsInstancedBaseVertexBaseInstance is used instead");
+ unreachable("should never end up here");
return 0;
}
uint32_t
-_mesa_unmarshal_MultiDrawElements(struct gl_context *ctx, const struct marshal_cmd_MultiDrawElements *cmd, const uint64_t *last)
+_mesa_unmarshal_MultiDrawElementsBaseVertex(struct gl_context *ctx,
+ const struct marshal_cmd_MultiDrawElementsBaseVertex *cmd,
+ const uint64_t *last)
{
- unreachable("never used - MultiDrawElementsBaseVertex is used instead");
+ unreachable("should never end up here");
return 0;
}
+
+void GLAPIENTRY
+_mesa_marshal_DrawArraysUserBuf(void)
+{
+ unreachable("should never end up here");
+}
+
+void GLAPIENTRY
+_mesa_marshal_DrawElementsUserBuf(void)
+{
+ unreachable("should never end up here");
+}
+
+void GLAPIENTRY
+_mesa_marshal_MultiDrawArraysUserBuf(void)
+{
+ unreachable("should never end up here");
+}
+
+void GLAPIENTRY
+_mesa_marshal_MultiDrawElementsUserBuf(void)
+{
+ unreachable("should never end up here");
+}
+
+void GLAPIENTRY
+_mesa_DrawArraysUserBuf(void)
+{
+ unreachable("should never end up here");
+}
+
+void GLAPIENTRY
+_mesa_DrawElementsUserBuf(void)
+{
+ unreachable("should never end up here");
+}
+
+void GLAPIENTRY
+_mesa_MultiDrawArraysUserBuf(void)
+{
+ unreachable("should never end up here");
+}
+
+void GLAPIENTRY
+_mesa_MultiDrawElementsUserBuf(void)
+{
+ unreachable("should never end up here");
+}