Преглед на файлове

gallium/i965: remove brw_shader_info struct

The info it contained is now found in tgsi_shader_info.
Added a few assertions to catch potential misunderstandings about register
counts vs. highest register index used.
tags/mesa_20090313
Brian преди 17 години
родител
ревизия
dacf91fe58

+ 0
- 1
src/gallium/drivers/i965simple/Makefile Целия файл

@@ -30,7 +30,6 @@ C_SOURCES = \
brw_sf.c \
brw_sf_emit.c \
brw_sf_state.c \
brw_shader_info.c \
brw_state.c \
brw_state_batch.c \
brw_state_cache.c \

+ 0
- 1
src/gallium/drivers/i965simple/SConscript Целия файл

@@ -29,7 +29,6 @@ i965simple = env.ConvenienceLibrary(
'brw_sf.c',
'brw_sf_emit.c',
'brw_sf_state.c',
'brw_shader_info.c',
'brw_state.c',
'brw_state_batch.c',
'brw_state_cache.c',

+ 1
- 12
src/gallium/drivers/i965simple/brw_context.h Целия файл

@@ -197,33 +197,22 @@ struct brw_state_flags {
};


struct brw_shader_info {
int nr_regs[8]; /* TGSI_FILE_* */
};


struct brw_vertex_program {
struct pipe_shader_state program;
struct tgsi_shader_info info;
struct brw_shader_info info2; /* XXX get rid of this */
int id;
};



struct brw_fragment_program {
struct pipe_shader_state program;
struct tgsi_shader_info info;
struct brw_shader_info info2; /* XXX get rid of this */
boolean UsesDepth;
boolean UsesDepth; /* XXX add this to tgsi_shader_info? */
int id;
};




struct pipe_setup_linkage {
struct {
unsigned vp_output:5;

+ 1
- 1
src/gallium/drivers/i965simple/brw_sf.c Целия файл

@@ -133,7 +133,7 @@ static void upload_sf_prog( struct brw_context *brw )
key.vp_output_count = brw->vs.prog_data->outputs_written;

/* BRW_NEW_FS */
key.fp_input_count = brw->attribs.FragmentProgram->info2.nr_regs[TGSI_FILE_INPUT];
key.fp_input_count = brw->attribs.FragmentProgram->info.file_max[TGSI_FILE_INPUT] + 1;


/* BRW_NEW_REDUCED_PRIMITIVE */

+ 1
- 1
src/gallium/drivers/i965simple/brw_shader_info.c Целия файл

@@ -7,7 +7,7 @@


/**
* XXX try to get rid of this. See tgsi_scan_shader() and tgsi_shader_info.
* XXX this obsolete new and no longer compiled.
*/
void brw_shader_info(const struct tgsi_token *tokens,
struct brw_shader_info *info )

+ 4
- 1
src/gallium/drivers/i965simple/brw_state.c Целия файл

@@ -177,8 +177,10 @@ static void * brw_create_fs_state(struct pipe_context *pipe,

tgsi_scan_shader(shader->tokens, &brw_fp->info);

#if 0
brw_shader_info(shader->tokens,
&brw_fp->info2);
#endif

tgsi_dump(shader->tokens, 0);

@@ -216,9 +218,10 @@ static void *brw_create_vs_state(struct pipe_context *pipe,

tgsi_scan_shader(shader->tokens, &brw_vp->info);

#if 0
brw_shader_info(shader->tokens,
&brw_vp->info2);
#endif
tgsi_dump(shader->tokens, 0);

return (void *)brw_vp;

+ 0
- 7
src/gallium/drivers/i965simple/brw_state.h Целия файл

@@ -148,11 +148,4 @@ void brw_invalidate_pools( struct brw_context *brw );
void brw_clear_batch_cache_flush( struct brw_context *brw );


/* brw_shader_info.c
*/

void brw_shader_info(const struct tgsi_token *tokens,
struct brw_shader_info *info );


#endif

+ 14
- 4
src/gallium/drivers/i965simple/brw_wm_decl.c Целия файл

@@ -259,9 +259,12 @@ static void prealloc_reg(struct brw_wm_compile *c)
/* Then a copy of our part of the CURBE entry:
*/
{
int nr_constants = c->fp->info2.nr_regs[TGSI_FILE_CONSTANT];
int nr_constants = c->fp->info.file_max[TGSI_FILE_CONSTANT] + 1;
int index = 0;

/* XXX number of constants, or highest numbered constant? */
assert(nr_constants == c->fp->info.file_count[TGSI_FILE_CONSTANT]);

c->prog_data.max_const = 4*nr_constants;
for (i = 0; i < nr_constants; i++) {
for (j = 0; j < 4; j++, index++)
@@ -282,7 +285,8 @@ static void prealloc_reg(struct brw_wm_compile *c)
/* Next we receive the plane coefficients for parameter
* interpolation:
*/
for (i = 0; i < c->fp->info2.nr_regs[TGSI_FILE_INPUT]; i++) {
assert(c->fp->info.file_max[TGSI_FILE_INPUT] == c->fp->info.num_inputs);
for (i = 0; i < c->fp->info.file_max[TGSI_FILE_INPUT] + 1; i++) {
c->payload_coef[i] = brw_vec8_grf(c->reg_index, 0);
c->reg_index += 2;
}
@@ -302,11 +306,17 @@ static void prealloc_reg(struct brw_wm_compile *c)
/* Now allocate room for the interpolated inputs and staging
* registers for the outputs:
*/
for (i = 0; i < c->fp->info2.nr_regs[TGSI_FILE_INPUT]; i++)
/* XXX do we want to loop over the _number_ of inputs/outputs or loop
* to the highest input/output index that's used?
* Probably the same, actually.
*/
assert(c->fp->info.file_max[TGSI_FILE_INPUT] + 1 == c->fp->info.num_inputs);
assert(c->fp->info.file_max[TGSI_FILE_OUTPUT] + 1 == c->fp->info.num_outputs);
for (i = 0; i < c->fp->info.file_max[TGSI_FILE_INPUT] + 1; i++)
for (j = 0; j < 4; j++)
c->wm_regs[TGSI_FILE_INPUT][i][j] = brw_vec8_grf( c->reg_index++, 0 );

for (i = 0; i < c->fp->info2.nr_regs[TGSI_FILE_OUTPUT]; i++)
for (i = 0; i < c->fp->info.file_max[TGSI_FILE_OUTPUT] + 1; i++)
for (j = 0; j < 4; j++)
c->wm_regs[TGSI_FILE_OUTPUT][i][j] = brw_vec8_grf( c->reg_index++, 0 );


Loading…
Отказ
Запис