mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 19:58:09 +02:00
Commit Gary Wong & Keith Packard's changes for bug 8867 -- adjust code
after repositioning of INDEX value in BRW_ATTRIB enum.
This commit is contained in:
parent
0570fcfd93
commit
d6f89107ba
3 changed files with 23 additions and 10 deletions
|
|
@ -95,6 +95,7 @@ enum {
|
|||
} ;
|
||||
|
||||
#define BRW_ATTRIB_FIRST_MATERIAL BRW_ATTRIB_MAT_FRONT_AMBIENT
|
||||
#define BRW_ATTRIB_LAST_MATERIAL BRW_ATTRIB_MAT_BACK_INDEXES
|
||||
|
||||
#define BRW_MAX_COPIED_VERTS 3
|
||||
|
||||
|
|
|
|||
|
|
@ -417,7 +417,7 @@ static void _save_copy_to_current( GLcontext *ctx )
|
|||
struct brw_save_context *save = IMM_CONTEXT(ctx)->save;
|
||||
GLuint i;
|
||||
|
||||
for (i = BRW_ATTRIB_POS+1 ; i <= BRW_ATTRIB_INDEX ; i++) {
|
||||
for (i = BRW_ATTRIB_POS+1 ; i < BRW_ATTRIB_MAX ; i++) {
|
||||
if (save->attrsz[i]) {
|
||||
save->currentsz[i][0] = save->attrsz[i];
|
||||
COPY_CLEAN_4V(save->current[i],
|
||||
|
|
@ -445,7 +445,7 @@ static void _save_copy_from_current( GLcontext *ctx )
|
|||
struct brw_save_context *save = IMM_CONTEXT(ctx)->save;
|
||||
GLint i;
|
||||
|
||||
for (i = BRW_ATTRIB_POS+1 ; i <= BRW_ATTRIB_INDEX ; i++)
|
||||
for (i = BRW_ATTRIB_POS+1 ; i < BRW_ATTRIB_MAX ; i++)
|
||||
switch (save->attrsz[i]) {
|
||||
case 4: save->attrptr[i][3] = save->current[i][3];
|
||||
case 3: save->attrptr[i][2] = save->current[i][2];
|
||||
|
|
@ -1121,7 +1121,7 @@ static void _save_current_init( GLcontext *ctx )
|
|||
save->current[i] = ctx->ListState.CurrentAttrib[i];
|
||||
}
|
||||
|
||||
for (i = BRW_ATTRIB_FIRST_MATERIAL; i < BRW_ATTRIB_INDEX; i++) {
|
||||
for (i = BRW_ATTRIB_FIRST_MATERIAL; i <= BRW_ATTRIB_LAST_MATERIAL; i++) {
|
||||
const GLuint j = i - BRW_ATTRIB_FIRST_MATERIAL;
|
||||
ASSERT(j < MAT_ATTRIB_MAX);
|
||||
save->currentsz[i] = &ctx->ListState.ActiveMaterialSize[j];
|
||||
|
|
|
|||
|
|
@ -38,7 +38,10 @@
|
|||
#include "brw_draw.h"
|
||||
#include "brw_fallback.h"
|
||||
|
||||
|
||||
/*
|
||||
* After playback, copy everything but the position from the
|
||||
* last vertex to the saved state
|
||||
*/
|
||||
static void _playback_copy_to_current( GLcontext *ctx,
|
||||
const struct brw_save_vertex_list *node )
|
||||
{
|
||||
|
|
@ -47,21 +50,30 @@ static void _playback_copy_to_current( GLcontext *ctx,
|
|||
GLuint i, offset;
|
||||
|
||||
if (node->count)
|
||||
offset = node->buffer_offset + (node->count-1) * node->vertex_size;
|
||||
offset = (node->buffer_offset +
|
||||
(node->count-1) * node->vertex_size * sizeof(GLfloat));
|
||||
else
|
||||
offset = node->buffer_offset;
|
||||
|
||||
ctx->Driver.GetBufferSubData( ctx, 0, offset, node->vertex_size,
|
||||
ctx->Driver.GetBufferSubData( ctx, 0, offset,
|
||||
node->vertex_size * sizeof(GLfloat),
|
||||
data, node->vertex_store->bufferobj );
|
||||
|
||||
for (i = BRW_ATTRIB_POS+1 ; i <= BRW_ATTRIB_INDEX ; i++) {
|
||||
for (i = 0 ; i < BRW_ATTRIB_MAX ; i++) {
|
||||
if (node->attrsz[i]) {
|
||||
COPY_CLEAN_4V(save->current[i], node->attrsz[i], data);
|
||||
data += node->attrsz[i];
|
||||
if (i != BRW_ATTRIB_POS)
|
||||
COPY_CLEAN_4V(save->current[i], node->attrsz[i], data);
|
||||
|
||||
if (i >= BRW_ATTRIB_MAT_FRONT_AMBIENT &&
|
||||
i <= BRW_ATTRIB_MAT_BACK_INDEXES)
|
||||
ctx->NewState |= _NEW_LIGHT;
|
||||
|
||||
/* Edgeflag requires special treatment:
|
||||
*/
|
||||
if (i == BRW_ATTRIB_EDGEFLAG)
|
||||
ctx->Current.EdgeFlag = (data[0] == 1.0);
|
||||
|
||||
data += node->attrsz[i] * sizeof(GLfloat);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -105,7 +117,7 @@ static void brw_bind_vertex_list( struct brw_save_context *save,
|
|||
|
||||
memset(arrays, 0, BRW_ATTRIB_MAX * sizeof(arrays[0]));
|
||||
|
||||
for (attr = 0; attr <= BRW_ATTRIB_INDEX; attr++) {
|
||||
for (attr = 0; attr < BRW_ATTRIB_MAX; attr++) {
|
||||
if (node->attrsz[attr]) {
|
||||
arrays[attr].Ptr = (const GLubyte *)data;
|
||||
arrays[attr].Size = node->attrsz[attr];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue