ladybird/Userland/Libraries/LibSoftGPU/Config.h
Stephan Unverwerth 8ae3eb6c33 LibSoftGPU: Implement 5 bits of subpixel precision
This snaps vertices to 1/32 of a pixel before rasterization resulting
in smoother movement and less floaty appearance of moving triangles.

This also reduces the severity of the artifacts in the glquake port.

5 bits should allow up to 1024x1024 render targets. Anything larger
needs a different implementation.
2022-01-06 17:55:05 +01:00

26 lines
779 B
C++

/*
* Copyright (c) 2021, Stephan Unverwerth <s.unverwerth@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#define INCREASE_STATISTICS_COUNTER(stat, n) \
do { \
if constexpr (ENABLE_STATISTICS_OVERLAY) \
stat += (n); \
} while (0)
namespace SoftGPU {
static constexpr bool ENABLE_STATISTICS_OVERLAY = false;
static constexpr int RASTERIZER_BLOCK_SIZE = 8;
static constexpr int NUM_SAMPLERS = 32;
static constexpr int SUBPIXEL_BITS = 5;
// See: https://www.khronos.org/opengl/wiki/Common_Mistakes#Texture_edge_color_problem
// FIXME: make this dynamically configurable through ConfigServer
static constexpr bool CLAMP_DEPRECATED_BEHAVIOR = false;
}