mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 00:50:22 +00:00
LibSoftGPU: Avoid copying data when doing triangle rasterization
Several large-ish objects shouldn't be copied to the stack when a reference will do.
This commit is contained in:
parent
9f59d7d9a0
commit
759857b597
Notes:
sideshowbarker
2024-07-17 17:10:00 +09:00
Author: https://github.com/ldm5180 Commit: https://github.com/SerenityOS/serenity/commit/759857b597 Pull-request: https://github.com/SerenityOS/serenity/pull/13122
1 changed files with 4 additions and 4 deletions
|
@ -184,9 +184,9 @@ void Device::rasterize_triangle(const Triangle& triangle)
|
|||
return;
|
||||
|
||||
// Vertices
|
||||
Vertex const vertex0 = triangle.vertices[0];
|
||||
Vertex const vertex1 = triangle.vertices[1];
|
||||
Vertex const vertex2 = triangle.vertices[2];
|
||||
Vertex const& vertex0 = triangle.vertices[0];
|
||||
Vertex const& vertex1 = triangle.vertices[1];
|
||||
Vertex const& vertex2 = triangle.vertices[2];
|
||||
|
||||
// Calculate area of the triangle for later tests
|
||||
FloatVector2 const v0 = vertex0.window_coordinates.xy();
|
||||
|
@ -262,7 +262,7 @@ void Device::rasterize_triangle(const Triangle& triangle)
|
|||
auto stencil_buffer = m_frame_buffer->stencil_buffer();
|
||||
|
||||
// Stencil configuration and writing
|
||||
auto const stencil_configuration = m_stencil_configuration[Face::Front];
|
||||
auto const& stencil_configuration = m_stencil_configuration[Face::Front];
|
||||
auto const stencil_reference_value = stencil_configuration.reference_value & stencil_configuration.test_mask;
|
||||
|
||||
auto write_to_stencil = [](StencilType* stencil_ptrs[4], i32x4 stencil_value, StencilOperation op, StencilType reference_value, StencilType write_mask, i32x4 pixel_mask) {
|
||||
|
|
Loading…
Reference in a new issue