Browse Source

Merge branch 'mesa_7_5_branch'

tags/mesa_7_6_rc1
Brian Paul 16 years ago
parent
commit
9615daa932

+ 1
- 1
configure.ac View File

@@ -656,7 +656,7 @@ dnl Which drivers to build - default is chosen by platform
AC_ARG_WITH([dri-drivers],
[AS_HELP_STRING([--with-dri-drivers@<:@=DIRS...@:>@],
[comma delimited DRI drivers list, e.g.
"swrast,i965,radeon,nouveau" @<:@default=auto@:>@])],
"swrast,i965,radeon" @<:@default=auto@:>@])],
[with_dri_drivers="$withval"],
[with_dri_drivers=yes])
if test "x$with_dri_drivers" = x; then

+ 1
- 0
progs/glsl/reflect.vert View File

@@ -11,6 +11,7 @@ void main()
float two_n_dot_u = 2.0 * dot(n, u);
vec4 f;
f.xyz = u - n * two_n_dot_u;
f.w = 1.0;

// outputs
normal = n;

+ 30
- 4
src/gallium/auxiliary/tgsi/tgsi_build.c View File

@@ -139,8 +139,8 @@ tgsi_build_declaration(
{
struct tgsi_declaration declaration;

assert( file <= TGSI_FILE_IMMEDIATE );
assert( interpolate <= TGSI_INTERPOLATE_PERSPECTIVE );
assert( file < TGSI_FILE_COUNT );
assert( interpolate < TGSI_INTERPOLATE_COUNT );

declaration = tgsi_default_declaration();
declaration.File = file;
@@ -584,6 +584,7 @@ tgsi_build_full_instruction(
*dst_register = tgsi_build_dst_register(
reg->DstRegister.File,
reg->DstRegister.WriteMask,
reg->DstRegister.Indirect,
reg->DstRegister.Index,
instruction,
header );
@@ -631,6 +632,28 @@ tgsi_build_full_instruction(
header );
prev_token = (struct tgsi_token *) dst_register_ext_modulate;
}

if( reg->DstRegister.Indirect ) {
struct tgsi_src_register *ind;

if( maxsize <= size )
return 0;
ind = (struct tgsi_src_register *) &tokens[size];
size++;

*ind = tgsi_build_src_register(
reg->DstRegisterInd.File,
reg->DstRegisterInd.SwizzleX,
reg->DstRegisterInd.SwizzleY,
reg->DstRegisterInd.SwizzleZ,
reg->DstRegisterInd.SwizzleW,
reg->DstRegisterInd.Negate,
reg->DstRegisterInd.Indirect,
reg->DstRegisterInd.Dimension,
reg->DstRegisterInd.Index,
instruction,
header );
}
}

for( i = 0; i < full_inst->Instruction.NumSrcRegs; i++ ) {
@@ -973,7 +996,7 @@ tgsi_build_src_register(
{
struct tgsi_src_register src_register;

assert( file <= TGSI_FILE_IMMEDIATE );
assert( file < TGSI_FILE_COUNT );
assert( swizzle_x <= TGSI_SWIZZLE_W );
assert( swizzle_y <= TGSI_SWIZZLE_W );
assert( swizzle_z <= TGSI_SWIZZLE_W );
@@ -1194,13 +1217,14 @@ struct tgsi_dst_register
tgsi_build_dst_register(
unsigned file,
unsigned mask,
unsigned indirect,
int index,
struct tgsi_instruction *instruction,
struct tgsi_header *header )
{
struct tgsi_dst_register dst_register;

assert( file <= TGSI_FILE_IMMEDIATE );
assert( file < TGSI_FILE_COUNT );
assert( mask <= TGSI_WRITEMASK_XYZW );
assert( index >= -32768 && index <= 32767 );

@@ -1208,6 +1232,7 @@ tgsi_build_dst_register(
dst_register.File = file;
dst_register.WriteMask = mask;
dst_register.Index = index;
dst_register.Indirect = indirect;

instruction_grow( instruction, header );

@@ -1220,6 +1245,7 @@ tgsi_default_full_dst_register( void )
struct tgsi_full_dst_register full_dst_register;

full_dst_register.DstRegister = tgsi_default_dst_register();
full_dst_register.DstRegisterInd = tgsi_default_src_register();
full_dst_register.DstRegisterExtConcode =
tgsi_default_dst_register_ext_concode();
full_dst_register.DstRegisterExtModulate =

+ 1
- 0
src/gallium/auxiliary/tgsi/tgsi_build.h View File

@@ -289,6 +289,7 @@ struct tgsi_dst_register
tgsi_build_dst_register(
unsigned file,
unsigned mask,
unsigned indirect,
int index,
struct tgsi_instruction *instruction,
struct tgsi_header *header );

+ 22
- 6
src/gallium/auxiliary/tgsi/tgsi_dump.c View File

@@ -28,6 +28,7 @@
#include "util/u_debug.h"
#include "util/u_string.h"
#include "util/u_math.h"
#include "util/u_memory.h"
#include "tgsi_dump.h"
#include "tgsi_info.h"
#include "tgsi_iterate.h"
@@ -108,7 +109,8 @@ static const char *semantic_names[] =
"FOG",
"PSIZE",
"GENERIC",
"NORMAL"
"NORMAL",
"FACE"
};

static const char *immediate_type_names[] =
@@ -224,6 +226,9 @@ iter_declaration(
{
struct dump_ctx *ctx = (struct dump_ctx *)iter;

assert(Elements(semantic_names) == TGSI_SEMANTIC_COUNT);
assert(Elements(interpolate_names) == TGSI_INTERPOLATE_COUNT);

TXT( "DCL " );

_dump_register(
@@ -355,11 +360,22 @@ iter_instruction(
CHR( ',' );
CHR( ' ' );

_dump_register(
ctx,
dst->DstRegister.File,
dst->DstRegister.Index,
dst->DstRegister.Index );
if (dst->DstRegister.Indirect) {
_dump_register_ind(
ctx,
dst->DstRegister.File,
dst->DstRegister.Index,
dst->DstRegisterInd.File,
dst->DstRegisterInd.Index,
dst->DstRegisterInd.SwizzleX );
}
else {
_dump_register(
ctx,
dst->DstRegister.File,
dst->DstRegister.Index,
dst->DstRegister.Index );
}
ENM( dst->DstRegisterExtModulate.Modulate, modulate_names );
_dump_writemask( ctx, dst->DstRegister.WriteMask );


+ 46
- 5
src/gallium/auxiliary/tgsi/tgsi_exec.c View File

@@ -1395,28 +1395,69 @@ store_dest(
union tgsi_exec_channel null;
union tgsi_exec_channel *dst;
uint execmask = mach->ExecMask;
int offset = 0; /* indirection offset */
int index;

#ifdef DEBUG
check_inf_or_nan(chan);
#endif

/* There is an extra source register that indirectly subscripts
* a register file. The direct index now becomes an offset
* that is being added to the indirect register.
*
* file[ind[2].x+1],
* where:
* ind = DstRegisterInd.File
* [2] = DstRegisterInd.Index
* .x = DstRegisterInd.SwizzleX
*/
if (reg->DstRegister.Indirect) {
union tgsi_exec_channel index;
union tgsi_exec_channel indir_index;
uint swizzle;

/* which address register (always zero for now) */
index.i[0] =
index.i[1] =
index.i[2] =
index.i[3] = reg->DstRegisterInd.Index;

/* get current value of address register[swizzle] */
swizzle = tgsi_util_get_src_register_swizzle( &reg->DstRegisterInd, CHAN_X );

/* fetch values from the address/indirection register */
fetch_src_file_channel(
mach,
reg->DstRegisterInd.File,
swizzle,
&index,
&indir_index );

/* save indirection offset */
offset = (int) indir_index.f[0];
}

switch (reg->DstRegister.File) {
case TGSI_FILE_NULL:
dst = &null;
break;

case TGSI_FILE_OUTPUT:
dst = &mach->Outputs[mach->Temps[TEMP_OUTPUT_I].xyzw[TEMP_OUTPUT_C].u[0]
+ reg->DstRegister.Index].xyzw[chan_index];
index = mach->Temps[TEMP_OUTPUT_I].xyzw[TEMP_OUTPUT_C].u[0]
+ reg->DstRegister.Index;
dst = &mach->Outputs[offset + index].xyzw[chan_index];
break;

case TGSI_FILE_TEMPORARY:
assert( reg->DstRegister.Index < TGSI_EXEC_NUM_TEMPS );
dst = &mach->Temps[reg->DstRegister.Index].xyzw[chan_index];
index = reg->DstRegister.Index;
assert( index < TGSI_EXEC_NUM_TEMPS );
dst = &mach->Temps[offset + index].xyzw[chan_index];
break;

case TGSI_FILE_ADDRESS:
dst = &mach->Addrs[reg->DstRegister.Index].xyzw[chan_index];
index = reg->DstRegister.Index;
dst = &mach->Addrs[index].xyzw[chan_index];
break;

default:

+ 11
- 1
src/gallium/auxiliary/tgsi/tgsi_parse.c View File

@@ -219,7 +219,6 @@ tgsi_parse_token(
/*
* No support for indirect or multi-dimensional addressing.
*/
assert( !inst->FullDstRegisters[i].DstRegister.Indirect );
assert( !inst->FullDstRegisters[i].DstRegister.Dimension );

extended = inst->FullDstRegisters[i].DstRegister.Extended;
@@ -246,6 +245,17 @@ tgsi_parse_token(

extended = token.Extended;
}

if( inst->FullDstRegisters[i].DstRegister.Indirect ) {
next_token( ctx, &inst->FullDstRegisters[i].DstRegisterInd );

/*
* No support for indirect or multi-dimensional addressing.
*/
assert( !inst->FullDstRegisters[i].DstRegisterInd.Indirect );
assert( !inst->FullDstRegisters[i].DstRegisterInd.Dimension );
assert( !inst->FullDstRegisters[i].DstRegisterInd.Extended );
}
}

assert( inst->Instruction.NumSrcRegs <= TGSI_FULL_MAX_SRC_REGISTERS );

+ 1
- 0
src/gallium/auxiliary/tgsi/tgsi_parse.h View File

@@ -48,6 +48,7 @@ struct tgsi_full_header
struct tgsi_full_dst_register
{
struct tgsi_dst_register DstRegister;
struct tgsi_src_register DstRegisterInd;
struct tgsi_dst_register_ext_concode DstRegisterExtConcode;
struct tgsi_dst_register_ext_modulate DstRegisterExtModulate;
};

+ 6
- 1
src/gallium/auxiliary/tgsi/tgsi_text.c View File

@@ -26,6 +26,7 @@
**************************************************************************/

#include "util/u_debug.h"
#include "util/u_memory.h"
#include "tgsi_text.h"
#include "tgsi_build.h"
#include "tgsi_info.h"
@@ -927,7 +928,8 @@ static const char *semantic_names[TGSI_SEMANTIC_COUNT] =
"FOG",
"PSIZE",
"GENERIC",
"NORMAL"
"NORMAL",
"FACE"
};

static const char *interpolate_names[TGSI_INTERPOLATE_COUNT] =
@@ -947,6 +949,9 @@ static boolean parse_declaration( struct translate_ctx *ctx )
const char *cur;
uint advance;

assert(Elements(semantic_names) == TGSI_SEMANTIC_COUNT);
assert(Elements(interpolate_names) == TGSI_INTERPOLATE_COUNT);

if (!eat_white( &ctx->cur )) {
report_error( ctx, "Syntax error" );
return FALSE;

+ 1
- 1
src/mesa/drivers/dri/intel/intel_context.c View File

@@ -67,7 +67,7 @@ int INTEL_DEBUG = (0);
#endif


#define DRIVER_DATE "20090114"
#define DRIVER_DATE "20090712 2009Q2 RC3"
#define DRIVER_DATE_GEM "GEM " DRIVER_DATE



+ 5
- 0
src/mesa/drivers/dri/r128/r128_state.c View File

@@ -771,6 +771,11 @@ static void r128DDLightModelfv( GLcontext *ctx, GLenum pname,
FLUSH_BATCH( rmesa );
updateSpecularLighting(ctx);
}

if ( pname == GL_LIGHT_MODEL_TWO_SIDE ) {
FLUSH_BATCH( rmesa );
r128ChooseRenderState( ctx );
}
}

static void r128DDShadeModel( GLcontext *ctx, GLenum mode )

+ 1
- 1
src/mesa/drivers/dri/r128/r128_tris.c View File

@@ -426,7 +426,7 @@ r128_fallback_point( r128ContextPtr rmesa,
#define ANY_RASTER_FLAGS (DD_TRI_LIGHT_TWOSIDE|DD_TRI_OFFSET|DD_TRI_UNFILLED)
#define _R128_NEW_RENDER_STATE (ANY_FALLBACK_FLAGS | ANY_RASTER_FLAGS)

static void r128ChooseRenderState(GLcontext *ctx)
void r128ChooseRenderState(GLcontext *ctx)
{
r128ContextPtr rmesa = R128_CONTEXT(ctx);
GLuint flags = ctx->_TriangleCaps;

+ 1
- 1
src/mesa/drivers/dri/r128/r128_tris.h View File

@@ -38,7 +38,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "main/mtypes.h"

extern void r128InitTriFuncs( GLcontext *ctx );
extern void r128ChooseRenderState( GLcontext *ctx );

extern void r128Fallback( GLcontext *ctx, GLuint bit, GLboolean mode );
#define FALLBACK( rmesa, bit, mode ) r128Fallback( rmesa->glCtx, bit, mode )

+ 1
- 1
src/mesa/state_tracker/st_atom_shader.c View File

@@ -139,7 +139,7 @@ find_translated_vp(struct st_context *st,
if (fragInputsRead & (1 << inAttr)) {
stfp->input_to_slot[inAttr] = numIn;
numIn++;
if ((fragInputsRead & FRAG_BIT_FOGC)) {
if (((1 << inAttr) & FRAG_BIT_FOGC)) {
/* leave placeholders for the
* extra registers we extract from fog */
if (stfp->Base.UsesFrontFacing) {

+ 5
- 0
src/mesa/state_tracker/st_mesa_to_tgsi.c View File

@@ -268,6 +268,11 @@ compile_instruction(
NULL,
GL_FALSE );
fulldst->DstRegister.WriteMask = convert_writemask( inst->DstReg.WriteMask );
if (inst->DstReg.RelAddr) {
fulldst->DstRegister.Indirect = 1;
fulldst->DstRegisterInd.File = TGSI_FILE_ADDRESS;
fulldst->DstRegisterInd.Index = 0;
}

for (i = 0; i < fullinst->Instruction.NumSrcRegs; i++) {
GLuint j;

+ 5
- 0
src/mesa/vbo/vbo_save_api.c View File

@@ -1144,6 +1144,11 @@ static void vbo_destroy_vertex_list( GLcontext *ctx, void *data )

if ( --node->prim_store->refcount == 0 )
FREE( node->prim_store );

if (node->current_data) {
FREE(node->current_data);
node->current_data = NULL;
}
}



Loading…
Cancel
Save