-
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
VertexElementSemantic usage in the getting started #14
Comments
|
Could you explain how I was thinking either... |
SPIRV-Cross generating "TEXCOORD" semantics is just an arbitrary decision. When it outputs HLSL, it has to choose some semantic name for each attribute, and TEXCOORD is a generic enough string to use. But again, it's just an arbitrary string, there's nothing particularly special about it.
I'm not sure what you mean by this, exactly. You would like to support hand-written HLSL and HLSL cross-compiled from SPIR-V, but use the same vertex semantics? |
Is this documented somewhere? I guess to me its just not intuitive, I just assumed the getting started was a typo and upon fixing it, I was presented with an error without explanation or even a hint of what to fix. If I were to write this code from scratch I would have spent hours trying to figure out why the semantics were incorrect when in fact they were correct. I'm not specifically looking for supporting both, just trying to limit other people running in to the same issue. An example of this is if you were using HLSL one day and decided to port over to SPRIV, where would I find this documentation that explains this arbitrary choice? |
Also if its arbitrary and doesn't really matter, why does it throw an error when its not |
@xposure It's documented very briefly in the docs for
I agree that more could be done to make this more obvious. Is there anywhere in particular you looked first to find this kind of information?
By that, I meant that the particular string is arbitrary and doesn't carry any particular meaning. E.g. just because it is "TEXCOORD" doesn't mean the attribute has anything to do with a texture coordinate. The only part that is important is that the strings match exactly when you construct a Pipeline, and only when using the D3D11 backend (others don't use semantic strings to match attributes). |
Can't For example, if we'll add to Veldrid.Shader a property like: public VertexElementSemantic? OverrideSemantic { get; set; } Then Then the user can put the more intuitive semantic and it will work for both scenarios. |
@tzachshabtay That's an interesting option. It could potentially be taken even further and Veldrid.SPIRV could provide "overrides" for the entire |
Can you shed some light on the
VertexElementSemantic
usage? In the getting started, both position and color are set asTextureCoordinate
, which works. When I try to change it to Position and Color respectively, it crashes withMessage: The parameter is incorrect.
In what case would you use
Position
andColor
then?The text was updated successfully, but these errors were encountered: