<packet code="100" name="Non-perspective Flags" min_ver="41">
<field name="Non-perspective Flags for varyings V0*24" size="24" start="8" type="uint"/>
<field name="Action for Non-perspective Flags of higher numbered varyings" size="2" start="6" type="Varying Flags Action"/>
- <field name="Action for Non-perspectivey Flags of lower numbered varyings" size="2" start="4" type="Varying Flags Action"/>
+ <field name="Action for Non-perspective Flags of lower numbered varyings" size="2" start="4" type="Varying Flags Action"/>
<field name="Varying offset V0" size="4" start="0" type="uint"/>
</packet>
return vir_FADD(c, vir_FMUL(c, vary, c->payload_w), r5);
}
case INTERP_MODE_NOPERSPECTIVE:
- /* C appears after the mov from the varying.
- XXX: improve ldvary setup.
- */
+ BITSET_SET(c->noperspective_flags, i);
return vir_FADD(c, vir_MOV(c, vary), r5);
case INTERP_MODE_FLAT:
BITSET_SET(c->flat_shade_flags, i);
*/
uint32_t flat_shade_flags[BITSET_WORDS(V3D_MAX_FS_INPUTS)];
+ uint32_t noperspective_flags[BITSET_WORDS(V3D_MAX_FS_INPUTS)];
+
uint32_t centroid_flags[BITSET_WORDS(V3D_MAX_FS_INPUTS)];
bool uses_center_w;
*/
uint32_t flat_shade_flags[((V3D_MAX_FS_INPUTS - 1) / 24) + 1];
+ uint32_t noperspective_flags[((V3D_MAX_FS_INPUTS - 1) / 24) + 1];
+
uint32_t centroid_flags[((V3D_MAX_FS_INPUTS - 1) / 24) + 1];
bool writes_z;
if (BITSET_TEST(c->flat_shade_flags, i))
prog_data->flat_shade_flags[i / 24] |= 1 << (i % 24);
+ if (BITSET_TEST(c->noperspective_flags, i))
+ prog_data->noperspective_flags[i / 24] |= 1 << (i % 24);
+
if (BITSET_TEST(c->centroid_flags, i))
prog_data->centroid_flags[i / 24] |= 1 << (i % 24);
}
#define VC5_DIRTY_STREAMOUT (1 << 27)
#define VC5_DIRTY_OQ (1 << 28)
#define VC5_DIRTY_CENTROID_FLAGS (1 << 29)
+#define VC5_DIRTY_NOPERSPECTIVE_FLAGS (1 << 30)
#define VC5_MAX_FS_INPUTS 64
v3d->dirty |= VC5_DIRTY_FLAT_SHADE_FLAGS;
}
+ if (v3d->prog.fs->prog_data.fs->noperspective_flags !=
+ old_fs->prog_data.fs->noperspective_flags) {
+ v3d->dirty |= VC5_DIRTY_NOPERSPECTIVE_FLAGS;
+ }
+
if (v3d->prog.fs->prog_data.fs->centroid_flags !=
old_fs->prog_data.fs->centroid_flags) {
v3d->dirty |= VC5_DIRTY_CENTROID_FLAGS;
}
#if V3D_VERSION >= 40
+static void
+emit_noperspective_flags(struct v3d_job *job,
+ int varying_offset,
+ uint32_t varyings,
+ enum V3DX(Varying_Flags_Action) lower,
+ enum V3DX(Varying_Flags_Action) higher)
+{
+ cl_emit(&job->bcl, NON_PERSPECTIVE_FLAGS, flags) {
+ flags.varying_offset_v0 = varying_offset;
+ flags.non_perspective_flags_for_varyings_v024 = varyings;
+ flags.action_for_non_perspective_flags_of_lower_numbered_varyings =
+ lower;
+ flags.action_for_non_perspective_flags_of_higher_numbered_varyings =
+ higher;
+ }
+}
+
static void
emit_centroid_flags(struct v3d_job *job,
int varying_offset,
}
#if V3D_VERSION >= 40
+ if (v3d->dirty & VC5_DIRTY_NOPERSPECTIVE_FLAGS) {
+ if (!emit_varying_flags(job,
+ v3d->prog.fs->prog_data.fs->noperspective_flags,
+ emit_noperspective_flags)) {
+ cl_emit(&job->bcl, ZERO_ALL_NON_PERSPECTIVE_FLAGS, flags);
+ }
+ }
+
if (v3d->dirty & VC5_DIRTY_CENTROID_FLAGS) {
if (!emit_varying_flags(job,
v3d->prog.fs->prog_data.fs->centroid_flags,