Bläddra i källkod

LibGL+LibGPU+LibSoftGPU: Move TexCoordGenerationConfig into LibGPU

Stephan Unverwerth 3 år sedan
förälder
incheckning
5a5596b381

+ 1 - 1
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;

+ 19 - 0
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 {};
+};
+
+}

+ 2 - 6
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 };