SaschaWillems / Vulkan-glTF-PBR

Physical based rendering with Vulkan using glTF 2.0 models
MIT License
979 stars 132 forks source link

Strange colors on Intel UHD 620 #2

Closed natevm closed 6 years ago

natevm commented 6 years ago

Hey Sascha,

For some reason, I can't get your PBR examples to work on my intel graphics. The scene ends up looking like this: image

Any ideas what might be going on?

Thanks!

SaschaWillems commented 6 years ago

That blue is the default clear color for the irradiance and prefiltered cube map generation passes, so something goes wrong in these.

It's working for for me on Intel, but that's on Linux.

Can you run this with validation enabled and check for any errors? Maybe the driver doesn't support all required formats.

natevm commented 6 years ago

I ran with validation layers on, and I did get a couple error messages but they're just related to cleanup:

ERROR: [ObjectTracker] Code 614466292 : OBJ ERROR : For device 0x1a89bb59828, DeviceMemory object 0x21 has not been destroyed. The spec valid usage text states 'All child objects created on device must have been destroyed prior to destroying device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDevice-device-00378) ERROR: [ObjectTracker] Code 614466292 : OBJ ERROR : For device 0x1a89bb59828, Image object 0x20 has not been destroyed. The spec valid usage text states 'All child objects created on device must have been destroyed prior to destroying device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDevice-device-00378) ERROR: [ObjectTracker] Code 614466292 : OBJ ERROR : For device 0x1a89bb59828, ImageView object 0x24 has not been destroyed. The spec valid usage text states 'All child objects created on device must have been destroyed prior to destroying device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDevice-device-00378) ERROR: [ObjectTracker] Code 614466292 : OBJ ERROR : For device 0x1a89bb59828, Pipeline object 0xa9 has not been destroyed. The spec valid usage text states 'All child objects created on device must have been destroyed prior to destroying device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDevice-device-00378) ERROR: [ObjectTracker] Code 614466292 : OBJ ERROR : For device 0x1a89bb59828, Sampler object 0x23 has not been destroyed. The spec valid usage text states 'All child objects created on device must have been destroyed prior to destroying device' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDevice-device-00378)

natevm commented 6 years ago

I can run the pbrbasic target from your other examples alright: image

...But the results from running pbribl don't seem right: image

Validation layer outputs an error this time: ERROR: [SC] Code 5 : SPIR-V module not valid: Expected vector sizes of Result Type and the condition to be equal: Select Generating BRDF LUT took 226.765 ms Generating irradiance cube with 7 mip levels took 93.0566 ms ERROR: [SC] Code 5 : SPIR-V module not valid: Expected vector sizes of Result Type and the condition to be equal: Select Generating pre-filtered enivornment cube with 10 mip levels took 34.56 ms

Same bluish tint appears on the gun model in your pbrtexture target: image

I also get the same validation errors in the pbrtexture target.

natevm commented 6 years ago

The validation layer throws the error when loading the genbrdflut fragment shader on line 579 of pbribl.cpp. I tried recompiling the shaders with the reference compiler (one that comes with 1.0.68.0), but I get the same error. Maybe it's a validation layer/compiler bug?

SaschaWillems commented 6 years ago

Will take a look at the SPIR-V validation layer message, it's possible that one of the functions e.g. returns a float instead of a vector.

Since this is working fine for me with an Intel iGPU on Linux this may be a Windows related driver bug.

The blueish tint in the pbr samples from my example repo seems to be exactly the same problem. The difference is that these don't display the pre-filtered cube map in the background so it's not as visible as in the pbr sample.

natevm commented 6 years ago

I was able to get the validation layer message to go away by recompiling prefilterenvmap.frag. Still getting the weird blue on intel + windows. Nvidia + windows seems to work with all the above samples though.

natevm commented 6 years ago

I mentioned the bug on Intel's graphics bug reporting forms. Hopefully we can get a response over there.

https://software.intel.com/en-us/forums/graphics-driver-bug-reporting/topic/758149#