On Thu Mar 28 21:37:16 2024 +0000, Francisco Casas wrote:
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?
Looking back, the whole point of `HLSL_IR_JUMP_DISCARD_NEG` was for sm1. If we're not going to use it anymore, then we should just get rid of it, and generate DISCARD_NZ directly from hlsl.y.
That said, if we lower clip(var.xyz) down to a scalar condition, converting that *back* to texkill seems tricky.