diff options
author | 2022-10-05 16:07:43 -0700 | |
---|---|---|
committer | 2022-10-05 16:07:43 -0700 | |
commit | 1eb8d972ba60592da7bfc27fe7ec80138e64dd7b (patch) | |
tree | 1951255bcb8d2b87767da406eb87b80ab5a709cc /glow/src/quad | |
parent | f7ce7244d017ec16545a3e52b6e7cf634bbffd4a (diff) | |
download | iced-1eb8d972ba60592da7bfc27fe7ec80138e64dd7b.tar.gz iced-1eb8d972ba60592da7bfc27fe7ec80138e64dd7b.tar.bz2 iced-1eb8d972ba60592da7bfc27fe7ec80138e64dd7b.zip |
Reduced memory transfer of OpenGL gradient uniform upload. Rearranged gradient uniforms on OpenGL side to be more performant.
Diffstat (limited to 'glow/src/quad')
-rw-r--r-- | glow/src/quad/compatibility.rs | 6 | ||||
-rw-r--r-- | glow/src/quad/core.rs | 6 |
2 files changed, 4 insertions, 8 deletions
diff --git a/glow/src/quad/compatibility.rs b/glow/src/quad/compatibility.rs index eb3fb7e0..28a5ea7c 100644 --- a/glow/src/quad/compatibility.rs +++ b/glow/src/quad/compatibility.rs @@ -70,11 +70,10 @@ impl Pipeline { unsafe { gl.use_program(Some(program)); - let matrix: [f32; 16] = Transformation::identity().into(); gl.uniform_matrix_4_f32_slice( Some(&transform_location), false, - &matrix, + Transformation::identity().as_ref(), ); gl.uniform_1_f32(Some(&scale_location), 1.0); @@ -139,11 +138,10 @@ impl Pipeline { if transformation != self.current_transform { unsafe { - let matrix: [f32; 16] = transformation.into(); gl.uniform_matrix_4_f32_slice( Some(&self.transform_location), false, - &matrix, + transformation.as_ref(), ); self.current_transform = transformation; diff --git a/glow/src/quad/core.rs b/glow/src/quad/core.rs index 3e51b1ca..16bec385 100644 --- a/glow/src/quad/core.rs +++ b/glow/src/quad/core.rs @@ -65,11 +65,10 @@ impl Pipeline { unsafe { gl.use_program(Some(program)); - let matrix: [f32; 16] = Transformation::identity().into(); gl.uniform_matrix_4_f32_slice( Some(&transform_location), false, - &matrix, + Transformation::identity().as_ref(), ); gl.uniform_1_f32(Some(&scale_location), 1.0); @@ -119,11 +118,10 @@ impl Pipeline { if transformation != self.current_transform { unsafe { - let matrix: [f32; 16] = transformation.into(); gl.uniform_matrix_4_f32_slice( Some(&self.transform_location), false, - &matrix, + transformation.as_ref(), ); self.current_transform = transformation; |