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
Shader | |
layout (location = 0) in vec3 inPos; | |
layout (location = 1) in vec3 inColor; | |
layout (location = 2) in vec3 inPosB; | |
layout (location = 3) in vec3 inColorB; | |
... | |
Application |
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 Output | |
{ | |
float4 position_cs : SV_POSITION; | |
float2 texcoord : TEXCOORD; | |
}; | |
Output main(uint id: SV_VertexID) | |
{ | |
Output output; |
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
#ifndef defer | |
struct defer_dummy {}; | |
template <class F> struct deferrer { F f; ~deferrer() { f(); } }; | |
template <class F> deferrer<F> operator*(defer_dummy, F f) { return {f}; } | |
#define DEFER_(LINE) zz_defer##LINE | |
#define DEFER(LINE) DEFER_(LINE) | |
#define defer auto DEFER(__LINE__) = defer_dummy{} *[&]() | |
#endif // defer |