-
Notifications
You must be signed in to change notification settings - Fork 48
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
Ambiguous function call #93
Comments
The other errors occur due to the lack of an option for the shader input version in shader-playground (e.g. For the ambigious function call, Xsc clearly shows why this errors occurs:
The last parameter is the literal Of course, there is only one function that fits best, but since there is no clear specification for this behavior of HLSL, I would say that in this case the compiler you are using is "always right". Easiest solution: |
Sure I understand that this solution would work, I just saw that it compiles fine on FXC so I was wondering if this should be an error or not. |
Fxc also compiles this one: float4 VS() : SV_Position {
const float c = 1;
c += 5;
return (float4)c; // Returns (1, 1, 1, 1)
} :-D But seriously, those differences can be annoying but I think this is more of a specification issue. So far Xsc is not really wrong about this, but it is of course worth mentioning to relax the conditions to find a suitable overloaded function. |
Unfortunately even fixing those issues leads to another problem: I'm converting ps_3_0 shaders and defining my own Sample function. The error I get from XSC is this:
Just FYI the XSC version in shader playground gives completely different errors. I will try to find where this context error is emitted in XSC and work it around but I'm posting this before because maybe you already have an idea how to fix it. |
This is a good point. |
With commit d5c673b, you can now use functions with equal names to class intrinsics (this will emit a warning though!). |
If you still encounter any issues with this, just re-open the ticket. |
Thanks! Are we going to see another release in Shader Playground? |
As soon as I make a new release, I will ask Tim Jones about it. |
http://shader-playground.timjones.io/124766c34cc34e47ca09c3df1038889d
The above link demonstrates the issue. FXC can compile fine but switching to XShaderCompiler results in errors.
There are actually more errors visible in the shader playground than the ones I'm getting but that might be because I couldn't paste the whole shader
The text was updated successfully, but these errors were encountered: