diff --git a/src/default_shaders/glsl.rs b/src/default_shaders/glsl.rs index ab53fc2..94e1419 100644 --- a/src/default_shaders/glsl.rs +++ b/src/default_shaders/glsl.rs @@ -1,12 +1,24 @@ pub const FRAG_SHADER: &str = "#version 460 #extension GL_EXT_buffer_reference : require +#extension GL_EXT_nonuniform_qualifier : require // In the beginning, colours never existed. There's nothing that was done before you... #include +layout(location = 0) in vec2 in_uv; +layout(location = 0) out vec4 out_color; + layout(set = 0, binding = 0) uniform sampler gsamplers[]; layout(set = 0, binding = 1) uniform texture2D gtextures[]; +vec4 Tex(uint id) { + return texture( + nonuniformEXT(sampler2D(gtextures[id], gsamplers[LINER_SAMPL])), in_uv); +} +vec4 Tex(uint id, vec2 uv) { + return texture( + nonuniformEXT(sampler2D(gtextures[id], gsamplers[LINER_SAMPL])), uv); +} layout(std430, push_constant) uniform PushConstant { vec3 pos; @@ -20,9 +32,6 @@ layout(std430, push_constant) uniform PushConstant { } pc; -layout(location = 0) in vec2 in_uv; -layout(location = 0) out vec4 out_color; - void main() { vec2 uv = (in_uv + -0.5) * vec2(pc.resolution.x / pc.resolution.y, 1); @@ -32,6 +41,7 @@ void main() { pub const VERT_SHADER: &str = "#version 460 #extension GL_EXT_buffer_reference : require +#extension GL_EXT_nonuniform_qualifier : require layout(set = 0, binding = 0) uniform sampler gsamplers[]; layout(set = 0, binding = 1) uniform texture2D gtextures[]; @@ -56,6 +66,7 @@ void main() { }"; pub const COMP_SHADER: &str = "#version 460 +#extension GL_EXT_nonuniform_qualifier : require #extension GL_EXT_buffer_reference : require layout(set = 0, binding = 0) uniform sampler gsamplers[]; diff --git a/src/recorder.rs b/src/recorder.rs index 1c97518..cd62c3b 100644 --- a/src/recorder.rs +++ b/src/recorder.rs @@ -109,8 +109,8 @@ fn new_ffmpeg_command(image_dimensions: ImageDimensions, filename: &str) -> Resu "-f", "rawvideo", "-i", "pipe:", "-c:v", "libx264", - "-crf", "25", - "-preset", "ultrafast", + "-crf", "23", + // "-preset", "ultrafast", "-tune", "animation", "-color_primaries", "bt709", "-color_trc", "bt709", @@ -118,7 +118,7 @@ fn new_ffmpeg_command(image_dimensions: ImageDimensions, filename: &str) -> Resu "-color_range", "tv", "-chroma_sample_location", "center", "-pix_fmt", "yuv420p", - "-movflags", "+faststart", + // "-movflags", "+faststart", "-y", ]; @@ -127,8 +127,7 @@ fn new_ffmpeg_command(image_dimensions: ImageDimensions, filename: &str) -> Resu .arg("-video_size") .arg(format!( "{}x{}", - image_dimensions.unpadded_bytes_per_row / 4, - image_dimensions.height + image_dimensions.width, image_dimensions.height )) .args(args) .arg(filename)