mirror of https://github.com/bjornbytes/lovr.git
Add var shader helper;
Now you can write var(0) instead of layout(set = 2, binding = 0). The advantage is less typing and resilience in the event that the default set changes. The disadvantage is that now you can't use var.
This commit is contained in:
parent
2e0b5a4efa
commit
ef407fd564
|
@ -155,6 +155,11 @@ layout(location = 14) in vec3 Tangent;
|
|||
// Helpers
|
||||
|
||||
#define Constants layout(push_constant) uniform PushConstants
|
||||
#ifdef GL_COMPUTE_SHADER
|
||||
#define var(x) layout(set = 0, binding = x)
|
||||
#else
|
||||
#define var(x) layout(set = 2, binding = x)
|
||||
#endif
|
||||
|
||||
// Helper for sampling textures using the default sampler set using Pass:setSampler
|
||||
#ifndef GL_COMPUTE_SHADER
|
||||
|
|
Loading…
Reference in New Issue