i965g: get trivial/tri working again after edgeflag changes

This commit is contained in:
Keith Whitwell 2009-12-24 12:52:43 +00:00
parent 6c30e17f9e
commit 5f6dcf65e7
4 changed files with 33 additions and 34 deletions

View File

@ -83,19 +83,19 @@ compile_clip_prog( struct brw_context *brw,
c.offset_hpos = delta + c.key.output_hpos * ATTR_SIZE;
if (c.key.output_color0)
if (c.key.output_color0 != BRW_OUTPUT_NOT_PRESENT)
c.offset_color0 = delta + c.key.output_color0 * ATTR_SIZE;
if (c.key.output_color1)
if (c.key.output_color1 != BRW_OUTPUT_NOT_PRESENT)
c.offset_color1 = delta + c.key.output_color1 * ATTR_SIZE;
if (c.key.output_bfc0)
if (c.key.output_bfc0 != BRW_OUTPUT_NOT_PRESENT)
c.offset_bfc0 = delta + c.key.output_bfc0 * ATTR_SIZE;
if (c.key.output_bfc1)
if (c.key.output_bfc1 != BRW_OUTPUT_NOT_PRESENT)
c.offset_bfc1 = delta + c.key.output_bfc1 * ATTR_SIZE;
if (c.key.output_edgeflag)
if (c.key.output_edgeflag != BRW_OUTPUT_NOT_PRESENT)
c.offset_edgeflag = delta + c.key.output_edgeflag * ATTR_SIZE;
if (BRW_IS_IGDNG(brw))
@ -182,7 +182,6 @@ upload_clip_prog(struct brw_context *brw)
*/
/* CACHE_NEW_VS_PROG */
key.nr_attrs = brw->vs.prog_data->nr_outputs;
key.output_edgeflag = brw->vs.prog_data->output_edgeflag;
/* PIPE_NEW_VS */
key.output_hpos = vs->output_hpos;
@ -190,6 +189,7 @@ upload_clip_prog(struct brw_context *brw)
key.output_color1 = vs->output_color1;
key.output_bfc0 = vs->output_bfc0;
key.output_bfc1 = vs->output_bfc1;
key.output_edgeflag = vs->output_edgeflag;
/* PIPE_NEW_CLIP */
key.nr_userclip = brw->curr.ucp.nr;

View File

@ -120,6 +120,13 @@
#define BRW_MAX_CURBE (32*16)
/* Need a value to say a particular vertex shader output isn't
* present. Limits us to 63 outputs currently.
*/
#define BRW_OUTPUT_NOT_PRESENT ((1<<6)-1)
struct brw_context;
struct brw_depth_stencil_state {
@ -335,8 +342,6 @@ struct brw_vs_prog_data {
GLuint nr_params; /**< number of TGSI_FILE_CONSTANT's */
GLuint output_edgeflag;
GLboolean writes_psiz;
/* Used for calculating urb partitions:

View File

@ -197,6 +197,13 @@ static void *brw_create_vs_state( struct pipe_context *pipe,
vs->id = brw->program_id++;
vs->has_flow_control = has_flow_control(&vs->info);
vs->output_hpos = BRW_OUTPUT_NOT_PRESENT;
vs->output_color0 = BRW_OUTPUT_NOT_PRESENT;
vs->output_color1 = BRW_OUTPUT_NOT_PRESENT;
vs->output_bfc0 = BRW_OUTPUT_NOT_PRESENT;
vs->output_bfc1 = BRW_OUTPUT_NOT_PRESENT;
vs->output_edgeflag = BRW_OUTPUT_NOT_PRESENT;
for (i = 0; i < vs->info.num_outputs; i++) {
int index = vs->info.output_semantic_index[i];
switch (vs->info.output_semantic_name[i]) {

View File

@ -79,18 +79,12 @@ static void release_tmps( struct brw_vs_compile *c )
static boolean is_position_output( struct brw_vs_compile *c,
unsigned vs_output )
{
struct brw_vertex_shader *vs = c->vp;
if (vs_output == c->prog_data.output_edgeflag) {
return FALSE;
}
else {
unsigned semantic = vs->info.output_semantic_name[vs_output];
unsigned index = vs->info.output_semantic_index[vs_output];
const struct brw_vertex_shader *vs = c->vp;
unsigned semantic = vs->info.output_semantic_name[vs_output];
unsigned index = vs->info.output_semantic_index[vs_output];
return (semantic == TGSI_SEMANTIC_POSITION &&
index == 0);
}
return (semantic == TGSI_SEMANTIC_POSITION &&
index == 0);
}
@ -98,23 +92,16 @@ static boolean find_output_slot( struct brw_vs_compile *c,
unsigned vs_output,
unsigned *fs_input_slot )
{
struct brw_vertex_shader *vs = c->vp;
const struct brw_vertex_shader *vs = c->vp;
unsigned semantic = vs->info.output_semantic_name[vs_output];
unsigned index = vs->info.output_semantic_index[vs_output];
unsigned i;
if (vs_output == c->prog_data.output_edgeflag) {
*fs_input_slot = c->key.fs_signature.nr_inputs;
return TRUE;
}
else {
unsigned semantic = vs->info.output_semantic_name[vs_output];
unsigned index = vs->info.output_semantic_index[vs_output];
unsigned i;
for (i = 0; i < c->key.fs_signature.nr_inputs; i++) {
if (c->key.fs_signature.input[i].semantic == semantic &&
for (i = 0; i < c->key.fs_signature.nr_inputs; i++) {
if (c->key.fs_signature.input[i].semantic == semantic &&
c->key.fs_signature.input[i].semantic_index == index) {
*fs_input_slot = i;
return TRUE;
}
*fs_input_slot = i;
return TRUE;
}
}