Skip to content

Small bitfield_extract/insert optimizations to remove unnecessary bcsel operations for D3D

Daniel Schürmann requested to merge daniel-schuermann/mesa:bitfield into master

D3D has a slightly different semantics of bfi/bfe where the bit_width has to be max 31, while for SPIRV the bit_width+offset must be at most 32. This results in bcsel operations for the bit_width == 32 case which are unnecessary if the SPIRV code is generated from D3D. The idea of this optimization is to have an additional and(bit_width, 31) instructions which allows to optimize away the bcsel.

Merge request reports