Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FXC] Shader Model 3 allows TEXKILL with input register #2

Open
flibitijibibo opened this issue Jun 19, 2018 · 0 comments
Open

[FXC] Shader Model 3 allows TEXKILL with input register #2

flibitijibibo opened this issue Jun 19, 2018 · 0 comments
Labels
invalid This doesn't seem right

Comments

@flibitijibibo
Copy link
Collaborator

This is a follow-up issue for FNA-XNA/FNA#124.

From that issue...

The problem gets introduced when clip() is done directly on an input value, such as the TEXCOORD5 value in the very first pixel shader, which produces something like this:

        pixelshader = 
            asm {
            //
            // Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
                ps_3_0
                dcl_color v0
                dcl_texcoord5 v1
                texkill v1
                mov oC0, v0
            
            // approximately 2 instruction slots used
            };

The problem is that texkill against an input register is forbidden according to Microsoft's own documentation on the texkill instruction. In fact, if I change the shader model to 2.0 instead of 3.0, I get this...

        pixelshader = 
            asm {
            //
            // Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
                ps_2_0
                dcl v0
                dcl t5
                texkill t5
                mov oC0, v0
            
            // approximately 2 instruction slots used
            };

This is what we're actually expecting! So either the documentation we're looking at is outdated and only references SM2 or the SM3 compiler has a problem with this shader.

CC @mklingen

@flibitijibibo flibitijibibo changed the title Shader Model 3 allows TEXKILL with input register [FXC] Shader Model 3 allows TEXKILL with input register Jul 13, 2021
@flibitijibibo flibitijibibo added the invalid This doesn't seem right label Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

1 participant