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))
*/
/* 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;
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;
#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 {
GLuint nr_params; /**< number of TGSI_FILE_CONSTANT's */
- GLuint output_edgeflag;
-
GLboolean writes_psiz;
/* Used for calculating urb partitions:
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]) {
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);
}
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;
}
}