1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:47:34 +00:00

LibSoftGPU: Add device method for creating images

This commit is contained in:
Stephan Unverwerth 2021-12-19 00:02:32 +01:00 committed by Brian Gianforcaro
parent 91ccf9958f
commit b8bb72abbe
5 changed files with 192 additions and 0 deletions

View file

@ -7,6 +7,7 @@
#pragma once
#include <AK/Array.h>
#include <AK/NonnullRefPtr.h>
#include <AK/OwnPtr.h>
#include <LibGL/GL/gl.h>
#include <LibGL/Tex/Texture2D.h>
@ -17,6 +18,8 @@
#include <LibGfx/Vector4.h>
#include <LibSoftGPU/Clipper.h>
#include <LibSoftGPU/DepthBuffer.h>
#include <LibSoftGPU/Image.h>
#include <LibSoftGPU/ImageFormat.h>
#include <LibSoftGPU/Triangle.h>
#include <LibSoftGPU/Vertex.h>
@ -74,6 +77,8 @@ public:
Gfx::RGBA32 get_backbuffer_pixel(int x, int y);
float get_depthbuffer_value(int x, int y);
NonnullRefPtr<Image> create_image(ImageFormat, unsigned width, unsigned height, unsigned depth, unsigned levels, unsigned layers);
private:
void submit_triangle(Triangle const& triangle, GL::TextureUnit::BoundList const& bound_texture_units);