Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If vulkan version miss some .spv files? #11

Open
irimsky opened this issue Oct 29, 2021 · 2 comments
Open

If vulkan version miss some .spv files? #11

irimsky opened this issue Oct 29, 2021 · 2 comments

Comments

@irimsky
Copy link

irimsky commented Oct 29, 2021

When I run PBR -vulkan on Windows, it first threw the VK_ERROR_LAYER_NOT_PRESENT ERROR,
then I modified the related code not to load layers, then run again, it threw the Error: Could not open file: shaders/spirv/tonemap_vs.spv
But I didn't find the tonemap_vs.spv in the shaders dir. Is there anything missed?

@irimsky
Copy link
Author

irimsky commented Oct 29, 2021

I may got that spv should be translated from glsl. Maybe my vulkan version is the newest, so it don't support "VK_LAYER_KHRONOS_validation"
But it still can't work after I change the layer, because it has no output of spv files. Maybe it's not compatible with the new version?

@irimsky
Copy link
Author

irimsky commented Oct 30, 2021

So I have to solve it by manually add .psv files like this:

void add_spirv(const char* shadername, const char* stage)
{
	char cmdline[225];
	sprintf(cmdline, "glslangValidator -V -S %s -o \".\\shaders\\spirv\\%s.spv\" \".\\shaders\\glsl\\%s.glsl\" ", stage, shadername, shadername);
	std::cout << cmdline << std::endl;
	system(cmdline);
}

...

add_spirv("equirect2cube_cs", "comp");
add_spirv("irmap_cs", "comp");
add_spirv("pbr_fs", "frag");
add_spirv("pbr_vs", "vert");
add_spirv("skybox_fs", "frag");
add_spirv("skybox_vs", "vert");
add_spirv("spbrdf_cs", "comp");
add_spirv("spmap_cs", "comp");
add_spirv("tonemap_fs", "frag");
add_spirv("tonemap_vs", "vert");

then it can work at least...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant