summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibSoftGPU/Device.h
diff options
context:
space:
mode:
authorStephan Unverwerth <s.unverwerth@serenityos.org>2022-03-27 15:20:51 +0200
committerAndreas Kling <kling@serenityos.org>2022-04-06 11:32:24 +0200
commite416380826a680ca4f1de630f5407b1e997943bc (patch)
tree1f599f33f973ff32f1ebe1d21a8f11fec7ff8bfe /Userland/Libraries/LibSoftGPU/Device.h
parentb652db1f543c7c32f94a8d5cd9865ca7e02f09fd (diff)
downloadserenity-e416380826a680ca4f1de630f5407b1e997943bc.zip
LibGL+LibGPU+LibSoftGPU: Move StencilConfiguration.h to LibGPU
Diffstat (limited to 'Userland/Libraries/LibSoftGPU/Device.h')
-rw-r--r--Userland/Libraries/LibSoftGPU/Device.h28
1 files changed, 9 insertions, 19 deletions
diff --git a/Userland/Libraries/LibSoftGPU/Device.h b/Userland/Libraries/LibSoftGPU/Device.h
index 4edfb2c6ac..f0e0bf0e1a 100644
--- a/Userland/Libraries/LibSoftGPU/Device.h
+++ b/Userland/Libraries/LibSoftGPU/Device.h
@@ -17,6 +17,7 @@
#include <LibGPU/Light.h>
#include <LibGPU/Material.h>
#include <LibGPU/SamplerConfig.h>
+#include <LibGPU/StencilConfiguration.h>
#include <LibGfx/Bitmap.h>
#include <LibGfx/Matrix3x3.h>
#include <LibGfx/Matrix4x4.h>
@@ -99,17 +100,6 @@ struct RasterPosition {
FloatVector4 texture_coordinates { 0.0f, 0.0f, 0.0f, 1.0f };
};
-struct StencilConfiguration {
- GPU::StencilTestFunction test_function;
- StencilType reference_value;
- StencilType test_mask;
-
- GPU::StencilOperation on_stencil_test_fail;
- GPU::StencilOperation on_depth_test_fail;
- GPU::StencilOperation on_pass;
- StencilType write_mask;
-};
-
class Device final {
public:
Device(Gfx::IntSize const& min_size);
@@ -119,24 +109,24 @@ public:
void draw_primitives(GPU::PrimitiveType, FloatMatrix4x4 const& model_view_transform, FloatMatrix4x4 const& projection_transform, FloatMatrix4x4 const& texture_transform, Vector<Vertex> const& vertices, Vector<size_t> const& enabled_texture_units);
void resize(Gfx::IntSize const& min_size);
void clear_color(FloatVector4 const&);
- void clear_depth(DepthType);
- void clear_stencil(StencilType);
+ void clear_depth(GPU::DepthType);
+ void clear_stencil(GPU::StencilType);
void blit_color_buffer_to(Gfx::Bitmap& target);
void blit_to_color_buffer_at_raster_position(Gfx::Bitmap const&);
- void blit_to_depth_buffer_at_raster_position(Vector<DepthType> const&, int, int);
+ void blit_to_depth_buffer_at_raster_position(Vector<GPU::DepthType> const&, int, int);
void set_options(RasterizerOptions const&);
void set_light_model_params(LightModelParameters const&);
RasterizerOptions options() const { return m_options; }
LightModelParameters light_model() const { return m_lighting_model; }
- ColorType get_color_buffer_pixel(int x, int y);
- DepthType get_depthbuffer_value(int x, int y);
+ GPU::ColorType get_color_buffer_pixel(int x, int y);
+ GPU::DepthType get_depthbuffer_value(int x, int y);
NonnullRefPtr<Image> create_image(GPU::ImageFormat format, unsigned width, unsigned height, unsigned depth, unsigned levels, unsigned layers);
void set_sampler_config(unsigned, GPU::SamplerConfig const&);
void set_light_state(unsigned, GPU::Light const&);
void set_material_state(GPU::Face, GPU::Material const&);
- void set_stencil_configuration(GPU::Face, StencilConfiguration const&);
+ void set_stencil_configuration(GPU::Face, GPU::StencilConfiguration const&);
RasterPosition raster_position() const { return m_raster_position; }
void set_raster_position(RasterPosition const& raster_position);
@@ -151,7 +141,7 @@ private:
void shade_fragments(PixelQuad&);
bool test_alpha(PixelQuad&);
- RefPtr<FrameBuffer<ColorType, DepthType, StencilType>> m_frame_buffer {};
+ RefPtr<FrameBuffer<GPU::ColorType, GPU::DepthType, GPU::StencilType>> m_frame_buffer {};
RasterizerOptions m_options;
LightModelParameters m_lighting_model;
Clipper m_clipper;
@@ -164,7 +154,7 @@ private:
Array<GPU::Light, NUM_LIGHTS> m_lights;
Array<GPU::Material, 2u> m_materials;
RasterPosition m_raster_position;
- Array<StencilConfiguration, 2u> m_stencil_configuration;
+ Array<GPU::StencilConfiguration, 2u> m_stencil_configuration;
};
}