i965/vec4: Use NIR remapping for VS attributes
The NIR pass already handles remapping system values to attributes for us so we delete the system value code as part of the conversion. We also change nir_lower_vs_inputs to take an explicit inputs_read bitmask and pass in the inputs_read from prog_data instead from pulling it out of NIR. This is because the version in prog_data may get EDGEFLAG added to it on some old platforms. Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
@@ -1315,7 +1315,7 @@ vec4_visitor::emit_urb_slot(dst_reg reg, int varying)
|
||||
if (output_reg[VARYING_SLOT_POS][0].file != BAD_FILE)
|
||||
emit(MOV(reg, src_reg(output_reg[VARYING_SLOT_POS][0])));
|
||||
break;
|
||||
case VARYING_SLOT_EDGE:
|
||||
case VARYING_SLOT_EDGE: {
|
||||
/* This is present when doing unfilled polygons. We're supposed to copy
|
||||
* the edge flag from the user-provided vertex array
|
||||
* (glEdgeFlagPointer), or otherwise we'll copy from the current value
|
||||
@@ -1323,9 +1323,12 @@ vec4_visitor::emit_urb_slot(dst_reg reg, int varying)
|
||||
* determine which edges should be drawn as wireframe.
|
||||
*/
|
||||
current_annotation = "edge flag";
|
||||
emit(MOV(reg, src_reg(dst_reg(ATTR, VERT_ATTRIB_EDGEFLAG,
|
||||
int edge_attr = _mesa_bitcount_64(nir->info.inputs_read &
|
||||
BITFIELD64_MASK(VERT_ATTRIB_EDGEFLAG));
|
||||
emit(MOV(reg, src_reg(dst_reg(ATTR, edge_attr,
|
||||
glsl_type::float_type, WRITEMASK_XYZW))));
|
||||
break;
|
||||
}
|
||||
case BRW_VARYING_SLOT_PAD:
|
||||
/* No need to write to this slot */
|
||||
break;
|
||||
|
Reference in New Issue
Block a user