1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-11 18:20:43 +09:00

LibGL+LibGPU+LibSoftGPU: Move SamplerConfig to LibGPU

This commit is contained in:
Stephan Unverwerth 2022-03-27 14:55:31 +02:00 committed by Andreas Kling
parent 54307a9cd3
commit e7450fa940
Notes: sideshowbarker 2024-07-17 14:23:25 +09:00
6 changed files with 103 additions and 87 deletions

View file

@ -977,13 +977,13 @@ ALWAYS_INLINE void Device::shade_fragments(PixelQuad& quad)
// FIXME: Implement more blend modes
switch (sampler.config().fixed_function_texture_env_mode) {
case SoftGPU::TextureEnvMode::Modulate:
case GPU::TextureEnvMode::Modulate:
quad.out_color = quad.out_color * texel;
break;
case SoftGPU::TextureEnvMode::Replace:
case GPU::TextureEnvMode::Replace:
quad.out_color = texel;
break;
case SoftGPU::TextureEnvMode::Decal: {
case GPU::TextureEnvMode::Decal: {
auto dst_alpha = texel.w();
quad.out_color.set_x(mix(quad.out_color.x(), texel.x(), dst_alpha));
quad.out_color.set_y(mix(quad.out_color.y(), texel.y(), dst_alpha));
@ -1231,7 +1231,7 @@ NonnullRefPtr<Image> Device::create_image(GPU::ImageFormat format, unsigned widt
return adopt_ref(*new Image(width, height, depth, levels, layers));
}
void Device::set_sampler_config(unsigned sampler, SamplerConfig const& config)
void Device::set_sampler_config(unsigned sampler, GPU::SamplerConfig const& config)
{
m_samplers[sampler].set_config(config);
}