Merge branch 'mesa_7_6_branch' into mesa_7_7_branch
This commit is contained in:
@@ -93,7 +93,12 @@ static ImageRec *ImageOpen(char *fileName)
|
||||
fread(image, 1, 12, image->file);
|
||||
|
||||
if (swapFlag) {
|
||||
ConvertShort(&image->imagic, 6);
|
||||
ConvertShort(&image->imagic, 1);
|
||||
ConvertShort(&image->type, 1);
|
||||
ConvertShort(&image->dim, 1);
|
||||
ConvertShort(&image->xsize, 1);
|
||||
ConvertShort(&image->ysize, 1);
|
||||
ConvertShort(&image->zsize, 1);
|
||||
}
|
||||
|
||||
image->tmp = (unsigned char *)malloc(image->xsize*256);
|
||||
|
||||
@@ -117,7 +117,12 @@ static rawImageRec *RawImageOpen(const char *fileName)
|
||||
fread(raw, 1, 12, raw->file);
|
||||
|
||||
if (swapFlag) {
|
||||
ConvertShort(&raw->imagic, 6);
|
||||
ConvertShort(&raw->imagic, 1);
|
||||
ConvertShort(&raw->type, 1);
|
||||
ConvertShort(&raw->dim, 1);
|
||||
ConvertShort(&raw->sizeX, 1);
|
||||
ConvertShort(&raw->sizeY, 1);
|
||||
ConvertShort(&raw->sizeZ, 1);
|
||||
}
|
||||
|
||||
raw->tmp = (unsigned char *)malloc(raw->sizeX*256);
|
||||
|
||||
@@ -87,6 +87,7 @@ rbug_get_message(struct rbug_connection *c, uint32_t *serial)
|
||||
if (!data) {
|
||||
return NULL;
|
||||
}
|
||||
data->opcode = 0;
|
||||
|
||||
do {
|
||||
uint8_t *ptr = ((uint8_t*)data) + read;
|
||||
|
||||
@@ -806,6 +806,7 @@ static GLboolean i915_debug_packet( struct debug_stream *stream )
|
||||
default:
|
||||
return debug(stream, "", 0);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
return 0;
|
||||
|
||||
@@ -1154,7 +1154,11 @@ static int check_blnd(GLcontext *ctx, struct radeon_state_atom *atom)
|
||||
count += 3;
|
||||
|
||||
if (context->radeon.radeonScreen->chip_family > CHIP_FAMILY_R600) {
|
||||
for (ui = 0; ui < R700_MAX_RENDER_TARGETS; ui++) {
|
||||
/* targets are enabled in r700SetRenderTarget but state
|
||||
size is calculated before that. Until MRT's are done
|
||||
hardcode target0 as enabled. */
|
||||
count += 3;
|
||||
for (ui = 1; ui < R700_MAX_RENDER_TARGETS; ui++) {
|
||||
if (r700->render_target[ui].enabled)
|
||||
count += 3;
|
||||
}
|
||||
|
||||
+8
-3
@@ -34,15 +34,20 @@
|
||||
void GLAPIENTRY
|
||||
_mesa_Fogf(GLenum pname, GLfloat param)
|
||||
{
|
||||
_mesa_Fogfv(pname, ¶m);
|
||||
GLfloat fparam[4];
|
||||
fparam[0] = param;
|
||||
fparam[1] = fparam[2] = fparam[3] = 0.0F;
|
||||
_mesa_Fogfv(pname, fparam);
|
||||
}
|
||||
|
||||
|
||||
void GLAPIENTRY
|
||||
_mesa_Fogi(GLenum pname, GLint param )
|
||||
{
|
||||
GLfloat fparam = (GLfloat) param;
|
||||
_mesa_Fogfv(pname, &fparam);
|
||||
GLfloat fparam[4];
|
||||
fparam[0] = (GLfloat) param;
|
||||
fparam[1] = fparam[2] = fparam[3] = 0.0F;
|
||||
_mesa_Fogfv(pname, fparam);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+16
-4
@@ -206,7 +206,10 @@ _mesa_light(GLcontext *ctx, GLuint lnum, GLenum pname, const GLfloat *params)
|
||||
void GLAPIENTRY
|
||||
_mesa_Lightf( GLenum light, GLenum pname, GLfloat param )
|
||||
{
|
||||
_mesa_Lightfv( light, pname, ¶m );
|
||||
GLfloat fparam[4];
|
||||
fparam[0] = param;
|
||||
fparam[1] = fparam[2] = fparam[3] = 0.0F;
|
||||
_mesa_Lightfv( light, pname, fparam );
|
||||
}
|
||||
|
||||
|
||||
@@ -285,7 +288,10 @@ _mesa_Lightfv( GLenum light, GLenum pname, const GLfloat *params )
|
||||
void GLAPIENTRY
|
||||
_mesa_Lighti( GLenum light, GLenum pname, GLint param )
|
||||
{
|
||||
_mesa_Lightiv( light, pname, ¶m );
|
||||
GLint iparam[4];
|
||||
iparam[0] = param;
|
||||
iparam[1] = iparam[2] = iparam[3] = 0;
|
||||
_mesa_Lightiv( light, pname, iparam );
|
||||
}
|
||||
|
||||
|
||||
@@ -537,14 +543,20 @@ _mesa_LightModeliv( GLenum pname, const GLint *params )
|
||||
void GLAPIENTRY
|
||||
_mesa_LightModeli( GLenum pname, GLint param )
|
||||
{
|
||||
_mesa_LightModeliv( pname, ¶m );
|
||||
GLint iparam[4];
|
||||
iparam[0] = param;
|
||||
iparam[1] = iparam[2] = iparam[3] = 0;
|
||||
_mesa_LightModeliv( pname, iparam );
|
||||
}
|
||||
|
||||
|
||||
void GLAPIENTRY
|
||||
_mesa_LightModelf( GLenum pname, GLfloat param )
|
||||
{
|
||||
_mesa_LightModelfv( pname, ¶m );
|
||||
GLfloat fparam[4];
|
||||
fparam[0] = param;
|
||||
fparam[1] = fparam[2] = fparam[3] = 0.0F;
|
||||
_mesa_LightModelfv( pname, fparam );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -69,8 +69,10 @@ _mesa_PointSize( GLfloat size )
|
||||
void GLAPIENTRY
|
||||
_mesa_PointParameteri( GLenum pname, GLint param )
|
||||
{
|
||||
const GLfloat value = (GLfloat) param;
|
||||
_mesa_PointParameterfv(pname, &value);
|
||||
GLfloat p[3];
|
||||
p[0] = (GLfloat) param;
|
||||
p[1] = p[2] = 0.0F;
|
||||
_mesa_PointParameterfv(pname, p);
|
||||
}
|
||||
|
||||
|
||||
@@ -90,7 +92,10 @@ _mesa_PointParameteriv( GLenum pname, const GLint *params )
|
||||
void GLAPIENTRY
|
||||
_mesa_PointParameterf( GLenum pname, GLfloat param)
|
||||
{
|
||||
_mesa_PointParameterfv(pname, ¶m);
|
||||
GLfloat p[3];
|
||||
p[0] = param;
|
||||
p[1] = p[2] = 0.0F;
|
||||
_mesa_PointParameterfv(pname, p);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -186,8 +186,10 @@ _mesa_TexGeniv(GLenum coord, GLenum pname, const GLint *params )
|
||||
static void GLAPIENTRY
|
||||
_mesa_TexGend(GLenum coord, GLenum pname, GLdouble param )
|
||||
{
|
||||
GLfloat p = (GLfloat) param;
|
||||
_mesa_TexGenfv( coord, pname, &p );
|
||||
GLfloat p[4];
|
||||
p[0] = (GLfloat) param;
|
||||
p[1] = p[2] = p[3] = 0.0F;
|
||||
_mesa_TexGenfv( coord, pname, p );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -415,7 +415,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx,
|
||||
/* Detect cases where the application set the base level to an invalid
|
||||
* value.
|
||||
*/
|
||||
if ((baseLevel < 0) || (baseLevel > MAX_TEXTURE_LEVELS)) {
|
||||
if ((baseLevel < 0) || (baseLevel >= MAX_TEXTURE_LEVELS)) {
|
||||
char s[100];
|
||||
_mesa_sprintf(s, "base level = %d is invalid", baseLevel);
|
||||
incomplete(t, s);
|
||||
|
||||
@@ -595,8 +595,10 @@ _mesa_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params)
|
||||
case GL_DEPTH_TEXTURE_MODE_ARB:
|
||||
{
|
||||
/* convert float param to int */
|
||||
GLint p = (GLint) params[0];
|
||||
need_update = set_tex_parameteri(ctx, texObj, pname, &p);
|
||||
GLint p[4];
|
||||
p[0] = (GLint) params[0];
|
||||
p[1] = p[2] = p[3] = 0;
|
||||
need_update = set_tex_parameteri(ctx, texObj, pname, p);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -645,14 +647,21 @@ _mesa_TexParameteri(GLenum target, GLenum pname, GLint param)
|
||||
case GL_TEXTURE_LOD_BIAS:
|
||||
case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB:
|
||||
{
|
||||
GLfloat fparam = (GLfloat) param;
|
||||
GLfloat fparam[4];
|
||||
fparam[0] = (GLfloat) param;
|
||||
fparam[1] = fparam[2] = fparam[3] = 0.0F;
|
||||
/* convert int param to float */
|
||||
need_update = set_tex_parameterf(ctx, texObj, pname, &fparam);
|
||||
need_update = set_tex_parameterf(ctx, texObj, pname, fparam);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
/* this will generate an error if pname is illegal */
|
||||
need_update = set_tex_parameteri(ctx, texObj, pname, ¶m);
|
||||
{
|
||||
GLint iparam[4];
|
||||
iparam[0] = param;
|
||||
iparam[1] = iparam[2] = iparam[3] = 0;
|
||||
need_update = set_tex_parameteri(ctx, texObj, pname, iparam);
|
||||
}
|
||||
}
|
||||
|
||||
if (ctx->Driver.TexParameter && need_update) {
|
||||
@@ -694,8 +703,10 @@ _mesa_TexParameteriv(GLenum target, GLenum pname, const GLint *params)
|
||||
case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB:
|
||||
{
|
||||
/* convert int param to float */
|
||||
GLfloat fparam = (GLfloat) params[0];
|
||||
need_update = set_tex_parameterf(ctx, texObj, pname, &fparam);
|
||||
GLfloat fparams[4];
|
||||
fparams[0] = (GLfloat) params[0];
|
||||
fparams[1] = fparams[2] = fparams[3] = 0.0F;
|
||||
need_update = set_tex_parameterf(ctx, texObj, pname, fparams);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -217,6 +217,12 @@ MatchInstruction(const GLubyte *token)
|
||||
const struct instruction_pattern *inst;
|
||||
struct instruction_pattern result;
|
||||
|
||||
result.name = NULL;
|
||||
result.opcode = MAX_OPCODE; /* i.e. invalid instruction */
|
||||
result.inputs = 0;
|
||||
result.outputs = 0;
|
||||
result.suffixes = 0;
|
||||
|
||||
for (inst = Instructions; inst->name; inst++) {
|
||||
if (_mesa_strncmp((const char *) token, inst->name, 3) == 0) {
|
||||
/* matched! */
|
||||
@@ -247,7 +253,7 @@ MatchInstruction(const GLubyte *token)
|
||||
return result;
|
||||
}
|
||||
}
|
||||
result.opcode = MAX_OPCODE; /* i.e. invalid instruction */
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -500,7 +500,7 @@ GLfloat *
|
||||
_mesa_lookup_parameter_value(const struct gl_program_parameter_list *paramList,
|
||||
GLsizei nameLen, const char *name)
|
||||
{
|
||||
GLuint i = _mesa_lookup_parameter_index(paramList, nameLen, name);
|
||||
GLint i = _mesa_lookup_parameter_index(paramList, nameLen, name);
|
||||
if (i < 0)
|
||||
return NULL;
|
||||
else
|
||||
|
||||
@@ -806,9 +806,17 @@ _mesa_find_free_register(const struct gl_program *prog, GLuint regFile)
|
||||
const struct prog_instruction *inst = prog->Instructions + i;
|
||||
const GLuint n = _mesa_num_inst_src_regs(inst->Opcode);
|
||||
|
||||
for (k = 0; k < n; k++) {
|
||||
if (inst->SrcReg[k].File == regFile) {
|
||||
used[inst->SrcReg[k].Index] = GL_TRUE;
|
||||
/* check dst reg first */
|
||||
if (inst->DstReg.File == regFile) {
|
||||
used[inst->DstReg.Index] = GL_TRUE;
|
||||
}
|
||||
else {
|
||||
/* check src regs otherwise */
|
||||
for (k = 0; k < n; k++) {
|
||||
if (inst->SrcReg[k].File == regFile) {
|
||||
used[inst->SrcReg[k].Index] = GL_TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,7 +127,6 @@ typedef struct slang_operation_
|
||||
* indicate such. num_children indicates number of elements.
|
||||
*/
|
||||
GLboolean array_constructor;
|
||||
double x;
|
||||
} slang_operation;
|
||||
|
||||
|
||||
|
||||
@@ -84,10 +84,11 @@ _slang_lookup_constant(const char *name)
|
||||
for (i = 0; info[i].Name; i++) {
|
||||
if (strcmp(info[i].Name, name) == 0) {
|
||||
/* found */
|
||||
GLint value = -1;
|
||||
_mesa_GetIntegerv(info[i].Token, &value);
|
||||
ASSERT(value >= 0); /* sanity check that glGetFloatv worked */
|
||||
return value;
|
||||
GLint values[16];
|
||||
values[0] = -1;
|
||||
_mesa_GetIntegerv(info[i].Token, values);
|
||||
ASSERT(values[0] >= 0); /* sanity check that glGetFloatv worked */
|
||||
return values[0];
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
#include "sparc_matrix.h"
|
||||
|
||||
#if defined(SVR4) || defined(__SVR4) || defined(__svr4__)
|
||||
#if defined(SVR4) || defined(__SVR4) || defined(__svr4__) || defined(__arch64__)
|
||||
/* Solaris requires this for 64-bit. */
|
||||
.register %g2, #scratch
|
||||
.register %g3, #scratch
|
||||
|
||||
@@ -35,17 +35,20 @@
|
||||
|
||||
static void clear_active_eval1( struct vbo_exec_context *exec, GLuint attr )
|
||||
{
|
||||
assert(attr < Elements(exec->eval.map1));
|
||||
exec->eval.map1[attr].map = NULL;
|
||||
}
|
||||
|
||||
static void clear_active_eval2( struct vbo_exec_context *exec, GLuint attr )
|
||||
{
|
||||
assert(attr < Elements(exec->eval.map2));
|
||||
exec->eval.map2[attr].map = NULL;
|
||||
}
|
||||
|
||||
static void set_active_eval1( struct vbo_exec_context *exec, GLuint attr, GLuint dim,
|
||||
struct gl_1d_map *map )
|
||||
{
|
||||
assert(attr < Elements(exec->eval.map1));
|
||||
if (!exec->eval.map1[attr].map) {
|
||||
exec->eval.map1[attr].map = map;
|
||||
exec->eval.map1[attr].sz = dim;
|
||||
@@ -55,6 +58,7 @@ static void set_active_eval1( struct vbo_exec_context *exec, GLuint attr, GLuint
|
||||
static void set_active_eval2( struct vbo_exec_context *exec, GLuint attr, GLuint dim,
|
||||
struct gl_2d_map *map )
|
||||
{
|
||||
assert(attr < Elements(exec->eval.map2));
|
||||
if (!exec->eval.map2[attr].map) {
|
||||
exec->eval.map2[attr].map = map;
|
||||
exec->eval.map2[attr].sz = dim;
|
||||
@@ -73,18 +77,6 @@ void vbo_exec_eval_update( struct vbo_exec_context *exec )
|
||||
clear_active_eval2( exec, attr );
|
||||
}
|
||||
|
||||
/* _NEW_PROGRAM */
|
||||
if (ctx->VertexProgram._Enabled) {
|
||||
for (attr = 0; attr < VBO_ATTRIB_FIRST_MATERIAL; attr++) {
|
||||
/* _NEW_EVAL */
|
||||
if (ctx->Eval.Map1Attrib[attr])
|
||||
set_active_eval1( exec, attr, 4, &ctx->EvalMap.Map1Attrib[attr] );
|
||||
|
||||
if (ctx->Eval.Map2Attrib[attr])
|
||||
set_active_eval2( exec, attr, 4, &ctx->EvalMap.Map2Attrib[attr] );
|
||||
}
|
||||
}
|
||||
|
||||
if (ctx->Eval.Map1Color4)
|
||||
set_active_eval1( exec, VBO_ATTRIB_COLOR0, 4, &ctx->EvalMap.Map1Color4 );
|
||||
|
||||
@@ -125,6 +117,23 @@ void vbo_exec_eval_update( struct vbo_exec_context *exec )
|
||||
else if (ctx->Eval.Map2Vertex3)
|
||||
set_active_eval2( exec, VBO_ATTRIB_POS, 3, &ctx->EvalMap.Map2Vertex3 );
|
||||
|
||||
/* _NEW_PROGRAM */
|
||||
if (ctx->VertexProgram._Enabled) {
|
||||
/* These are the 16 evaluators which GL_NV_vertex_program defines.
|
||||
* They alias and override the conventional vertex attributs.
|
||||
*/
|
||||
for (attr = 0; attr < 16; attr++) {
|
||||
/* _NEW_EVAL */
|
||||
assert(attr < Elements(ctx->Eval.Map1Attrib));
|
||||
if (ctx->Eval.Map1Attrib[attr])
|
||||
set_active_eval1( exec, attr, 4, &ctx->EvalMap.Map1Attrib[attr] );
|
||||
|
||||
assert(attr < Elements(ctx->Eval.Map2Attrib));
|
||||
if (ctx->Eval.Map2Attrib[attr])
|
||||
set_active_eval2( exec, attr, 4, &ctx->EvalMap.Map2Attrib[attr] );
|
||||
}
|
||||
}
|
||||
|
||||
exec->eval.recalculate_maps = 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user