cschied / q2vkpt

Real-time path tracer VKPT integrated into q2pro Quake 2 client.
http://brechpunkt.de/q2vkpt
GNU General Public License v2.0
946 stars 76 forks source link

Error compiling asvgf_temporal.comp on Ubuntu 18.04 #40

Open lucastoro opened 5 years ago

lucastoro commented 5 years ago

Compiling with the following .config:

CONFIG_PNG=1
CONFIG_JPEG=1
CONFIG_SDL2=1
CONFIG_VKPT_RENDERER=1
CONFIG_VKPT_ENABLE_VALIDATION=0
CONFIG_NO_MD3=1
CONFIG_X11=y
CC=gcc

Leads to the following shader compilation error:

src/refresh/vkpt/shader/asvgf_temporal.comp
ERROR: src/refresh/vkpt/shader/asvgf_temporal.comp:231: 'format' : image formats must match 
ERROR: src/refresh/vkpt/shader/asvgf_temporal.comp:231: 'format' : image formats must match 
ERROR: src/refresh/vkpt/shader/asvgf_temporal.comp:233: '' : compilation terminated 
ERROR: 3 compilation errors.  No code generated.

In order to make the application run I "patched" glslangValidator so to skip the error, of course it's not a solution but the shader gets compiled and the q2vkpt runs.

--- a/glslang/MachineIndependent/ParseHelper.cpp
+++ b/glslang/MachineIndependent/ParseHelper.cpp
@@ -1166,2 +1166,2 @@ TIntermTyped* TParseContext::handleFunctionCall(const TSourceLoc& loc, TFunction
-                                                              argQualifier.layoutFormat != ElfNone))
-                            error(arguments->getLoc(), "image formats must match", "format", "");
+                                                              argQualifier.layoutFormat != ElfNone));
+                            //error(arguments->getLoc(), "image formats must match", "format", "");

q2vkpt: 0baa1a1fc33f98 glslang (pre-patch): 7.11.3204 (from here) glslang: 86c72c9486a97 (from here) Nvidia Driver: 430.09 OS: Ubuntu 18.04.2 x86_64 (4.15.0-48-generic) GPU: GTX 1070 VK_NV_ray_tracing: extension revision 3

Thank you for your amazing work

scratlantis commented 2 years ago

There seems to be some trouble with image formats when using images as function arguments. See: https://github.com/KhronosGroup/GLSL/issues/57 A solution that seems to work, is to make the entire function "temporal_filter(...)" in "asvgf_temporal.comp" into a macro.