Last active
May 31, 2019 19:32
-
-
Save litherum/ae5f6b81ab37c853876335d6f78530ac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct InnerVertexOut { | |
float4 extra : attribute(0); | |
} | |
Struct VertexOut { | |
float4 position : SV_Position; | |
InnerVertexOut innerVertexOut; | |
} | |
struct VertexInput { | |
float something : attribute(0); | |
} | |
vertex VertexOut vertexShader(VertexInput vertexInput, float somethingElse : attribute(1)) { ... } | |
=============================================== | |
struct MetalStageInParameters { float metalSomething [[ attribute(0) ]]; | |
float metalSomethingElse [[ attribute(1) ]]; | |
}; | |
struct MetalVertexOut { | |
float4 metalPosition [[ position ]]; | |
float4 metalExtra [[ user(user0) ]]; | |
}; | |
vertex MetalVertexOut metalVertexShader(MetalStageInParameters metalStageInParameters) { | |
VertexInput vertexInput; | |
float somethingElse; | |
vertexInput.something = metalStageInParameters.metalSomething; | |
somethingElse = metalStageInParameters.metalSomethingElse; | |
... | |
/* "return foo" gets turned into */ | |
metalVertexOut metalVertexOut; | |
metalVertexOut.metalPosition = foo.position; | |
metalVertexOut.metalExtra = foo.innerVertexOut.extra; | |
return metalVertexOut; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment