110
110
struct brw_compile *p = &c->func;
111
111
struct brw_reg tmp = get_tmp(c);
112
GLuint hpos_offset = brw_vert_result_to_offset(&c->vue_map,
114
GLuint ndc_offset = brw_vert_result_to_offset(&c->vue_map,
115
BRW_VERT_RESULT_NDC);
113
117
/* Fixup position. Extract from the original vertex and re-project
114
118
* to screen space:
116
brw_MOV(p, tmp, deref_4f(vert_addr, c->offset[VERT_RESULT_HPOS]));
120
brw_MOV(p, tmp, deref_4f(vert_addr, hpos_offset));
117
121
brw_clip_project_position(c, tmp);
118
brw_MOV(p, deref_4f(vert_addr, c->header_position_offset), tmp);
122
brw_MOV(p, deref_4f(vert_addr, ndc_offset), tmp);
120
124
release_tmp(c, tmp);
131
135
struct brw_indirect v0_ptr, /* from */
132
136
struct brw_indirect v1_ptr, /* to */
133
137
struct brw_reg t0,
134
GLboolean force_edgeflag)
136
140
struct brw_compile *p = &c->func;
137
141
struct brw_reg tmp = get_tmp(c);
140
144
/* Just copy the vertex header:
148
152
/* Iterate over each attribute (could be done in pairs?)
150
for (i = 0; i < c->nr_attrs; i++) {
151
GLuint delta = c->offset[c->idx_to_attr[i]];
154
for (slot = 0; slot < c->vue_map.num_slots; slot++) {
155
int vert_result = c->vue_map.slot_to_vert_result[slot];
156
GLuint delta = brw_vue_slot_to_offset(slot);
153
if (c->idx_to_attr[i] == VERT_RESULT_EDGE) {
158
if (vert_result == VERT_RESULT_EDGE) {
154
159
if (force_edgeflag)
155
160
brw_MOV(p, deref_4f(dest_ptr, delta), brw_imm_f(1));
157
162
brw_MOV(p, deref_4f(dest_ptr, delta), deref_4f(v0_ptr, delta));
163
} else if (vert_result == VERT_RESULT_PSIZ ||
164
vert_result == VERT_RESULT_CLIP_DIST0 ||
165
vert_result == VERT_RESULT_CLIP_DIST1) {
166
/* PSIZ doesn't need interpolation because it isn't used by the
167
* fragment shader. CLIP_DIST0 and CLIP_DIST1 don't need
168
* intepolation because on pre-GEN6, these are just placeholder VUE
169
* slots that don't perform any action.
171
} else if (vert_result < VERT_RESULT_MAX) {
172
/* This is a true vertex result (and not a special value for the VUE
173
* header), so interpolate:
162
175
* New = attr0 + t*attr1 - t*attr0
287
300
struct brw_compile *p = &c->func;
289
if (c->offset[VERT_RESULT_COL0])
291
byte_offset(c->reg.vertex[to], c->offset[VERT_RESULT_COL0]),
292
byte_offset(c->reg.vertex[from], c->offset[VERT_RESULT_COL0]));
294
if (c->offset[VERT_RESULT_COL1])
296
byte_offset(c->reg.vertex[to], c->offset[VERT_RESULT_COL1]),
297
byte_offset(c->reg.vertex[from], c->offset[VERT_RESULT_COL1]));
299
if (c->offset[VERT_RESULT_BFC0])
301
byte_offset(c->reg.vertex[to], c->offset[VERT_RESULT_BFC0]),
302
byte_offset(c->reg.vertex[from], c->offset[VERT_RESULT_BFC0]));
304
if (c->offset[VERT_RESULT_BFC1])
306
byte_offset(c->reg.vertex[to], c->offset[VERT_RESULT_BFC1]),
307
byte_offset(c->reg.vertex[from], c->offset[VERT_RESULT_BFC1]));
302
if (brw_clip_have_vert_result(c, VERT_RESULT_COL0))
304
byte_offset(c->reg.vertex[to],
305
brw_vert_result_to_offset(&c->vue_map,
307
byte_offset(c->reg.vertex[from],
308
brw_vert_result_to_offset(&c->vue_map,
311
if (brw_clip_have_vert_result(c, VERT_RESULT_COL1))
313
byte_offset(c->reg.vertex[to],
314
brw_vert_result_to_offset(&c->vue_map,
316
byte_offset(c->reg.vertex[from],
317
brw_vert_result_to_offset(&c->vue_map,
320
if (brw_clip_have_vert_result(c, VERT_RESULT_BFC0))
322
byte_offset(c->reg.vertex[to],
323
brw_vert_result_to_offset(&c->vue_map,
325
byte_offset(c->reg.vertex[from],
326
brw_vert_result_to_offset(&c->vue_map,
329
if (brw_clip_have_vert_result(c, VERT_RESULT_BFC1))
331
byte_offset(c->reg.vertex[to],
332
brw_vert_result_to_offset(&c->vue_map,
334
byte_offset(c->reg.vertex[from],
335
brw_vert_result_to_offset(&c->vue_map,