Commit b1399e7b authored by Erik Faye-Lund 's avatar Erik Faye-Lund

nir_lower_clip fixup

parent 828112c3
......@@ -236,7 +236,7 @@ nir_lower_clip_vs(nir_shader *shader, unsigned ucp_enables, bool use_vars,
if (use_clipdist_array) {
out[0] = create_clipdist_var(shader, ++maxloc, true,
VARYING_SLOT_CLIP_DIST0,
ffs(ucp_enables));
util_last_bit(ucp_enables));
} else {
if (ucp_enables & 0x0f)
out[0] = create_clipdist_var(shader, ++maxloc, true,
......@@ -279,7 +279,7 @@ nir_lower_clip_vs(nir_shader *shader, unsigned ucp_enables, bool use_vars,
/* 0.0 == don't-clip == disabled: */
clipdist[plane] = nir_imm_float(&b, 0.0);
}
if (use_clipdist_array && plane < ffs(ucp_enables)) {
if (use_clipdist_array && plane < util_last_bit(ucp_enables)) {
assert(use_vars);
nir_deref_instr *deref;
deref = nir_build_deref_array_imm(&b,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment