Merge branch 'mesa_7_6_branch'

Conflicts:

	src/mesa/drivers/dri/r600/r700_assembler.c
	src/mesa/drivers/dri/r600/r700_chip.c
	src/mesa/drivers/dri/r600/r700_render.c
	src/mesa/drivers/dri/r600/r700_vertprog.c
	src/mesa/drivers/dri/r600/r700_vertprog.h
	src/mesa/drivers/dri/radeon/radeon_span.c
This commit is contained in:
Brian Paul 2009-09-24 11:03:16 -06:00
commit c9f7a23ef0
8 changed files with 43 additions and 22 deletions

View File

@ -1445,11 +1445,11 @@ fetch_texel( struct tgsi_sampler **sampler,
{
float rgba[NUM_CHANNELS][QUAD_SIZE];
(*sampler)->get_samples(*sampler,
&store[0],
&store[4],
&store[8],
0.0f, /*store[12], lodbias */
rgba);
&store[0], /* s */
&store[4], /* t */
&store[8], /* r */
store[12], /* lodbias */
rgba); /* results */
memcpy( store, rgba, 16 * sizeof(float));
}

View File

@ -99,8 +99,8 @@ static void insert_WPOS_trailer(struct r300_fragment_program_compiler *compiler,
{
int i;
fp->wpos_attr = FRAG_ATTRIB_MAX;
if (!(compiler->Base.Program.InputsRead & FRAG_BIT_WPOS)) {
fp->wpos_attr = FRAG_ATTRIB_MAX;
return;
}
@ -112,6 +112,13 @@ static void insert_WPOS_trailer(struct r300_fragment_program_compiler *compiler,
}
}
/* No free texcoord found, fall-back to software rendering */
if (fp->wpos_attr == FRAG_ATTRIB_MAX)
{
compiler->Base.Error = 1;
return;
}
rc_transform_fragment_wpos(&compiler->Base, FRAG_ATTRIB_WPOS, fp->wpos_attr);
}
@ -127,8 +134,8 @@ static void rewriteFog(struct r300_fragment_program_compiler *compiler, struct r
struct prog_src_register src;
int i;
fp->fog_attr = FRAG_ATTRIB_MAX;
if (!(compiler->Base.Program.InputsRead & FRAG_BIT_FOGC)) {
fp->fog_attr = FRAG_ATTRIB_MAX;
return;
}
@ -140,6 +147,13 @@ static void rewriteFog(struct r300_fragment_program_compiler *compiler, struct r
}
}
/* No free texcoord found, fall-back to software rendering */
if (fp->fog_attr == FRAG_ATTRIB_MAX)
{
compiler->Base.Error = 1;
return;
}
memset(&src, 0, sizeof(src));
src.File = PROGRAM_INPUT;
src.Index = fp->fog_attr;

View File

@ -276,6 +276,7 @@ need_saturate( GLuint mode )
return GL_TRUE;
default:
assert(0);
return GL_FALSE;
}
}

View File

@ -1555,17 +1555,12 @@ _mesa_execute_program(GLcontext * ctx,
case OPCODE_TXB: /* GL_ARB_fragment_program only */
/* Texel lookup with LOD bias */
{
const GLuint unit = machine->Samplers[inst->TexSrcUnit];
const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
GLfloat texcoord[4], color[4], lodBias;
fetch_vector4(&inst->SrcReg[0], machine, texcoord);
/* texcoord[3] is the bias to add to lambda */
lodBias = texUnit->LodBias + texcoord[3];
if (texUnit->_Current) {
lodBias += texUnit->_Current->LodBias;
}
lodBias = texcoord[3];
fetch_texel(ctx, machine, inst, texcoord, lodBias, color);

View File

@ -741,7 +741,7 @@ static const struct input_info vertInputs[] = {
{ "gl_MultiTexCoord5", VERT_ATTRIB_TEX5, GL_FLOAT_VEC4, SWIZZLE_NOOP },
{ "gl_MultiTexCoord6", VERT_ATTRIB_TEX6, GL_FLOAT_VEC4, SWIZZLE_NOOP },
{ "gl_MultiTexCoord7", VERT_ATTRIB_TEX7, GL_FLOAT_VEC4, SWIZZLE_NOOP },
{ NULL, 0, SWIZZLE_NOOP }
{ NULL, 0, GL_NONE, SWIZZLE_NOOP }
};
/** Predefined fragment shader inputs */
@ -754,7 +754,7 @@ static const struct input_info fragInputs[] = {
{ "gl_FogFragCoord", FRAG_ATTRIB_FOGC, GL_FLOAT, SWIZZLE_XXXX },
{ "gl_FrontFacing", FRAG_ATTRIB_FACE, GL_FLOAT, SWIZZLE_XXXX },
{ "gl_PointCoord", FRAG_ATTRIB_PNTC, GL_FLOAT_VEC2, SWIZZLE_XYZW },
{ NULL, 0, SWIZZLE_NOOP }
{ NULL, 0, GL_NONE, SWIZZLE_NOOP }
};

View File

@ -2775,7 +2775,7 @@ _slang_gen_while(slang_assemble_ctx * A, slang_operation *oper)
* body code (child[1])
*/
slang_ir_node *loop, *breakIf, *body;
GLboolean isConst, constTrue;
GLboolean isConst, constTrue = GL_FALSE;
if (!A->EmitContReturn) {
/* We don't want to emit CONT instructions. If this while-loop has

View File

@ -328,23 +328,29 @@ get_arrays_bounds(const struct st_vertex_program *vp,
const GLubyte **low, const GLubyte **high)
{
const GLubyte *low_addr = NULL;
const GLubyte *high_addr = NULL;
GLuint attr;
GLint stride;
for (attr = 0; attr < vp->num_inputs; attr++) {
const GLuint mesaAttr = vp->index_to_input[attr];
const GLint stride = arrays[mesaAttr]->StrideB;
const GLubyte *start = arrays[mesaAttr]->Ptr;
stride = arrays[mesaAttr]->StrideB;
const unsigned sz = (arrays[mesaAttr]->Size *
_mesa_sizeof_type(arrays[mesaAttr]->Type));
const GLubyte *end = start + (max_index * stride) + sz;
if (attr == 0) {
low_addr = start;
high_addr = end;
}
else {
low_addr = MIN2(low_addr, start);
high_addr = MAX2(high_addr, end);
}
}
*low = low_addr;
*high = low_addr + (max_index + 1) * stride;
*high = high_addr;
}

View File

@ -89,6 +89,8 @@ fetch_texel_lod( GLcontext *ctx, const GLfloat texcoord[4], GLfloat lambda,
* Fetch a texel with the given partial derivatives to compute a level
* of detail in the mipmap.
* Called via machine->FetchTexelDeriv()
* \param lodBias the lod bias which may be specified by a TXB instruction,
* otherwise zero.
*/
static void
fetch_texel_deriv( GLcontext *ctx, const GLfloat texcoord[4],
@ -96,7 +98,8 @@ fetch_texel_deriv( GLcontext *ctx, const GLfloat texcoord[4],
GLfloat lodBias, GLuint unit, GLfloat color[4] )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
const struct gl_texture_object *texObj = ctx->Texture.Unit[unit]._Current;
const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
const struct gl_texture_object *texObj = texUnit->_Current;
if (texObj) {
const struct gl_texture_image *texImg =
@ -108,10 +111,12 @@ fetch_texel_deriv( GLcontext *ctx, const GLfloat texcoord[4],
lambda = _swrast_compute_lambda(texdx[0], texdy[0], /* ds/dx, ds/dy */
texdx[1], texdy[1], /* dt/dx, dt/dy */
texdx[3], texdy[2], /* dq/dx, dq/dy */
texdx[3], texdy[3], /* dq/dx, dq/dy */
texW, texH,
texcoord[0], texcoord[1], texcoord[3],
1.0F / texcoord[3]) + lodBias;
1.0F / texcoord[3]);
lambda += lodBias + texUnit->LodBias + texObj->LodBias;
lambda = CLAMP(lambda, texObj->MinLod, texObj->MaxLod);