summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorStephan Unverwerth <s.unverwerth@serenityos.org>2022-03-27 15:28:08 +0200
committerAndreas Kling <kling@serenityos.org>2022-04-06 11:32:24 +0200
commit5a5596b381c8ecf257aa0b41bab21d26c6d86986 (patch)
tree05a326ba7335b32331c5734e0df5485c1f813f8c /Userland
parent8f359bf758c277cb81c9907428d7e7aa1ac0d8ef (diff)
downloadserenity-5a5596b381c8ecf257aa0b41bab21d26c6d86986.zip
LibGL+LibGPU+LibSoftGPU: Move TexCoordGenerationConfig into LibGPU
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibGL/GLContext.cpp2
-rw-r--r--Userland/Libraries/LibGPU/TexCoordGenerationConfig.h19
-rw-r--r--Userland/Libraries/LibSoftGPU/Device.h8
3 files changed, 22 insertions, 7 deletions
diff --git a/Userland/Libraries/LibGL/GLContext.cpp b/Userland/Libraries/LibGL/GLContext.cpp
index a303e0d1d9..33142e86e9 100644
--- a/Userland/Libraries/LibGL/GLContext.cpp
+++ b/Userland/Libraries/LibGL/GLContext.cpp
@@ -3089,7 +3089,7 @@ void GLContext::sync_device_texcoord_config()
if (!context_coordinate_config.enabled)
continue;
- SoftGPU::TexCoordGenerationConfig* texcoord_generation_config;
+ GPU::TexCoordGenerationConfig* texcoord_generation_config;
switch (capability) {
case GL_TEXTURE_GEN_S:
enabled_coordinates |= GPU::TexCoordGenerationCoordinate::S;
diff --git a/Userland/Libraries/LibGPU/TexCoordGenerationConfig.h b/Userland/Libraries/LibGPU/TexCoordGenerationConfig.h
new file mode 100644
index 0000000000..dbd8db63e6
--- /dev/null
+++ b/Userland/Libraries/LibGPU/TexCoordGenerationConfig.h
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2022, Jelle Raaijmakers <jelle@gmta.nl>
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#pragma once
+
+#include <LibGPU/Enums.h>
+#include <LibGfx/Vector4.h>
+
+namespace GPU {
+
+struct TexCoordGenerationConfig {
+ GPU::TexCoordGenerationMode mode { GPU::TexCoordGenerationMode::EyeLinear };
+ FloatVector4 coefficients {};
+};
+
+}
diff --git a/Userland/Libraries/LibSoftGPU/Device.h b/Userland/Libraries/LibSoftGPU/Device.h
index 979681f83e..310c89abd2 100644
--- a/Userland/Libraries/LibSoftGPU/Device.h
+++ b/Userland/Libraries/LibSoftGPU/Device.h
@@ -19,6 +19,7 @@
#include <LibGPU/RasterPosition.h>
#include <LibGPU/SamplerConfig.h>
#include <LibGPU/StencilConfiguration.h>
+#include <LibGPU/TexCoordGenerationConfig.h>
#include <LibGfx/Bitmap.h>
#include <LibGfx/Matrix3x3.h>
#include <LibGfx/Matrix4x4.h>
@@ -36,11 +37,6 @@
namespace SoftGPU {
-struct TexCoordGenerationConfig {
- GPU::TexCoordGenerationMode mode { GPU::TexCoordGenerationMode::EyeLinear };
- FloatVector4 coefficients {};
-};
-
struct RasterizerOptions {
bool shade_smooth { true };
bool enable_stencil_test { false };
@@ -75,7 +71,7 @@ struct RasterizerOptions {
bool cull_back { true };
bool cull_front { false };
Array<u8, NUM_SAMPLERS> texcoord_generation_enabled_coordinates {};
- Array<Array<TexCoordGenerationConfig, 4>, NUM_SAMPLERS> texcoord_generation_config {};
+ Array<Array<GPU::TexCoordGenerationConfig, 4>, NUM_SAMPLERS> texcoord_generation_config {};
Gfx::IntRect viewport;
bool lighting_enabled { false };
bool color_material_enabled { false };