From dfb75dc3c578a24d3a4548d80a9f71bae0a0e7fb Mon Sep 17 00:00:00 2001 From: nashmuhandes Date: Thu, 7 Nov 2024 04:48:50 +0800 Subject: [PATCH 1/2] GLSL: add a vec4 texture(int index, vec2 p, float bias) overload --- wadsrc/static/shaders/scene/layout_frag.glsl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wadsrc/static/shaders/scene/layout_frag.glsl b/wadsrc/static/shaders/scene/layout_frag.glsl index 0cf2b01e0..f769a1fbd 100644 --- a/wadsrc/static/shaders/scene/layout_frag.glsl +++ b/wadsrc/static/shaders/scene/layout_frag.glsl @@ -31,6 +31,11 @@ vec4 texture(int index, vec2 p) return texture(textures[uTextureIndex + index], p); } +vec4 texture(int index, vec2 p, float bias) +{ + return texture(textures[uTextureIndex + index], p, bias); +} + ivec2 textureSize(int index, int lod) { return textureSize(textures[uTextureIndex + index], lod); From 6c67c55ca7c36bf137cc0053e5d0d453690368a4 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Wed, 6 Nov 2024 22:27:46 +0100 Subject: [PATCH 2/2] Set a define for user shaders if they need to deviate between GZD and VKD --- wadsrc/static/shaders/scene/binding_textures.glsl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wadsrc/static/shaders/scene/binding_textures.glsl b/wadsrc/static/shaders/scene/binding_textures.glsl index 3ef32bc69..5f013d45d 100644 --- a/wadsrc/static/shaders/scene/binding_textures.glsl +++ b/wadsrc/static/shaders/scene/binding_textures.glsl @@ -21,3 +21,6 @@ const int texture17 = 16; const int texture18 = 17; const int texture19 = 18; const int texture20 = 19; + +/* For user shaders so they can check if the engine uses bindless textures */ +#define USES_BINDLESS