summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibSoftGPU/Device.cpp
diff options
context:
space:
mode:
authorStephan Unverwerth <s.unverwerth@serenityos.org>2022-09-14 23:48:10 +0200
committerAndrew Kaster <andrewdkaster@gmail.com>2022-12-17 22:39:09 -0700
commit93ab2db80fed38b6e621085b5e060ae726d77a88 (patch)
tree5e0f4fd00f777dd60b932af8c3c52833e9752ee0 /Userland/Libraries/LibSoftGPU/Device.cpp
parent4ad41e6680bad5397ab9f16110514268673c3ab2 (diff)
downloadserenity-93ab2db80fed38b6e621085b5e060ae726d77a88.zip
LibGL+LibSoftGPU: Add GPU side shader infrastructure
This adds a shader class to LibSoftGPU and makes use of it when linking GLSL program in LibGL. Also adds actual rendering code to the shader tests.
Diffstat (limited to 'Userland/Libraries/LibSoftGPU/Device.cpp')
-rw-r--r--Userland/Libraries/LibSoftGPU/Device.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/Userland/Libraries/LibSoftGPU/Device.cpp b/Userland/Libraries/LibSoftGPU/Device.cpp
index c3085a9328..318617d7e6 100644
--- a/Userland/Libraries/LibSoftGPU/Device.cpp
+++ b/Userland/Libraries/LibSoftGPU/Device.cpp
@@ -22,6 +22,7 @@
#include <LibSoftGPU/PixelConverter.h>
#include <LibSoftGPU/PixelQuad.h>
#include <LibSoftGPU/SIMD.h>
+#include <LibSoftGPU/Shader.h>
#include <math.h>
namespace SoftGPU {
@@ -1626,6 +1627,11 @@ NonnullRefPtr<GPU::Image> Device::create_image(GPU::PixelFormat const& pixel_for
return adopt_ref(*new Image(this, pixel_format, width, height, depth, max_levels));
}
+ErrorOr<NonnullRefPtr<GPU::Shader>> Device::create_shader(GPU::IR::Shader const&)
+{
+ return adopt_ref(*new Shader(this));
+}
+
void Device::set_sampler_config(unsigned sampler, GPU::SamplerConfig const& config)
{
VERIFY(config.bound_image.is_null() || config.bound_image->ownership_token() == this);