Config.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Copyright (c) 2021, Stephan Unverwerth <s.unverwerth@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibGPU/Config.h>
  8. #define INCREASE_STATISTICS_COUNTER(stat, n) \
  9. do { \
  10. if constexpr (ENABLE_STATISTICS_OVERLAY) \
  11. stat += (n); \
  12. } while (0)
  13. namespace SoftGPU {
  14. static constexpr bool ENABLE_STATISTICS_OVERLAY = false;
  15. static constexpr int MILLISECONDS_PER_STATISTICS_PERIOD = 500;
  16. static constexpr int NUM_LIGHTS = 8;
  17. static constexpr int MAX_CLIP_PLANES = 6;
  18. static constexpr int MAX_TEXTURE_SIZE = 2048;
  19. static constexpr float MAX_TEXTURE_LOD_BIAS = 2.f;
  20. static constexpr int SUBPIXEL_BITS = 4;
  21. static constexpr int NUM_SHADER_INPUTS = 64;
  22. // Verify that we have enough inputs to hold vertex color and texture coordinates for all fixed function texture units
  23. static_assert(NUM_SHADER_INPUTS >= 4 + GPU::NUM_TEXTURE_UNITS * 4);
  24. static constexpr int SHADER_INPUT_VERTEX_COLOR = 0;
  25. static constexpr int SHADER_INPUT_FIRST_TEXCOORD = 4;
  26. static constexpr int NUM_SHADER_OUTPUTS = 4;
  27. // Verify that we have enough outputs to hold the fragment's color
  28. static_assert(NUM_SHADER_OUTPUTS >= 4);
  29. static constexpr int SHADER_OUTPUT_FIRST_COLOR = 0;
  30. // See: https://www.khronos.org/opengl/wiki/Common_Mistakes#Texture_edge_color_problem
  31. // FIXME: make this dynamically configurable through ConfigServer
  32. static constexpr bool CLAMP_DEPRECATED_BEHAVIOR = false;
  33. }