diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2022-01-15 16:02:48 +0100 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2022-01-15 16:02:48 +0100 |
| commit | 07e316316bc7a7529c2d9b3503771eab34775bc3 (patch) | |
| tree | 5881f36c214012206ff0f75a460cac3579c8181d /shaders/vkvg_solid.vert | |
| parent | e5b3a3e3eda98688b731ee5e59da6725315b220c (diff) | |
test with solid color onlysolidColorOnlyShader
Diffstat (limited to 'shaders/vkvg_solid.vert')
| -rw-r--r-- | shaders/vkvg_solid.vert | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/shaders/vkvg_solid.vert b/shaders/vkvg_solid.vert index 1b08122..8c823dd 100644 --- a/shaders/vkvg_solid.vert +++ b/shaders/vkvg_solid.vert @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Jean-Philippe Bruyère <jp_bruyere@hotmail.com> + * Copyright (c) 2018-2022 Jean-Philippe Bruyère <jp_bruyere@hotmail.com> * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in @@ -28,6 +28,8 @@ layout (location = 0) in vec2 inPos; layout (location = 1) in vec4 inColor; layout (location = 0) out vec4 outSrc; +layout (location = 1) out flat float outOpacity; +layout (location = 2) out mat3x2 outMat; out gl_PerVertex { @@ -35,13 +37,15 @@ out gl_PerVertex }; layout(push_constant) uniform PushConsts { - vec4 source; - vec2 size; - int srcType; - int fullScreenQuad; - mat3x2 mat; - mat3x2 matInv; + vec4 source; + vec2 size; + int fullScreenQuad_srcType; + float opacity; + mat3x2 mat; + mat3x2 matInv; } pc; +#define FULLSCREEN_BIT 0x10000000 +#define SRCTYPE_MASK 0x000000FF #define SOLID 0 #define SURFACE 1 @@ -52,9 +56,11 @@ layout(push_constant) uniform PushConsts { void main() { - outSrc = pc.srcType == SOLID ? inColor : pc.source; + outSrc = pc.source; + outOpacity = pc.opacity; + outMat = pc.matInv; - if (pc.fullScreenQuad != 0) { + if ((pc.fullScreenQuad_srcType & FULLSCREEN_BIT)==FULLSCREEN_BIT) { gl_Position = vec4(inPos, 0.0f, 1.0f); return; } |