LibGL+LibGPU+LibSoftGPU: Move TexCoordGenerationConfig into LibGPU

This commit is contained in:
Stephan Unverwerth 2022-03-27 15:28:08 +02:00 committed by Andreas Kling
parent 8f359bf758
commit 5a5596b381
Notes: sideshowbarker 2024-07-17 14:23:04 +09:00
3 changed files with 22 additions and 7 deletions

View file

@ -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;

View file

@ -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 {};
};
}

View file

@ -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 };