ShaderLang icon indicating copy to clipboard operation
ShaderLang copied to clipboard

[Feature] Add support for bit operators on vectors of integers

Open SirLynix opened this issue 2 years ago • 0 comments

Add support for bit operators (&, |, ~, <<, >>) on vector of integers.

  1. [ ] Implement bitwise operators to the nzsl::Vector class (component-wise), beware of right shifting on integer which should be arithmetic (see BinaryShiftRightBase in ConstantPropagationVisitorBinaryArithmetics.cpp)
  2. [ ] Extend sanitization rules to allow Vector of integers on bitwise ops.
  3. [ ] Extend GLSL, NZSL and SPIR-V generation (mostly improve the assertions)
  4. [ ] Implement constant propagation on vector of i32 and u32 (reuse the BinaryShiftRightBase and extends it)
  5. [ ] Add some tests in ArithmeticTests (extends "Bitwise operations", "Unary operators")
  6. [ ] Add some tests in OptimizationTests (add a new section "propagating vector constants bitwise")

SirLynix avatar Dec 31 '23 12:12 SirLynix