On Thu Mar 28 21:37:16 2024 +0000, Zebediah Figura wrote:
HLSL_IR_JUMP_DISCARD_NEG, + /* DISCARD_NZ cancels rendering of the current pixel if the
condition, which in HLSL IR is
HLSL_IR_JUMP_DISCARD_NZ, HLSL_IR_JUMP_RETURN,expected be a bool scalar, is true. */
- /* JUMP_TEXKILL cancels rendering of the current pixel if the
condition, which in HLSL IR is
expected to be a float scalar, is negative. */
- HLSL_IR_JUMP_TEXKILL,
How is TEXKILL different from DISCARD_NEG, then? That needs to be made clear.
I see, the difference is that in `HLSL_IR_JUMP_DISCARD_NEG` the condition doesn't need to be an scalar, it can be a vector or a matrix. And the rendering is aborted if any component is negative. I will add a comment.
Our current path for SM4 is:
DISCARD_NEG -> DISCARD_NZ
My patch proposes also doing that for SM1, and going this route to get TEXKILLs in SM1:
DISCARD_NEG -> DISCARD_NZ -> TEXKILL
Actually, the only place we are generating `HLSL_IR_JUMP_DISCARD_NEG` is in `intrinsic_clip()`. I would go further and rename it to `HLSL_IR_JUMP_CLIP`, what do you think of this?