Texture2D & Sampler instead of Sampler2D crashing while creating Pipeline
ajaybedi opened this issue · 5 comments
I had the HLSL source with Texture2D and Sampler separately (not using Sampler2D basically)... SPIRV generated through that works fine on Windows but it fails on Android while creatingGraphicsPipeline. Is it a known issue ?
If not, can u please share a tutorial/sample where instead of using Sampler2D you have used Texture2D and Sampler separately. I see this crashing on Samsung S7 as well as Pixel XL
I believe separate_image_sampler is working in the vulkan-basic-samples repo.
@cnorthrop thnx for sharing. Yes. the GLSL based example works but same SPIRV when generated from HLSL (with same sampler and texture) fails on the same device in VKCreateGraphicsPipeline. I have enabled all Validation layers so no issue is reported before this call. This fails with mesg Initialization failed and no other clue. As I told before it works fine on my NVidia driver on Windows. Can this be due to the driver version on Android device.. I have tested both on Pixel device with Adreno GPU and Samsung S7 with Mali & Adreno.. Fails on all these devices in vkCreateGraphicsPipeline.
Are you running with validation layers built from source, or are you using them from the NDK prebuilts? The latter are fairly out of date at this point.
There could be something wrong with the HLSL to SPIR-V toolchain. Can you share the shaders in question? Or is there an application we can run to see this behavior?
@cnorthrop Yes, I am running with latest validation layers built from source directly...
I tried using google's separate_sampler code after changing the shaders to HLSL and compiliing them to SPIR-V and then assigning that SPIR-V in the code. It also failed to run with error VK_ERROR_DEVICE_LOST. Please note that same example having SPIRV generated through GLSL version was working fine.
The vulkandriver API version in the device is 1.0.11. CAn that be the culprit ? I am using latest toolchain for the conversion (1.0.57)... But given that i am trying with very simple shader having only sampler and texture and getting value out of that. I don't think that API version will make a difference here.
In the AST I see that for HLSL converted SPIRV, shader version is mentioned as 500.
Sorry for the long delay is responding - yes, newer drivers will most likely fix your problem. 1.0.11 is rather old (April 2016). The latest Pixel XL images (Android 8.0.0) should support Vulkan apiVersion 1.0.38.
I do recall some changes in the toolchain behavior early on, where they may not handle this scenario correctly, although I can't find a link. Are you able to update the images on your devices?
If moving to the latest does not solve your problem, then we'll need to dig a bit deeper.