This thread is intended for feedback and discussion regarding the recently released Vulkan renderer preview ( Unity Blog ).
Have a problem? Got some feedback? Post it here!
I got it a build running. But I think the compiler is not mature enough or simply vulkan does not allow these things, because there are multiple errors thrown when compiling a pretty complex grass shader . It throws out bunch of errors. Here is a list of them:
'out; must be an array: undefined 146
'out; must be an array: cullDistance 147
'scalar swizzle' : not supported with this profile: es 150
'assign' : |-value required (can't modify a const) 166
'gl_ClipDistance' left of left of '[' is not of type array, matrix or vector 166
'gl_ClipDistance' : undeclared identifier 166
'phase3_gl_TessLevelOuter' : left of '[' is not of type array, matrix or vector 166
'phase3_gl_TessLevelOuter' : undeclared identifier 166
Should I file a bug report?
Hey,
Thanks for testing! This looks like a bug in the shader compiler. Please test it first with GLCore renderer as well (my guess is that it might fail there as well), and either way, please file a bug report with a repro.
Cheers,
Mikko
strandborg:
Hey,
Thanks for testing! This looks like a bug in the shader compiler. Please test it first with GLCore renderer as well (my guess is that it might fail there as well), and either way, please file a bug report with a repro.
Cheers,
Mikko
GLCore is known not to work as well . But all right, I will file the bug report.
Then it is very likely that this is the same exact issue, caused by the shader compiler because both vulkan and gl use hlslcc for translation. Thanks for reporting it though, we’ll take a look.
Umm, I kinda can’t use cutout shaders on Android deploy. All the textures have alpha checked, it doesn’t use Graphics job and still cutout shaders don’t, well, cutout.
Kolyasisan:
Umm, I kinda can’t use cutout shaders on Android deploy. All the textures have alpha checked, it doesn’t use Graphics job and still cutout shaders don’t, well, cutout.
Hmm cutouts should work… which device are you testing it on? Does this also happen on Windows standalone when targeting Vulkan? In any case, please file a bug with repro project and we’ll check it out.
It happens on 2 android devices and in Android editor, nothing of that happens while targeting standalone. Gotta file a bug report now…
EDIT: figured out what was the problem, it didn’t work because of “Alpha is transparency” turned on. Had to disable it. Strange.
Arowx
September 30, 2016, 12:12am
9
Builds and Starts up OK then stalls with a ‘grayish’ screen post Unity Logo.
Initialize engine version: 5.5.0b4 (275684f68981)
GfxDevice: creating device client; threaded=1
[Vulkan init] extensions: count=3
[Vulkan init] extensions: name=VK_KHR_surface, enabled=1
[Vulkan init] extensions: name=VK_KHR_win32_surface, enabled=1
[Vulkan init] extensions: name=VK_EXT_debug_report, enabled=0
[Vulkan init] extensions: count=8
[Vulkan init] extensions: name=VK_KHR_sampler_mirror_clamp_to_edge, enabled=0
[Vulkan init] extensions: name=VK_KHR_swapchain, enabled=1
[Vulkan init] extensions: name=VK_AMD_rasterization_order, enabled=0
[Vulkan init] extensions: name=VK_AMD_shader_ballot, enabled=0
[Vulkan init] extensions: name=VK_AMD_shader_trinary_minmax, enabled=0
[Vulkan init] extensions: name=VK_AMD_shader_explicit_vertex_parameter, enabled=0
[Vulkan init] extensions: name=VK_AMD_gcn_shader, enabled=0
[Vulkan init] extensions: name=VK_AMD_draw_indirect_count, enabled=0
Vulkan API version 1.0.21
Vulkan vendor=[ATI] id=[1002]
Vulkan renderer=[AMD Radeon HD 7900 Series] id=[679a]
Vulkan device type 2
Vulkan driverversion=[0x00403000] uint=[4206592]
Default GameObject BitMask: UI already registered
(Filename: Line: 100)
Begin MonoManager ReloadAssembly
Platform assembly: E:\Dev\Active Projects\BenchmarkVulkan\Test\CMVulkan_Data\Managed\UnityEngine.dll (this message is harmless)
Loading E:\Dev\Active Projects\BenchmarkVulkan\Test\CMVulkan_Data\Managed\UnityEngine.dll into Unity Child Domain
Platform assembly: E:\Dev\Active Projects\BenchmarkVulkan\Test\CMVulkan_Data\Managed\Assembly-CSharp-firstpass.dll (this message is harmless)
Loading E:\Dev\Active Projects\BenchmarkVulkan\Test\CMVulkan_Data\Managed\Assembly-CSharp-firstpass.dll into Unity Child Domain
Platform assembly: E:\Dev\Active Projects\BenchmarkVulkan\Test\CMVulkan_Data\Managed\Assembly-CSharp.dll (this message is harmless)
Loading E:\Dev\Active Projects\BenchmarkVulkan\Test\CMVulkan_Data\Managed\Assembly-CSharp.dll into Unity Child Domain
Platform assembly: E:\Dev\Active Projects\BenchmarkVulkan\Test\CMVulkan_Data\Managed\UnityEngine.UI.dll (this message is harmless)
Loading E:\Dev\Active Projects\BenchmarkVulkan\Test\CMVulkan_Data\Managed\UnityEngine.UI.dll into Unity Child Domain
Platform assembly: E:\Dev\Active Projects\BenchmarkVulkan\Test\CMVulkan_Data\Managed\UnityEngine.Networking.dll (this message is harmless)
Loading E:\Dev\Active Projects\BenchmarkVulkan\Test\CMVulkan_Data\Managed\UnityEngine.Networking.dll into Unity Child Domain
Platform assembly: E:\Dev\Active Projects\BenchmarkVulkan\Test\CMVulkan_Data\Managed\UnityEngine.PlaymodeTestsRunner.dll (this message is harmless)
Loading E:\Dev\Active Projects\BenchmarkVulkan\Test\CMVulkan_Data\Managed\UnityEngine.PlaymodeTestsRunner.dll into Unity Child Domain
Completed reload, in 0.037 seconds
Platform assembly: E:\Dev\Active Projects\BenchmarkVulkan\Test\CMVulkan_Data\Managed\System.Core.dll (this message is harmless)
Platform assembly: E:\Dev\Active Projects\BenchmarkVulkan\Test\CMVulkan_Data\Managed\System.dll (this message is harmless)
OnLevelWasLoaded was found on GameData
This message has been deprecated and will be removed in a later version of Unity.
Add a delegate to SceneManager.sceneLoaded instead to get notifications after scene loading has completed
(Filename: Line: 379)
desktop: 1600x1200 60Hz; virtual: 1600x1200 at 0,0
Initializing input.
Input initialized.
InitializeOrResetSwapChain 1600x1200 samples=2
Using present mode 2
Initialized touch support.
UnloadTime: 1.204624 ms
Setting up 6 worker threads for Enlighten.
Thread → id: 2064 → priority: 1
Thread → id: 206c → priority: 1
Thread → id: 2068 → priority: 1
Thread → id: 14d8 → priority: 1
Thread → id: 370 → priority: 1
Thread → id: 2184 → priority: 1
InitializeOrResetSwapChain 1600x1200 samples=2
Vulkan error VK_ERROR_DEVICE_LOST (-4) file: C:/buildslave/unity/build/Runtime/GfxDevice/vulkan/VKTaskExecutor.cpp, line: 675
App Log File (above)
Windows 10 PC latest AMD drivers, a quick one default cube test scene/project seems to work OK?
Arowx:
Builds and Starts up OK then stalls with a ‘grayish’ screen post Unity Logo.
App Log File (above)
Windows 10 PC latest AMD drivers, a quick one default cube test scene/project seems to work OK?
Was this with Graphics Jobs on or off? The error saying VK_ERROR_DEVICE_LOST seems kinda fatal =). Can you send us a small repro project where this happens?
Machine:
Intel Xeon E3-1231
8Gbyte RAM
Geforce GTX 750 Ti
Windows 7 Pro
What should I say? I had almost no compatibility issues after migrating from 5.3.6. The overall performance with everything left at default (no graphics jobs) is in our project around 10-20fps higher. The overall look is far smoother. Way less z-buffer issues and very nice shadows. Conclusion: GREAT JOB FOLKS! Can’t await to get my hands dirty with a more stable version.
1 Like
toxtronyx:
Machine:
Intel Xeon E3-1231
8Gbyte RAM
Geforce GTX 750 Ti
Windows 7 Pro
What should I say? I had almost no compatibility issues after migrating from 5.3.6. The overall performance with everything left at default (no graphics jobs) is in our project around 10-20fps higher. The overall look is far smoother. Way less z-buffer issues and very nice shadows. Conclusion: GREAT JOB FOLKS! Can’t await to get my hands dirty with a more stable version.
Awesome! Is this on desktop standalone, or on Android? If desktop, which graphics API were you using previously?
Arowx
September 30, 2016, 3:01pm
13
Graphic Jobs Off.
Standalone.
As stated a simple test scene works.
4.2.3. Lost Device
A logical device may become lost because of hardware errors, execution timeouts, power management events and/or platform-specific events. This may cause pending and future command execution to fail and cause hardware resources to be corrupted. When this happens, certain commands will returnVK_ERROR_DEVICE_LOST (see Error Codes for a list of such commands). After any such event, the logical device is considered lost . It is not possible to reset the logical device to a non-lost state, however the lost state is specific to a logical device (VkDevice), and the corresponding physical device (VkPhysicalDevice) may be otherwise unaffected. In some cases, the physical device may also be lost, and attempting to create a new logical device will fail, returning VK_ERROR_DEVICE_LOST. This is usually indicative of a problem with the underlying hardware, or its connection to the host. If the physical device has not been lost, and a new logical device is successfully created from that physical device, it must be in the non-lost state.
Note
Whilst logical device loss may be recoverable, in the case of physical device loss, it is unlikely that an application will be able to recover unless additional, unaffected physical devices exist on the system. The error is largely informational and intended only to inform the user that their hardware has probably developed a fault or become physically disconnected, and should be investigated further. In many cases, physical device loss may cause other more serious issues such as the operating system crashing; in which case it may not be reported via the Vulkan API.
Note
Undefined behavior caused by an application error may cause a device to become lost. However, such undefined behavior may also cause unrecoverable damage to the process, and it is then not guaranteed that the API objects, including the VkPhysicalDevice or the VkInstance are still valid or that the error is recoverable.
When a device is lost, its child objects are not implicitly destroyed and their handles are still valid. Those objects must still be destroyed before their parents or the device can be destroyed (see the Object Lifetime section). The host address space corresponding to device memory mapped using vkMapMemory is still valid, and host memory accesses to these mapped regions are still valid, but the contents are undefined. It is still legal to call any API command on the device and child objects.
Once a device is lost, command execution may fail, and commands that return a VkResult may return VK_ERROR_DEVICE_LOST. Commands that do not allow run-time errors must still operate correctly for valid usage and, if applicable, return valid data.
It looks like it might not be terminal just a recoverable hiccup.
Arowx
September 30, 2016, 3:06pm
14
OK It’s when I use the default instance shader, even on a few cubes it crashes.
Okay, please file a bug with a repro project and we’ll take a look.
Yep, this was indeed the same case, and I finally got around to take a look at it. There were a few fixes needed to the shader compiler (and the fixes are in the process of trickling down to 5.5 and 5.4), but the content also has some problems: the domain shader outputs triangles, while the geometry shader takes points in. DX11 seems to silently ignore this, but both OpenGL and Vulkan implementations, if they wish to be conformant, have to detect and reject these cases. The shaders need to be reworked somewhat so that either the domain shader outputs points or the geometry shader takes in triangles; I didn’t look into the shader any further than that.
Arowx:
Case 837045 raised.
Here’s what I’ve gathered so far:
NVidia GPU renders just fine.
On my AMD GPU I’m not getting any errors, but the cubes are not rendered either.
I’ll have to investigate this a bit further. Thanks for the report!
I found an annoying bug. Vulkan tends to mess up some image effects in built version of the game. Applied 2 screenshots, one of editor and other of build. Notice how bloom (from cinematic image effects) is messed up.