1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 22:18:12 +00:00

LibGL+LibGPU+LibSoftGPU: Implement matrix stack per texture unit

Each texture unit now has its own texture transformation matrix stack.
Introduce a new texture unit configuration that is synced when changed.
Because we're no longer passing a silly `Vector` when drawing each
primitive, this results in a slightly improved frames per second :^)
This commit is contained in:
Jelle Raaijmakers 2022-09-05 00:40:27 +02:00 committed by Linus Groh
parent 1540c56e6c
commit 00d46e5d77
22 changed files with 208 additions and 152 deletions

View file

@ -228,3 +228,27 @@ TEST_CASE(0007_test_rgba_to_rgb_texture)
context->present();
expect_bitmap_equals_reference(context->frontbuffer(), "0007_test_rgba_to_rgb_texture"sv);
}
TEST_CASE(0008_test_pop_matrix_regression)
{
auto context = create_testing_context(64, 64);
// Load identity matrix after popping
glMatrixMode(GL_MODELVIEW);
glTranslatef(10.f, 10.f, 10.f);
glPushMatrix();
glPopMatrix();
glLoadIdentity();
glBegin(GL_TRIANGLES);
glColor3f(0.f, 1.f, 0.f);
glVertex2f(.5f, -.5f);
glVertex2f(.0f, .5f);
glVertex2f(-.5f, -.5f);
glEnd();
EXPECT_EQ(glGetError(), 0u);
context->present();
expect_bitmap_equals_reference(context->frontbuffer(), "0008_test_pop_matrix_regression"sv);
}