mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-07 02:10:12 +01:00
dlist: remove ListExt feature
This is only used by vbo_save_api so let's simplify the code and add a normal opcode for this one. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9533>
This commit is contained in:
parent
89b6d70c1c
commit
bb108bdec7
6 changed files with 87 additions and 222 deletions
|
|
@ -1381,9 +1381,6 @@ _mesa_free_context_data(struct gl_context *ctx, bool destroy_debug_output)
|
||||||
/* Shared context state (display lists, textures, etc) */
|
/* Shared context state (display lists, textures, etc) */
|
||||||
_mesa_reference_shared_state(ctx, &ctx->Shared, NULL);
|
_mesa_reference_shared_state(ctx, &ctx->Shared, NULL);
|
||||||
|
|
||||||
/* needs to be after freeing shared state */
|
|
||||||
_mesa_free_display_list_data(ctx);
|
|
||||||
|
|
||||||
if (destroy_debug_output)
|
if (destroy_debug_output)
|
||||||
_mesa_destroy_debug_output(ctx);
|
_mesa_destroy_debug_output(ctx);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -71,40 +71,13 @@
|
||||||
|
|
||||||
#include "vbo/vbo.h"
|
#include "vbo/vbo.h"
|
||||||
#include "vbo/vbo_util.h"
|
#include "vbo/vbo_util.h"
|
||||||
|
#include "vbo/vbo_save.h"
|
||||||
#include "util/format_r11g11b10f.h"
|
#include "util/format_r11g11b10f.h"
|
||||||
|
|
||||||
#include "util/u_memory.h"
|
#include "util/u_memory.h"
|
||||||
|
|
||||||
#define USE_BITMAP_ATLAS 1
|
#define USE_BITMAP_ATLAS 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Other parts of Mesa (such as the VBO module) can plug into the display
|
|
||||||
* list system. This structure describes new display list instructions.
|
|
||||||
*/
|
|
||||||
struct gl_list_instruction
|
|
||||||
{
|
|
||||||
GLuint Size;
|
|
||||||
void (*Execute)( struct gl_context *ctx, void *data );
|
|
||||||
void (*Destroy)( struct gl_context *ctx, void *data );
|
|
||||||
void (*Print)( struct gl_context *ctx, void *data, FILE *f );
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#define MAX_DLIST_EXT_OPCODES 16
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Used by device drivers to hook new commands into display lists.
|
|
||||||
*/
|
|
||||||
struct gl_list_extensions
|
|
||||||
{
|
|
||||||
struct gl_list_instruction Opcode[MAX_DLIST_EXT_OPCODES];
|
|
||||||
GLuint NumOpcodes;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Flush vertices.
|
* Flush vertices.
|
||||||
*
|
*
|
||||||
|
|
@ -656,6 +629,8 @@ typedef enum
|
||||||
OPCODE_NAMED_PROGRAM_STRING,
|
OPCODE_NAMED_PROGRAM_STRING,
|
||||||
OPCODE_NAMED_PROGRAM_LOCAL_PARAMETER,
|
OPCODE_NAMED_PROGRAM_LOCAL_PARAMETER,
|
||||||
|
|
||||||
|
OPCODE_VERTEX_LIST,
|
||||||
|
|
||||||
/* The following three are meta instructions */
|
/* The following three are meta instructions */
|
||||||
OPCODE_ERROR, /* raise compiled-in error */
|
OPCODE_ERROR, /* raise compiled-in error */
|
||||||
OPCODE_CONTINUE,
|
OPCODE_CONTINUE,
|
||||||
|
|
@ -815,6 +790,53 @@ static GLuint InstSize[OPCODE_END_OF_LIST + 1];
|
||||||
void mesa_print_display_list(GLuint list);
|
void mesa_print_display_list(GLuint list);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called by display list code when a display list is being deleted.
|
||||||
|
*/
|
||||||
|
static void
|
||||||
|
vbo_destroy_vertex_list(struct gl_context *ctx, struct vbo_save_vertex_list *node)
|
||||||
|
{
|
||||||
|
for (gl_vertex_processing_mode vpm = VP_MODE_FF; vpm < VP_MODE_MAX; ++vpm)
|
||||||
|
_mesa_reference_vao(ctx, &node->VAO[vpm], NULL);
|
||||||
|
|
||||||
|
if (--node->prim_store->refcount == 0) {
|
||||||
|
free(node->prim_store->prims);
|
||||||
|
free(node->prim_store);
|
||||||
|
}
|
||||||
|
|
||||||
|
free(node->merged.prims);
|
||||||
|
|
||||||
|
_mesa_reference_buffer_object(ctx, &node->merged.ib.obj, NULL);
|
||||||
|
free(node->current_data);
|
||||||
|
node->current_data = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
vbo_print_vertex_list(struct gl_context *ctx, struct vbo_save_vertex_list *node, FILE *f)
|
||||||
|
{
|
||||||
|
GLuint i;
|
||||||
|
struct gl_buffer_object *buffer = node->VAO[0]->BufferBinding[0].BufferObj;
|
||||||
|
const GLuint vertex_size = _vbo_save_get_stride(node)/sizeof(GLfloat);
|
||||||
|
(void) ctx;
|
||||||
|
|
||||||
|
fprintf(f, "VBO-VERTEX-LIST, %u vertices, %d primitives, %d vertsize, "
|
||||||
|
"buffer %p\n",
|
||||||
|
node->vertex_count, node->prim_count, vertex_size,
|
||||||
|
buffer);
|
||||||
|
|
||||||
|
for (i = 0; i < node->prim_count; i++) {
|
||||||
|
struct _mesa_prim *prim = &node->prims[i];
|
||||||
|
fprintf(f, " prim %d: %s %d..%d %s %s\n",
|
||||||
|
i,
|
||||||
|
_mesa_lookup_prim_by_nr(prim->mode),
|
||||||
|
prim->start,
|
||||||
|
prim->start + prim->count,
|
||||||
|
(prim->begin) ? "BEGIN" : "(wrap)",
|
||||||
|
(prim->end) ? "END" : "(wrap)");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Does the given display list only contain a single glBitmap call?
|
* Does the given display list only contain a single glBitmap call?
|
||||||
*/
|
*/
|
||||||
|
|
@ -1105,50 +1127,6 @@ _mesa_lookup_list(struct gl_context *ctx, GLuint list)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Is the given opcode an extension code? */
|
|
||||||
static inline GLboolean
|
|
||||||
is_ext_opcode(OpCode opcode)
|
|
||||||
{
|
|
||||||
return (opcode >= OPCODE_EXT_0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/** Destroy an extended opcode instruction */
|
|
||||||
static GLint
|
|
||||||
ext_opcode_destroy(struct gl_context *ctx, Node *node)
|
|
||||||
{
|
|
||||||
const GLint i = node[0].opcode - OPCODE_EXT_0;
|
|
||||||
GLint step;
|
|
||||||
ctx->ListExt->Opcode[i].Destroy(ctx, &node[1]);
|
|
||||||
step = ctx->ListExt->Opcode[i].Size;
|
|
||||||
return step;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/** Execute an extended opcode instruction */
|
|
||||||
static GLint
|
|
||||||
ext_opcode_execute(struct gl_context *ctx, Node *node)
|
|
||||||
{
|
|
||||||
const GLint i = node[0].opcode - OPCODE_EXT_0;
|
|
||||||
GLint step;
|
|
||||||
ctx->ListExt->Opcode[i].Execute(ctx, &node[1]);
|
|
||||||
step = ctx->ListExt->Opcode[i].Size;
|
|
||||||
return step;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/** Print an extended opcode instruction */
|
|
||||||
static GLint
|
|
||||||
ext_opcode_print(struct gl_context *ctx, Node *node, FILE *f)
|
|
||||||
{
|
|
||||||
const GLint i = node[0].opcode - OPCODE_EXT_0;
|
|
||||||
GLint step;
|
|
||||||
ctx->ListExt->Opcode[i].Print(ctx, &node[1], f);
|
|
||||||
step = ctx->ListExt->Opcode[i].Size;
|
|
||||||
return step;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete the named display list, but don't remove from hash table.
|
* Delete the named display list, but don't remove from hash table.
|
||||||
* \param dlist - display list pointer
|
* \param dlist - display list pointer
|
||||||
|
|
@ -1169,12 +1147,7 @@ _mesa_delete_list(struct gl_context *ctx, struct gl_display_list *dlist)
|
||||||
while (1) {
|
while (1) {
|
||||||
const OpCode opcode = n[0].opcode;
|
const OpCode opcode = n[0].opcode;
|
||||||
|
|
||||||
/* check for extension opcodes first */
|
switch (opcode) {
|
||||||
if (is_ext_opcode(opcode)) {
|
|
||||||
n += ext_opcode_destroy(ctx, n);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
switch (opcode) {
|
|
||||||
/* for some commands, we need to free malloc'd memory */
|
/* for some commands, we need to free malloc'd memory */
|
||||||
case OPCODE_MAP1:
|
case OPCODE_MAP1:
|
||||||
free(get_pointer(&n[6]));
|
free(get_pointer(&n[6]));
|
||||||
|
|
@ -1380,6 +1353,9 @@ _mesa_delete_list(struct gl_context *ctx, struct gl_display_list *dlist)
|
||||||
case OPCODE_NAMED_PROGRAM_STRING:
|
case OPCODE_NAMED_PROGRAM_STRING:
|
||||||
free(get_pointer(&n[5]));
|
free(get_pointer(&n[5]));
|
||||||
break;
|
break;
|
||||||
|
case OPCODE_VERTEX_LIST:
|
||||||
|
vbo_destroy_vertex_list(ctx, (struct vbo_save_vertex_list *) &n[1]);
|
||||||
|
break;
|
||||||
case OPCODE_CONTINUE:
|
case OPCODE_CONTINUE:
|
||||||
n = (Node *) get_pointer(&n[1]);
|
n = (Node *) get_pointer(&n[1]);
|
||||||
free(block);
|
free(block);
|
||||||
|
|
@ -1393,11 +1369,10 @@ _mesa_delete_list(struct gl_context *ctx, struct gl_display_list *dlist)
|
||||||
default:
|
default:
|
||||||
/* just increment 'n' pointer, below */
|
/* just increment 'n' pointer, below */
|
||||||
;
|
;
|
||||||
}
|
|
||||||
|
|
||||||
assert(InstSize[opcode] > 0);
|
|
||||||
n += InstSize[opcode];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert(InstSize[opcode] > 0);
|
||||||
|
n += InstSize[opcode];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1659,33 +1634,11 @@ _mesa_dlist_alloc_aligned(struct gl_context *ctx, GLuint opcode, GLuint bytes)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
void *
|
||||||
* This function allows modules and drivers to get their own opcodes
|
_mesa_dlist_alloc_vertex_list(struct gl_context *ctx)
|
||||||
* for extending display list functionality.
|
|
||||||
* \param ctx the rendering context
|
|
||||||
* \param size number of bytes for storing the new display list command
|
|
||||||
* \param execute function to execute the new display list command
|
|
||||||
* \param destroy function to destroy the new display list command
|
|
||||||
* \param print function to print the new display list command
|
|
||||||
* \return the new opcode number or -1 if error
|
|
||||||
*/
|
|
||||||
GLint
|
|
||||||
_mesa_dlist_alloc_opcode(struct gl_context *ctx,
|
|
||||||
GLuint size,
|
|
||||||
void (*execute) (struct gl_context *, void *),
|
|
||||||
void (*destroy) (struct gl_context *, void *),
|
|
||||||
void (*print) (struct gl_context *, void *, FILE *))
|
|
||||||
{
|
{
|
||||||
if (ctx->ListExt->NumOpcodes < MAX_DLIST_EXT_OPCODES) {
|
return _mesa_dlist_alloc_aligned(ctx, OPCODE_VERTEX_LIST,
|
||||||
const GLuint i = ctx->ListExt->NumOpcodes++;
|
sizeof(struct vbo_save_vertex_list));
|
||||||
ctx->ListExt->Opcode[i].Size =
|
|
||||||
1 + (size + sizeof(Node) - 1) / sizeof(Node);
|
|
||||||
ctx->ListExt->Opcode[i].Execute = execute;
|
|
||||||
ctx->ListExt->Opcode[i].Destroy = destroy;
|
|
||||||
ctx->ListExt->Opcode[i].Print = print;
|
|
||||||
return i + OPCODE_EXT_0;
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -11283,11 +11236,7 @@ execute_list(struct gl_context *ctx, GLuint list)
|
||||||
while (1) {
|
while (1) {
|
||||||
const OpCode opcode = n[0].opcode;
|
const OpCode opcode = n[0].opcode;
|
||||||
|
|
||||||
if (is_ext_opcode(opcode)) {
|
switch (opcode) {
|
||||||
n += ext_opcode_execute(ctx, n);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
switch (opcode) {
|
|
||||||
case OPCODE_ERROR:
|
case OPCODE_ERROR:
|
||||||
_mesa_error(ctx, n[1].e, "%s", (const char *) get_pointer(&n[2]));
|
_mesa_error(ctx, n[1].e, "%s", (const char *) get_pointer(&n[2]));
|
||||||
break;
|
break;
|
||||||
|
|
@ -13455,6 +13404,10 @@ execute_list(struct gl_context *ctx, GLuint list)
|
||||||
n[5].f, n[6].f, n[7].f));
|
n[5].f, n[6].f, n[7].f));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case OPCODE_VERTEX_LIST:
|
||||||
|
vbo_save_playback_vertex_list(ctx, &n[1]);
|
||||||
|
break;
|
||||||
|
|
||||||
case OPCODE_CONTINUE:
|
case OPCODE_CONTINUE:
|
||||||
n = (Node *) get_pointer(&n[1]);
|
n = (Node *) get_pointer(&n[1]);
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -13473,12 +13426,11 @@ execute_list(struct gl_context *ctx, GLuint list)
|
||||||
vbo_save_EndCallList(ctx);
|
vbo_save_EndCallList(ctx);
|
||||||
ctx->ListState.CallDepth--;
|
ctx->ListState.CallDepth--;
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
/* increment n to point to next compiled command */
|
|
||||||
assert(InstSize[opcode] > 0);
|
|
||||||
n += InstSize[opcode];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* increment n to point to next compiled command */
|
||||||
|
assert(InstSize[opcode] > 0);
|
||||||
|
n += InstSize[opcode];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -14632,11 +14584,7 @@ print_list(struct gl_context *ctx, GLuint list, const char *fname)
|
||||||
while (1) {
|
while (1) {
|
||||||
const OpCode opcode = n[0].opcode;
|
const OpCode opcode = n[0].opcode;
|
||||||
|
|
||||||
if (is_ext_opcode(opcode)) {
|
switch (opcode) {
|
||||||
n += ext_opcode_print(ctx, n, f);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
switch (opcode) {
|
|
||||||
case OPCODE_ACCUM:
|
case OPCODE_ACCUM:
|
||||||
fprintf(f, "Accum %s %g\n", enum_string(n[1].e), n[2].f);
|
fprintf(f, "Accum %s %g\n", enum_string(n[1].e), n[2].f);
|
||||||
break;
|
break;
|
||||||
|
|
@ -14880,6 +14828,9 @@ print_list(struct gl_context *ctx, GLuint list, const char *fname)
|
||||||
case OPCODE_NOP:
|
case OPCODE_NOP:
|
||||||
fprintf(f, "NOP\n");
|
fprintf(f, "NOP\n");
|
||||||
break;
|
break;
|
||||||
|
case OPCODE_VERTEX_LIST:
|
||||||
|
vbo_print_vertex_list(ctx, (struct vbo_save_vertex_list *) &n[1], f);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
if (opcode < 0 || opcode > OPCODE_END_OF_LIST) {
|
if (opcode < 0 || opcode > OPCODE_END_OF_LIST) {
|
||||||
printf
|
printf
|
||||||
|
|
@ -14897,12 +14848,11 @@ print_list(struct gl_context *ctx, GLuint list, const char *fname)
|
||||||
if (fname)
|
if (fname)
|
||||||
fclose(f);
|
fclose(f);
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
/* increment n to point to next compiled command */
|
|
||||||
assert(InstSize[opcode] > 0);
|
|
||||||
n += InstSize[opcode];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* increment n to point to next compiled command */
|
||||||
|
assert(InstSize[opcode] > 0);
|
||||||
|
n += InstSize[opcode];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -14924,10 +14874,7 @@ _mesa_glthread_execute_list(struct gl_context *ctx, GLuint list)
|
||||||
while (1) {
|
while (1) {
|
||||||
const OpCode opcode = n[0].opcode;
|
const OpCode opcode = n[0].opcode;
|
||||||
|
|
||||||
if (is_ext_opcode(opcode)) {
|
switch (opcode) {
|
||||||
n += ctx->ListExt->Opcode[n[0].opcode - OPCODE_EXT_0].Size;
|
|
||||||
} else {
|
|
||||||
switch (opcode) {
|
|
||||||
case OPCODE_CALL_LIST:
|
case OPCODE_CALL_LIST:
|
||||||
/* Generated by glCallList(), don't add ListBase */
|
/* Generated by glCallList(), don't add ListBase */
|
||||||
if (ctx->GLThread.ListCallDepth < MAX_LIST_NESTING)
|
if (ctx->GLThread.ListCallDepth < MAX_LIST_NESTING)
|
||||||
|
|
@ -14979,12 +14926,11 @@ _mesa_glthread_execute_list(struct gl_context *ctx, GLuint list)
|
||||||
default:
|
default:
|
||||||
/* ignore */
|
/* ignore */
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
/* increment n to point to next compiled command */
|
|
||||||
assert(InstSize[opcode] > 0);
|
|
||||||
n += InstSize[opcode];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* increment n to point to next compiled command */
|
||||||
|
assert(InstSize[opcode] > 0);
|
||||||
|
n += InstSize[opcode];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -15030,9 +14976,6 @@ _mesa_init_display_list(struct gl_context *ctx)
|
||||||
tableInitialized = GL_TRUE;
|
tableInitialized = GL_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* extension info */
|
|
||||||
ctx->ListExt = CALLOC_STRUCT(gl_list_extensions);
|
|
||||||
|
|
||||||
/* Display list */
|
/* Display list */
|
||||||
ctx->ListState.CallDepth = 0;
|
ctx->ListState.CallDepth = 0;
|
||||||
ctx->ExecuteFlag = GL_TRUE;
|
ctx->ExecuteFlag = GL_TRUE;
|
||||||
|
|
@ -15044,6 +14987,7 @@ _mesa_init_display_list(struct gl_context *ctx)
|
||||||
ctx->List.ListBase = 0;
|
ctx->List.ListBase = 0;
|
||||||
|
|
||||||
InstSize[OPCODE_NOP] = 1;
|
InstSize[OPCODE_NOP] = 1;
|
||||||
|
InstSize[OPCODE_VERTEX_LIST] = 1 + align(sizeof(struct vbo_save_vertex_list), sizeof(Node)) / sizeof(Node);
|
||||||
|
|
||||||
#define NAME_AE(x) _ae_##x
|
#define NAME_AE(x) _ae_##x
|
||||||
#define NAME_CALLLIST(x) save_##x
|
#define NAME_CALLLIST(x) save_##x
|
||||||
|
|
@ -15052,11 +14996,3 @@ _mesa_init_display_list(struct gl_context *ctx)
|
||||||
|
|
||||||
#include "vbo/vbo_init_tmp.h"
|
#include "vbo/vbo_init_tmp.h"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
_mesa_free_display_list_data(struct gl_context *ctx)
|
|
||||||
{
|
|
||||||
free(ctx->ListExt);
|
|
||||||
ctx->ListExt = NULL;
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -111,11 +111,8 @@ _mesa_dlist_alloc(struct gl_context *ctx, GLuint opcode, GLuint sz);
|
||||||
void *
|
void *
|
||||||
_mesa_dlist_alloc_aligned(struct gl_context *ctx, GLuint opcode, GLuint bytes);
|
_mesa_dlist_alloc_aligned(struct gl_context *ctx, GLuint opcode, GLuint bytes);
|
||||||
|
|
||||||
GLint
|
void *
|
||||||
_mesa_dlist_alloc_opcode(struct gl_context *ctx, GLuint sz,
|
_mesa_dlist_alloc_vertex_list(struct gl_context *ctx);
|
||||||
void (*execute)(struct gl_context *, void *),
|
|
||||||
void (*destroy)(struct gl_context *, void *),
|
|
||||||
void (*print)(struct gl_context *, void *, FILE *));
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_mesa_delete_list(struct gl_context *ctx, struct gl_display_list *dlist);
|
_mesa_delete_list(struct gl_context *ctx, struct gl_display_list *dlist);
|
||||||
|
|
@ -130,9 +127,6 @@ _mesa_install_dlist_vtxfmt(struct _glapi_table *disp,
|
||||||
void
|
void
|
||||||
_mesa_init_display_list(struct gl_context * ctx);
|
_mesa_init_display_list(struct gl_context * ctx);
|
||||||
|
|
||||||
void
|
|
||||||
_mesa_free_display_list_data(struct gl_context *ctx);
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
_mesa_get_list(struct gl_context *ctx, GLuint list,
|
_mesa_get_list(struct gl_context *ctx, GLuint list,
|
||||||
struct gl_display_list **dlist);
|
struct gl_display_list **dlist);
|
||||||
|
|
|
||||||
|
|
@ -5461,8 +5461,6 @@ struct gl_context
|
||||||
|
|
||||||
GLuint TextureStateTimestamp; /**< detect changes to shared state */
|
GLuint TextureStateTimestamp; /**< detect changes to shared state */
|
||||||
|
|
||||||
struct gl_list_extensions *ListExt; /**< driver dlist extensions */
|
|
||||||
|
|
||||||
/** \name For debugging/development only */
|
/** \name For debugging/development only */
|
||||||
/*@{*/
|
/*@{*/
|
||||||
GLboolean FirstTimeCurrent;
|
GLboolean FirstTimeCurrent;
|
||||||
|
|
|
||||||
|
|
@ -189,8 +189,6 @@ struct vbo_save_context {
|
||||||
GLuint max_vert;
|
GLuint max_vert;
|
||||||
GLboolean dangling_attr_ref;
|
GLboolean dangling_attr_ref;
|
||||||
|
|
||||||
GLuint opcode_vertex_list;
|
|
||||||
|
|
||||||
struct vbo_save_copied_vtx copied;
|
struct vbo_save_copied_vtx copied;
|
||||||
|
|
||||||
fi_type *current[VBO_ATTRIB_MAX]; /* points into ctx->ListState */
|
fi_type *current[VBO_ATTRIB_MAX]; /* points into ctx->ListState */
|
||||||
|
|
|
||||||
|
|
@ -529,7 +529,7 @@ compile_vertex_list(struct gl_context *ctx)
|
||||||
* being compiled.
|
* being compiled.
|
||||||
*/
|
*/
|
||||||
node = (struct vbo_save_vertex_list *)
|
node = (struct vbo_save_vertex_list *)
|
||||||
_mesa_dlist_alloc_aligned(ctx, save->opcode_vertex_list, sizeof(*node));
|
_mesa_dlist_alloc_vertex_list(ctx);
|
||||||
|
|
||||||
if (!node)
|
if (!node)
|
||||||
return;
|
return;
|
||||||
|
|
@ -1922,57 +1922,6 @@ vbo_save_EndCallList(struct gl_context *ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called by display list code when a display list is being deleted.
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
vbo_destroy_vertex_list(struct gl_context *ctx, void *data)
|
|
||||||
{
|
|
||||||
struct vbo_save_vertex_list *node = (struct vbo_save_vertex_list *) data;
|
|
||||||
|
|
||||||
for (gl_vertex_processing_mode vpm = VP_MODE_FF; vpm < VP_MODE_MAX; ++vpm)
|
|
||||||
_mesa_reference_vao(ctx, &node->VAO[vpm], NULL);
|
|
||||||
|
|
||||||
if (--node->prim_store->refcount == 0) {
|
|
||||||
free(node->prim_store->prims);
|
|
||||||
free(node->prim_store);
|
|
||||||
}
|
|
||||||
|
|
||||||
free(node->merged.prims);
|
|
||||||
|
|
||||||
_mesa_reference_buffer_object(ctx, &node->merged.ib.obj, NULL);
|
|
||||||
free(node->current_data);
|
|
||||||
node->current_data = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
vbo_print_vertex_list(struct gl_context *ctx, void *data, FILE *f)
|
|
||||||
{
|
|
||||||
struct vbo_save_vertex_list *node = (struct vbo_save_vertex_list *) data;
|
|
||||||
GLuint i;
|
|
||||||
struct gl_buffer_object *buffer = node->VAO[0]->BufferBinding[0].BufferObj;
|
|
||||||
const GLuint vertex_size = _vbo_save_get_stride(node)/sizeof(GLfloat);
|
|
||||||
(void) ctx;
|
|
||||||
|
|
||||||
fprintf(f, "VBO-VERTEX-LIST, %u vertices, %d primitives, %d vertsize, "
|
|
||||||
"buffer %p\n",
|
|
||||||
node->vertex_count, node->prim_count, vertex_size,
|
|
||||||
buffer);
|
|
||||||
|
|
||||||
for (i = 0; i < node->prim_count; i++) {
|
|
||||||
struct _mesa_prim *prim = &node->prims[i];
|
|
||||||
fprintf(f, " prim %d: %s %d..%d %s %s\n",
|
|
||||||
i,
|
|
||||||
_mesa_lookup_prim_by_nr(prim->mode),
|
|
||||||
prim->start,
|
|
||||||
prim->start + prim->count,
|
|
||||||
(prim->begin) ? "BEGIN" : "(wrap)",
|
|
||||||
(prim->end) ? "END" : "(wrap)");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called during context creation/init.
|
* Called during context creation/init.
|
||||||
*/
|
*/
|
||||||
|
|
@ -2006,13 +1955,6 @@ vbo_save_api_init(struct vbo_save_context *save)
|
||||||
{
|
{
|
||||||
struct gl_context *ctx = gl_context_from_vbo_save(save);
|
struct gl_context *ctx = gl_context_from_vbo_save(save);
|
||||||
|
|
||||||
save->opcode_vertex_list =
|
|
||||||
_mesa_dlist_alloc_opcode(ctx,
|
|
||||||
sizeof(struct vbo_save_vertex_list),
|
|
||||||
vbo_save_playback_vertex_list,
|
|
||||||
vbo_destroy_vertex_list,
|
|
||||||
vbo_print_vertex_list);
|
|
||||||
|
|
||||||
vtxfmt_init(ctx);
|
vtxfmt_init(ctx);
|
||||||
current_init(ctx);
|
current_init(ctx);
|
||||||
_mesa_noop_vtxfmt_init(ctx, &save->vtxfmt_noop);
|
_mesa_noop_vtxfmt_init(ctx, &save->vtxfmt_noop);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue