diff --git a/src/rendervulkan.cpp b/src/rendervulkan.cpp index 48bd78d..825545f 100644 --- a/src/rendervulkan.cpp +++ b/src/rendervulkan.cpp @@ -1279,8 +1279,6 @@ retry: vecEnabledDeviceExtensions.push_back( VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME ); vecEnabledDeviceExtensions.push_back( VK_EXT_EXTERNAL_MEMORY_DMA_BUF_EXTENSION_NAME ); - vecEnabledDeviceExtensions.push_back( VK_KHR_SHADER_CLOCK_EXTENSION_NAME ); - vecEnabledDeviceExtensions.push_back( VK_EXT_ROBUSTNESS_2_EXTENSION_NAME ); if ( supportsFp16 ) @@ -1302,11 +1300,6 @@ retry: .pEnabledFeatures = 0, }; - VkPhysicalDeviceShaderClockFeaturesKHR clockFeatures = {}; - clockFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR; - clockFeatures.pNext = std::exchange(features2.pNext, &clockFeatures); - clockFeatures.shaderSubgroupClock = VK_TRUE; - VkPhysicalDeviceSamplerYcbcrConversionFeatures ycbcrFeatures = {}; ycbcrFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES; ycbcrFeatures.pNext = std::exchange(features2.pNext, &ycbcrFeatures); diff --git a/src/shaders/composite.h b/src/shaders/composite.h index c0c902b..e243ef6 100644 --- a/src/shaders/composite.h +++ b/src/shaders/composite.h @@ -22,15 +22,23 @@ vec4 linearToSrgb(vec4 color) { return vec4(linearToSrgb(color.rgb), color.a); } -void compositing_debug(uvec2 size, uvec2 coord) { +uint pseudo_random(uint seed) { + seed ^= (seed << 13); + seed ^= (seed >> 17); + seed ^= (seed << 5); + return seed * 1664525u + 1013904223u; +} + +void compositing_debug(uvec2 coord) { uvec2 pos = coord; - pos.x -= (u_frameId & 2) != 0 ? /* size.x - 160 */ 128 : 0; - pos.y -= (u_frameId & 1) != 0 ? /* size.y - 160 */ 128 : 0; + pos.x -= (u_frameId & 2) != 0 ? 128 : 0; + pos.y -= (u_frameId & 1) != 0 ? 128 : 0; if (pos.x >= 40 && pos.x < 120 && pos.y >= 40 && pos.y < 120) { vec4 value = vec4(1.0f, 1.0f, 1.0f, 1.0f); if (pos.x >= 48 && pos.x < 112 && pos.y >= 48 && pos.y < 112) { - vec4 time = round(unpackUnorm4x8(clock2x32ARB().x * 1664525u + 1013904223u)).xyzw; + uint random = pseudo_random(u_frameId.x + (pos.x & ~0x7) + (pos.y & ~0x7) * 50); + vec4 time = round(unpackUnorm4x8(random)).xyzw; if (time.x + time.y + time.z + time.w < 2.0f) value = vec4(0.0f, 0.0f, 0.0f, 1.0f); } diff --git a/src/shaders/cs_composite_blit.comp b/src/shaders/cs_composite_blit.comp index 50e2f52..f07fc01 100644 --- a/src/shaders/cs_composite_blit.comp +++ b/src/shaders/cs_composite_blit.comp @@ -1,8 +1,7 @@ #version 450 -#extension GL_GOOGLE_include_directive : require #extension GL_EXT_scalar_block_layout : require -#extension GL_ARB_shader_clock : require +#extension GL_GOOGLE_include_directive : require #include "descriptor_set.h" @@ -57,5 +56,5 @@ void main() { // Indicator to quickly tell if we're in the compositing path or not. if (c_compositing_debug) - compositing_debug(outSize, coord); + compositing_debug(coord); } diff --git a/src/shaders/cs_composite_rcas.comp b/src/shaders/cs_composite_rcas.comp index e9b5b9a..b2db6b6 100644 --- a/src/shaders/cs_composite_rcas.comp +++ b/src/shaders/cs_composite_rcas.comp @@ -1,6 +1,5 @@ #version 460 -#extension GL_ARB_shader_clock : require #extension GL_EXT_scalar_block_layout : require #extension GL_GOOGLE_include_directive : require @@ -77,7 +76,7 @@ void rcasComposite(uvec2 pos) imageStore(dst, ivec2(pos), vec4(outputValue, undef)); if (c_compositing_debug) - compositing_debug(uvec2(0), ivec2(pos)); + compositing_debug(pos); } void main()