Reduced memory transfer of OpenGL gradient uniform upload. Rearranged gradient uniforms on OpenGL side to be more performant.
This commit is contained in:
parent
f7ce7244d0
commit
1eb8d972ba
7 changed files with 83 additions and 128 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue