mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 13:55:08 +00:00

With the RASTERIZER_BLOCK_SIZE gone we can now render to any size, even odd ones. We have to be careful to not generate out of bounds accesses when calculating the render target and depth buffer pointers. Thus we check the coverage mask and generate nullptrs for pixels that will not be updated. This also masks out pixels that would touch the triangle but are outside the render target/scissor rect bounds.
25 lines
731 B
C++
25 lines
731 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 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;
|
|
|
|
}
|