From 9f9233c15360064c3a7a91ff2b18b0f11a595b96 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Wed, 5 Jun 2019 17:20:12 -0700 Subject: [PATCH] Add Metal shaders, cross-compiled from the GLSL via SPIR-V. The Metal shaders are checked into the repository for convenience, but they should not be directly edited. Instead, edit the corresponding GLSL shader in the top-level `shaders/` directory, and rerun `make` in there. --- gl/src/lib.rs | 23 +--- gpu/src/lib.rs | 27 +--- resources/shaders/README.md | 7 + resources/shaders/gl3/debug_solid.fs.glsl | 22 +++ resources/shaders/gl3/debug_solid.vs.glsl | 23 ++++ resources/shaders/gl3/debug_texture.fs.glsl | 26 ++++ resources/shaders/gl3/debug_texture.vs.glsl | 28 ++++ resources/shaders/gl3/demo_ground.fs.glsl | 26 ++++ resources/shaders/gl3/demo_ground.vs.glsl | 26 ++++ resources/shaders/gl3/fill.fs.glsl | 42 ++++++ resources/shaders/gl3/fill.vs.glsl | 55 ++++++++ resources/shaders/gl3/post.fs.glsl | 125 ++++++++++++++++++ resources/shaders/gl3/post.vs.glsl | 23 ++++ resources/shaders/gl3/reproject.fs.glsl | 27 ++++ resources/shaders/gl3/reproject.vs.glsl | 25 ++++ resources/shaders/gl3/stencil.fs.glsl | 21 +++ resources/shaders/gl3/stencil.vs.glsl | 20 +++ resources/shaders/gl3/tile_alpha.fs.glsl | 27 ++++ .../shaders/gl3/tile_alpha_monochrome.vs.glsl | 85 ++++++++++++ .../shaders/gl3/tile_alpha_multicolor.vs.glsl | 88 ++++++++++++ resources/shaders/gl3/tile_solid.fs.glsl | 22 +++ .../shaders/gl3/tile_solid_monochrome.vs.glsl | 69 ++++++++++ .../shaders/gl3/tile_solid_multicolor.vs.glsl | 72 ++++++++++ resources/shaders/metal/debug_solid.fs.metal | 17 +++ resources/shaders/metal/debug_solid.vs.metal | 23 ++++ .../shaders/metal/debug_texture.fs.metal | 23 ++++ .../shaders/metal/debug_texture.vs.metal | 26 ++++ resources/shaders/metal/demo_ground.fs.metal | 24 ++++ resources/shaders/metal/demo_ground.vs.metal | 24 ++++ resources/shaders/metal/fill.fs.metal | 35 +++++ resources/shaders/metal/fill.vs.metal | 62 +++++++++ resources/shaders/metal/post.fs.metal | 119 +++++++++++++++++ resources/shaders/metal/post.vs.metal | 24 ++++ resources/shaders/metal/reproject.fs.metal | 24 ++++ resources/shaders/metal/reproject.vs.metal | 24 ++++ resources/shaders/metal/stencil.fs.metal | 17 +++ resources/shaders/metal/stencil.vs.metal | 22 +++ resources/shaders/metal/tile_alpha.fs.metal | 25 ++++ .../metal/tile_alpha_monochrome.vs.metal | 57 ++++++++ .../metal/tile_alpha_multicolor.vs.metal | 58 ++++++++ resources/shaders/metal/tile_solid.fs.metal | 22 +++ .../metal/tile_solid_monochrome.vs.metal | 39 ++++++ .../metal/tile_solid_multicolor.vs.metal | 40 ++++++ resources/shaders/spirv/debug_solid.fs.spv | Bin 0 -> 644 bytes resources/shaders/spirv/debug_solid.vs.spv | Bin 0 -> 1252 bytes resources/shaders/spirv/debug_texture.fs.spv | Bin 0 -> 1064 bytes resources/shaders/spirv/debug_texture.vs.spv | Bin 0 -> 1516 bytes resources/shaders/spirv/demo_ground.fs.spv | Bin 0 -> 908 bytes resources/shaders/spirv/demo_ground.vs.spv | Bin 0 -> 1328 bytes resources/shaders/spirv/fill.fs.spv | Bin 0 -> 2688 bytes resources/shaders/spirv/fill.vs.spv | Bin 0 -> 3908 bytes resources/shaders/spirv/post.fs.spv | Bin 0 -> 6864 bytes resources/shaders/spirv/post.vs.spv | Bin 0 -> 1080 bytes resources/shaders/spirv/reproject.fs.spv | Bin 0 -> 1212 bytes resources/shaders/spirv/reproject.vs.spv | Bin 0 -> 1144 bytes resources/shaders/spirv/stencil.fs.spv | Bin 0 -> 352 bytes resources/shaders/spirv/stencil.vs.spv | Bin 0 -> 908 bytes resources/shaders/spirv/tile_alpha.fs.spv | Bin 0 -> 1140 bytes .../spirv/tile_alpha_monochrome.vs.spv | Bin 0 -> 3876 bytes .../spirv/tile_alpha_multicolor.vs.spv | Bin 0 -> 4128 bytes resources/shaders/spirv/tile_solid.fs.spv | Bin 0 -> 376 bytes .../spirv/tile_solid_monochrome.vs.spv | Bin 0 -> 2016 bytes .../spirv/tile_solid_multicolor.vs.spv | Bin 0 -> 2268 bytes shaders/Makefile | 69 ++++++++++ .../shaders => shaders}/debug_solid.fs.glsl | 4 +- .../shaders => shaders}/debug_solid.vs.glsl | 4 +- .../shaders => shaders}/debug_texture.fs.glsl | 4 +- .../shaders => shaders}/debug_texture.vs.glsl | 4 +- .../shaders => shaders}/demo_ground.fs.glsl | 4 +- .../shaders => shaders}/demo_ground.vs.glsl | 4 +- {resources/shaders => shaders}/fill.fs.glsl | 6 +- {resources/shaders => shaders}/fill.vs.glsl | 4 +- {resources/shaders => shaders}/post.fs.glsl | 10 +- {resources/shaders => shaders}/post.vs.glsl | 4 +- .../post_convolve.inc.glsl | 2 +- .../post_gamma_correct.inc.glsl | 2 +- .../shaders => shaders}/reproject.fs.glsl | 4 +- .../shaders => shaders}/reproject.vs.glsl | 4 +- .../shaders => shaders}/stencil.fs.glsl | 4 +- .../shaders => shaders}/stencil.vs.glsl | 6 +- .../shaders => shaders}/tile_alpha.fs.glsl | 4 +- .../tile_alpha_monochrome.vs.glsl | 10 +- .../tile_alpha_multicolor.vs.glsl | 10 +- .../tile_alpha_vertex.inc.glsl | 2 +- .../tile_monochrome.inc.glsl | 2 +- .../tile_multicolor.inc.glsl | 2 +- .../shaders => shaders}/tile_solid.fs.glsl | 6 +- .../tile_solid_monochrome.vs.glsl | 10 +- .../tile_solid_multicolor.vs.glsl | 10 +- .../tile_solid_vertex.inc.glsl | 2 +- 90 files changed, 1709 insertions(+), 102 deletions(-) create mode 100644 resources/shaders/README.md create mode 100644 resources/shaders/gl3/debug_solid.fs.glsl create mode 100644 resources/shaders/gl3/debug_solid.vs.glsl create mode 100644 resources/shaders/gl3/debug_texture.fs.glsl create mode 100644 resources/shaders/gl3/debug_texture.vs.glsl create mode 100644 resources/shaders/gl3/demo_ground.fs.glsl create mode 100644 resources/shaders/gl3/demo_ground.vs.glsl create mode 100644 resources/shaders/gl3/fill.fs.glsl create mode 100644 resources/shaders/gl3/fill.vs.glsl create mode 100644 resources/shaders/gl3/post.fs.glsl create mode 100644 resources/shaders/gl3/post.vs.glsl create mode 100644 resources/shaders/gl3/reproject.fs.glsl create mode 100644 resources/shaders/gl3/reproject.vs.glsl create mode 100644 resources/shaders/gl3/stencil.fs.glsl create mode 100644 resources/shaders/gl3/stencil.vs.glsl create mode 100644 resources/shaders/gl3/tile_alpha.fs.glsl create mode 100644 resources/shaders/gl3/tile_alpha_monochrome.vs.glsl create mode 100644 resources/shaders/gl3/tile_alpha_multicolor.vs.glsl create mode 100644 resources/shaders/gl3/tile_solid.fs.glsl create mode 100644 resources/shaders/gl3/tile_solid_monochrome.vs.glsl create mode 100644 resources/shaders/gl3/tile_solid_multicolor.vs.glsl create mode 100644 resources/shaders/metal/debug_solid.fs.metal create mode 100644 resources/shaders/metal/debug_solid.vs.metal create mode 100644 resources/shaders/metal/debug_texture.fs.metal create mode 100644 resources/shaders/metal/debug_texture.vs.metal create mode 100644 resources/shaders/metal/demo_ground.fs.metal create mode 100644 resources/shaders/metal/demo_ground.vs.metal create mode 100644 resources/shaders/metal/fill.fs.metal create mode 100644 resources/shaders/metal/fill.vs.metal create mode 100644 resources/shaders/metal/post.fs.metal create mode 100644 resources/shaders/metal/post.vs.metal create mode 100644 resources/shaders/metal/reproject.fs.metal create mode 100644 resources/shaders/metal/reproject.vs.metal create mode 100644 resources/shaders/metal/stencil.fs.metal create mode 100644 resources/shaders/metal/stencil.vs.metal create mode 100644 resources/shaders/metal/tile_alpha.fs.metal create mode 100644 resources/shaders/metal/tile_alpha_monochrome.vs.metal create mode 100644 resources/shaders/metal/tile_alpha_multicolor.vs.metal create mode 100644 resources/shaders/metal/tile_solid.fs.metal create mode 100644 resources/shaders/metal/tile_solid_monochrome.vs.metal create mode 100644 resources/shaders/metal/tile_solid_multicolor.vs.metal create mode 100644 resources/shaders/spirv/debug_solid.fs.spv create mode 100644 resources/shaders/spirv/debug_solid.vs.spv create mode 100644 resources/shaders/spirv/debug_texture.fs.spv create mode 100644 resources/shaders/spirv/debug_texture.vs.spv create mode 100644 resources/shaders/spirv/demo_ground.fs.spv create mode 100644 resources/shaders/spirv/demo_ground.vs.spv create mode 100644 resources/shaders/spirv/fill.fs.spv create mode 100644 resources/shaders/spirv/fill.vs.spv create mode 100644 resources/shaders/spirv/post.fs.spv create mode 100644 resources/shaders/spirv/post.vs.spv create mode 100644 resources/shaders/spirv/reproject.fs.spv create mode 100644 resources/shaders/spirv/reproject.vs.spv create mode 100644 resources/shaders/spirv/stencil.fs.spv create mode 100644 resources/shaders/spirv/stencil.vs.spv create mode 100644 resources/shaders/spirv/tile_alpha.fs.spv create mode 100644 resources/shaders/spirv/tile_alpha_monochrome.vs.spv create mode 100644 resources/shaders/spirv/tile_alpha_multicolor.vs.spv create mode 100644 resources/shaders/spirv/tile_solid.fs.spv create mode 100644 resources/shaders/spirv/tile_solid_monochrome.vs.spv create mode 100644 resources/shaders/spirv/tile_solid_multicolor.vs.spv create mode 100644 shaders/Makefile rename {resources/shaders => shaders}/debug_solid.fs.glsl (88%) rename {resources/shaders => shaders}/debug_solid.vs.glsl (89%) rename {resources/shaders => shaders}/debug_texture.fs.glsl (88%) rename {resources/shaders => shaders}/debug_texture.vs.glsl (90%) rename {resources/shaders => shaders}/demo_ground.fs.glsl (89%) rename {resources/shaders => shaders}/demo_ground.vs.glsl (88%) rename {resources/shaders => shaders}/fill.fs.glsl (91%) rename {resources/shaders => shaders}/fill.vs.glsl (96%) rename {resources/shaders => shaders}/post.fs.glsl (90%) rename {resources/shaders => shaders}/post.vs.glsl (88%) rename {resources/shaders => shaders}/post_convolve.inc.glsl (96%) rename {resources/shaders => shaders}/post_gamma_correct.inc.glsl (93%) rename {resources/shaders => shaders}/reproject.fs.glsl (90%) rename {resources/shaders => shaders}/reproject.vs.glsl (88%) rename {resources/shaders => shaders}/stencil.fs.glsl (88%) rename {resources/shaders => shaders}/stencil.vs.glsl (76%) rename {resources/shaders => shaders}/tile_alpha.fs.glsl (89%) rename {resources/shaders => shaders}/tile_alpha_monochrome.vs.glsl (69%) rename {resources/shaders => shaders}/tile_alpha_multicolor.vs.glsl (69%) rename {resources/shaders => shaders}/tile_alpha_vertex.inc.glsl (96%) rename {resources/shaders => shaders}/tile_monochrome.inc.glsl (88%) rename {resources/shaders => shaders}/tile_multicolor.inc.glsl (90%) rename {resources/shaders => shaders}/tile_solid.fs.glsl (78%) rename {resources/shaders => shaders}/tile_solid_monochrome.vs.glsl (69%) rename {resources/shaders => shaders}/tile_solid_multicolor.vs.glsl (69%) rename {resources/shaders => shaders}/tile_solid_vertex.inc.glsl (93%) diff --git a/gl/src/lib.rs b/gl/src/lib.rs index baec4e26..ae0d2140 100644 --- a/gl/src/lib.rs +++ b/gl/src/lib.rs @@ -225,18 +225,12 @@ impl Device for GLDevice { texture } - fn create_shader_from_source(&self, - resources: &dyn ResourceLoader, - name: &str, - source: &[u8], - kind: ShaderKind, - includes: &[&str]) - -> GLShader { + fn create_shader_from_source(&self, name: &str, source: &[u8], kind: ShaderKind) -> GLShader { // FIXME(pcwalton): Do this once and cache it. let glsl_version_spec = self.version.to_glsl_version_spec(); let mut output = vec![]; - self.preprocess(&mut output, resources, source, includes, glsl_version_spec); + self.preprocess(&mut output, source, glsl_version_spec); let source = output; let gl_shader_kind = match kind { @@ -650,12 +644,7 @@ impl Device for GLDevice { } impl GLDevice { - fn preprocess(&self, - output: &mut Vec, - resources: &dyn ResourceLoader, - source: &[u8], - includes: &[&str], - version: &str) { + fn preprocess(&self, output: &mut Vec, source: &[u8], version: &str) { let mut index = 0; while index < source.len() { if source[index..].starts_with(b"{{") { @@ -666,12 +655,6 @@ impl GLDevice { let ident = String::from_utf8_lossy(&source[(index + 2)..end_index]); if ident == "version" { output.extend_from_slice(version.as_bytes()); - } else if ident.starts_with("include_") { - let include_name = &ident["include_".len()..]; - if includes.iter().any(|include| *include == include_name) { - let include_source = self.load_shader_include(resources, include_name); - self.preprocess(output, resources, &include_source, includes, version); - } } else { panic!("unknown template variable: `{}`", ident); } diff --git a/gpu/src/lib.rs b/gpu/src/lib.rs index fdbab686..cfe4b4ee 100644 --- a/gpu/src/lib.rs +++ b/gpu/src/lib.rs @@ -21,15 +21,6 @@ use std::time::Duration; pub mod resources; -static INCLUDES: [&str; 6] = [ - "tile_alpha_vertex", - "tile_monochrome", - "tile_multicolor", - "tile_solid_vertex", - "post_convolve", - "post_gamma_correct", -]; - pub trait Device { type Buffer; type Framebuffer; @@ -43,14 +34,8 @@ pub trait Device { fn create_texture(&self, format: TextureFormat, size: Vector2I) -> Self::Texture; fn create_texture_from_data(&self, size: Vector2I, data: &[u8]) -> Self::Texture; - fn create_shader_from_source( - &self, - resources: &dyn ResourceLoader, - name: &str, - source: &[u8], - kind: ShaderKind, - includes: &[&str], - ) -> Self::Shader; + fn create_shader_from_source(&self, name: &str, source: &[u8], kind: ShaderKind) + -> Self::Shader; fn create_vertex_array(&self) -> Self::VertexArray; fn create_program_from_shaders( &self, @@ -117,8 +102,8 @@ pub trait Device { ShaderKind::Vertex => 'v', ShaderKind::Fragment => 'f', }; - let source = resources.slurp(&format!("shaders/{}.{}s.glsl", name, suffix)).unwrap(); - self.create_shader_from_source(resources, name, &source, kind, &INCLUDES) + let source = resources.slurp(&format!("shaders/gl3/{}.{}s.glsl", name, suffix)).unwrap(); + self.create_shader_from_source(name, &source, kind) } fn create_program_from_shader_names( @@ -137,10 +122,6 @@ pub trait Device { fn create_program(&self, resources: &dyn ResourceLoader, name: &str) -> Self::Program { self.create_program_from_shader_names(resources, name, name, name) } - - fn load_shader_include(&self, resources: &dyn ResourceLoader, include_name: &str) -> Vec { - resources.slurp(&format!("shaders/{}.inc.glsl", include_name)).unwrap() - } } #[derive(Clone, Copy, Debug)] diff --git a/resources/shaders/README.md b/resources/shaders/README.md new file mode 100644 index 00000000..24bff80f --- /dev/null +++ b/resources/shaders/README.md @@ -0,0 +1,7 @@ +This directory contains postprocessed versions of the shaders in the top-level +`shaders/` directory, for convenience. Don't modify the shaders here; instead +modify the corresponding shaders in `shaders/` and rerun `make` in that +directory. + +You will need `glslangValidator` and `spirv-cross` installed to execute the +Makefile. On macOS, you can get these with `brew install glslang spirv-cross`. diff --git a/resources/shaders/gl3/debug_solid.fs.glsl b/resources/shaders/gl3/debug_solid.fs.glsl new file mode 100644 index 00000000..eeaaf489 --- /dev/null +++ b/resources/shaders/gl3/debug_solid.fs.glsl @@ -0,0 +1,22 @@ +#version {{version}} + + + + + + + + + + + +precision highp float; + +uniform vec4 uColor; + +out vec4 oFragColor; + +void main(){ + oFragColor = vec4(uColor . rgb, 1.0)* uColor . a; +} + diff --git a/resources/shaders/gl3/debug_solid.vs.glsl b/resources/shaders/gl3/debug_solid.vs.glsl new file mode 100644 index 00000000..3c38f3f7 --- /dev/null +++ b/resources/shaders/gl3/debug_solid.vs.glsl @@ -0,0 +1,23 @@ +#version {{version}} + + + + + + + + + + + +precision highp float; + +uniform vec2 uFramebufferSize; + +in vec2 aPosition; + +void main(){ + vec2 position = aPosition / uFramebufferSize * 2.0 - 1.0; + gl_Position = vec4(position . x, - position . y, 0.0, 1.0); +} + diff --git a/resources/shaders/gl3/debug_texture.fs.glsl b/resources/shaders/gl3/debug_texture.fs.glsl new file mode 100644 index 00000000..9601adf2 --- /dev/null +++ b/resources/shaders/gl3/debug_texture.fs.glsl @@ -0,0 +1,26 @@ +#version {{version}} + + + + + + + + + + + +precision highp float; + +uniform sampler2D uTexture; +uniform vec4 uColor; + +in vec2 vTexCoord; + +out vec4 oFragColor; + +void main(){ + float alpha = texture(uTexture, vTexCoord). r * uColor . a; + oFragColor = alpha * vec4(uColor . rgb, 1.0); +} + diff --git a/resources/shaders/gl3/debug_texture.vs.glsl b/resources/shaders/gl3/debug_texture.vs.glsl new file mode 100644 index 00000000..b3b546d8 --- /dev/null +++ b/resources/shaders/gl3/debug_texture.vs.glsl @@ -0,0 +1,28 @@ +#version {{version}} + + + + + + + + + + + +precision highp float; + +uniform vec2 uFramebufferSize; +uniform vec2 uTextureSize; + +in vec2 aPosition; +in vec2 aTexCoord; + +out vec2 vTexCoord; + +void main(){ + vTexCoord = aTexCoord / uTextureSize; + vec2 position = aPosition / uFramebufferSize * 2.0 - 1.0; + gl_Position = vec4(position . x, - position . y, 0.0, 1.0); +} + diff --git a/resources/shaders/gl3/demo_ground.fs.glsl b/resources/shaders/gl3/demo_ground.fs.glsl new file mode 100644 index 00000000..3bf84270 --- /dev/null +++ b/resources/shaders/gl3/demo_ground.fs.glsl @@ -0,0 +1,26 @@ +#version {{version}} + + + + + + + + + + + +precision highp float; + +uniform vec4 uGroundColor; +uniform vec4 uGridlineColor; + +in vec2 vTexCoord; + +out vec4 oFragColor; + +void main(){ + vec2 texCoordPx = fract(vTexCoord)/ fwidth(vTexCoord); + oFragColor = any(lessThanEqual(texCoordPx, vec2(1.0)))? uGridlineColor : uGroundColor; +} + diff --git a/resources/shaders/gl3/demo_ground.vs.glsl b/resources/shaders/gl3/demo_ground.vs.glsl new file mode 100644 index 00000000..418eb50a --- /dev/null +++ b/resources/shaders/gl3/demo_ground.vs.glsl @@ -0,0 +1,26 @@ +#version {{version}} + + + + + + + + + + + +precision highp float; + +uniform mat4 uTransform; +uniform int uGridlineCount; + +in vec2 aPosition; + +out vec2 vTexCoord; + +void main(){ + vTexCoord = aPosition * float(uGridlineCount); + gl_Position = uTransform * vec4(aPosition . x, 0.0, aPosition . y, 1.0); +} + diff --git a/resources/shaders/gl3/fill.fs.glsl b/resources/shaders/gl3/fill.fs.glsl new file mode 100644 index 00000000..aeebe141 --- /dev/null +++ b/resources/shaders/gl3/fill.fs.glsl @@ -0,0 +1,42 @@ +#version {{version}} + + + + + + + + + + + +precision highp float; + +uniform sampler2D uAreaLUT; + +in vec2 vFrom; +in vec2 vTo; + +out vec4 oFragColor; + +void main(){ + + vec2 from = vFrom, to = vTo; + + + vec2 left = from . x < to . x ? from : to, right = from . x < to . x ? to : from; + + + vec2 window = clamp(vec2(from . x, to . x), - 0.5, 0.5); + float offset = mix(window . x, window . y, 0.5)- left . x; + float t = offset /(right . x - left . x); + + + float y = mix(left . y, right . y, t); + float d =(right . y - left . y)/(right . x - left . x); + + + float dX = window . x - window . y; + oFragColor = vec4(texture(uAreaLUT, vec2(y + 8.0, abs(d * dX))/ 16.0). r * dX); +} + diff --git a/resources/shaders/gl3/fill.vs.glsl b/resources/shaders/gl3/fill.vs.glsl new file mode 100644 index 00000000..fac4560a --- /dev/null +++ b/resources/shaders/gl3/fill.vs.glsl @@ -0,0 +1,55 @@ +#version {{version}} + + + + + + + + + + + +precision highp float; + +uniform vec2 uFramebufferSize; +uniform vec2 uTileSize; + +in vec2 aTessCoord; +in uint aFromPx; +in uint aToPx; +in vec2 aFromSubpx; +in vec2 aToSubpx; +in uint aTileIndex; + +out vec2 vFrom; +out vec2 vTo; + +vec2 computeTileOffset(uint tileIndex, float stencilTextureWidth){ + uint tilesPerRow = uint(stencilTextureWidth / uTileSize . x); + uvec2 tileOffset = uvec2(aTileIndex % tilesPerRow, aTileIndex / tilesPerRow); + return vec2(tileOffset)* uTileSize; +} + +void main(){ + vec2 tileOrigin = computeTileOffset(aTileIndex, uFramebufferSize . x); + + vec2 from = vec2(aFromPx & 15u, aFromPx >> 4u)+ aFromSubpx; + vec2 to = vec2(aToPx & 15u, aToPx >> 4u)+ aToSubpx; + + vec2 position; + if(aTessCoord . x < 0.5) + position . x = floor(min(from . x, to . x)); + else + position . x = ceil(max(from . x, to . x)); + if(aTessCoord . y < 0.5) + position . y = floor(min(from . y, to . y)); + else + position . y = uTileSize . y; + + vFrom = from - position; + vTo = to - position; + + gl_Position = vec4((tileOrigin + position)/ uFramebufferSize * 2.0 - 1.0, 0.0, 1.0); +} + diff --git a/resources/shaders/gl3/post.fs.glsl b/resources/shaders/gl3/post.fs.glsl new file mode 100644 index 00000000..0a74556b --- /dev/null +++ b/resources/shaders/gl3/post.fs.glsl @@ -0,0 +1,125 @@ +#version {{version}} + + + + + + + + + + + + + + +#extension GL_GOOGLE_include_directive : enable + +precision highp float; + +uniform sampler2D uSource; +uniform vec2 uSourceSize; +uniform vec4 uFGColor; +uniform vec4 uBGColor; +uniform int uGammaCorrectionEnabled; + +in vec2 vTexCoord; + +out vec4 oFragColor; + + + + + + + + + + + + + + +uniform sampler2D uGammaLUT; + +float gammaCorrectChannel(float bgColor, float fgColor){ + return texture(uGammaLUT, vec2(fgColor, 1.0 - bgColor)). r; +} + + +vec3 gammaCorrect(vec3 bgColor, vec3 fgColor){ + return vec3(gammaCorrectChannel(bgColor . r, fgColor . r), + gammaCorrectChannel(bgColor . g, fgColor . g), + gammaCorrectChannel(bgColor . b, fgColor . b)); +} + + + + + + + + + + + + + +uniform vec4 uKernel; + + + +float sample1Tap(float offset); + + +void sample9Tap(out vec4 outAlphaLeft, + out float outAlphaCenter, + out vec4 outAlphaRight, + float onePixel){ + outAlphaLeft = vec4(uKernel . x > 0.0 ? sample1Tap(- 4.0 * onePixel): 0.0, + sample1Tap(- 3.0 * onePixel), + sample1Tap(- 2.0 * onePixel), + sample1Tap(- 1.0 * onePixel)); + outAlphaCenter = sample1Tap(0.0); + outAlphaRight = vec4(sample1Tap(1.0 * onePixel), + sample1Tap(2.0 * onePixel), + sample1Tap(3.0 * onePixel), + uKernel . x > 0.0 ? sample1Tap(4.0 * onePixel): 0.0); +} + + +float convolve7Tap(vec4 alpha0, vec3 alpha1){ + return dot(alpha0, uKernel)+ dot(alpha1, uKernel . zyx); +} + + + +float sample1Tap(float offset){ + return texture(uSource, vec2(vTexCoord . x + offset, vTexCoord . y)). r; +} + +void main(){ + + vec3 alpha; + if(uKernel . w == 0.0){ + alpha = texture(uSource, vTexCoord). rrr; + } else { + vec4 alphaLeft, alphaRight; + float alphaCenter; + sample9Tap(alphaLeft, alphaCenter, alphaRight, 1.0 / uSourceSize . x); + + float r = convolve7Tap(alphaLeft, vec3(alphaCenter, alphaRight . xy)); + float g = convolve7Tap(vec4(alphaLeft . yzw, alphaCenter), alphaRight . xyz); + float b = convolve7Tap(vec4(alphaLeft . zw, alphaCenter, alphaRight . x), alphaRight . yzw); + + alpha = vec3(r, g, b); + } + + + if(uGammaCorrectionEnabled != 0) + alpha = gammaCorrect(uBGColor . rgb, alpha); + + + oFragColor = vec4(mix(uBGColor . rgb, uFGColor . rgb, alpha), 1.0); +} + diff --git a/resources/shaders/gl3/post.vs.glsl b/resources/shaders/gl3/post.vs.glsl new file mode 100644 index 00000000..29e75ade --- /dev/null +++ b/resources/shaders/gl3/post.vs.glsl @@ -0,0 +1,23 @@ +#version {{version}} + + + + + + + + + + + +precision highp float; + +in vec2 aPosition; + +out vec2 vTexCoord; + +void main(){ + vTexCoord = aPosition; + gl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0); +} + diff --git a/resources/shaders/gl3/reproject.fs.glsl b/resources/shaders/gl3/reproject.fs.glsl new file mode 100644 index 00000000..427b632c --- /dev/null +++ b/resources/shaders/gl3/reproject.fs.glsl @@ -0,0 +1,27 @@ +#version {{version}} + + + + + + + + + + + +precision highp float; + +uniform mat4 uOldTransform; +uniform sampler2D uTexture; + +in vec2 vTexCoord; + +out vec4 oFragColor; + +void main(){ + vec4 normTexCoord = uOldTransform * vec4(vTexCoord, 0.0, 1.0); + vec2 texCoord =((normTexCoord . xy / normTexCoord . w)+ 1.0)* 0.5; + oFragColor = texture(uTexture, texCoord); +} + diff --git a/resources/shaders/gl3/reproject.vs.glsl b/resources/shaders/gl3/reproject.vs.glsl new file mode 100644 index 00000000..d1c70544 --- /dev/null +++ b/resources/shaders/gl3/reproject.vs.glsl @@ -0,0 +1,25 @@ +#version {{version}} + + + + + + + + + + + +precision highp float; + +uniform mat4 uNewTransform; + +in vec2 aPosition; + +out vec2 vTexCoord; + +void main(){ + vTexCoord = aPosition; + gl_Position = uNewTransform * vec4(aPosition, 0.0, 1.0); +} + diff --git a/resources/shaders/gl3/stencil.fs.glsl b/resources/shaders/gl3/stencil.fs.glsl new file mode 100644 index 00000000..e2e093ab --- /dev/null +++ b/resources/shaders/gl3/stencil.fs.glsl @@ -0,0 +1,21 @@ +#version {{version}} + + + + + + + + + + + +precision highp float; + +out vec4 oFragColor; + +void main(){ + + oFragColor = vec4(1.0, 0.0, 0.0, 1.0); +} + diff --git a/resources/shaders/gl3/stencil.vs.glsl b/resources/shaders/gl3/stencil.vs.glsl new file mode 100644 index 00000000..2fee81a2 --- /dev/null +++ b/resources/shaders/gl3/stencil.vs.glsl @@ -0,0 +1,20 @@ +#version {{version}} + + + + + + + + + + + +precision highp float; + +in vec3 aPosition; + +void main(){ + gl_Position = vec4(aPosition, 1.0); +} + diff --git a/resources/shaders/gl3/tile_alpha.fs.glsl b/resources/shaders/gl3/tile_alpha.fs.glsl new file mode 100644 index 00000000..3af9cf4d --- /dev/null +++ b/resources/shaders/gl3/tile_alpha.fs.glsl @@ -0,0 +1,27 @@ +#version {{version}} + + + + + + + + + + + +precision highp float; + +uniform sampler2D uStencilTexture; + +in vec2 vTexCoord; +in float vBackdrop; +in vec4 vColor; + +out vec4 oFragColor; + +void main(){ + float coverage = abs(texture(uStencilTexture, vTexCoord). r + vBackdrop); + oFragColor = vec4(vColor . rgb, vColor . a * coverage); +} + diff --git a/resources/shaders/gl3/tile_alpha_monochrome.vs.glsl b/resources/shaders/gl3/tile_alpha_monochrome.vs.glsl new file mode 100644 index 00000000..d99d7dd7 --- /dev/null +++ b/resources/shaders/gl3/tile_alpha_monochrome.vs.glsl @@ -0,0 +1,85 @@ +#version {{version}} + + + + + + + + + + + +#extension GL_GOOGLE_include_directive : enable + +precision highp float; + + + + + + + + + + + + +uniform vec2 uFramebufferSize; +uniform vec2 uTileSize; +uniform vec2 uStencilTextureSize; +uniform vec2 uViewBoxOrigin; + +in vec2 aTessCoord; +in uvec3 aTileOrigin; +in int aBackdrop; +in uint aTileIndex; + +out vec2 vTexCoord; +out float vBackdrop; +out vec4 vColor; + +vec4 getColor(); + +vec2 computeTileOffset(uint tileIndex, float stencilTextureWidth){ + uint tilesPerRow = uint(stencilTextureWidth / uTileSize . x); + uvec2 tileOffset = uvec2(tileIndex % tilesPerRow, tileIndex / tilesPerRow); + return vec2(tileOffset)* uTileSize; +} + +void computeVaryings(){ + vec2 origin = vec2(aTileOrigin . xy)+ vec2(aTileOrigin . z & 15u, aTileOrigin . z >> 4u)* 256.0; + vec2 pixelPosition =(origin + aTessCoord)* uTileSize + uViewBoxOrigin; + vec2 position =(pixelPosition / uFramebufferSize * 2.0 - 1.0)* vec2(1.0, - 1.0); + vec2 maskTexCoordOrigin = computeTileOffset(aTileIndex, uStencilTextureSize . x); + vec2 maskTexCoord = maskTexCoordOrigin + aTessCoord * uTileSize; + + vTexCoord = maskTexCoord / uStencilTextureSize; + vBackdrop = float(aBackdrop); + vColor = getColor(); + gl_Position = vec4(position, 0.0, 1.0); +} + + + + + + + + + + + + + +uniform vec4 uColor; + +vec4 getColor(){ + return uColor; +} + + +void main(){ + computeVaryings(); +} + diff --git a/resources/shaders/gl3/tile_alpha_multicolor.vs.glsl b/resources/shaders/gl3/tile_alpha_multicolor.vs.glsl new file mode 100644 index 00000000..be655748 --- /dev/null +++ b/resources/shaders/gl3/tile_alpha_multicolor.vs.glsl @@ -0,0 +1,88 @@ +#version {{version}} + + + + + + + + + + + +#extension GL_GOOGLE_include_directive : enable + +precision highp float; + + + + + + + + + + + + +uniform vec2 uFramebufferSize; +uniform vec2 uTileSize; +uniform vec2 uStencilTextureSize; +uniform vec2 uViewBoxOrigin; + +in vec2 aTessCoord; +in uvec3 aTileOrigin; +in int aBackdrop; +in uint aTileIndex; + +out vec2 vTexCoord; +out float vBackdrop; +out vec4 vColor; + +vec4 getColor(); + +vec2 computeTileOffset(uint tileIndex, float stencilTextureWidth){ + uint tilesPerRow = uint(stencilTextureWidth / uTileSize . x); + uvec2 tileOffset = uvec2(tileIndex % tilesPerRow, tileIndex / tilesPerRow); + return vec2(tileOffset)* uTileSize; +} + +void computeVaryings(){ + vec2 origin = vec2(aTileOrigin . xy)+ vec2(aTileOrigin . z & 15u, aTileOrigin . z >> 4u)* 256.0; + vec2 pixelPosition =(origin + aTessCoord)* uTileSize + uViewBoxOrigin; + vec2 position =(pixelPosition / uFramebufferSize * 2.0 - 1.0)* vec2(1.0, - 1.0); + vec2 maskTexCoordOrigin = computeTileOffset(aTileIndex, uStencilTextureSize . x); + vec2 maskTexCoord = maskTexCoordOrigin + aTessCoord * uTileSize; + + vTexCoord = maskTexCoord / uStencilTextureSize; + vBackdrop = float(aBackdrop); + vColor = getColor(); + gl_Position = vec4(position, 0.0, 1.0); +} + + + + + + + + + + + + + +uniform sampler2D uPaintTexture; +uniform vec2 uPaintTextureSize; + +in vec2 aColorTexCoord; + +vec4 getColor(){ + return texture(uPaintTexture, aColorTexCoord); +} + + +void main(){ + computeVaryings(); +} + diff --git a/resources/shaders/gl3/tile_solid.fs.glsl b/resources/shaders/gl3/tile_solid.fs.glsl new file mode 100644 index 00000000..2079d945 --- /dev/null +++ b/resources/shaders/gl3/tile_solid.fs.glsl @@ -0,0 +1,22 @@ +#version {{version}} + + + + + + + + + + + +precision highp float; + +in vec4 vColor; + +out vec4 oFragColor; + +void main(){ + oFragColor = vColor; +} + diff --git a/resources/shaders/gl3/tile_solid_monochrome.vs.glsl b/resources/shaders/gl3/tile_solid_monochrome.vs.glsl new file mode 100644 index 00000000..d7544c26 --- /dev/null +++ b/resources/shaders/gl3/tile_solid_monochrome.vs.glsl @@ -0,0 +1,69 @@ +#version {{version}} + + + + + + + + + + + +#extension GL_GOOGLE_include_directive : enable + +precision highp float; + + + + + + + + + + + + +uniform vec2 uFramebufferSize; +uniform vec2 uTileSize; +uniform vec2 uViewBoxOrigin; + +in vec2 aTessCoord; +in vec2 aTileOrigin; + +out vec4 vColor; + +vec4 getColor(); + +void computeVaryings(){ + vec2 pixelPosition =(aTileOrigin + aTessCoord)* uTileSize + uViewBoxOrigin; + vec2 position =(pixelPosition / uFramebufferSize * 2.0 - 1.0)* vec2(1.0, - 1.0); + + vColor = getColor(); + + gl_Position = vec4(position, 0.0, 1.0); +} + + + + + + + + + + + + +uniform vec4 uColor; + +vec4 getColor(){ + return uColor; +} + + +void main(){ + computeVaryings(); +} + diff --git a/resources/shaders/gl3/tile_solid_multicolor.vs.glsl b/resources/shaders/gl3/tile_solid_multicolor.vs.glsl new file mode 100644 index 00000000..0e23e0a4 --- /dev/null +++ b/resources/shaders/gl3/tile_solid_multicolor.vs.glsl @@ -0,0 +1,72 @@ +#version {{version}} + + + + + + + + + + + +#extension GL_GOOGLE_include_directive : enable + +precision highp float; + + + + + + + + + + + + +uniform vec2 uFramebufferSize; +uniform vec2 uTileSize; +uniform vec2 uViewBoxOrigin; + +in vec2 aTessCoord; +in vec2 aTileOrigin; + +out vec4 vColor; + +vec4 getColor(); + +void computeVaryings(){ + vec2 pixelPosition =(aTileOrigin + aTessCoord)* uTileSize + uViewBoxOrigin; + vec2 position =(pixelPosition / uFramebufferSize * 2.0 - 1.0)* vec2(1.0, - 1.0); + + vColor = getColor(); + + gl_Position = vec4(position, 0.0, 1.0); +} + + + + + + + + + + + + +uniform sampler2D uPaintTexture; +uniform vec2 uPaintTextureSize; + +in vec2 aColorTexCoord; + +vec4 getColor(){ + return texture(uPaintTexture, aColorTexCoord); +} + + +void main(){ + computeVaryings(); +} + diff --git a/resources/shaders/metal/debug_solid.fs.metal b/resources/shaders/metal/debug_solid.fs.metal new file mode 100644 index 00000000..6fc13e2f --- /dev/null +++ b/resources/shaders/metal/debug_solid.fs.metal @@ -0,0 +1,17 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 oFragColor [[color(0)]]; +}; + +fragment main0_out main0(float4 uColor [[buffer(0)]]) +{ + main0_out out = {}; + out.oFragColor = float4(uColor.xyz, 1.0) * uColor.w; + return out; +} + diff --git a/resources/shaders/metal/debug_solid.vs.metal b/resources/shaders/metal/debug_solid.vs.metal new file mode 100644 index 00000000..bcad2a03 --- /dev/null +++ b/resources/shaders/metal/debug_solid.vs.metal @@ -0,0 +1,23 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 gl_Position [[position]]; +}; + +struct main0_in +{ + float2 aPosition [[attribute(0)]]; +}; + +vertex main0_out main0(main0_in in [[stage_in]], float2 uFramebufferSize [[buffer(0)]], uint gl_VertexID [[vertex_id]], uint gl_InstanceID [[instance_id]]) +{ + main0_out out = {}; + float2 position = ((in.aPosition / uFramebufferSize) * 2.0) - float2(1.0); + out.gl_Position = float4(position.x, -position.y, 0.0, 1.0); + return out; +} + diff --git a/resources/shaders/metal/debug_texture.fs.metal b/resources/shaders/metal/debug_texture.fs.metal new file mode 100644 index 00000000..67bc2370 --- /dev/null +++ b/resources/shaders/metal/debug_texture.fs.metal @@ -0,0 +1,23 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 oFragColor [[color(0)]]; +}; + +struct main0_in +{ + float2 vTexCoord [[user(locn0)]]; +}; + +fragment main0_out main0(main0_in in [[stage_in]], float4 uColor [[buffer(0)]], texture2d uTexture [[texture(0)]], sampler uTextureSmplr [[sampler(0)]]) +{ + main0_out out = {}; + float alpha = uTexture.sample(uTextureSmplr, in.vTexCoord).x * uColor.w; + out.oFragColor = float4(uColor.xyz, 1.0) * alpha; + return out; +} + diff --git a/resources/shaders/metal/debug_texture.vs.metal b/resources/shaders/metal/debug_texture.vs.metal new file mode 100644 index 00000000..25eb20b8 --- /dev/null +++ b/resources/shaders/metal/debug_texture.vs.metal @@ -0,0 +1,26 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float2 vTexCoord [[user(locn0)]]; + float4 gl_Position [[position]]; +}; + +struct main0_in +{ + float2 aPosition [[attribute(0)]]; + float2 aTexCoord [[attribute(1)]]; +}; + +vertex main0_out main0(main0_in in [[stage_in]], float2 uTextureSize [[buffer(0)]], float2 uFramebufferSize [[buffer(1)]], uint gl_VertexID [[vertex_id]], uint gl_InstanceID [[instance_id]]) +{ + main0_out out = {}; + out.vTexCoord = in.aTexCoord / uTextureSize; + float2 position = ((in.aPosition / uFramebufferSize) * 2.0) - float2(1.0); + out.gl_Position = float4(position.x, -position.y, 0.0, 1.0); + return out; +} + diff --git a/resources/shaders/metal/demo_ground.fs.metal b/resources/shaders/metal/demo_ground.fs.metal new file mode 100644 index 00000000..919b2f37 --- /dev/null +++ b/resources/shaders/metal/demo_ground.fs.metal @@ -0,0 +1,24 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 oFragColor [[color(0)]]; +}; + +struct main0_in +{ + float2 vTexCoord [[user(locn0)]]; +}; + +fragment main0_out main0(main0_in in [[stage_in]], float4 uGridlineColor [[buffer(0)]], float4 uGroundColor [[buffer(1)]]) +{ + main0_out out = {}; + float2 texCoordPx = fract(in.vTexCoord) / fwidth(in.vTexCoord); + bool4 _33 = bool4(any(texCoordPx <= float2(1.0))); + out.oFragColor = float4(_33.x ? uGridlineColor.x : uGroundColor.x, _33.y ? uGridlineColor.y : uGroundColor.y, _33.z ? uGridlineColor.z : uGroundColor.z, _33.w ? uGridlineColor.w : uGroundColor.w); + return out; +} + diff --git a/resources/shaders/metal/demo_ground.vs.metal b/resources/shaders/metal/demo_ground.vs.metal new file mode 100644 index 00000000..049083ea --- /dev/null +++ b/resources/shaders/metal/demo_ground.vs.metal @@ -0,0 +1,24 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float2 vTexCoord [[user(locn0)]]; + float4 gl_Position [[position]]; +}; + +struct main0_in +{ + float2 aPosition [[attribute(0)]]; +}; + +vertex main0_out main0(main0_in in [[stage_in]], int uGridlineCount [[buffer(0)]], float4x4 uTransform [[buffer(1)]], uint gl_VertexID [[vertex_id]], uint gl_InstanceID [[instance_id]]) +{ + main0_out out = {}; + out.vTexCoord = in.aPosition * float(uGridlineCount); + out.gl_Position = uTransform * float4(in.aPosition.x, 0.0, in.aPosition.y, 1.0); + return out; +} + diff --git a/resources/shaders/metal/fill.fs.metal b/resources/shaders/metal/fill.fs.metal new file mode 100644 index 00000000..d002bba6 --- /dev/null +++ b/resources/shaders/metal/fill.fs.metal @@ -0,0 +1,35 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 oFragColor [[color(0)]]; +}; + +struct main0_in +{ + float2 vFrom [[user(locn0)]]; + float2 vTo [[user(locn1)]]; +}; + +fragment main0_out main0(main0_in in [[stage_in]], texture2d uAreaLUT [[texture(0)]], sampler uAreaLUTSmplr [[sampler(0)]]) +{ + main0_out out = {}; + float2 from = in.vFrom; + float2 to = in.vTo; + bool2 _29 = bool2(from.x < to.x); + float2 left = float2(_29.x ? from.x : to.x, _29.y ? from.y : to.y); + bool2 _39 = bool2(from.x < to.x); + float2 right = float2(_39.x ? to.x : from.x, _39.y ? to.y : from.y); + float2 window = fast::clamp(float2(from.x, to.x), float2(-0.5), float2(0.5)); + float offset = mix(window.x, window.y, 0.5) - left.x; + float t = offset / (right.x - left.x); + float y = mix(left.y, right.y, t); + float d = (right.y - left.y) / (right.x - left.x); + float dX = window.x - window.y; + out.oFragColor = float4(uAreaLUT.sample(uAreaLUTSmplr, (float2(y + 8.0, abs(d * dX)) / float2(16.0))).x * dX); + return out; +} + diff --git a/resources/shaders/metal/fill.vs.metal b/resources/shaders/metal/fill.vs.metal new file mode 100644 index 00000000..1c545156 --- /dev/null +++ b/resources/shaders/metal/fill.vs.metal @@ -0,0 +1,62 @@ +#pragma clang diagnostic ignored "-Wmissing-prototypes" + +#include +#include + +using namespace metal; + +struct main0_out +{ + float2 vFrom [[user(locn0)]]; + float2 vTo [[user(locn1)]]; + float4 gl_Position [[position]]; +}; + +struct main0_in +{ + float2 aTessCoord [[attribute(0)]]; + uint aFromPx [[attribute(1)]]; + uint aToPx [[attribute(2)]]; + float2 aFromSubpx [[attribute(3)]]; + float2 aToSubpx [[attribute(4)]]; + uint aTileIndex [[attribute(5)]]; +}; + +float2 computeTileOffset(thread const uint& tileIndex, thread const float& stencilTextureWidth, thread float2 uTileSize, thread uint& aTileIndex) +{ + uint tilesPerRow = uint(stencilTextureWidth / uTileSize.x); + uint2 tileOffset = uint2(aTileIndex % tilesPerRow, aTileIndex / tilesPerRow); + return float2(tileOffset) * uTileSize; +} + +vertex main0_out main0(main0_in in [[stage_in]], float2 uTileSize [[buffer(0)]], float2 uFramebufferSize [[buffer(1)]], uint gl_VertexID [[vertex_id]], uint gl_InstanceID [[instance_id]]) +{ + main0_out out = {}; + uint param = in.aTileIndex; + float param_1 = uFramebufferSize.x; + float2 tileOrigin = computeTileOffset(param, param_1, uTileSize, in.aTileIndex); + float2 from = float2(float(in.aFromPx & 15u), float(in.aFromPx >> 4u)) + in.aFromSubpx; + float2 to = float2(float(in.aToPx & 15u), float(in.aToPx >> 4u)) + in.aToSubpx; + float2 position; + if (in.aTessCoord.x < 0.5) + { + position.x = floor(fast::min(from.x, to.x)); + } + else + { + position.x = ceil(fast::max(from.x, to.x)); + } + if (in.aTessCoord.y < 0.5) + { + position.y = floor(fast::min(from.y, to.y)); + } + else + { + position.y = uTileSize.y; + } + out.vFrom = from - position; + out.vTo = to - position; + out.gl_Position = float4((((tileOrigin + position) / uFramebufferSize) * 2.0) - float2(1.0), 0.0, 1.0); + return out; +} + diff --git a/resources/shaders/metal/post.fs.metal b/resources/shaders/metal/post.fs.metal new file mode 100644 index 00000000..66ca87f8 --- /dev/null +++ b/resources/shaders/metal/post.fs.metal @@ -0,0 +1,119 @@ +#pragma clang diagnostic ignored "-Wmissing-prototypes" + +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 oFragColor [[color(0)]]; +}; + +struct main0_in +{ + float2 vTexCoord [[user(locn0)]]; +}; + +float sample1Tap(thread const float& offset, thread texture2d uSource, thread const sampler uSourceSmplr, thread float2& vTexCoord) +{ + return uSource.sample(uSourceSmplr, float2(vTexCoord.x + offset, vTexCoord.y)).x; +} + +void sample9Tap(thread float4& outAlphaLeft, thread float& outAlphaCenter, thread float4& outAlphaRight, thread const float& onePixel, thread float4 uKernel, thread texture2d uSource, thread const sampler uSourceSmplr, thread float2& vTexCoord) +{ + float _89; + if (uKernel.x > 0.0) + { + float param = (-4.0) * onePixel; + _89 = sample1Tap(param, uSource, uSourceSmplr, vTexCoord); + } + else + { + _89 = 0.0; + } + float param_1 = (-3.0) * onePixel; + float param_2 = (-2.0) * onePixel; + float param_3 = (-1.0) * onePixel; + outAlphaLeft = float4(_89, sample1Tap(param_1, uSource, uSourceSmplr, vTexCoord), sample1Tap(param_2, uSource, uSourceSmplr, vTexCoord), sample1Tap(param_3, uSource, uSourceSmplr, vTexCoord)); + float param_4 = 0.0; + outAlphaCenter = sample1Tap(param_4, uSource, uSourceSmplr, vTexCoord); + float param_5 = 1.0 * onePixel; + float _120 = sample1Tap(param_5, uSource, uSourceSmplr, vTexCoord); + float param_6 = 2.0 * onePixel; + float _125 = sample1Tap(param_6, uSource, uSourceSmplr, vTexCoord); + float param_7 = 3.0 * onePixel; + float _130 = sample1Tap(param_7, uSource, uSourceSmplr, vTexCoord); + float _134; + if (uKernel.x > 0.0) + { + float param_8 = 4.0 * onePixel; + _134 = sample1Tap(param_8, uSource, uSourceSmplr, vTexCoord); + } + else + { + _134 = 0.0; + } + outAlphaRight = float4(_120, _125, _130, _134); +} + +float convolve7Tap(thread const float4& alpha0, thread const float3& alpha1, thread float4 uKernel) +{ + return dot(alpha0, uKernel) + dot(alpha1, uKernel.zyx); +} + +float gammaCorrectChannel(thread const float& bgColor, thread const float& fgColor, thread texture2d uGammaLUT, thread const sampler uGammaLUTSmplr) +{ + return uGammaLUT.sample(uGammaLUTSmplr, float2(fgColor, 1.0 - bgColor)).x; +} + +float3 gammaCorrect(thread const float3& bgColor, thread const float3& fgColor, thread texture2d uGammaLUT, thread const sampler uGammaLUTSmplr) +{ + float param = bgColor.x; + float param_1 = fgColor.x; + float param_2 = bgColor.y; + float param_3 = fgColor.y; + float param_4 = bgColor.z; + float param_5 = fgColor.z; + return float3(gammaCorrectChannel(param, param_1, uGammaLUT, uGammaLUTSmplr), gammaCorrectChannel(param_2, param_3, uGammaLUT, uGammaLUTSmplr), gammaCorrectChannel(param_4, param_5, uGammaLUT, uGammaLUTSmplr)); +} + +fragment main0_out main0(main0_in in [[stage_in]], int uGammaCorrectionEnabled [[buffer(2)]], float4 uKernel [[buffer(0)]], float2 uSourceSize [[buffer(1)]], float4 uBGColor [[buffer(3)]], float4 uFGColor [[buffer(4)]], texture2d uGammaLUT [[texture(0)]], texture2d uSource [[texture(0)]], sampler uGammaLUTSmplr [[sampler(0)]], sampler uSourceSmplr [[sampler(0)]]) +{ + main0_out out = {}; + float3 alpha; + if (uKernel.w == 0.0) + { + alpha = uSource.sample(uSourceSmplr, in.vTexCoord).xxx; + } + else + { + float param_3 = 1.0 / uSourceSize.x; + float4 param; + float param_1; + float4 param_2; + sample9Tap(param, param_1, param_2, param_3, uKernel, uSource, uSourceSmplr, in.vTexCoord); + float4 alphaLeft = param; + float alphaCenter = param_1; + float4 alphaRight = param_2; + float4 param_4 = alphaLeft; + float3 param_5 = float3(alphaCenter, alphaRight.xy); + float r = convolve7Tap(param_4, param_5, uKernel); + float4 param_6 = float4(alphaLeft.yzw, alphaCenter); + float3 param_7 = alphaRight.xyz; + float g = convolve7Tap(param_6, param_7, uKernel); + float4 param_8 = float4(alphaLeft.zw, alphaCenter, alphaRight.x); + float3 param_9 = alphaRight.yzw; + float b = convolve7Tap(param_8, param_9, uKernel); + alpha = float3(r, g, b); + } + if (uGammaCorrectionEnabled != 0) + { + float3 param_10 = uBGColor.xyz; + float3 param_11 = alpha; + alpha = gammaCorrect(param_10, param_11, uGammaLUT, uGammaLUTSmplr); + } + out.oFragColor = float4(mix(uBGColor.xyz, uFGColor.xyz, alpha), 1.0); + return out; +} + diff --git a/resources/shaders/metal/post.vs.metal b/resources/shaders/metal/post.vs.metal new file mode 100644 index 00000000..a960ca1b --- /dev/null +++ b/resources/shaders/metal/post.vs.metal @@ -0,0 +1,24 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float2 vTexCoord [[user(locn0)]]; + float4 gl_Position [[position]]; +}; + +struct main0_in +{ + float2 aPosition [[attribute(0)]]; +}; + +vertex main0_out main0(main0_in in [[stage_in]], uint gl_VertexID [[vertex_id]], uint gl_InstanceID [[instance_id]]) +{ + main0_out out = {}; + out.vTexCoord = in.aPosition; + out.gl_Position = float4((in.aPosition * 2.0) - float2(1.0), 0.0, 1.0); + return out; +} + diff --git a/resources/shaders/metal/reproject.fs.metal b/resources/shaders/metal/reproject.fs.metal new file mode 100644 index 00000000..3e2a2039 --- /dev/null +++ b/resources/shaders/metal/reproject.fs.metal @@ -0,0 +1,24 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 oFragColor [[color(0)]]; +}; + +struct main0_in +{ + float2 vTexCoord [[user(locn0)]]; +}; + +fragment main0_out main0(main0_in in [[stage_in]], float4x4 uOldTransform [[buffer(0)]], texture2d uTexture [[texture(0)]], sampler uTextureSmplr [[sampler(0)]]) +{ + main0_out out = {}; + float4 normTexCoord = uOldTransform * float4(in.vTexCoord, 0.0, 1.0); + float2 texCoord = ((normTexCoord.xy / float2(normTexCoord.w)) + float2(1.0)) * 0.5; + out.oFragColor = uTexture.sample(uTextureSmplr, texCoord); + return out; +} + diff --git a/resources/shaders/metal/reproject.vs.metal b/resources/shaders/metal/reproject.vs.metal new file mode 100644 index 00000000..d125c376 --- /dev/null +++ b/resources/shaders/metal/reproject.vs.metal @@ -0,0 +1,24 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float2 vTexCoord [[user(locn0)]]; + float4 gl_Position [[position]]; +}; + +struct main0_in +{ + float2 aPosition [[attribute(0)]]; +}; + +vertex main0_out main0(main0_in in [[stage_in]], float4x4 uNewTransform [[buffer(0)]], uint gl_VertexID [[vertex_id]], uint gl_InstanceID [[instance_id]]) +{ + main0_out out = {}; + out.vTexCoord = in.aPosition; + out.gl_Position = uNewTransform * float4(in.aPosition, 0.0, 1.0); + return out; +} + diff --git a/resources/shaders/metal/stencil.fs.metal b/resources/shaders/metal/stencil.fs.metal new file mode 100644 index 00000000..426311ef --- /dev/null +++ b/resources/shaders/metal/stencil.fs.metal @@ -0,0 +1,17 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 oFragColor [[color(0)]]; +}; + +fragment main0_out main0() +{ + main0_out out = {}; + out.oFragColor = float4(1.0, 0.0, 0.0, 1.0); + return out; +} + diff --git a/resources/shaders/metal/stencil.vs.metal b/resources/shaders/metal/stencil.vs.metal new file mode 100644 index 00000000..2dc23a5d --- /dev/null +++ b/resources/shaders/metal/stencil.vs.metal @@ -0,0 +1,22 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 gl_Position [[position]]; +}; + +struct main0_in +{ + float3 aPosition [[attribute(0)]]; +}; + +vertex main0_out main0(main0_in in [[stage_in]], uint gl_VertexID [[vertex_id]], uint gl_InstanceID [[instance_id]]) +{ + main0_out out = {}; + out.gl_Position = float4(in.aPosition, 1.0); + return out; +} + diff --git a/resources/shaders/metal/tile_alpha.fs.metal b/resources/shaders/metal/tile_alpha.fs.metal new file mode 100644 index 00000000..30afe4cd --- /dev/null +++ b/resources/shaders/metal/tile_alpha.fs.metal @@ -0,0 +1,25 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 oFragColor [[color(0)]]; +}; + +struct main0_in +{ + float2 vTexCoord [[user(locn0)]]; + float vBackdrop [[user(locn1)]]; + float4 vColor [[user(locn2)]]; +}; + +fragment main0_out main0(main0_in in [[stage_in]], texture2d uStencilTexture [[texture(0)]], sampler uStencilTextureSmplr [[sampler(0)]]) +{ + main0_out out = {}; + float coverage = abs(uStencilTexture.sample(uStencilTextureSmplr, in.vTexCoord).x + in.vBackdrop); + out.oFragColor = float4(in.vColor.xyz, in.vColor.w * coverage); + return out; +} + diff --git a/resources/shaders/metal/tile_alpha_monochrome.vs.metal b/resources/shaders/metal/tile_alpha_monochrome.vs.metal new file mode 100644 index 00000000..e92a3af0 --- /dev/null +++ b/resources/shaders/metal/tile_alpha_monochrome.vs.metal @@ -0,0 +1,57 @@ +#pragma clang diagnostic ignored "-Wmissing-prototypes" + +#include +#include + +using namespace metal; + +struct main0_out +{ + float2 vTexCoord [[user(locn0)]]; + float vBackdrop [[user(locn1)]]; + float4 vColor [[user(locn2)]]; + float4 gl_Position [[position]]; +}; + +struct main0_in +{ + float2 aTessCoord [[attribute(0)]]; + uint3 aTileOrigin [[attribute(1)]]; + int aBackdrop [[attribute(2)]]; + uint aTileIndex [[attribute(3)]]; +}; + +float2 computeTileOffset(thread const uint& tileIndex, thread const float& stencilTextureWidth, thread float2 uTileSize) +{ + uint tilesPerRow = uint(stencilTextureWidth / uTileSize.x); + uint2 tileOffset = uint2(tileIndex % tilesPerRow, tileIndex / tilesPerRow); + return float2(tileOffset) * uTileSize; +} + +float4 getColor(thread float4 uColor) +{ + return uColor; +} + +void computeVaryings(thread float2 uTileSize, thread uint3& aTileOrigin, thread float2& aTessCoord, thread float2 uViewBoxOrigin, thread float2 uFramebufferSize, thread uint& aTileIndex, thread float2 uStencilTextureSize, thread float2& vTexCoord, thread float& vBackdrop, thread int& aBackdrop, thread float4& vColor, thread float4& gl_Position, thread float4 uColor) +{ + float2 origin = float2(aTileOrigin.xy) + (float2(float(aTileOrigin.z & 15u), float(aTileOrigin.z >> 4u)) * 256.0); + float2 pixelPosition = ((origin + aTessCoord) * uTileSize) + uViewBoxOrigin; + float2 position = (((pixelPosition / uFramebufferSize) * 2.0) - float2(1.0)) * float2(1.0, -1.0); + uint param = aTileIndex; + float param_1 = uStencilTextureSize.x; + float2 maskTexCoordOrigin = computeTileOffset(param, param_1, uTileSize); + float2 maskTexCoord = maskTexCoordOrigin + (aTessCoord * uTileSize); + vTexCoord = maskTexCoord / uStencilTextureSize; + vBackdrop = float(aBackdrop); + vColor = getColor(uColor); + gl_Position = float4(position, 0.0, 1.0); +} + +vertex main0_out main0(main0_in in [[stage_in]], float2 uTileSize [[buffer(0)]], float2 uViewBoxOrigin [[buffer(1)]], float2 uFramebufferSize [[buffer(2)]], float2 uStencilTextureSize [[buffer(3)]], float4 uColor [[buffer(4)]], uint gl_VertexID [[vertex_id]], uint gl_InstanceID [[instance_id]]) +{ + main0_out out = {}; + computeVaryings(uTileSize, in.aTileOrigin, in.aTessCoord, uViewBoxOrigin, uFramebufferSize, in.aTileIndex, uStencilTextureSize, out.vTexCoord, out.vBackdrop, in.aBackdrop, out.vColor, out.gl_Position, uColor); + return out; +} + diff --git a/resources/shaders/metal/tile_alpha_multicolor.vs.metal b/resources/shaders/metal/tile_alpha_multicolor.vs.metal new file mode 100644 index 00000000..525d7fe3 --- /dev/null +++ b/resources/shaders/metal/tile_alpha_multicolor.vs.metal @@ -0,0 +1,58 @@ +#pragma clang diagnostic ignored "-Wmissing-prototypes" + +#include +#include + +using namespace metal; + +struct main0_out +{ + float2 vTexCoord [[user(locn0)]]; + float vBackdrop [[user(locn1)]]; + float4 vColor [[user(locn2)]]; + float4 gl_Position [[position]]; +}; + +struct main0_in +{ + float2 aTessCoord [[attribute(0)]]; + uint3 aTileOrigin [[attribute(1)]]; + int aBackdrop [[attribute(2)]]; + uint aTileIndex [[attribute(3)]]; + float2 aColorTexCoord [[attribute(4)]]; +}; + +float2 computeTileOffset(thread const uint& tileIndex, thread const float& stencilTextureWidth, thread float2 uTileSize) +{ + uint tilesPerRow = uint(stencilTextureWidth / uTileSize.x); + uint2 tileOffset = uint2(tileIndex % tilesPerRow, tileIndex / tilesPerRow); + return float2(tileOffset) * uTileSize; +} + +float4 getColor(thread texture2d uPaintTexture, thread const sampler uPaintTextureSmplr, thread float2& aColorTexCoord) +{ + return uPaintTexture.sample(uPaintTextureSmplr, aColorTexCoord, level(0.0)); +} + +void computeVaryings(thread float2 uTileSize, thread uint3& aTileOrigin, thread float2& aTessCoord, thread float2 uViewBoxOrigin, thread float2 uFramebufferSize, thread uint& aTileIndex, thread float2 uStencilTextureSize, thread float2& vTexCoord, thread float& vBackdrop, thread int& aBackdrop, thread float4& vColor, thread float4& gl_Position, thread texture2d uPaintTexture, thread const sampler uPaintTextureSmplr, thread float2& aColorTexCoord) +{ + float2 origin = float2(aTileOrigin.xy) + (float2(float(aTileOrigin.z & 15u), float(aTileOrigin.z >> 4u)) * 256.0); + float2 pixelPosition = ((origin + aTessCoord) * uTileSize) + uViewBoxOrigin; + float2 position = (((pixelPosition / uFramebufferSize) * 2.0) - float2(1.0)) * float2(1.0, -1.0); + uint param = aTileIndex; + float param_1 = uStencilTextureSize.x; + float2 maskTexCoordOrigin = computeTileOffset(param, param_1, uTileSize); + float2 maskTexCoord = maskTexCoordOrigin + (aTessCoord * uTileSize); + vTexCoord = maskTexCoord / uStencilTextureSize; + vBackdrop = float(aBackdrop); + vColor = getColor(uPaintTexture, uPaintTextureSmplr, aColorTexCoord); + gl_Position = float4(position, 0.0, 1.0); +} + +vertex main0_out main0(main0_in in [[stage_in]], float2 uTileSize [[buffer(0)]], float2 uViewBoxOrigin [[buffer(1)]], float2 uFramebufferSize [[buffer(2)]], float2 uStencilTextureSize [[buffer(3)]], texture2d uPaintTexture [[texture(0)]], sampler uPaintTextureSmplr [[sampler(0)]], uint gl_VertexID [[vertex_id]], uint gl_InstanceID [[instance_id]]) +{ + main0_out out = {}; + computeVaryings(uTileSize, in.aTileOrigin, in.aTessCoord, uViewBoxOrigin, uFramebufferSize, in.aTileIndex, uStencilTextureSize, out.vTexCoord, out.vBackdrop, in.aBackdrop, out.vColor, out.gl_Position, uPaintTexture, uPaintTextureSmplr, in.aColorTexCoord); + return out; +} + diff --git a/resources/shaders/metal/tile_solid.fs.metal b/resources/shaders/metal/tile_solid.fs.metal new file mode 100644 index 00000000..fed4023d --- /dev/null +++ b/resources/shaders/metal/tile_solid.fs.metal @@ -0,0 +1,22 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 oFragColor [[color(0)]]; +}; + +struct main0_in +{ + float4 vColor [[user(locn0)]]; +}; + +fragment main0_out main0(main0_in in [[stage_in]]) +{ + main0_out out = {}; + out.oFragColor = in.vColor; + return out; +} + diff --git a/resources/shaders/metal/tile_solid_monochrome.vs.metal b/resources/shaders/metal/tile_solid_monochrome.vs.metal new file mode 100644 index 00000000..83410055 --- /dev/null +++ b/resources/shaders/metal/tile_solid_monochrome.vs.metal @@ -0,0 +1,39 @@ +#pragma clang diagnostic ignored "-Wmissing-prototypes" + +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 vColor [[user(locn0)]]; + float4 gl_Position [[position]]; +}; + +struct main0_in +{ + float2 aTessCoord [[attribute(0)]]; + float2 aTileOrigin [[attribute(1)]]; +}; + +float4 getColor(thread float4 uColor) +{ + return uColor; +} + +void computeVaryings(thread float2& aTileOrigin, thread float2& aTessCoord, thread float2 uTileSize, thread float2 uViewBoxOrigin, thread float2 uFramebufferSize, thread float4& vColor, thread float4& gl_Position, thread float4 uColor) +{ + float2 pixelPosition = ((aTileOrigin + aTessCoord) * uTileSize) + uViewBoxOrigin; + float2 position = (((pixelPosition / uFramebufferSize) * 2.0) - float2(1.0)) * float2(1.0, -1.0); + vColor = getColor(uColor); + gl_Position = float4(position, 0.0, 1.0); +} + +vertex main0_out main0(main0_in in [[stage_in]], float2 uTileSize [[buffer(0)]], float2 uViewBoxOrigin [[buffer(1)]], float2 uFramebufferSize [[buffer(2)]], float4 uColor [[buffer(3)]], uint gl_VertexID [[vertex_id]], uint gl_InstanceID [[instance_id]]) +{ + main0_out out = {}; + computeVaryings(in.aTileOrigin, in.aTessCoord, uTileSize, uViewBoxOrigin, uFramebufferSize, out.vColor, out.gl_Position, uColor); + return out; +} + diff --git a/resources/shaders/metal/tile_solid_multicolor.vs.metal b/resources/shaders/metal/tile_solid_multicolor.vs.metal new file mode 100644 index 00000000..3f5d0c45 --- /dev/null +++ b/resources/shaders/metal/tile_solid_multicolor.vs.metal @@ -0,0 +1,40 @@ +#pragma clang diagnostic ignored "-Wmissing-prototypes" + +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 vColor [[user(locn0)]]; + float4 gl_Position [[position]]; +}; + +struct main0_in +{ + float2 aTessCoord [[attribute(0)]]; + float2 aTileOrigin [[attribute(1)]]; + float2 aColorTexCoord [[attribute(2)]]; +}; + +float4 getColor(thread texture2d uPaintTexture, thread const sampler uPaintTextureSmplr, thread float2& aColorTexCoord) +{ + return uPaintTexture.sample(uPaintTextureSmplr, aColorTexCoord, level(0.0)); +} + +void computeVaryings(thread float2& aTileOrigin, thread float2& aTessCoord, thread float2 uTileSize, thread float2 uViewBoxOrigin, thread float2 uFramebufferSize, thread float4& vColor, thread float4& gl_Position, thread texture2d uPaintTexture, thread const sampler uPaintTextureSmplr, thread float2& aColorTexCoord) +{ + float2 pixelPosition = ((aTileOrigin + aTessCoord) * uTileSize) + uViewBoxOrigin; + float2 position = (((pixelPosition / uFramebufferSize) * 2.0) - float2(1.0)) * float2(1.0, -1.0); + vColor = getColor(uPaintTexture, uPaintTextureSmplr, aColorTexCoord); + gl_Position = float4(position, 0.0, 1.0); +} + +vertex main0_out main0(main0_in in [[stage_in]], float2 uTileSize [[buffer(0)]], float2 uViewBoxOrigin [[buffer(1)]], float2 uFramebufferSize [[buffer(2)]], texture2d uPaintTexture [[texture(0)]], sampler uPaintTextureSmplr [[sampler(0)]], uint gl_VertexID [[vertex_id]], uint gl_InstanceID [[instance_id]]) +{ + main0_out out = {}; + computeVaryings(in.aTileOrigin, in.aTessCoord, uTileSize, uViewBoxOrigin, uFramebufferSize, out.vColor, out.gl_Position, uPaintTexture, uPaintTextureSmplr, in.aColorTexCoord); + return out; +} + diff --git a/resources/shaders/spirv/debug_solid.fs.spv b/resources/shaders/spirv/debug_solid.fs.spv new file mode 100644 index 0000000000000000000000000000000000000000..ae1e7b85c0fe2cea57566e63c24cfbb86f9bed24 GIT binary patch literal 644 zcmZ9J%}N775QM+|ne1vbKgJ~LL82ao;6X(Y6%hh=k+2;)lNWd zSa!Oqrn|Z)OLq!LC@9&WiZ&?;P^aeqXnZ#wzP{ZL_Yd}@XpmVbO_Lfq_O)7pd*491o%H=_!dP}jM^tf+_DFHZ%-j`$lYfATSfHC0;y^VH$OR$%g->r%{){dC8b8IDI wx_d+6c{_ejtQW7j&I$J1k3KYuylKa4-U)mXe19EWL-;9~_bTk0gd-Au07NDmivR!s literal 0 HcmV?d00001 diff --git a/resources/shaders/spirv/debug_solid.vs.spv b/resources/shaders/spirv/debug_solid.vs.spv new file mode 100644 index 0000000000000000000000000000000000000000..0c94d0dfa07e41bf550045bc9e8cbd4649547308 GIT binary patch literal 1252 zcmZ9LOKTKS5QV>fN27@`Ch-wtVthw~3l%|p;ovwSi-CaKVbsph(3ymp4u~5CH?I7> zZUi~ib%}a6Gw0N~Ri~$hi!R>OsGpye}tB`B{AKypCcaTTWqm`8U2AHz8Mu$?vEhys4|B zPBm?Yi(qk7OAw|9CSpi64~tl7;LtC#=rb&tOzGk-do zgHGVuy=Y@6oV-e>t#nE3t~k||N5wM7@+X`Fi^Qheunl4Vmq{$P4y=$;xK{brNtprT z#0#HxFT&3pE5H0He%AemxUhQH*&?-C3oU#V@S@>wFI9ip>+5|jk+NcW+ata3MX$F? z$|cu}Tk|=F9E!=)6`z&fj64hLy=s1{an)<62h|V`y9zb0xd-Lbtiqf^54Zk`-|^h? zA^kn~tGuc&tUak-z}l1W6Ed5<`qz=iU&OXgX|)f1fvW%9_jSg19Pqr){D*x-a1Kl( z{-<;2o!2h<&RwuKqIUw{om&FaD)xfJYKwbKW^>qZKbnu~>z(Ociw~Mj*JwvUa|4Y3 l>UVB}aeWG#+ilMyUbB@a<ADVp!(nCcM6(J;qP@&NC1uq&{6E_VXd+D{mx0fJ( zd(OnI4a1zZ&f5Fzz0Rr1jRp!D2HdBMc}fakhN<{(@9geuem&mbeDwICidm`zA=iVm8;)Z}oGz zcX{<AdMz3FqJMZ+D^Iqpc3a@-YeZJo5 zp`87A7iz`UbA2;ve1G|bI_9!hL(MNr>fDRo`j-4ZCxu7nAp8;Q!F-a>X>0Q&*^N|vac%;{EwV>6(U#u1y%GS*Xw-)_9u3J-;v(EWe{_3WUhZ- z-jVm%_jLbhN38l3OFEwIHPq!V`7{Fp<-Axfw*m|Jerr3mb|uxxY5LoEB{_M zCgykF{bcwy^xS*y@SXELqUusjs;H(ht*AUxs;VMsT&ewSY;JAV2g9BE%JauCCKMSF z&ZNfecPweIo%aBztX8@pX-U#kNzWujid2>Ku_7gkkJThftnTY}cCgy-7dwKJSoij^ zSgHw0qwVZqI4ZKO{9DFMxaTG9_Xqhf@7o^4*rDA#3?`~+n)>yky_bC+?e1p9VUJXc zk~-a1Gb=u2#V|Xdcj|EtxzH_D&G_hG@w_(-y+V%rcDk+AZoa>k4~FgDmrRKw(}ly1 z=+o)8%7GheN|c&joo;KRSJrH-NopuIjpnVg#HbHu2l8lh65lw&M~|cRXmJt;{s$#? zKTheg{>RGqQO*rK?h23B(NJWy#Mp~Fl1m)(9>A%+ldAC+?S;sG&nU9of}~l+syUZ_ z3yL-7bBMok%)4VY`P05z$b*^3-sI1^CLs?-I}Z6N$#Nl2J=#&vJosqGSypVjUMk_c zfUg+-@s|Cs`Tl$-(~3=V?#6+S2iLv-oMOwN4Y7ImA@rb*9r20#@@Cly%=bo&88?kr z?#vAEtrIhEJEq?qzcX{g9UdOZKl0w}0so2jrZ4ls_#89><1_e$67!DxbJ+2Zs`ehJ zMQ^@e^nUGrpK;Fuo^+3X*;g!`lZ-?BjUw}(Sm0lD&jOxt&qDpIWE|qZz2{|nZ!#~N z9=j@;m-zY9V{?*m$uXPViM>~1I^OmBpfB^$^qyq#z`5@nJPw>?$>QI==7D)3HB~d+ d>)wYr-mnw>@P>cR_>afz1cv`t6}?nN{{UeyW4izV literal 0 HcmV?d00001 diff --git a/resources/shaders/spirv/demo_ground.fs.spv b/resources/shaders/spirv/demo_ground.fs.spv new file mode 100644 index 0000000000000000000000000000000000000000..8dc291cf6243e259735c00dfc7669a8d0318a52b GIT binary patch literal 908 zcmY+CNlF7z6h%+s-9J1!P{t&YB`T**Mhvze zI{kqH-S(?;66^DF>m&uIzWL>_bJxu8 z^P#wuRp7Zb?04_`gIZiS4zAJym{Ka_X3rmx3X_wf} znz#AiF7`;Q?*bSnevXia_g=JbF}HfJxNe=P-oo-jtHh-jnyt`SyoX~F)2KPMG|vwq ziP!2~=-#FC%zdf(`>Bx{KjFINiDG5mr00EmUESU#yt}?Buv+owM0Sq2vVP9b{vt8W zOXdUS%LlRfu?)tmM*7!WdxdO5|YPEVFimQj}G?VT~{4W6~1pEQm Ce>2qp literal 0 HcmV?d00001 diff --git a/resources/shaders/spirv/demo_ground.vs.spv b/resources/shaders/spirv/demo_ground.vs.spv new file mode 100644 index 0000000000000000000000000000000000000000..0a0926a6f5d4eb63a7dd54289b2eec8f02bc7e27 GIT binary patch literal 1328 zcmY+CU279z5QR^&`);b$)>`|a*4kRXtHBEuK~yAxSm{Ne#oG|f8Wy&@l5C}TW=Htw~QG2f=wbapqx~gqOZM7sVDzWe2@aV8RuO{8+FP_0zQe;Fp z%erX)v80o6Rsb$ou5?|}6G=}cMT*px^syxc#sBexg5`WWPS1K}IhzPh(4wUAu$*UA zR#G@9(Xyn|!7Q8PS&{b2)1s>V8U`Gr#$>qB_dH zr*%#pW7cUt>gCzjem1Yh#phH(k!ix1?-sKh&&I|4OF28KedwL$qk4#gzRisOX+AnA z>N*E~Ndv{EdE2Vh7`^8)TEWZ-AAHC89~Ay+BM)nQ_3i4s#)lqwTyCJqa`90Y9q0Rk zn?A(RL~d|CdccXKRkf|ou3cF6zplt)JCZgOtK(ey?I_lQ&w>B7W8Mt25$8prp^1a( zhi^@>E*r1L@RwXae(HhQ6-NJ6@6Q`0|C;Ax`;OPV-j-smJ0IV+@42Z#jGmi5FYk_? zVBR|#sL3ohtb??vST}7~vKh$V@)&;d!R#GtX1eVdKD$IeJ15R}&*KfgZ}`VM_>X)R z<_7P3ezPMmccmu%!Q2)6Qo(M;zA!ZXR@?6X#_xH_Zvv*~72kR3v#q%Ar-I$_s$@C% z-zu_u<0GFP@cz*MUct2PdVO{P2fe&W{0-->bGTE(xhI)_sE%oW;Cbwd7(4o57tyi literal 0 HcmV?d00001 diff --git a/resources/shaders/spirv/fill.fs.spv b/resources/shaders/spirv/fill.fs.spv new file mode 100644 index 0000000000000000000000000000000000000000..4cb3b288627ff14dc30c22142e38799cca4cf7e0 GIT binary patch literal 2688 zcmZveX>(Ln5Qd-3%_Ko0i)tNTL`u2ng;*vk(o8P68>vX<1hJSNsQl z^KbdZD(mU#u3V_ORZ}zX+sk=RpYA!g=^Pt}5yqKdlfko_4kN&J#^QT+?#kTM`o`ka ziIXquv4bWY_1Vb;qY$543#+#^Y!4q;0Cv%YZ31X$=m3{Spv&kzG2(5&a=&-W9Afj_ zof!~a8Xg2TdfFOxXuH}Azg@uE((*>dJpuGrS8hs}=Q&_=_4Zs_YM8Kv9I1te_`c9Z>`rKa7)0Q>HgBf+_kIfm`(kU3lghY zY~8e5pSIl`_v53jc}&EkEGvO9D898dgE>M`G*%&msKba*&*JPPq!9mZ*YX%P2M;b<&4UwL28b=}7| zxexoyb-s;WB6xL*t)*RgkZpXI{_1W&g%8p2J%pe6JYyd@^NFpsPwBfkfYXJ0fq$Jo zMK|`PHXk+oONVaevhVHds4uKIxi@=2f6sMaoc)&1{@icd=Kuu%H{IxqgBd4Z>pqgX z3m?in^K_%19*eW~yx}j#Vn5D~ys`SL+1kpNW@p3mXzOvNsvKwHe!2IY-io<{-|0q~(N<)^V;? zNAu}F@EP29+DpSnL-KzN!I#hc5S^E!f41uW2}GQH#a$UvTQ5ub^0_vowx2@qRom+j zaq?B$8xU)1v$p={$yMIZhxFtZ5PbQ3Iix4Qg5YcIuOZ^(UB~}YIcx9zv7C2Doy7{o z|M73x1FI06_euHu0HL?=j}UqP$e1+@;>w4(O$Fb3z%zYFYYJbck*Ms z{4e+!!dKgMx^b8GQ@^&$x%Rs6QhB$PKHrtxcj>zW;U_=Oc;ve4`_O$K>*YPI?LS61 H%?SSkKmwEa literal 0 HcmV?d00001 diff --git a/resources/shaders/spirv/fill.vs.spv b/resources/shaders/spirv/fill.vs.spv new file mode 100644 index 0000000000000000000000000000000000000000..1ae09e95694f83f3ec9e21e5ea9bf0c9d9adc656 GIT binary patch literal 3908 zcmZvf>2nli5XPVE?(Bjfh+H0sARbt16y;Ln5+nps0$IU3F3D_I-DKh(5b**L1P{D# z{XhKd7yl%WDlO~R(=9`ase;VY{k+{h-Tl7(Zn?CsCJm^jdHO~9vqU8gNLrw({T(_u zdT_AYn;6`<=^+@4R5l`<#k#@XE0U%ft!cn&Nt-3@mh_~grzMR@dP~xKl0KC5lcb*| zl~qm_x2>GXK3T~B9w{Z4wUHPJg^d?JS59Z5S!vQs8oDyff$(bnnI?XGfO?lkws zw>99oGyFdgyiRM93?!;)5PSPNjj8l_zu8PXZq~l>K}j=>PGidaRJ36Z-Xy8n$xs`g zTsHP~vZ;|-^G99{kM@tx%)%*aFEL~}pPV=9*+`y?#PZ*$XU>L`SUno`wA6^*+SnhCmuf;(hO}58|r}H(#B78o7>64z5RFb{fgkxw0p_NW7x-2k7wgZU0HeGg`DfY}4!uupD_n7sie z-u+4}Upx!!|0^=|$cj9CBFkeb+uDeOoS}>FBwygFq@^kuZ>{abJoe?Pm~M^xU89O> zlKo@N3Y9faGCjKau0ys`6`?sNak9K&Dk@8RPX zj~^fCZ*}{~!MAySh!^|d$SwN&onQ1%y?KI9y~%OJv(?VKEBJA*E%tUfH|&Aw57vi0 z`XexU`lE>H4>0x)`#ax@fBx3<@OCa!NzWGIXcg9-_8y2h!1Nh?K^$QE3{0)gd9CQt zRjTL%$Jku$Js2Ex#CE~gv;VOPW{+Z%-nnSJ{9A|}d?}Cp|8My$$GhU&zA$`dXW*}$ zkH7ETHgSM|blcd)KbRhmT!QIw@Ma~}BYYnZG5)EN?FH7-2b|yZCYZmR&w=Sz&ga1J zIiHJ|^QMS7N5R{@j~SZu-VT+`Hh8xZ>*pOZKK6QRXGC6#FgCAAZYP!+pZyqB$ zIK+=U{B801`@5Zvtd+^=-x>Gun9E}g!<2si&DU(Ve8_q{*6c7J%<{xy*(sTwT%Pay zC%o^^I%kh$Jmkbm?vRDweSSxXScfE&6=U6R=jW9*!@eeBJs_Ek{TQ)6#hs!M>p?p| zWpaG8Kc4YD7_lCbjE9_9sVg#S#eO{E_n2a>MqU1^65EqUC6lpN|4>=adEfo5is_Cq zo4p5l$2L9og7;O?_KPkL&P$TTROGxYnS7z$;G|c)@9&aqJ^F>JT3?O1jvj*-c3+jO zXR*t7gW>+AlEu${A?Dy8zecR%lF5TJagA8HS0RsBn;y@4?s$^vBi2dRksEkn_r#o7 z!ElSQl5_af>@}|$=NWb9+h2Ei)U55YsF_`UB&!)Z?mj2IX1qr%ndhNsdqy&OaNh7d z6geHq<;{~ zuaEuwiDVq)!THqB+lwCKWyyHRFT3n>dza0qIP1QYY(_Ds;`_dmjEnBD66>vRB$M-m z>|2*Hk499pIrg1oTy)Gj>{172-48xbnVEby82&#R&{hrDOym6Gw-FC_xh*Q&%;C2X z@9Z0X1JMVI3$u;iJ~6AfGw~ZIW)*v5iLZ;kS>b(CJabms9Z;4-*4*UlkWcx{yV>Q$ zk54c);68S{&%?mnGvQqF*|XL;$b-W@oEaK;ov*pzYwq;BI&x~pJ&-dHTj+>`Z$*X; h^mqIBGc(BNJuX8J=3L@VdfxluUgseHS0%&L<3E+GK#TwY literal 0 HcmV?d00001 diff --git a/resources/shaders/spirv/post.fs.spv b/resources/shaders/spirv/post.fs.spv new file mode 100644 index 0000000000000000000000000000000000000000..b6d2fec3f1e906d766194ec03a93915a9384efaf GIT binary patch literal 6864 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 literal 0 HcmV?d00001 diff --git a/resources/shaders/spirv/post.vs.spv b/resources/shaders/spirv/post.vs.spv new file mode 100644 index 0000000000000000000000000000000000000000..6d35fb90ef6c4475e3c3396c437bdf31e41ca863 GIT binary patch literal 1080 zcmY+C&1(};6vcnZ%p}!nYt^=X)Y@8I3B`qqAb!z6taK5nxDCM$VIU@w1Szfr_x`0gL*eJ=iYPgJ@34iwGX<`qRR>osAGdREnt;SeETP-Cx?sW+2P|Sk7TTo1yRmA z7vnz%K98!Y;6n7mHQ)fa4`gJtfp;w^$p7OP6w&kbLwSBQo6XOVQ?Lq*2D3%AtY!`_ z=&%8dC&NKG|5(nK<+=MhDQ{S7Iy!WNug=I<)8%RPt*m?MnwrLw;nAe}(yJEB(ezVE zK^EE#b$EvHWLPge?u8D|G@cBPr*+S959pJ}Id-G7#-5?UZz)2LVcuwRwcp;v-<;ay z>2{widd;~K~-st)$;G{7AXm5L|2T<7L7fh`iC{e1me;I-nb8 cyqmbz^uf7rD8h&ROA(@~Ep_)m0 zln~!w=j(wR7lC{6TLeD}6cluU_Z_Gx&*&>g7y}OKX0W|?vR2p4u65+k1IL^DyW7pq z!Qtn+83bQNk8eZbii!o`=*;;leAMrnoiA(ke%)BJ;-NLS_fC$En?3uiQ%0ZbajXCM z<`DKy!~5QE7+X_pCe{-VpBFD@y=l6U#d4%V{GX*@1Xu#*DCt39vt6Q$4CVahDLI$_ z+x_vZE&q}-u-Un+H<9&x1M5wuS9$ef@2LM(%IJM5&$oCw@b@>KpU?iDpP}SxdUvT8 zUyFA??PoUao!WZ0PwPj$yQx*9AF&xbX$y>TKmF@(c(r(uf(H;f{jH`*&U#|s!1bIe zaxgoWJ^s+8O0DziJhooEtFtA3mDyi_$X9FzQ<>j~m|D1;oU7$#lGF1Ry{I>vTKCM` zjDJ(b-W)_9HLoeclbk*EawUCk(hCoZ$;rFy^Oh>IzmZzs#PjW}$!}4`dFRvl^ZS{c zGi+V=THQ+e)a#Gb-O71)?^kknAb8(d|7Iv>f8XU%zDb*5KXd++_kWxkdCxl!a)0UY Hf)4)xUq?Rb literal 0 HcmV?d00001 diff --git a/resources/shaders/spirv/reproject.vs.spv b/resources/shaders/spirv/reproject.vs.spv new file mode 100644 index 0000000000000000000000000000000000000000..9b39096ee1e45cf70d82df2665effa6796fd5f90 GIT binary patch literal 1144 zcmZ9KU279z5QU#)cav(hwQ4`qT3f5$2*nE(K~$uLS}9U#@iqjzhJ`edBx>=>zu>?1 zMv!OrT}0<*_spD`IWzNS?d>kK=rYFxYFnaB3z(-9-~Gem!=35ubm#GtM=}=3f+%N^ zi}9ZWXZ>msSquFuwy{vQUn3@K|-tMsayjM+U{n5vg zf-JOa_FMzLyeq$*O!}kgr}5-0>2tQhuvZH?*bA<+4u-vhQC;g`57;M<`8J|rjh(H* zZzw{ireAA(^&Py>U!R)gd4+wl$kk^bwKjDdd^gn;tJ&Nl@zpEt#J$>4XDhBn{I8Hj zY!g@|r<=I;+azZ$>Cpc?VehXtQIpuWs3v<{Pd(IN5Aky9xkkedN5Rhq_`oKT_~QGp{+k!u;s6VxwDv6yExhKt+JxS31Tvrlyc5Ymy=CbTOJAf<%ieNX u@;*^)Rr}AgdtWR42IQK11~H~v8UI0&zxmj)eHT0l_#()|=KgVf;{EttH~45PYywC@Nwgru3mw=xYdd2@C61l6@#X`Dgng zlrwj>;=JU}nKLuzo}10m*CiyB3^*djE-4AHL1Dks^UL$`y8AwUcl=h2EixmDv&{oL z=fICe-70wmJO&Pdmq12F3Y;Yn$p7O83O0acGry=-SJkSkZZ)HDT%p>{y6)OG#4GXSe8-gvGTlfFZ89y(vxk>9JIq1uR?P1i0Rr=IJLbsz26@*SF~ z9m=r zC;6d}hCig{?+0?zF!cT3?8S8_c^#w2_8im99@}?JZ+Ss!`kr~e_^Rt3p9yw{=l*TT Pn~!9ci~pB|6B6zKMX@=L literal 0 HcmV?d00001 diff --git a/resources/shaders/spirv/tile_alpha.fs.spv b/resources/shaders/spirv/tile_alpha.fs.spv new file mode 100644 index 0000000000000000000000000000000000000000..006cb101c9179314bb137408f2377daa8ff4a5dd GIT binary patch literal 1140 zcmZ9K-Afc<6vltMGqby9X=Z9>ADVp|(nUoO1tlbeP@&NEvO9=mPHgMqZ5RE|-30MF z^Nwu2Fw8vXJaf)-p7&(!%`UX)(&GvBS)fe|n57f%-M#(2?H}Xe_Os_tWz3NUQO-Ow zU)Z*qk2E;AMRAg)u`^Pu1UhX-r!uFo#JFi$ztY^>Zy#2(^zDPUX8{tMBTPC9etjCkng?NmuGQ$kSxAmt_ zgV)Ho0Kr=)XEu?Hy-HXgJuBqQrF!a-KcBQ4moIik>&w5A_}=vrIaiZb&sM@qf$DlI z>0k9*Ppn7Qv)_%_1){Ebv7WhE<{K~VYhJ8}jUIinw*035X2LHhVlK6Mhk!tC! zyXgBhd3baQ!XL37ETs9rP=tm>2#)d3v6ZkKcUd3*tM96w^Jn5*PrTKr-wDoInnQi& z-;jkKVtRpmLj~poA`RrXt@UwZ}9yz_phYw0R+c*Gt)yj m-}@%^D8=mA#2%-Z8a~kt&07%v%QtU*XY*do{h`H6TKom8$2h$J literal 0 HcmV?d00001 diff --git a/resources/shaders/spirv/tile_alpha_monochrome.vs.spv b/resources/shaders/spirv/tile_alpha_monochrome.vs.spv new file mode 100644 index 0000000000000000000000000000000000000000..782bc4f9579eed7822025c38862b31919b4defd8 GIT binary patch literal 3876 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 literal 0 HcmV?d00001 diff --git a/resources/shaders/spirv/tile_solid.fs.spv b/resources/shaders/spirv/tile_solid.fs.spv new file mode 100644 index 0000000000000000000000000000000000000000..cce9973509dfa21e87490918d21e784113db7874 GIT binary patch literal 376 zcmY+ATMI!!6otRJIqsJfZzAvVfRuPql)U)`N=e}q^4q;A?R`cvHO;KO*4}H)INMLa zkdUWBwi;LrP$H-2db`^W?vKM@G#-kgic_IzY9x5jec7L`LKL(Y>Nu_E0f)l^8v_CV zrw;_}NmsZ1ahaaeTc#-i&xqG})pW9miiQ8;CRXS7)Cs+}aO8k4(8iO1V#(XZ$6RQA s7O`ZP*9l)le&)vu7Eh^72e#xTY30Ue7e@dJ6wOVzPzZn zm#sQ>P4JR z7MIbLD>t>1P_N9&Sw%2cUxy{l<6bB?XNy?J8Ha$&IYv)o88)goiBpSluF=!5Sgg!u z)po->DQOqpllWWkJwGJ26~nI&XM6s+eg84FUY9YwpTK=ojdsE>yU(75%D1tz(ZlDa z7TgyDn3Tn4sJ22?hds{K_c)7O+P<%W@tKpwbS&^@G*8R{OEW?~TsHqb5AuK2*=XO*-fa`!>0zNA0?Jo^Ny4 zO@F|6^O(A}&sn<>&Dl<dD|iPai;;WBb7(oEOot>5B#VRJ^>e_x z?HDg}#)O#z82$ow>L zy2011;_GwXaLj(U{eRL7#uqH|4_qJnP!EhR(j36}0(?Wc&69bv(DaYG=AT>2EO+1i z^RGI(sm}g4c&hykUZ5Vn;B9MT-XHKC_t8;*uM>XH-|jzrPRAwV5Ko-<-5)QV^MTDs z7Ehdy+%svPQ1HV3_} zt={IN!Du!c%&S*L7!>&=40iJ}jH>))fVa}%<&#md*liLrrT>YasjH5p(R6RNsKU;$ ze3ehe^N-0bQ>G)5#-Uo97Sj@ArjCwDn&rz-^r!Q@%BK_pms*C~c@ehCe4J0rMs36G zFrTkYr{!+VJ1uDe?|J@H@HgMVwv&e+A5NEk-R{3jtb;I??|X0`m&3jA!{Wt@Q2H}g z8-09f*@8P_2;*YV59LlMtFWZ5j@vo-;`1GKjnAyio=>XycJwiiaWPmc^4WSmuZELR zP^QFY$06oj^6L-tNwpo8)uN0wGTWi$wjGxH{pjlP|M~lU$xI95Vo)c)v2O39jd3y9 znAGt%)+P0nTK~@rh1QtfgE{!=d(#hozu{*F_^A;-xap_w&G*1fKfRCsC(5js95lp< zwt8RcJfn@6@Yt4~61yAopr5>3`%=TrxcD!64DzPW%{u5Wn7zXfZr*3#h@H8g{({+y z6KY!?7i}Bs-kegR6-gH)omQ$tl40J5cUUqTzSrGHEfLi+Jda?{pLMEd}3kUB2mmegO>&Kxy+X6Udkl6P z4)#CXcFA|1J?^{hvg;JB{_3_5CFA0YIe#LV9bJ c+1-OYANc $@ + +$(TARGET_DIR)/spirv/%.vs.spv: %.vs.glsl $(INCLUDES) + mkdir -p $(TARGET_DIR)/spirv && glslangValidator $(GLSLANGFLAGS) -G$(GLSL_VERSION) -S vert -o $@ $< + +$(TARGET_DIR)/gl3/%.vs.glsl: %.vs.glsl $(INCLUDES) + mkdir -p $(TARGET_DIR)/gl3 && glslangValidator $(GLSLANGFLAGS) -S vert -E $< | sed $(SED_ARGS) > $@ + +$(TARGET_DIR)/metal/%.metal: $(TARGET_DIR)/spirv/%.spv + mkdir -p $(TARGET_DIR)/metal && spirv-cross $(SPIRVCROSSFLAGS) --output $@ $< diff --git a/resources/shaders/debug_solid.fs.glsl b/shaders/debug_solid.fs.glsl similarity index 88% rename from resources/shaders/debug_solid.fs.glsl rename to shaders/debug_solid.fs.glsl index a50236a7..e8c09515 100644 --- a/resources/shaders/debug_solid.fs.glsl +++ b/shaders/debug_solid.fs.glsl @@ -1,6 +1,6 @@ -#version {{version}} +#version 330 -// pathfinder/demo/shaders/debug_solid.fs.glsl +// pathfinder/shaders/debug_solid.fs.glsl // // Copyright © 2019 The Pathfinder Project Developers. // diff --git a/resources/shaders/debug_solid.vs.glsl b/shaders/debug_solid.vs.glsl similarity index 89% rename from resources/shaders/debug_solid.vs.glsl rename to shaders/debug_solid.vs.glsl index 47b1f0bb..10b92ad8 100644 --- a/resources/shaders/debug_solid.vs.glsl +++ b/shaders/debug_solid.vs.glsl @@ -1,6 +1,6 @@ -#version {{version}} +#version 330 -// pathfinder/demo/shaders/debug_solid.vs.glsl +// pathfinder/shaders/debug_solid.vs.glsl // // Copyright © 2019 The Pathfinder Project Developers. // diff --git a/resources/shaders/debug_texture.fs.glsl b/shaders/debug_texture.fs.glsl similarity index 88% rename from resources/shaders/debug_texture.fs.glsl rename to shaders/debug_texture.fs.glsl index 2065c2a6..b157011f 100644 --- a/resources/shaders/debug_texture.fs.glsl +++ b/shaders/debug_texture.fs.glsl @@ -1,6 +1,6 @@ -#version {{version}} +#version 330 -// pathfinder/resources/shaders/debug_texture.fs.glsl +// pathfinder/shaders/debug_texture.fs.glsl // // Copyright © 2019 The Pathfinder Project Developers. // diff --git a/resources/shaders/debug_texture.vs.glsl b/shaders/debug_texture.vs.glsl similarity index 90% rename from resources/shaders/debug_texture.vs.glsl rename to shaders/debug_texture.vs.glsl index beed30cf..734916f1 100644 --- a/resources/shaders/debug_texture.vs.glsl +++ b/shaders/debug_texture.vs.glsl @@ -1,6 +1,6 @@ -#version {{version}} +#version 330 -// pathfinder/demo/shaders/debug_texture.vs.glsl +// pathfinder/shaders/debug_texture.vs.glsl // // Copyright © 2019 The Pathfinder Project Developers. // diff --git a/resources/shaders/demo_ground.fs.glsl b/shaders/demo_ground.fs.glsl similarity index 89% rename from resources/shaders/demo_ground.fs.glsl rename to shaders/demo_ground.fs.glsl index a34a29d5..983511d5 100644 --- a/resources/shaders/demo_ground.fs.glsl +++ b/shaders/demo_ground.fs.glsl @@ -1,6 +1,6 @@ -#version {{version}} +#version 330 -// pathfinder/demo/resources/shaders/demo_ground.fs.glsl +// pathfinder/resources/shaders/demo_ground.fs.glsl // // Copyright © 2019 The Pathfinder Project Developers. // diff --git a/resources/shaders/demo_ground.vs.glsl b/shaders/demo_ground.vs.glsl similarity index 88% rename from resources/shaders/demo_ground.vs.glsl rename to shaders/demo_ground.vs.glsl index 15287408..b145ce04 100644 --- a/resources/shaders/demo_ground.vs.glsl +++ b/shaders/demo_ground.vs.glsl @@ -1,6 +1,6 @@ -#version {{version}} +#version 330 -// pathfinder/demo/resources/shaders/demo_ground.vs.glsl +// pathfinder/resources/shaders/demo_ground.vs.glsl // // Copyright © 2019 The Pathfinder Project Developers. // diff --git a/resources/shaders/fill.fs.glsl b/shaders/fill.fs.glsl similarity index 91% rename from resources/shaders/fill.fs.glsl rename to shaders/fill.fs.glsl index 1874a60c..25872515 100644 --- a/resources/shaders/fill.fs.glsl +++ b/shaders/fill.fs.glsl @@ -1,8 +1,8 @@ -#version {{version}} +#version 330 -// pathfinder/demo2/stencil.fs.glsl +// pathfinder/shaders/stencil.fs.glsl // -// Copyright © 2018 The Pathfinder Project Developers. +// Copyright © 2019 The Pathfinder Project Developers. // // Licensed under the Apache License, Version 2.0 or the MIT license diff --git a/resources/shaders/fill.vs.glsl b/shaders/fill.vs.glsl similarity index 96% rename from resources/shaders/fill.vs.glsl rename to shaders/fill.vs.glsl index c8a2aacb..f5abbf7e 100644 --- a/resources/shaders/fill.vs.glsl +++ b/shaders/fill.vs.glsl @@ -1,6 +1,6 @@ -#version {{version}} +#version 330 -// pathfinder/demo/fill.vs.glsl +// pathfinder/resources/fill.vs.glsl // // Copyright © 2019 The Pathfinder Project Developers. // diff --git a/resources/shaders/post.fs.glsl b/shaders/post.fs.glsl similarity index 90% rename from resources/shaders/post.fs.glsl rename to shaders/post.fs.glsl index cb7326a6..62d40494 100644 --- a/resources/shaders/post.fs.glsl +++ b/shaders/post.fs.glsl @@ -1,6 +1,6 @@ -#version {{version}} +#version 330 -// pathfinder/resources/shaders/post.fs.glsl +// pathfinder/shaders/post.fs.glsl // // Copyright © 2019 The Pathfinder Project Developers. // @@ -13,6 +13,8 @@ // TODO(pcwalton): This could be significantly optimized by operating on a // sparse per-tile basis. +#extension GL_GOOGLE_include_directive : enable + precision highp float; uniform sampler2D uSource; @@ -25,8 +27,8 @@ in vec2 vTexCoord; out vec4 oFragColor; -{{include_post_gamma_correct}} -{{include_post_convolve}} +#include "post_gamma_correct.inc.glsl" +#include "post_convolve.inc.glsl" // Convolve horizontally in this pass. float sample1Tap(float offset) { diff --git a/resources/shaders/post.vs.glsl b/shaders/post.vs.glsl similarity index 88% rename from resources/shaders/post.vs.glsl rename to shaders/post.vs.glsl index 44b692ae..2ee824a7 100644 --- a/resources/shaders/post.vs.glsl +++ b/shaders/post.vs.glsl @@ -1,6 +1,6 @@ -#version {{version}} +#version 330 -// pathfinder/resources/shaders/post.vs.glsl +// pathfinder/shaders/post.vs.glsl // // Copyright © 2019 The Pathfinder Project Developers. // diff --git a/resources/shaders/post_convolve.inc.glsl b/shaders/post_convolve.inc.glsl similarity index 96% rename from resources/shaders/post_convolve.inc.glsl rename to shaders/post_convolve.inc.glsl index 8eab750b..1bf3e2ce 100644 --- a/resources/shaders/post_convolve.inc.glsl +++ b/shaders/post_convolve.inc.glsl @@ -1,4 +1,4 @@ -// pathfinder/resources/shaders/post_convolve.inc.glsl +// pathfinder/shaders/post_convolve.inc.glsl // // Copyright © 2019 The Pathfinder Project Developers. // diff --git a/resources/shaders/post_gamma_correct.inc.glsl b/shaders/post_gamma_correct.inc.glsl similarity index 93% rename from resources/shaders/post_gamma_correct.inc.glsl rename to shaders/post_gamma_correct.inc.glsl index 85c3d803..11f47d2a 100644 --- a/resources/shaders/post_gamma_correct.inc.glsl +++ b/shaders/post_gamma_correct.inc.glsl @@ -1,4 +1,4 @@ -// pathfinder/resources/shaders/post_gamma_correct.inc.glsl +// pathfinder/shaders/post_gamma_correct.inc.glsl // // Copyright © 2019 The Pathfinder Project Developers. // diff --git a/resources/shaders/reproject.fs.glsl b/shaders/reproject.fs.glsl similarity index 90% rename from resources/shaders/reproject.fs.glsl rename to shaders/reproject.fs.glsl index a1849a98..6b499664 100644 --- a/resources/shaders/reproject.fs.glsl +++ b/shaders/reproject.fs.glsl @@ -1,6 +1,6 @@ -#version {{version}} +#version 330 -// pathfinder/resources/shaders/reproject.fs.glsl +// pathfinder/shaders/reproject.fs.glsl // // Copyright © 2019 The Pathfinder Project Developers. // diff --git a/resources/shaders/reproject.vs.glsl b/shaders/reproject.vs.glsl similarity index 88% rename from resources/shaders/reproject.vs.glsl rename to shaders/reproject.vs.glsl index d297058d..91d9f9a9 100644 --- a/resources/shaders/reproject.vs.glsl +++ b/shaders/reproject.vs.glsl @@ -1,6 +1,6 @@ -#version {{version}} +#version 330 -// pathfinder/resources/shaders/reproject.vs.glsl +// pathfinder/shaders/reproject.vs.glsl // // Copyright © 2019 The Pathfinder Project Developers. // diff --git a/resources/shaders/stencil.fs.glsl b/shaders/stencil.fs.glsl similarity index 88% rename from resources/shaders/stencil.fs.glsl rename to shaders/stencil.fs.glsl index 8781cbaa..67a83918 100644 --- a/resources/shaders/stencil.fs.glsl +++ b/shaders/stencil.fs.glsl @@ -1,6 +1,6 @@ -#version {{version}} +#version 330 -// pathfinder/resources/shaders/stencil.fs.glsl +// pathfinder/shaders/stencil.fs.glsl // // Copyright © 2018 The Pathfinder Project Developers. // diff --git a/resources/shaders/stencil.vs.glsl b/shaders/stencil.vs.glsl similarity index 76% rename from resources/shaders/stencil.vs.glsl rename to shaders/stencil.vs.glsl index 1fcdc3b3..77346aa9 100644 --- a/resources/shaders/stencil.vs.glsl +++ b/shaders/stencil.vs.glsl @@ -1,8 +1,8 @@ -#version {{version}} +#version 330 -// pathfinder/resources/shaders/stencil.vs.glsl +// pathfinder/shaders/stencil.vs.glsl // -// Copyright © 2018 The Pathfinder Project Developers. +// Copyright © 2019 The Pathfinder Project Developers. // // Licensed under the Apache License, Version 2.0 or the MIT license diff --git a/resources/shaders/tile_alpha.fs.glsl b/shaders/tile_alpha.fs.glsl similarity index 89% rename from resources/shaders/tile_alpha.fs.glsl rename to shaders/tile_alpha.fs.glsl index 0a24afd6..b7dc5df9 100644 --- a/resources/shaders/tile_alpha.fs.glsl +++ b/shaders/tile_alpha.fs.glsl @@ -1,6 +1,6 @@ -#version {{version}} +#version 330 -// pathfinder/demo/resources/shaders/mask_tile.fs.glsl +// pathfinder/shaders/tile_alpha.fs.glsl // // Copyright © 2018 The Pathfinder Project Developers. // diff --git a/resources/shaders/tile_alpha_monochrome.vs.glsl b/shaders/tile_alpha_monochrome.vs.glsl similarity index 69% rename from resources/shaders/tile_alpha_monochrome.vs.glsl rename to shaders/tile_alpha_monochrome.vs.glsl index ac6cf195..856b4f1f 100644 --- a/resources/shaders/tile_alpha_monochrome.vs.glsl +++ b/shaders/tile_alpha_monochrome.vs.glsl @@ -1,6 +1,6 @@ -#version {{version}} +#version 330 -// pathfinder/resources/shaders/tile_alpha_monochrome.vs.glsl +// pathfinder/shaders/tile_alpha_monochrome.vs.glsl // // Copyright © 2019 The Pathfinder Project Developers. // @@ -10,10 +10,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#extension GL_GOOGLE_include_directive : enable + precision highp float; -{{include_tile_alpha_vertex}} -{{include_tile_monochrome}} +#include "tile_alpha_vertex.inc.glsl" +#include "tile_monochrome.inc.glsl" void main() { computeVaryings(); diff --git a/resources/shaders/tile_alpha_multicolor.vs.glsl b/shaders/tile_alpha_multicolor.vs.glsl similarity index 69% rename from resources/shaders/tile_alpha_multicolor.vs.glsl rename to shaders/tile_alpha_multicolor.vs.glsl index b74c57fb..823016dd 100644 --- a/resources/shaders/tile_alpha_multicolor.vs.glsl +++ b/shaders/tile_alpha_multicolor.vs.glsl @@ -1,6 +1,6 @@ -#version {{version}} +#version 330 -// pathfinder/resources/shaders/tile_alpha_multicolor.vs.glsl +// pathfinder/shaders/tile_alpha_multicolor.vs.glsl // // Copyright © 2019 The Pathfinder Project Developers. // @@ -10,10 +10,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#extension GL_GOOGLE_include_directive : enable + precision highp float; -{{include_tile_alpha_vertex}} -{{include_tile_multicolor}} +#include "tile_alpha_vertex.inc.glsl" +#include "tile_multicolor.inc.glsl" void main() { computeVaryings(); diff --git a/resources/shaders/tile_alpha_vertex.inc.glsl b/shaders/tile_alpha_vertex.inc.glsl similarity index 96% rename from resources/shaders/tile_alpha_vertex.inc.glsl rename to shaders/tile_alpha_vertex.inc.glsl index 426b2731..6993a13d 100644 --- a/resources/shaders/tile_alpha_vertex.inc.glsl +++ b/shaders/tile_alpha_vertex.inc.glsl @@ -1,4 +1,4 @@ -// pathfinder/resources/shaders/tile_alpha_vertex.inc.glsl +// pathfinder/shaders/tile_alpha_vertex.inc.glsl // // Copyright © 2019 The Pathfinder Project Developers. // diff --git a/resources/shaders/tile_monochrome.inc.glsl b/shaders/tile_monochrome.inc.glsl similarity index 88% rename from resources/shaders/tile_monochrome.inc.glsl rename to shaders/tile_monochrome.inc.glsl index 7b10b25b..3e27f749 100644 --- a/resources/shaders/tile_monochrome.inc.glsl +++ b/shaders/tile_monochrome.inc.glsl @@ -1,4 +1,4 @@ -// pathfinder/resources/shaders/tile_monochrome.inc.glsl +// pathfinder/shaders/tile_monochrome.inc.glsl // // Copyright © 2019 The Pathfinder Project Developers. // diff --git a/resources/shaders/tile_multicolor.inc.glsl b/shaders/tile_multicolor.inc.glsl similarity index 90% rename from resources/shaders/tile_multicolor.inc.glsl rename to shaders/tile_multicolor.inc.glsl index a374bbee..4520625b 100644 --- a/resources/shaders/tile_multicolor.inc.glsl +++ b/shaders/tile_multicolor.inc.glsl @@ -1,4 +1,4 @@ -// pathfinder/resources/shaders/tile_multicolor.inc.glsl +// pathfinder/shaders/tile_multicolor.inc.glsl // // Copyright © 2019 The Pathfinder Project Developers. // diff --git a/resources/shaders/tile_solid.fs.glsl b/shaders/tile_solid.fs.glsl similarity index 78% rename from resources/shaders/tile_solid.fs.glsl rename to shaders/tile_solid.fs.glsl index 129c6813..eed63042 100644 --- a/resources/shaders/tile_solid.fs.glsl +++ b/shaders/tile_solid.fs.glsl @@ -1,8 +1,8 @@ -#version {{version}} +#version 330 -// pathfinder/demo2/opaque.fs.glsl +// pathfinder/shaders/tile_solid.fs.glsl // -// Copyright © 2018 The Pathfinder Project Developers. +// Copyright © 2019 The Pathfinder Project Developers. // // Licensed under the Apache License, Version 2.0 or the MIT license diff --git a/resources/shaders/tile_solid_monochrome.vs.glsl b/shaders/tile_solid_monochrome.vs.glsl similarity index 69% rename from resources/shaders/tile_solid_monochrome.vs.glsl rename to shaders/tile_solid_monochrome.vs.glsl index 408488d7..cf6f61e7 100644 --- a/resources/shaders/tile_solid_monochrome.vs.glsl +++ b/shaders/tile_solid_monochrome.vs.glsl @@ -1,6 +1,6 @@ -#version {{version}} +#version 330 -// pathfinder/resources/shaders/tile_solid_monochrome.vs.glsl +// pathfinder/shaders/tile_solid_monochrome.vs.glsl // // Copyright © 2019 The Pathfinder Project Developers. // @@ -10,10 +10,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#extension GL_GOOGLE_include_directive : enable + precision highp float; -{{include_tile_solid_vertex}} -{{include_tile_monochrome}} +#include "tile_solid_vertex.inc.glsl" +#include "tile_monochrome.inc.glsl" void main() { computeVaryings(); diff --git a/resources/shaders/tile_solid_multicolor.vs.glsl b/shaders/tile_solid_multicolor.vs.glsl similarity index 69% rename from resources/shaders/tile_solid_multicolor.vs.glsl rename to shaders/tile_solid_multicolor.vs.glsl index ae3b86bd..34ee0f20 100644 --- a/resources/shaders/tile_solid_multicolor.vs.glsl +++ b/shaders/tile_solid_multicolor.vs.glsl @@ -1,6 +1,6 @@ -#version {{version}} +#version 330 -// pathfinder/resources/shaders/tile_solid_multicolor.vs.glsl +// pathfinder/shaders/tile_solid_multicolor.vs.glsl // // Copyright © 2019 The Pathfinder Project Developers. // @@ -10,10 +10,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#extension GL_GOOGLE_include_directive : enable + precision highp float; -{{include_tile_solid_vertex}} -{{include_tile_multicolor}} +#include "tile_solid_vertex.inc.glsl" +#include "tile_multicolor.inc.glsl" void main() { computeVaryings(); diff --git a/resources/shaders/tile_solid_vertex.inc.glsl b/shaders/tile_solid_vertex.inc.glsl similarity index 93% rename from resources/shaders/tile_solid_vertex.inc.glsl rename to shaders/tile_solid_vertex.inc.glsl index a7932c94..73f30cd0 100644 --- a/resources/shaders/tile_solid_vertex.inc.glsl +++ b/shaders/tile_solid_vertex.inc.glsl @@ -1,4 +1,4 @@ -// pathfinder/resources/shaders/tile_solid_vertex.inc.glsl +// pathfinder/shaders/tile_solid_vertex.inc.glsl // // Copyright © 2019 The Pathfinder Project Developers. //