Hi All !
I use glslang for compilation GLSL/HLSL to SPIR-V. vkCreateGraphicsPipelines returns VK_ERROR_OUT_OF_HOST_MEMORY
So, I know the problem in my shader code, because if I use SV_POSITION instead of POSITION it works.
The similar problem was described here:vkCreateGraphicsPipelines returns VK_ERROR_INITIALIZATION_FAILED
I have attached minimal test project for Visual Studio 2017 with source code, HLSL source code and spirv output.
please see vs.vert
#define POSITION SV_POSITION // it will work.
...
I have no problem on nVidia/ARM Mali GPU. Bug happens on AMD R7 240, AMD R7 350X
May be could you fix Vulkan Driver ?
BR, Andrey.
Yes, HLSL declare the output as "Position" instead of "SV_Position", where "Position" is not a system value but a generic semantic name, or else PS won't executed because VS doesn't export position.
Hi dorisyan, why do we have VK_ERROR_OUT_OF_HOST_MEMORY? Because on another GPU we have no this error.
VK_ERROR_OUT_OF_HOST_MEMORY means the memory you are going to use is NULL now, do you allocate host memory for that? and maybe it has been deleted?
Hi dorisyan
VK_ERROR_OUT_OF_HOST_MEMORY means the memory you are going to use is NULL now, do you allocate host memory for that? and maybe it has been deleted?
I have no problem with memory on HOST for attached small test project. I didn't allocate any memory for this project on HOST using malloc/new. May be we have some allocations inside C RunTime, All structs and variable is allocated in stack. I still think that is AMD driver bug despite we have error in HLSL code.
I suggest AMD return VK_ERROR_INCOMPLETE instead of VK_ERROR_OUT_OF_HOST_MEMORY and fix memory bug in driver, if it exists.
What do you think?
Hi Andrey2007AMD, I also think this error code is not proper.
Refer to spec:
VkResult vkCreateGraphicsPipelines()
VK_ERROR_INVALID_SHADER_NV may be a good choice.
Hi @dorisyan, you are right. This is my mistake