[Mesa-dev] [PATCH 09/20] mesa: shrink VERT_ATTRIB bitfields to 32 bits
Marek Olšák
maraeo at gmail.com
Tue Nov 21 18:01:51 UTC 2017
From: Marek Olšák <marek.olsak at amd.com>
There are only 32 vertex attribs now.
---
src/compiler/shader_enums.h | 46 ++++++++++++++---------------
src/mesa/drivers/dri/i965/brw_draw_upload.c | 8 ++---
src/mesa/main/arrayobj.c | 14 ++++-----
src/mesa/main/enable.c | 2 +-
src/mesa/main/ff_fragment_shader.cpp | 2 +-
src/mesa/main/ffvertex_prog.c | 2 +-
src/mesa/main/mtypes.h | 20 +++++++++----
src/mesa/main/state.c | 2 +-
src/mesa/main/state.h | 2 +-
src/mesa/main/varray.c | 2 +-
src/mesa/program/program_parse.y | 2 +-
src/mesa/vbo/vbo_exec_array.c | 2 +-
src/mesa/vbo/vbo_exec_draw.c | 2 +-
src/mesa/vbo/vbo_save_draw.c | 2 +-
14 files changed, 59 insertions(+), 49 deletions(-)
diff --git a/src/compiler/shader_enums.h b/src/compiler/shader_enums.h
index af4008c..ffe551a 100644
--- a/src/compiler/shader_enums.h
+++ b/src/compiler/shader_enums.h
@@ -132,50 +132,50 @@ const char *gl_vert_attrib_name(gl_vert_attrib attrib);
#define VERT_ATTRIB_TEX_MAX MAX_TEXTURE_COORD_UNITS
#define VERT_ATTRIB_GENERIC(i) (VERT_ATTRIB_GENERIC0 + (i))
#define VERT_ATTRIB_GENERIC_MAX MAX_VERTEX_GENERIC_ATTRIBS
/**
* Bitflags for vertex attributes.
* These are used in bitfields in many places.
*/
/*@{*/
-#define VERT_BIT_POS BITFIELD64_BIT(VERT_ATTRIB_POS)
-#define VERT_BIT_NORMAL BITFIELD64_BIT(VERT_ATTRIB_NORMAL)
-#define VERT_BIT_COLOR0 BITFIELD64_BIT(VERT_ATTRIB_COLOR0)
-#define VERT_BIT_COLOR1 BITFIELD64_BIT(VERT_ATTRIB_COLOR1)
-#define VERT_BIT_FOG BITFIELD64_BIT(VERT_ATTRIB_FOG)
-#define VERT_BIT_COLOR_INDEX BITFIELD64_BIT(VERT_ATTRIB_COLOR_INDEX)
-#define VERT_BIT_EDGEFLAG BITFIELD64_BIT(VERT_ATTRIB_EDGEFLAG)
-#define VERT_BIT_TEX0 BITFIELD64_BIT(VERT_ATTRIB_TEX0)
-#define VERT_BIT_TEX1 BITFIELD64_BIT(VERT_ATTRIB_TEX1)
-#define VERT_BIT_TEX2 BITFIELD64_BIT(VERT_ATTRIB_TEX2)
-#define VERT_BIT_TEX3 BITFIELD64_BIT(VERT_ATTRIB_TEX3)
-#define VERT_BIT_TEX4 BITFIELD64_BIT(VERT_ATTRIB_TEX4)
-#define VERT_BIT_TEX5 BITFIELD64_BIT(VERT_ATTRIB_TEX5)
-#define VERT_BIT_TEX6 BITFIELD64_BIT(VERT_ATTRIB_TEX6)
-#define VERT_BIT_TEX7 BITFIELD64_BIT(VERT_ATTRIB_TEX7)
-#define VERT_BIT_POINT_SIZE BITFIELD64_BIT(VERT_ATTRIB_POINT_SIZE)
-#define VERT_BIT_GENERIC0 BITFIELD64_BIT(VERT_ATTRIB_GENERIC0)
-
-#define VERT_BIT(i) BITFIELD64_BIT(i)
-#define VERT_BIT_ALL BITFIELD64_RANGE(0, VERT_ATTRIB_MAX)
+#define VERT_BIT_POS BITFIELD_BIT(VERT_ATTRIB_POS)
+#define VERT_BIT_NORMAL BITFIELD_BIT(VERT_ATTRIB_NORMAL)
+#define VERT_BIT_COLOR0 BITFIELD_BIT(VERT_ATTRIB_COLOR0)
+#define VERT_BIT_COLOR1 BITFIELD_BIT(VERT_ATTRIB_COLOR1)
+#define VERT_BIT_FOG BITFIELD_BIT(VERT_ATTRIB_FOG)
+#define VERT_BIT_COLOR_INDEX BITFIELD_BIT(VERT_ATTRIB_COLOR_INDEX)
+#define VERT_BIT_EDGEFLAG BITFIELD_BIT(VERT_ATTRIB_EDGEFLAG)
+#define VERT_BIT_TEX0 BITFIELD_BIT(VERT_ATTRIB_TEX0)
+#define VERT_BIT_TEX1 BITFIELD_BIT(VERT_ATTRIB_TEX1)
+#define VERT_BIT_TEX2 BITFIELD_BIT(VERT_ATTRIB_TEX2)
+#define VERT_BIT_TEX3 BITFIELD_BIT(VERT_ATTRIB_TEX3)
+#define VERT_BIT_TEX4 BITFIELD_BIT(VERT_ATTRIB_TEX4)
+#define VERT_BIT_TEX5 BITFIELD_BIT(VERT_ATTRIB_TEX5)
+#define VERT_BIT_TEX6 BITFIELD_BIT(VERT_ATTRIB_TEX6)
+#define VERT_BIT_TEX7 BITFIELD_BIT(VERT_ATTRIB_TEX7)
+#define VERT_BIT_POINT_SIZE BITFIELD_BIT(VERT_ATTRIB_POINT_SIZE)
+#define VERT_BIT_GENERIC0 BITFIELD_BIT(VERT_ATTRIB_GENERIC0)
+
+#define VERT_BIT(i) BITFIELD_BIT(i)
+#define VERT_BIT_ALL BITFIELD_RANGE(0, VERT_ATTRIB_MAX)
#define VERT_BIT_FF(i) VERT_BIT(i)
-#define VERT_BIT_FF_ALL BITFIELD64_RANGE(0, VERT_ATTRIB_FF_MAX)
+#define VERT_BIT_FF_ALL BITFIELD_RANGE(0, VERT_ATTRIB_FF_MAX)
#define VERT_BIT_TEX(i) VERT_BIT(VERT_ATTRIB_TEX(i))
#define VERT_BIT_TEX_ALL \
- BITFIELD64_RANGE(VERT_ATTRIB_TEX(0), VERT_ATTRIB_TEX_MAX)
+ BITFIELD_RANGE(VERT_ATTRIB_TEX(0), VERT_ATTRIB_TEX_MAX)
#define VERT_BIT_GENERIC(i) VERT_BIT(VERT_ATTRIB_GENERIC(i))
#define VERT_BIT_GENERIC_ALL \
- BITFIELD64_RANGE(VERT_ATTRIB_GENERIC(0), VERT_ATTRIB_GENERIC_MAX)
+ BITFIELD_RANGE(VERT_ATTRIB_GENERIC(0), VERT_ATTRIB_GENERIC_MAX)
/*@}*/
#define MAX_VARYING 32 /**< number of float[4] vectors */
/**
* Indexes for vertex shader outputs, geometry shader inputs/outputs, and
* fragment shader inputs.
*
* Note that some of these values are not available to all pipeline stages.
*
diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c
index 9b81999..2204bf4 100644
--- a/src/mesa/drivers/dri/i965/brw_draw_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c
@@ -451,21 +451,21 @@ copy_array_to_vbo_array(struct brw_context *brw,
}
void
brw_prepare_vertices(struct brw_context *brw)
{
const struct gen_device_info *devinfo = &brw->screen->devinfo;
struct gl_context *ctx = &brw->ctx;
/* BRW_NEW_VS_PROG_DATA */
const struct brw_vs_prog_data *vs_prog_data =
brw_vs_prog_data(brw->vs.base.prog_data);
- GLbitfield64 vs_inputs = vs_prog_data->inputs_read;
+ GLbitfield vs_inputs = vs_prog_data->inputs_read;
const unsigned char *ptr = NULL;
GLuint interleaved = 0;
unsigned int min_index = brw->vb.min_index + brw->basevertex;
unsigned int max_index = brw->vb.max_index + brw->basevertex;
unsigned i;
int delta, j;
struct brw_vertex_element *upload[VERT_ATTRIB_MAX];
GLuint nr_uploads = 0;
@@ -480,30 +480,30 @@ brw_prepare_vertices(struct brw_context *brw)
ctx->Polygon.BackMode != GL_FILL)) {
vs_inputs |= VERT_BIT_EDGEFLAG;
}
if (0)
fprintf(stderr, "%s %d..%d\n", __func__, min_index, max_index);
/* Accumulate the list of enabled arrays. */
brw->vb.nr_enabled = 0;
while (vs_inputs) {
- GLuint first = ffsll(vs_inputs) - 1;
+ GLuint first = ffs(vs_inputs) - 1;
assert (first < 64);
GLuint index =
first - DIV_ROUND_UP(_mesa_bitcount_64(vs_prog_data->double_inputs_read &
BITFIELD64_MASK(first)), 2);
struct brw_vertex_element *input = &brw->vb.inputs[index];
input->is_dual_slot = (vs_prog_data->double_inputs_read & BITFIELD64_BIT(first)) != 0;
- vs_inputs &= ~BITFIELD64_BIT(first);
+ vs_inputs &= ~BITFIELD_BIT(first);
if (input->is_dual_slot)
- vs_inputs &= ~BITFIELD64_BIT(first + 1);
+ vs_inputs &= ~BITFIELD_BIT(first + 1);
brw->vb.enabled[brw->vb.nr_enabled++] = input;
}
if (brw->vb.nr_enabled == 0)
return;
if (brw->vb.nr_buffers)
return;
/* The range of data in a given buffer represented as [min, max) */
diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c
index 18d6d80..d9a65ba 100644
--- a/src/mesa/main/arrayobj.c
+++ b/src/mesa/main/arrayobj.c
@@ -245,21 +245,21 @@ init_array(struct gl_context *ctx,
array->Enabled = GL_FALSE;
array->Normalized = GL_FALSE;
array->Integer = GL_FALSE;
array->Doubles = GL_FALSE;
array->_ElementSize = size * _mesa_sizeof_type(type);
array->BufferBindingIndex = index;
binding->Offset = 0;
binding->Stride = array->_ElementSize;
binding->BufferObj = NULL;
- binding->_BoundArrays = BITFIELD64_BIT(index);
+ binding->_BoundArrays = BITFIELD_BIT(index);
/* Vertex array buffers */
_mesa_reference_buffer_object(ctx, &binding->BufferObj,
ctx->Shared->NullBufferObj);
}
/**
* Initialize a gl_vertex_array_object's arrays.
*/
@@ -307,47 +307,47 @@ _mesa_initialize_vao(struct gl_context *ctx,
/**
* Updates the derived gl_vertex_arrays when a gl_vertex_attrib_array
* or a gl_vertex_buffer_binding has changed.
*/
void
_mesa_update_vao_client_arrays(struct gl_context *ctx,
struct gl_vertex_array_object *vao)
{
- GLbitfield64 arrays = vao->NewArrays;
+ GLbitfield arrays = vao->NewArrays;
while (arrays) {
- const int attrib = u_bit_scan64(&arrays);
+ const int attrib = u_bit_scan(&arrays);
struct gl_vertex_array *client_array = &vao->_VertexAttrib[attrib];
const struct gl_array_attributes *attrib_array =
&vao->VertexAttrib[attrib];
const struct gl_vertex_buffer_binding *buffer_binding =
&vao->BufferBinding[attrib_array->BufferBindingIndex];
_mesa_update_client_array(ctx, client_array, attrib_array,
buffer_binding);
}
}
bool
_mesa_all_varyings_in_vbos(const struct gl_vertex_array_object *vao)
{
/* Walk those enabled arrays that have the default vbo attached */
- GLbitfield64 mask = vao->_Enabled & ~vao->VertexAttribBufferMask;
+ GLbitfield mask = vao->_Enabled & ~vao->VertexAttribBufferMask;
while (mask) {
/* Do not use u_bit_scan64 as we can walk multiple
* attrib arrays at once
*/
- const int i = ffsll(mask) - 1;
+ const int i = ffs(mask) - 1;
const struct gl_array_attributes *attrib_array =
&vao->VertexAttrib[i];
const struct gl_vertex_buffer_binding *buffer_binding =
&vao->BufferBinding[attrib_array->BufferBindingIndex];
/* Only enabled arrays shall appear in the _Enabled bitmask */
assert(attrib_array->Enabled);
/* We have already masked out vao->VertexAttribBufferMask */
assert(!_mesa_is_bufferobj(buffer_binding->BufferObj));
@@ -361,24 +361,24 @@ _mesa_all_varyings_in_vbos(const struct gl_vertex_array_object *vao)
mask &= ~buffer_binding->_BoundArrays;
}
return true;
}
bool
_mesa_all_buffers_are_unmapped(const struct gl_vertex_array_object *vao)
{
/* Walk the enabled arrays that have a vbo attached */
- GLbitfield64 mask = vao->_Enabled & vao->VertexAttribBufferMask;
+ GLbitfield mask = vao->_Enabled & vao->VertexAttribBufferMask;
while (mask) {
- const int i = ffsll(mask) - 1;
+ const int i = ffs(mask) - 1;
const struct gl_array_attributes *attrib_array =
&vao->VertexAttrib[i];
const struct gl_vertex_buffer_binding *buffer_binding =
&vao->BufferBinding[attrib_array->BufferBindingIndex];
/* Only enabled arrays shall appear in the _Enabled bitmask */
assert(attrib_array->Enabled);
/* We have already masked with vao->VertexAttribBufferMask */
assert(_mesa_is_bufferobj(buffer_binding->BufferObj));
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 54b3b65..5e707ba 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -57,21 +57,21 @@ update_derived_primitive_restart_state(struct gl_context *ctx)
|| ctx->Array.PrimitiveRestartFixedIndex;
}
/**
* Helper to enable/disable client-side state.
*/
static void
client_state(struct gl_context *ctx, GLenum cap, GLboolean state)
{
struct gl_vertex_array_object *vao = ctx->Array.VAO;
- GLbitfield64 flag;
+ GLbitfield flag;
GLboolean *var;
switch (cap) {
case GL_VERTEX_ARRAY:
var = &vao->VertexAttrib[VERT_ATTRIB_POS].Enabled;
flag = VERT_BIT_POS;
break;
case GL_NORMAL_ARRAY:
var = &vao->VertexAttrib[VERT_ATTRIB_NORMAL].Enabled;
flag = VERT_BIT_NORMAL;
diff --git a/src/mesa/main/ff_fragment_shader.cpp b/src/mesa/main/ff_fragment_shader.cpp
index 8fde074..d172965 100644
--- a/src/mesa/main/ff_fragment_shader.cpp
+++ b/src/mesa/main/ff_fragment_shader.cpp
@@ -173,21 +173,21 @@ static GLbitfield filter_fp_input_mask( GLbitfield fp_inputs,
/* _NEW_PROGRAM */
const GLboolean vertexShader =
ctx->_Shader->CurrentProgram[MESA_SHADER_VERTEX] != NULL;
const GLboolean vertexProgram = _mesa_arb_vertex_program_enabled(ctx);
if (!(vertexProgram || vertexShader)) {
/* Fixed function vertex logic */
GLbitfield possible_inputs = 0;
/* _NEW_VARYING_VP_INPUTS */
- GLbitfield64 varying_inputs = ctx->varying_vp_inputs;
+ GLbitfield varying_inputs = ctx->varying_vp_inputs;
/* These get generated in the setup routine regardless of the
* vertex program:
*/
/* _NEW_POINT */
if (ctx->Point.PointSprite) {
/* All texture varyings are possible to use */
possible_inputs = VARYING_BITS_TEX_ANY;
}
else {
diff --git a/src/mesa/main/ffvertex_prog.c b/src/mesa/main/ffvertex_prog.c
index 72244c4..3c998eb 100644
--- a/src/mesa/main/ffvertex_prog.c
+++ b/src/mesa/main/ffvertex_prog.c
@@ -61,21 +61,21 @@ struct state_key {
unsigned rescale_normals:1;
unsigned fog_source_is_depth:1;
unsigned fog_distance_mode:2;
unsigned separate_specular:1;
unsigned point_attenuated:1;
unsigned point_array:1;
unsigned texture_enabled_global:1;
unsigned fragprog_inputs_read:12;
- GLbitfield64 varying_vp_inputs;
+ GLbitfield varying_vp_inputs;
struct {
unsigned light_enabled:1;
unsigned light_eyepos3_is_zero:1;
unsigned light_spotcutoff_is_180:1;
unsigned light_attenuated:1;
unsigned texunit_really_enabled:1;
unsigned texmat_enabled:1;
unsigned coord_replace:1;
unsigned texgen_enabled:4;
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 660b1a5..f16ff4e 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -49,20 +49,30 @@
#include "util/bitscan.h"
#include "util/simple_mtx.h"
#include "util/u_dynarray.h"
#ifdef __cplusplus
extern "C" {
#endif
+/** Set a single bit */
+#define BITFIELD_BIT(b) ((GLbitfield)1 << (b))
+/** Set all bits up to excluding bit b */
+#define BITFIELD_MASK(b) \
+ ((b) == 32 ? (~(GLbitfield)0) : BITFIELD_BIT(b) - 1)
+/** Set count bits starting from bit b */
+#define BITFIELD_RANGE(b, count) \
+ (BITFIELD_MASK((b) + (count)) & ~BITFIELD_MASK(b))
+
+
/**
* \name 64-bit extension of GLbitfield.
*/
/*@{*/
typedef GLuint64 GLbitfield64;
/** Set a single bit */
#define BITFIELD64_BIT(b) ((GLbitfield64)1 << (b))
/** Set all bits up to excluding bit b */
#define BITFIELD64_MASK(b) \
@@ -1508,21 +1518,21 @@ struct gl_array_attributes
* This describes the buffer object used for a vertex array (or
* multiple vertex arrays). If BufferObj points to the default/null
* buffer object, then the vertex array lives in user memory and not a VBO.
*/
struct gl_vertex_buffer_binding
{
GLintptr Offset; /**< User-specified offset */
GLsizei Stride; /**< User-specified stride */
GLuint InstanceDivisor; /**< GL_ARB_instanced_arrays */
struct gl_buffer_object *BufferObj; /**< GL_ARB_vertex_buffer_object */
- GLbitfield64 _BoundArrays; /**< Arrays bound to this binding point */
+ GLbitfield _BoundArrays; /**< Arrays bound to this binding point */
};
/**
* A representation of "Vertex Array Objects" (VAOs) from OpenGL 3.1+ /
* the GL_ARB_vertex_array_object extension.
*/
struct gl_vertex_array_object
{
/** Name of the VAO as received from glGenVertexArray. */
@@ -1545,27 +1555,27 @@ struct gl_vertex_array_object
*/
struct gl_vertex_array _VertexAttrib[VERT_ATTRIB_MAX];
/** Vertex attribute arrays */
struct gl_array_attributes VertexAttrib[VERT_ATTRIB_MAX];
/** Vertex buffer bindings */
struct gl_vertex_buffer_binding BufferBinding[VERT_ATTRIB_MAX];
/** Mask indicating which vertex arrays have vertex buffer associated. */
- GLbitfield64 VertexAttribBufferMask;
+ GLbitfield VertexAttribBufferMask;
/** Mask of VERT_BIT_* values indicating which arrays are enabled */
- GLbitfield64 _Enabled;
+ GLbitfield _Enabled;
/** Mask of VERT_BIT_* values indicating changed/dirty arrays */
- GLbitfield64 NewArrays;
+ GLbitfield NewArrays;
/** The index buffer (also known as the element array buffer in OpenGL). */
struct gl_buffer_object *IndexBufferObj;
};
/** Used to signal when transitioning from one kind of drawing method
* to another.
*/
typedef enum {
@@ -4949,21 +4959,21 @@ struct gl_context
struct gl_debug_state *Debug;
GLenum16 RenderMode; /**< either GL_RENDER, GL_SELECT, GL_FEEDBACK */
GLbitfield NewState; /**< bitwise-or of _NEW_* flags */
uint64_t NewDriverState; /**< bitwise-or of flags from DriverFlags */
struct gl_driver_flags DriverFlags;
GLboolean ViewportInitialized; /**< has viewport size been initialized? */
- GLbitfield64 varying_vp_inputs; /**< mask of VERT_BIT_* flags */
+ GLbitfield varying_vp_inputs; /**< mask of VERT_BIT_* flags */
/** \name Derived state */
GLbitfield _ImageTransferState;/**< bitwise-or of IMAGE_*_BIT flags */
GLfloat _EyeZDir[3];
GLfloat _ModelViewInvScale;
GLboolean _NeedEyeCoords;
GLboolean _ForceEyeCoords;
GLuint TextureStateTimestamp; /**< detect changes to shared state */
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
index 7aec98e..7a9732d 100644
--- a/src/mesa/main/state.c
+++ b/src/mesa/main/state.c
@@ -407,21 +407,21 @@ _mesa_update_state( struct gl_context *ctx )
*
* Where potential_vp_outputs is calculated by looking at enabled
* texgen, etc.
*
* The generated fragment program should then only declare inputs that
* may vary or otherwise differ from the ctx->Current values.
* Otherwise, the fp should track them as state values instead.
*/
void
_mesa_set_varying_vp_inputs( struct gl_context *ctx,
- GLbitfield64 varying_inputs )
+ GLbitfield varying_inputs )
{
if (ctx->API != API_OPENGL_COMPAT &&
ctx->API != API_OPENGLES)
return;
if (ctx->varying_vp_inputs != varying_inputs) {
ctx->varying_vp_inputs = varying_inputs;
/* Only the fixed-func generated programs need to use the flag
* and the fixed-func fragment program uses it only if there is also
diff --git a/src/mesa/main/state.h b/src/mesa/main/state.h
index b719f39..9d45917 100644
--- a/src/mesa/main/state.h
+++ b/src/mesa/main/state.h
@@ -32,21 +32,21 @@ extern void
_mesa_update_state(struct gl_context *ctx);
/* As above but can only be called between _mesa_lock_context_textures() and
* _mesa_unlock_context_textures().
*/
extern void
_mesa_update_state_locked(struct gl_context *ctx);
extern void
-_mesa_set_varying_vp_inputs(struct gl_context *ctx, GLbitfield64 varying_inputs);
+_mesa_set_varying_vp_inputs(struct gl_context *ctx, GLbitfield varying_inputs);
extern void
_mesa_set_vp_override(struct gl_context *ctx, GLboolean flag);
/**
* Is the secondary color needed?
*/
static inline GLboolean
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index 9934724..31f1c83 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -131,21 +131,21 @@ type_to_bit(const struct gl_context *ctx, GLenum type)
*/
static void
vertex_attrib_binding(struct gl_context *ctx,
struct gl_vertex_array_object *vao,
GLuint attribIndex,
GLuint bindingIndex)
{
struct gl_array_attributes *array = &vao->VertexAttrib[attribIndex];
if (array->BufferBindingIndex != bindingIndex) {
- const GLbitfield64 array_bit = VERT_BIT(attribIndex);
+ const GLbitfield array_bit = VERT_BIT(attribIndex);
if (_mesa_is_bufferobj(vao->BufferBinding[bindingIndex].BufferObj))
vao->VertexAttribBufferMask |= array_bit;
FLUSH_VERTICES(ctx, _NEW_ARRAY);
vao->BufferBinding[array->BufferBindingIndex]._BoundArrays &= ~array_bit;
vao->BufferBinding[bindingIndex]._BoundArrays |= array_bit;
array->BufferBindingIndex = bindingIndex;
diff --git a/src/mesa/program/program_parse.y b/src/mesa/program/program_parse.y
index 1bc5f51..04ec18d 100644
--- a/src/mesa/program/program_parse.y
+++ b/src/mesa/program/program_parse.y
@@ -2205,21 +2205,21 @@ set_src_reg_swz(struct asm_src_register *r, gl_register_file file, GLint index,
* Validates that legal sets of inputs are used by the program. In this case
* "used" included both reading the input or binding the input to a name using
* the \c ATTRIB command.
*
* \return
* \c TRUE if the combination of inputs used is valid, \c FALSE otherwise.
*/
int
validate_inputs(struct YYLTYPE *locp, struct asm_parser_state *state)
{
- const GLbitfield64 inputs = state->prog->info.inputs_read | state->InputsBound;
+ const GLbitfield inputs = state->prog->info.inputs_read | state->InputsBound;
GLbitfield ff_inputs = 0;
/* Since Mesa internal attribute indices are different from
* how NV_vertex_program defines attribute aliasing, we have to construct
* a separate usage mask based on how the aliasing is defined.
*
* Note that attribute aliasing is optional if NV_vertex_program is
* unsupported.
*/
if (inputs & VERT_BIT_POS)
diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c
index e3421fa..024d4d6 100644
--- a/src/mesa/vbo/vbo_exec_array.c
+++ b/src/mesa/vbo/vbo_exec_array.c
@@ -292,21 +292,21 @@ print_draw_arrays(struct gl_context *ctx,
* to point at a zero-stride current value "array".
*/
static void
recalculate_input_bindings(struct gl_context *ctx)
{
struct vbo_context *vbo = vbo_context(ctx);
struct vbo_exec_context *exec = &vbo->exec;
const struct gl_array_attributes *array = ctx->Array.VAO->VertexAttrib;
struct gl_vertex_array *vertexAttrib = ctx->Array.VAO->_VertexAttrib;
const struct gl_vertex_array **inputs = &exec->array.inputs[0];
- GLbitfield64 const_inputs = 0x0;
+ GLbitfield const_inputs = 0x0;
GLuint i;
switch (get_program_mode(ctx)) {
case VP_NONE:
/* When no vertex program is active (or the vertex program is generated
* from fixed-function state). We put the material values into the
* generic slots. This is the only situation where material values
* are available as per-vertex attributes.
*/
for (i = 0; i < VERT_ATTRIB_FF_MAX; i++) {
diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c
index f34b591..e0f5d31 100644
--- a/src/mesa/vbo/vbo_exec_draw.c
+++ b/src/mesa/vbo/vbo_exec_draw.c
@@ -170,21 +170,21 @@ vbo_copy_vertices( struct vbo_exec_context *exec )
/* TODO: populate these as the vertex is defined:
*/
static void
vbo_exec_bind_arrays( struct gl_context *ctx )
{
struct vbo_context *vbo = vbo_context(ctx);
struct vbo_exec_context *exec = &vbo->exec;
struct gl_vertex_array *arrays = exec->vtx.arrays;
const GLubyte *map;
GLuint attr;
- GLbitfield64 varying_inputs = 0x0;
+ GLbitfield varying_inputs = 0x0;
bool swap_pos = false;
/* Install the default (ie Current) attributes first, then overlay
* all active ones.
*/
switch (get_program_mode(exec->ctx)) {
case VP_NONE:
for (attr = 0; attr < VERT_ATTRIB_FF_MAX; attr++) {
exec->vtx.inputs[attr] = &vbo->currval[VBO_ATTRIB_POS+attr];
}
diff --git a/src/mesa/vbo/vbo_save_draw.c b/src/mesa/vbo/vbo_save_draw.c
index 02920c9..cd7eda0 100644
--- a/src/mesa/vbo/vbo_save_draw.c
+++ b/src/mesa/vbo/vbo_save_draw.c
@@ -134,21 +134,21 @@ static void vbo_bind_vertex_list(struct gl_context *ctx,
const struct vbo_save_vertex_list *node)
{
struct vbo_context *vbo = vbo_context(ctx);
struct vbo_save_context *save = &vbo->save;
struct gl_vertex_array *arrays = save->arrays;
GLuint buffer_offset = node->buffer_offset;
const GLubyte *map;
GLuint attr;
GLubyte node_attrsz[VBO_ATTRIB_MAX]; /* copy of node->attrsz[] */
GLenum16 node_attrtype[VBO_ATTRIB_MAX]; /* copy of node->attrtype[] */
- GLbitfield64 varying_inputs = 0x0;
+ GLbitfield varying_inputs = 0x0;
memcpy(node_attrsz, node->attrsz, sizeof(node->attrsz));
memcpy(node_attrtype, node->attrtype, sizeof(node->attrtype));
/* Install the default (ie Current) attributes first, then overlay
* all active ones.
*/
switch (get_program_mode(ctx)) {
case VP_NONE:
for (attr = 0; attr < VERT_ATTRIB_FF_MAX; attr++) {
--
2.7.4
More information about the mesa-dev
mailing list