From c55bdc6e894e98b4000c21ab63e96b9cdb73f07b Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Fri, 6 Jun 2025 23:15:47 +0200 Subject: [PATCH] Drop obsolete foveate shader --- server/CMakeLists.txt | 8 ----- server/shaders/foveate.comp.glsl | 62 -------------------------------- 2 files changed, 70 deletions(-) delete mode 100644 server/shaders/foveate.comp.glsl diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt index f0dfcc78..89c7da77 100644 --- a/server/CMakeLists.txt +++ b/server/CMakeLists.txt @@ -105,8 +105,6 @@ if (WIVRN_BUILD_SERVER) driver/xrt_cast.cpp utils/wivrn_vk_bundle.cpp - - ${WIVRN_SHADER_HEADERS} ) target_compile_features(wivrn-server PRIVATE cxx_std_20) target_compile_definitions(wivrn-server PRIVATE VULKAN_HPP_NO_CONSTRUCTORS) @@ -188,12 +186,6 @@ if (WIVRN_BUILD_SERVER) target_link_libraries(wivrn-server PUBLIC wivrn-server-dbus) target_link_libraries(wivrn-server PUBLIC PkgConfig::libnotify) - include(CompileGLSL) - - file(GLOB VULKAN_SHADERS CONFIGURE_DEPENDS "shaders/*.glsl") - target_sources(wivrn-server PRIVATE ${VULKAN_SHADERS}) - wivrn_compile_glsl(wivrn-server ${VULKAN_SHADERS}) - target_link_libraries( wivrn-server PRIVATE diff --git a/server/shaders/foveate.comp.glsl b/server/shaders/foveate.comp.glsl deleted file mode 100644 index 527b02a4..00000000 --- a/server/shaders/foveate.comp.glsl +++ /dev/null @@ -1,62 +0,0 @@ -/* - * WiVRn VR streaming - * Copyright (C) 2024 galister - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#version 450 - -layout(local_size_x = 8, local_size_y = 8, local_size_z = 1) in; - -layout(set = 0, binding = 0, rgba8) uniform writeonly restrict image2D target; - -layout(push_constant) uniform PushConstants -{ - vec2 a; - vec2 b; - vec2 scale; - vec2 center; -} pcs; - -layout(constant_id = 0) const float one_over_dim = 0.0; - -float foveate(float a, float b, float scale, float c, float x) { - return scale / a * tan(a * x + b) + c; -} - -void main() -{ - ivec2 coords = ivec2(gl_GlobalInvocationID.x, gl_GlobalInvocationID.y); - - vec2 uv = vec2( - float(coords.x), - float(coords.y) - ) * one_over_dim; - vec2 duv = vec2(1.0); - - if (pcs.scale.x < 1.0) { - float u = uv.x * 2.0 - 1.0; - float val = foveate(pcs.a.x, pcs.b.x, pcs.scale.x, pcs.center.x, u); - uv.x = clamp((1.0 + val) / 2.0, 0.0, 1.0); - } - - if (pcs.scale.y < 1.0) { - float v = uv.y * 2.0 - 1.0; - float val = foveate(pcs.a.y, pcs.b.y, pcs.scale.y, pcs.center.y, v); - uv.y = clamp((1.0 + val) / 2.0, 0.0, 1.0); - } - - imageStore(target, coords, vec4(uv.x, uv.y, 0.0, 0.0)); -}