增加glsl文件和编译批命令
仅增加glsl文件,代码中未使用
This commit is contained in:
parent
712d8cfca4
commit
7461b7edf3
@ -22,9 +22,14 @@ SET(VULKAN_TEST_HEADER_FILES VK.h
|
|||||||
VKBuffer.h
|
VKBuffer.h
|
||||||
Window.h)
|
Window.h)
|
||||||
|
|
||||||
|
SET(SHADER_FILES shader_compile.bat
|
||||||
|
FlatColor.vert
|
||||||
|
FlatColor.frag)
|
||||||
|
|
||||||
SOURCE_GROUP("Header Files" FILES ${VULKAN_TEST_HEADER_FILES})
|
SOURCE_GROUP("Header Files" FILES ${VULKAN_TEST_HEADER_FILES})
|
||||||
SOURCE_GROUP("Source Files" FILES ${VULKAN_TEST_SOURCE_FILES})
|
SOURCE_GROUP("Source Files" FILES ${VULKAN_TEST_SOURCE_FILES})
|
||||||
|
SOURCE_GROUP("Shader Files" FILES ${SHADER_FILES})
|
||||||
|
|
||||||
add_executable(VulkanTest ${VULKAN_TEST_HEADER_FILES} ${VULKAN_TEST_SOURCE_FILES})
|
add_executable(VulkanTest ${VULKAN_TEST_HEADER_FILES} ${VULKAN_TEST_SOURCE_FILES} ${SHADER_FILES})
|
||||||
|
|
||||||
target_link_libraries(VulkanTest PRIVATE ${ULRE} ${VULKAN_LIB} ${RENDER_WINDOW_LIBRARY})
|
target_link_libraries(VulkanTest PRIVATE ${ULRE} ${VULKAN_LIB} ${RENDER_WINDOW_LIBRARY})
|
||||||
|
9
example/Vulkan/FlatColor.frag
Normal file
9
example/Vulkan/FlatColor.frag
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#version 450
|
||||||
|
|
||||||
|
layout(location = 0) in vec4 FragmentColor;
|
||||||
|
layout(location = 0) out vec4 FragColor;
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
FragColor=vec4(FragmentColor.rgb,1);
|
||||||
|
}
|
13
example/Vulkan/FlatColor.vert
Normal file
13
example/Vulkan/FlatColor.vert
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#version 450
|
||||||
|
|
||||||
|
layout(location = 0) in vec2 Vertex;
|
||||||
|
layout(location = 1) in vec3 Color;
|
||||||
|
|
||||||
|
layout(location = 0) out vec4 FragmentColor;
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
FragmentColor=vec4(Color,1.0);
|
||||||
|
|
||||||
|
gl_Position=vec4(Vertex,0.0,1.0);
|
||||||
|
}
|
2
example/Vulkan/shader_compile.bat
Normal file
2
example/Vulkan/shader_compile.bat
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
glslangValidator -V -o FlatColor.vert.spv FlatColor.vert
|
||||||
|
glslangValidator -V -o FlatColor.frag.spv FlatColor.frag
|
Loading…
x
Reference in New Issue
Block a user