1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:27:45 +00:00

LibGL+LibSoftGPU: Implement GL_POLYGON_OFFSET_FILL capability

This commit is contained in:
Jelle Raaijmakers 2022-01-19 22:49:52 +01:00 committed by Andreas Kling
parent 991cbc56a2
commit 453f62c935
4 changed files with 17 additions and 2 deletions

View file

@ -413,7 +413,8 @@ void Device::rasterize_triangle(const Triangle& triangle)
quad.depth = interpolate(vertex0.window_coordinates.z(), vertex1.window_coordinates.z(), vertex2.window_coordinates.z(), quad.barycentrics);
// FIXME: Also apply depth_offset_factor which depends on the depth gradient
quad.depth += m_options.depth_offset_constant * NumericLimits<float>::epsilon();
if (m_options.depth_offset_enabled)
quad.depth += m_options.depth_offset_constant * NumericLimits<float>::epsilon();
i32x4 depth_test_passed;
switch (m_options.depth_func) {

View file

@ -66,6 +66,7 @@ struct RasterizerOptions {
bool enable_color_write { true };
float depth_offset_factor { 0 };
float depth_offset_constant { 0 };
bool depth_offset_enabled { false };
bool enable_culling { false };
WindingOrder front_face { WindingOrder::CounterClockwise };
bool cull_back { true };