mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-23 02:05:33 +07:00
Fix size_curr_geo in resize shader
This commit is contained in:
@@ -81,6 +81,8 @@ impl ResizeRenderElement {
|
|||||||
let geo_to_tex_next = Mat3::from_translation(-tex_next_geo_loc / tex_next_geo_size)
|
let geo_to_tex_next = Mat3::from_translation(-tex_next_geo_loc / tex_next_geo_size)
|
||||||
* Mat3::from_scale(size_next / tex_next_geo_size * scale);
|
* Mat3::from_scale(size_next / tex_next_geo_size * scale);
|
||||||
|
|
||||||
|
let curr_geo_size = curr_geo_size * scale;
|
||||||
|
|
||||||
// Create the shader.
|
// Create the shader.
|
||||||
Shaders::get(renderer).resize().map(|shader| {
|
Shaders::get(renderer).resize().map(|shader| {
|
||||||
Self(PrimaryGpuPixelShaderWithTexturesRenderElement::new(
|
Self(PrimaryGpuPixelShaderWithTexturesRenderElement::new(
|
||||||
@@ -97,6 +99,7 @@ impl ResizeRenderElement {
|
|||||||
mat3_uniform("niri_input_to_curr_geo", input_to_curr_geo),
|
mat3_uniform("niri_input_to_curr_geo", input_to_curr_geo),
|
||||||
mat3_uniform("niri_curr_geo_to_prev_geo", curr_geo_to_prev_geo),
|
mat3_uniform("niri_curr_geo_to_prev_geo", curr_geo_to_prev_geo),
|
||||||
mat3_uniform("niri_curr_geo_to_next_geo", curr_geo_to_next_geo),
|
mat3_uniform("niri_curr_geo_to_next_geo", curr_geo_to_next_geo),
|
||||||
|
Uniform::new("niri_curr_geo_size", curr_geo_size.to_array()),
|
||||||
mat3_uniform("niri_geo_to_tex_prev", geo_to_tex_prev),
|
mat3_uniform("niri_geo_to_tex_prev", geo_to_tex_prev),
|
||||||
mat3_uniform("niri_geo_to_tex_next", geo_to_tex_next),
|
mat3_uniform("niri_geo_to_tex_next", geo_to_tex_next),
|
||||||
Uniform::new("niri_progress", progress),
|
Uniform::new("niri_progress", progress),
|
||||||
|
|||||||
@@ -92,6 +92,7 @@ fn compile_resize_program(
|
|||||||
UniformName::new("niri_input_to_curr_geo", UniformType::Matrix3x3),
|
UniformName::new("niri_input_to_curr_geo", UniformType::Matrix3x3),
|
||||||
UniformName::new("niri_curr_geo_to_prev_geo", UniformType::Matrix3x3),
|
UniformName::new("niri_curr_geo_to_prev_geo", UniformType::Matrix3x3),
|
||||||
UniformName::new("niri_curr_geo_to_next_geo", UniformType::Matrix3x3),
|
UniformName::new("niri_curr_geo_to_next_geo", UniformType::Matrix3x3),
|
||||||
|
UniformName::new("niri_curr_geo_size", UniformType::_2f),
|
||||||
UniformName::new("niri_geo_to_tex_prev", UniformType::Matrix3x3),
|
UniformName::new("niri_geo_to_tex_prev", UniformType::Matrix3x3),
|
||||||
UniformName::new("niri_geo_to_tex_next", UniformType::Matrix3x3),
|
UniformName::new("niri_geo_to_tex_next", UniformType::Matrix3x3),
|
||||||
UniformName::new("niri_progress", UniformType::_1f),
|
UniformName::new("niri_progress", UniformType::_1f),
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
vec3 coords_curr_geo = niri_input_to_curr_geo * vec3(niri_v_coords, 1.0);
|
vec3 coords_curr_geo = niri_input_to_curr_geo * vec3(niri_v_coords, 1.0);
|
||||||
vec3 size_curr_geo = niri_input_to_curr_geo * vec3(niri_size, 1.0);
|
vec3 size_curr_geo = vec3(niri_curr_geo_size, 1.0);
|
||||||
|
|
||||||
vec4 color = resize_color(coords_curr_geo, size_curr_geo);
|
vec4 color = resize_color(coords_curr_geo, size_curr_geo);
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ uniform vec2 niri_size;
|
|||||||
uniform mat3 niri_input_to_curr_geo;
|
uniform mat3 niri_input_to_curr_geo;
|
||||||
uniform mat3 niri_curr_geo_to_prev_geo;
|
uniform mat3 niri_curr_geo_to_prev_geo;
|
||||||
uniform mat3 niri_curr_geo_to_next_geo;
|
uniform mat3 niri_curr_geo_to_next_geo;
|
||||||
|
uniform vec2 niri_curr_geo_size;
|
||||||
|
|
||||||
uniform sampler2D niri_tex_prev;
|
uniform sampler2D niri_tex_prev;
|
||||||
uniform mat3 niri_geo_to_tex_prev;
|
uniform mat3 niri_geo_to_tex_prev;
|
||||||
|
|||||||
Reference in New Issue
Block a user