From aa192964ca1442fcb8592b9de70e3e8814307e7a Mon Sep 17 00:00:00 2001 From: csmartdalton Date: Mon, 26 Aug 2024 02:42:39 +0000 Subject: [PATCH] Revive the WebGL backend Always declare the clip buffer when using WEBGL_shader_pixel_local_storage. The spec requires the shader to explicitly declare every plane that has been enabled. Also fix some bit-rot in path_fiddle. Diffs= e1b4a53ec Revive the WebGL backend (#7948) Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com> --- .rive_head | 2 +- pls/path_fiddle/fiddle_context_gl.cpp | 4 ++-- pls/renderer/shaders/draw_image_mesh.glsl | 2 +- pls/renderer/shaders/draw_path.glsl | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.rive_head b/.rive_head index 6cd2f3da..7d187dca 100644 --- a/.rive_head +++ b/.rive_head @@ -1 +1 @@ -813db58e71b442a83574745cf6cc29e5d885b403 +e1b4a53ecb34d62e9d4160e3040803173c2233b0 diff --git a/pls/path_fiddle/fiddle_context_gl.cpp b/pls/path_fiddle/fiddle_context_gl.cpp index e838f523..ea29bdb5 100644 --- a/pls/path_fiddle/fiddle_context_gl.cpp +++ b/pls/path_fiddle/fiddle_context_gl.cpp @@ -1,6 +1,6 @@ #include "fiddle_context.hpp" -#ifndef RIVE_DESKTOP_GL +#ifdef RIVE_TOOLS_NO_GLFW std::unique_ptr FiddleContext::MakeGLPLS() { return nullptr; } @@ -109,7 +109,7 @@ class FiddleContextGL : public FiddleContext float dpiScale(GLFWwindow*) const override { -#ifdef __APPLE__ +#if defined(__APPLE__) || defined(RIVE_WEBGL) return 2; #else return 1; diff --git a/pls/renderer/shaders/draw_image_mesh.glsl b/pls/renderer/shaders/draw_image_mesh.glsl index 8d1f4ec0..a34191e2 100644 --- a/pls/renderer/shaders/draw_image_mesh.glsl +++ b/pls/renderer/shaders/draw_image_mesh.glsl @@ -98,7 +98,7 @@ FRAG_STORAGE_BUFFER_BLOCK_END PLS_BLOCK_BEGIN PLS_DECL4F(COLOR_PLANE_IDX, colorBuffer); -#ifdef @ENABLE_CLIPPING +#if defined(@ENABLE_CLIPPING) || defined(@PLS_IMPL_ANGLE) PLS_DECLUI(CLIP_PLANE_IDX, clipBuffer); #endif PLS_DECL4F(SCRATCH_COLOR_PLANE_IDX, scratchColorBuffer); diff --git a/pls/renderer/shaders/draw_path.glsl b/pls/renderer/shaders/draw_path.glsl index 00d18358..cf1dc5af 100644 --- a/pls/renderer/shaders/draw_path.glsl +++ b/pls/renderer/shaders/draw_path.glsl @@ -309,7 +309,7 @@ INLINE half4 find_paint_color(float4 paint PLS_BLOCK_BEGIN PLS_DECL4F(COLOR_PLANE_IDX, colorBuffer); -#ifdef @ENABLE_CLIPPING +#if defined(@ENABLE_CLIPPING) || defined(@PLS_IMPL_ANGLE) PLS_DECLUI(CLIP_PLANE_IDX, clipBuffer); #endif PLS_DECL4F(SCRATCH_COLOR_PLANE_IDX, scratchColorBuffer);