Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package vkbasalt for openSUSE:Factory checked in at 2022-02-23 16:26:01 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/vkbasalt (Old) and /work/SRC/openSUSE:Factory/.vkbasalt.new.1958 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "vkbasalt" Wed Feb 23 16:26:01 2022 rev:4 rq:956880 version:0.3.2.5 Changes: -------- --- /work/SRC/openSUSE:Factory/vkbasalt/vkbasalt.changes 2021-07-23 23:41:36.421801034 +0200 +++ /work/SRC/openSUSE:Factory/.vkbasalt.new.1958/vkbasalt.changes 2022-02-23 16:26:46.983509545 +0100 @@ -1,0 +2,10 @@ +Mon Feb 14 17:41:02 UTC 2022 - andy great <andythe_gr...@pm.me> + +- Update to version 0.3.2.5. + * micro optimized some shaders + * added a new enableOnLaunch config option + * fixed crash when the swapchain was created before + vkGetDeviceQueue was called + * fixed build on gcc12 + +------------------------------------------------------------------- Old: ---- vkBasalt-0.3.2.4.tar.gz New: ---- vkBasalt-0.3.2.5.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ vkbasalt.spec ++++++ --- /var/tmp/diff_new_pack.iabOtM/_old 2022-02-23 16:26:47.439509562 +0100 +++ /var/tmp/diff_new_pack.iabOtM/_new 2022-02-23 16:26:47.443509561 +0100 @@ -1,7 +1,7 @@ # # spec file for package vkbasalt # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ %define __builder ninja Name: vkbasalt -Version: 0.3.2.4 +Version: 0.3.2.5 Release: 0 Summary: Vulkan post processing layer License: Zlib ++++++ vkBasalt-0.3.2.4.tar.gz -> vkBasalt-0.3.2.5.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vkBasalt-0.3.2.4/README.md new/vkBasalt-0.3.2.5/README.md --- old/vkBasalt-0.3.2.4/README.md 2021-01-12 11:40:13.000000000 +0100 +++ new/vkBasalt-0.3.2.5/README.md 2022-02-12 18:17:32.000000000 +0100 @@ -50,6 +50,8 @@ ## Packaging status +[Debian](https://tracker.debian.org/pkg/vkbasalt) `sudo apt install vkbasalt` + [Fedora](https://src.fedoraproject.org/rpms/vkBasalt) `sudo dnf install vkBasalt` [Void Linux](https://github.com/void-linux/void-packages/blob/master/srcpkgs/vkBasalt/template) `sudo xbps-install vkBasalt` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vkBasalt-0.3.2.4/config/vkBasalt.conf new/vkBasalt-0.3.2.5/config/vkBasalt.conf --- old/vkBasalt-0.3.2.4/config/vkBasalt.conf 2021-01-12 11:40:13.000000000 +0100 +++ new/vkBasalt-0.3.2.5/config/vkBasalt.conf 2022-02-12 18:17:32.000000000 +0100 @@ -16,6 +16,9 @@ #toggleKey toggles the effects on/off toggleKey = Home +#enableOnLaunch sets if the effects are emabled when started +enableOnLaunch = True + #casSharpness specifies the amount of sharpning in the CAS shader. #0.0 less sharp, less artefacts, but not off #1.0 maximum sharp more artefacts diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vkBasalt-0.3.2.4/meson.build new/vkBasalt-0.3.2.5/meson.build --- old/vkBasalt-0.3.2.4/meson.build 2021-01-12 11:40:13.000000000 +0100 +++ new/vkBasalt-0.3.2.5/meson.build 2022-02-12 18:17:32.000000000 +0100 @@ -9,7 +9,7 @@ if get_option('append_libdir_vkbasalt') lib_dir = join_paths(lib_dir, 'vkbasalt') - ld_lib_dir_vkbasalt = get_option('prefix') + '/\$LIB/vkbasalt/' + ld_lib_dir_vkbasalt = get_option('prefix') + '/$LIB/vkbasalt/' endif if get_option('with_so') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vkBasalt-0.3.2.4/src/basalt.cpp new/vkBasalt-0.3.2.5/src/basalt.cpp --- old/vkBasalt-0.3.2.4/src/basalt.cpp 2021-01-12 11:40:13.000000000 +0100 +++ new/vkBasalt-0.3.2.5/src/basalt.cpp 2022-02-12 18:17:32.000000000 +0100 @@ -150,6 +150,7 @@ const VkAllocationCallbacks* pAllocator, VkDevice* pDevice) { + scoped_lock l(globalLock); Logger::trace("vkCreateDevice"); VkLayerDeviceCreateInfo* layerCreateInfo = (VkLayerDeviceCreateInfo*) pCreateInfo->pNext; @@ -220,6 +221,9 @@ VkResult ret = createFunc(physicalDevice, &modifiedCreateInfo, pAllocator, pDevice); + if (ret != VK_SUCCESS) + return ret; + std::shared_ptr<LogicalDevice> pLogicalDevice(new LogicalDevice()); pLogicalDevice->vki = instanceDispatchMap[GetKey(physicalDevice)]; pLogicalDevice->device = *pDevice; @@ -232,101 +236,60 @@ fillDispatchTableDevice(*pDevice, gdpa, &pLogicalDevice->vkd); - // store the table by key - { - scoped_lock l(globalLock); - deviceMap[GetKey(*pDevice)] = pLogicalDevice; - } - - return ret; - } - - VK_LAYER_EXPORT void VKAPI_CALL vkBasalt_DestroyDevice(VkDevice device, const VkAllocationCallbacks* pAllocator) - { - scoped_lock l(globalLock); - - Logger::trace("vkDestroyDevice"); - - LogicalDevice* pLogicalDevice = deviceMap[GetKey(device)].get(); - if (pLogicalDevice->commandPool != VK_NULL_HANDLE) - { - Logger::debug("DestroyCommandPool"); - pLogicalDevice->vkd.DestroyCommandPool(device, pLogicalDevice->commandPool, pAllocator); - } - - pLogicalDevice->vkd.DestroyDevice(device, pAllocator); - - deviceMap.erase(GetKey(device)); - } - - static void saveDeviceQueue(LogicalDevice* pLogicalDevice, uint32_t queueFamilyIndex, VkQueue* pQueue) - { - if (pLogicalDevice->queue != VK_NULL_HANDLE) - { - return; // we allready have a queue - } - - // Save the first graphic capable queue in our deviceMap uint32_t count; - VkBool32 graphicsCapable = VK_FALSE; - // TODO also check if the queue is present capable + pLogicalDevice->vki.GetPhysicalDeviceQueueFamilyProperties(pLogicalDevice->physicalDevice, &count, nullptr); std::vector<VkQueueFamilyProperties> queueProperties(count); - if (count > 0) + pLogicalDevice->vki.GetPhysicalDeviceQueueFamilyProperties(pLogicalDevice->physicalDevice, &count, queueProperties.data()); + for (uint32_t i = 0; i < pCreateInfo->queueCreateInfoCount; i++) { - pLogicalDevice->vki.GetPhysicalDeviceQueueFamilyProperties(pLogicalDevice->physicalDevice, &count, queueProperties.data()); - if ((queueProperties[queueFamilyIndex].queueFlags & VK_QUEUE_GRAPHICS_BIT) != 0) + auto& queueInfo = pCreateInfo->pQueueCreateInfos[i]; + if ((queueProperties[queueInfo.queueFamilyIndex].queueFlags & VK_QUEUE_GRAPHICS_BIT)) { - graphicsCapable = VK_TRUE; - } - } - else - { - // TODO - graphicsCapable = VK_TRUE; - } + pLogicalDevice->vkd.GetDeviceQueue(pLogicalDevice->device, queueInfo.queueFamilyIndex, 0, &pLogicalDevice->queue); - if (graphicsCapable) - { - VkCommandPoolCreateInfo commandPoolCreateInfo; - commandPoolCreateInfo.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO; - commandPoolCreateInfo.pNext = nullptr; - commandPoolCreateInfo.flags = 0; - commandPoolCreateInfo.queueFamilyIndex = queueFamilyIndex; + VkCommandPoolCreateInfo commandPoolCreateInfo; + commandPoolCreateInfo.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO; + commandPoolCreateInfo.pNext = nullptr; + commandPoolCreateInfo.flags = 0; + commandPoolCreateInfo.queueFamilyIndex = queueInfo.queueFamilyIndex; - Logger::debug("found graphic capable queue"); - pLogicalDevice->vkd.CreateCommandPool(pLogicalDevice->device, &commandPoolCreateInfo, nullptr, &pLogicalDevice->commandPool); - pLogicalDevice->queue = *pQueue; - pLogicalDevice->queueFamilyIndex = queueFamilyIndex; - } - } + Logger::debug("Found graphics capable queue"); + pLogicalDevice->vkd.CreateCommandPool(pLogicalDevice->device, &commandPoolCreateInfo, nullptr, &pLogicalDevice->commandPool); + pLogicalDevice->queueFamilyIndex = queueInfo.queueFamilyIndex; - VKAPI_ATTR void VKAPI_CALL vkBasalt_GetDeviceQueue2(VkDevice device, const VkDeviceQueueInfo2* pQueueInfo, VkQueue* pQueue) - { - scoped_lock l(globalLock); + initializeDispatchTable(pLogicalDevice->queue, pLogicalDevice->device); - Logger::trace("vkGetDeviceQueue2"); + break; + } + } - LogicalDevice* pLogicalDevice = deviceMap[GetKey(device)].get(); + if (!pLogicalDevice->queue) + Logger::err("Did not find a graphics queue!"); - pLogicalDevice->vkd.GetDeviceQueue2(device, pQueueInfo, pQueue); + deviceMap[GetKey(*pDevice)] = pLogicalDevice; - saveDeviceQueue(pLogicalDevice, pQueueInfo->queueFamilyIndex, pQueue); + return VK_SUCCESS; } - VKAPI_ATTR void VKAPI_CALL vkBasalt_GetDeviceQueue(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue* pQueue) + VK_LAYER_EXPORT void VKAPI_CALL vkBasalt_DestroyDevice(VkDevice device, const VkAllocationCallbacks* pAllocator) { scoped_lock l(globalLock); - Logger::trace("vkGetDeviceQueue"); + Logger::trace("vkDestroyDevice"); LogicalDevice* pLogicalDevice = deviceMap[GetKey(device)].get(); + if (pLogicalDevice->commandPool != VK_NULL_HANDLE) + { + Logger::debug("DestroyCommandPool"); + pLogicalDevice->vkd.DestroyCommandPool(device, pLogicalDevice->commandPool, pAllocator); + } - pLogicalDevice->vkd.GetDeviceQueue(device, queueFamilyIndex, queueIndex, pQueue); + pLogicalDevice->vkd.DestroyDevice(device, pAllocator); - saveDeviceQueue(pLogicalDevice, queueFamilyIndex, pQueue); + deviceMap.erase(GetKey(device)); } VKAPI_ATTR VkResult VKAPI_CALL vkBasalt_CreateSwapchainKHR(VkDevice device, @@ -566,7 +529,7 @@ static uint32_t keySymbol = convertToKeySym(pConfig->getOption<std::string>("toggleKey", "Home")); static bool pressed = false; - static bool presentEffect = true; + static bool presentEffect = pConfig->getOption<bool>("enableOnLaunch", true); if (isKeyPressed(keySymbol)) { @@ -876,8 +839,6 @@ GETPROCADDR(EnumerateDeviceExtensionProperties); \ GETPROCADDR(CreateDevice); \ GETPROCADDR(DestroyDevice); \ - GETPROCADDR(GetDeviceQueue); \ - GETPROCADDR(GetDeviceQueue2); \ GETPROCADDR(CreateSwapchainKHR); \ GETPROCADDR(GetSwapchainImagesKHR); \ GETPROCADDR(QueuePresentKHR); \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vkBasalt-0.3.2.4/src/reshade/effect_preprocessor.cpp new/vkBasalt-0.3.2.5/src/reshade/effect_preprocessor.cpp --- old/vkBasalt-0.3.2.4/src/reshade/effect_preprocessor.cpp 2021-01-12 11:40:13.000000000 +0100 +++ new/vkBasalt-0.3.2.5/src/reshade/effect_preprocessor.cpp 2022-02-12 18:17:32.000000000 +0100 @@ -6,6 +6,7 @@ #include "effect_lexer.hpp" #include "effect_preprocessor.hpp" #include <cassert> +#include <algorithm> #ifndef _WIN32 // On Linux systems the native path encoding is UTF-8 already, so no conversion necessary diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vkBasalt-0.3.2.4/src/shader/cas.frag.glsl new/vkBasalt-0.3.2.5/src/shader/cas.frag.glsl --- old/vkBasalt-0.3.2.4/src/shader/cas.frag.glsl 2021-01-12 11:40:13.000000000 +0100 +++ new/vkBasalt-0.3.2.5/src/shader/cas.frag.glsl 2022-02-12 18:17:32.000000000 +0100 @@ -23,55 +23,59 @@ layout(location = 0) in vec2 textureCoord; layout(location = 0) out vec4 fragColor; +#define textureLod0Offset(img, coord, offset) textureLodOffset(img, coord, 0.0f, offset) +#define textureLod0(img, coord) textureLod(img, coord, 0.0f) + void main() { // fetch a 3x3 neighborhood around the pixel 'e', // a b c // d(e)f // g h i - float alpha = texture(img,textureCoord).w; - - vec3 a = textureOffset(img, textureCoord, ivec2(-1,-1)).xyz; - vec3 b = textureOffset(img, textureCoord, ivec2( 0,-1)).xyz; - vec3 c = textureOffset(img, textureCoord, ivec2( 1,-1)).xyz; - vec3 d = textureOffset(img, textureCoord, ivec2(-1, 0)).xyz; - vec3 e = textureOffset(img, textureCoord, ivec2( 0, 0)).xyz; - vec3 f = textureOffset(img, textureCoord, ivec2( 1, 0)).xyz; - vec3 g = textureOffset(img, textureCoord, ivec2(-1, 1)).xyz; - vec3 h = textureOffset(img, textureCoord, ivec2( 0, 1)).xyz; - vec3 i = textureOffset(img, textureCoord, ivec2( 1, 1)).xyz; - + vec4 inputColor = textureLod0(img,textureCoord); + float alpha = inputColor.a; + + vec3 a = textureLod0Offset(img, textureCoord, ivec2(-1,-1)).rgb; + vec3 b = textureLod0Offset(img, textureCoord, ivec2( 0,-1)).rgb; + vec3 c = textureLod0Offset(img, textureCoord, ivec2( 1,-1)).rgb; + vec3 d = textureLod0Offset(img, textureCoord, ivec2(-1, 0)).rgb; + vec3 e = inputColor.rgb; + vec3 f = textureLod0Offset(img, textureCoord, ivec2( 1, 0)).rgb; + vec3 g = textureLod0Offset(img, textureCoord, ivec2(-1, 1)).rgb; + vec3 h = textureLod0Offset(img, textureCoord, ivec2( 0, 1)).rgb; + vec3 i = textureLod0Offset(img, textureCoord, ivec2( 1, 1)).rgb; + // Soft min and max. // a b c b // d e f * 0.5 + d e f * 0.5 // g h i h // These are 2.0x bigger (factored out the extra multiply). - + vec3 mnRGB = min(min(min(d,e),min(f,b)),h); vec3 mnRGB2 = min(min(min(mnRGB,a),min(g,c)),i); mnRGB += mnRGB2; - + vec3 mxRGB = max(max(max(d,e),max(f,b)),h); vec3 mxRGB2 = max(max(max(mxRGB,a),max(g,c)),i); mxRGB += mxRGB2; - + // Smooth minimum distance to signal limit divided by smooth max. - + vec3 rcpMxRGB = vec3(1)/mxRGB; vec3 ampRGB = clamp((min(mnRGB,2.0-mxRGB) * rcpMxRGB),0,1); - + // Shaping amount of sharpening. ampRGB = inversesqrt(ampRGB); float peak = 8.0 - 3.0 * sharpness; vec3 wRGB = -vec3(1)/(ampRGB * peak); vec3 rcpWeightRGB = vec3(1)/(1.0 + 4.0 * wRGB); - + // 0 w 0 // Filter shape: w 1 w // 0 w 0 - + vec3 window = (b + d) + (f + h); vec3 outColor = clamp((window * wRGB + e) * rcpWeightRGB,0,1); - + fragColor = vec4(outColor,alpha); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vkBasalt-0.3.2.4/src/shader/deband.frag.glsl new/vkBasalt-0.3.2.5/src/shader/deband.frag.glsl --- old/vkBasalt-0.3.2.4/src/shader/deband.frag.glsl 2021-01-12 11:40:13.000000000 +0100 +++ new/vkBasalt-0.3.2.5/src/shader/deband.frag.glsl 2022-02-12 18:17:32.000000000 +0100 @@ -39,6 +39,8 @@ layout(location = 0) in vec2 texcoord; layout(location = 0) out vec4 fragColor; +#define textureLod0Offset(img, coord, offset) textureLodOffset(img, coord, 0.0f, offset) +#define textureLod0(img, coord) textureLod(img, coord, 0.0f) float rand(float x) { @@ -55,28 +57,28 @@ // Sample at quarter-turn intervals around the source pixel // South-east - vec3 ref = texture(tex, texcoord + _range * dir).rgb; + vec3 ref = textureLod0(tex, texcoord + _range * dir).rgb; vec3 diff = abs(ori - ref); ref_max_diff = diff; ref_avg = ref; ref_mid_diff1 = ref; // North-west - ref = texture(tex, texcoord + _range * -dir).rgb; + ref = textureLod0(tex, texcoord + _range * -dir).rgb; diff = abs(ori - ref); ref_max_diff = max(ref_max_diff, diff); ref_avg += ref; ref_mid_diff1 = abs(((ref_mid_diff1 + ref) * 0.5) - ori); // North-east - ref = texture(tex, texcoord + _range * vec2(-dir.y, dir.x)).rgb; + ref = textureLod0(tex, texcoord + _range * vec2(-dir.y, dir.x)).rgb; diff = abs(ori - ref); ref_max_diff = max(ref_max_diff, diff); ref_avg += ref; ref_mid_diff2 = ref; // South-west - ref = texture(tex, texcoord + _range * vec2( dir.y, -dir.x)).rgb; + ref = textureLod0(tex, texcoord + _range * vec2( dir.y, -dir.x)).rgb; diff = abs(ori - ref); ref_max_diff = max(ref_max_diff, diff); ref_avg += ref; @@ -104,7 +106,7 @@ vec3 ref_mid_diff1; // The difference between the average of SE and NW reference pixels and the original pixel vec3 ref_mid_diff2; // The difference between the average of NE and SW reference pixels and the original pixel - vec4 ori_alpha = texture(img, texcoord); // Original pixel + vec4 ori_alpha = textureLod0(img, texcoord); // Original pixel vec3 ori = ori_alpha.rgb; vec3 res; // Final pixel diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vkBasalt-0.3.2.4/src/shader/dls.frag.glsl new/vkBasalt-0.3.2.5/src/shader/dls.frag.glsl --- old/vkBasalt-0.3.2.4/src/shader/dls.frag.glsl 2021-01-12 11:40:13.000000000 +0100 +++ new/vkBasalt-0.3.2.5/src/shader/dls.frag.glsl 2022-02-12 18:17:32.000000000 +0100 @@ -30,6 +30,9 @@ layout(location = 0) in vec2 textureCoord; layout(location = 0) out vec4 fragColor; +#define textureLod0Offset(img, coord, offset) textureLodOffset(img, coord, 0.0f, offset) +#define textureLod0(img, coord) textureLod(img, coord, 0.0f) + float GetLumaComponents(float r, float g, float b) { // Y from JPEG spec @@ -61,17 +64,17 @@ // a (x) b // g c f - vec4 x = texture(img, textureCoord); - - vec4 a = textureOffset(img, textureCoord, ivec2(-1, 0)); - vec4 b = textureOffset(img, textureCoord, ivec2( 1, 0)); - vec4 c = textureOffset(img, textureCoord, ivec2( 0, 1)); - vec4 d = textureOffset(img, textureCoord, ivec2( 0, -1)); - - vec4 e = textureOffset(img, textureCoord, ivec2(-1, -1)); - vec4 f = textureOffset(img, textureCoord, ivec2( 1, 1)); - vec4 g = textureOffset(img, textureCoord, ivec2(-1, 1)); - vec4 h = textureOffset(img, textureCoord, ivec2( 1, -1)); + vec4 x = textureLod0(img, textureCoord); + + vec4 a = textureLod0Offset(img, textureCoord, ivec2(-1, 0)); + vec4 b = textureLod0Offset(img, textureCoord, ivec2( 1, 0)); + vec4 c = textureLod0Offset(img, textureCoord, ivec2( 0, 1)); + vec4 d = textureLod0Offset(img, textureCoord, ivec2( 0, -1)); + + vec4 e = textureLod0Offset(img, textureCoord, ivec2(-1, -1)); + vec4 f = textureLod0Offset(img, textureCoord, ivec2( 1, 1)); + vec4 g = textureLod0Offset(img, textureCoord, ivec2(-1, 1)); + vec4 h = textureLod0Offset(img, textureCoord, ivec2( 1, -1)); float lx = GetLuma(x); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vkBasalt-0.3.2.4/src/shader/lut.frag.glsl new/vkBasalt-0.3.2.5/src/shader/lut.frag.glsl --- old/vkBasalt-0.3.2.4/src/shader/lut.frag.glsl 2021-01-12 11:40:13.000000000 +0100 +++ new/vkBasalt-0.3.2.5/src/shader/lut.frag.glsl 2022-02-12 18:17:32.000000000 +0100 @@ -10,21 +10,24 @@ layout(location = 0) in vec2 textureCoord; layout(location = 0) out vec4 fragColor; +#define textureLod0Offset(img, coord, offset) textureLodOffset(img, coord, 0.0f, offset) +#define textureLod0(img, coord) textureLod(img, coord, 0.0f) + void main() { vec4 color; if(flipGB != 0) { - color = texture(img,textureCoord).rbga; + color = textureLod0(img,textureCoord).rbga; } else { - color = texture(img,textureCoord); + color = textureLod0(img,textureCoord); } - + //see https://developer.nvidia.com/gpugems/GPUGems2/gpugems2_chapter24.html vec3 scale = (vec3(lutSize) - 1.0) / vec3(lutSize); vec3 offset = 1.0 / (2.0 * vec3(lutSize)); - - fragColor = vec4(texture(lut, scale * color.rgb + offset).rgb, color.a); + + fragColor = vec4(textureLod0(lut, scale * color.rgb + offset).rgb, color.a); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vkBasalt-0.3.2.4/src/shader/smaa_neighbor.vert.glsl new/vkBasalt-0.3.2.5/src/shader/smaa_neighbor.vert.glsl --- old/vkBasalt-0.3.2.4/src/shader/smaa_neighbor.vert.glsl 2021-01-12 11:40:13.000000000 +0100 +++ new/vkBasalt-0.3.2.5/src/shader/smaa_neighbor.vert.glsl 2022-02-12 18:17:32.000000000 +0100 @@ -1,18 +1,6 @@ #version 450 #extension GL_GOOGLE_include_directive : require -vec2 positions[3] = vec2[]( - vec2(-1.0,-1.0), - vec2( 3.0,-1.0), - vec2(-1.0, 3.0) -); - -vec2 texture_coordinates[3] = vec2[]( - vec2( 0.0, 0.0), - vec2( 2.0, 0.0), - vec2( 0.0, 2.0) -); - layout(location=0) out vec2 textureCoord; layout(location=1) out vec4 offset; @@ -23,8 +11,13 @@ void main() { - textureCoord = texture_coordinates[gl_VertexIndex]; + gl_Position = vec4(gl_VertexIndex == 1 ? 3.0 : -1.0, + gl_VertexIndex == 2 ? 3.0 : -1.0, + 0.0, + 1.0); + + textureCoord = vec2(gl_VertexIndex == 1 ? 2.0 : 0.0, + gl_VertexIndex == 2 ? 2.0 : 0.0); + SMAANeighborhoodBlendingVS(textureCoord, offset); - gl_Position = vec4(positions[gl_VertexIndex], 0.0, 1.0); - }