Adds new QUNIFORMs to store the line widths.
v2: Also handle the aa_line_width intrinsic
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5624>
ntq_store_dest(c, &instr->dest, 0, vir_MOV(c, c->line_x));
break;
+ case nir_intrinsic_load_line_width:
+ ntq_store_dest(c, &instr->dest, 0,
+ vir_uniform(c, QUNIFORM_LINE_WIDTH, 0));
+ break;
+
+ case nir_intrinsic_load_aa_line_width:
+ ntq_store_dest(c, &instr->dest, 0,
+ vir_uniform(c, QUNIFORM_AA_LINE_WIDTH, 0));
+ break;
+
case nir_intrinsic_load_sample_mask_in:
ntq_store_dest(c, &instr->dest, 0, vir_MSF(c));
break;
QUNIFORM_ALPHA_REF,
+ QUNIFORM_LINE_WIDTH,
+
+ /* The line width sent to hardware. This includes the expanded width
+ * when anti-aliasing is enabled.
+ */
+ QUNIFORM_AA_LINE_WIDTH,
+
/* Number of workgroups passed to glDispatchCompute in the dimension
* selected by the data value.
*/
{
static const char *quniform_names[] = {
[QUNIFORM_ALPHA_REF] = "alpha_ref",
+ [QUNIFORM_LINE_WIDTH] = "line_width",
+ [QUNIFORM_AA_LINE_WIDTH] = "aa_line_width",
[QUNIFORM_VIEWPORT_X_SCALE] = "vp_x_scale",
[QUNIFORM_VIEWPORT_Y_SCALE] = "vp_y_scale",
[QUNIFORM_VIEWPORT_Z_OFFSET] = "vp_z_offset",
v3d->zsa->base.alpha.ref_value);
break;
+ case QUNIFORM_LINE_WIDTH:
+ case QUNIFORM_AA_LINE_WIDTH:
+ cl_aligned_f(&uniforms,
+ v3d->rasterizer->base.line_width);
+ break;
+
case QUNIFORM_UBO_ADDR: {
uint32_t unit = v3d_unit_data_get_unit(data);
/* Constant buffer 0 may be a system memory pointer,
dirty |= VC5_DIRTY_ZSA;
break;
+ case QUNIFORM_LINE_WIDTH:
+ case QUNIFORM_AA_LINE_WIDTH:
+ dirty |= VC5_DIRTY_RASTERIZER;
+ break;
+
case QUNIFORM_NUM_WORK_GROUPS:
case QUNIFORM_SHARED_OFFSET:
/* Compute always recalculates uniforms. */