shader: track possible bits through bit-field inserts in resource tracking

This commit is contained in:
nmzik committed 2026-10-22 01:08:07 +02:00
1 parent a3aece2762
commit 2b37dee2b7
1 file changed
+11
@@ -56,6 +56,17 @@ uint32_t PossibleU32Bits(Value value, const auto& normalize) {
} }
break; break;
} }
case ValueOpcode::BitFieldInsert: {
const auto offset = inst->Arg(2).Resolve();
const auto count = inst->Arg(3).Resolve();
if (offset.IsImmediate() && count.IsImmediate() && offset.U32() < 32u &&
count.U32() <= 32u - offset.U32()) {
const auto field = (count.U32() == 32u ? UINT32_MAX : (1u << count.U32()) - 1u)
<< offset.U32();
bits = (arg(0) & ~field) | ((arg(1) << offset.U32()) & field);
}
break;
}
default: break; default: break;
} }
return bits; return bits;