Skip to content

Commit

Permalink
Use SHADER_* source properties over VS_SHADER_*
Browse files Browse the repository at this point in the history
  • Loading branch information
andrejnau committed Jan 24, 2024
1 parent 88fa4dc commit 354db86
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 70 deletions.
6 changes: 3 additions & 3 deletions cmake/shader_parser.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ function(gen_shaders_ref target shaders shaders_ref)
get_filename_component(shader_name ${full_shader_path} NAME_WE)
string(REPLACE "${assets_path}" "" shader_path ${full_shader_path})
set(output_file ${output_dir}/${shader_name}.h)
get_property(entrypoint SOURCE ${full_shader_path} PROPERTY VS_SHADER_ENTRYPOINT)
get_property(type SOURCE ${full_shader_path} PROPERTY VS_SHADER_TYPE)
get_property(model SOURCE ${full_shader_path} PROPERTY VS_SHADER_MODEL)
get_property(entrypoint SOURCE ${full_shader_path} PROPERTY SHADER_ENTRYPOINT)
get_property(type SOURCE ${full_shader_path} PROPERTY SHADER_TYPE)
get_property(model SOURCE ${full_shader_path} PROPERTY SHADER_MODEL)
add_custom_command(OUTPUT ${output_file}
COMMAND ${CMAKE_COMMAND} -E echo ${assets_path} ${shader_name} ${shader_path} ${entrypoint} ${type} ${model} ${template} ${output_dir} ${build_folder}
COMMAND ${CMAKE_COMMAND} -E make_directory ${output_dir}
Expand Down
7 changes: 3 additions & 4 deletions src/Apps/DispatchIndirect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ set(compute_shaders
${shaders_path}/Task.hlsl
)

set_property(SOURCE ${compute_shaders} PROPERTY VS_SHADER_ENTRYPOINT MainCS)
set_property(SOURCE ${compute_shaders} PROPERTY VS_SHADER_TYPE Compute)
set_property(SOURCE ${compute_shaders} PROPERTY VS_SHADER_MODEL 6.0)
set_property(SOURCE ${compute_shaders} PROPERTY VS_SHADER_FLAGS "/Zi /auto-binding-space 0")
set_property(SOURCE ${compute_shaders} PROPERTY SHADER_ENTRYPOINT MainCS)
set_property(SOURCE ${compute_shaders} PROPERTY SHADER_TYPE Compute)
set_property(SOURCE ${compute_shaders} PROPERTY SHADER_MODEL 6.0)

set(shaders_files ${compute_shaders})

Expand Down
7 changes: 3 additions & 4 deletions src/Apps/DxrTriangle/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ set(lib_shaders
${shaders_path}/RayTracing.hlsl
)

set_property(SOURCE ${lib_shaders} PROPERTY VS_SHADER_ENTRYPOINT " ")
set_property(SOURCE ${lib_shaders} PROPERTY VS_SHADER_TYPE Library)
set_property(SOURCE ${lib_shaders} PROPERTY VS_SHADER_MODEL 6.3)
set_property(SOURCE ${lib_shaders} PROPERTY VS_SHADER_FLAGS "/Zi /auto-binding-space 0")
set_property(SOURCE ${lib_shaders} PROPERTY SHADER_ENTRYPOINT " ")
set_property(SOURCE ${lib_shaders} PROPERTY SHADER_TYPE Library)
set_property(SOURCE ${lib_shaders} PROPERTY SHADER_MODEL 6.3)

set(shaders_files ${lib_shaders})

Expand Down
16 changes: 7 additions & 9 deletions src/Apps/Indirect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@ set(vertex_shaders
${shaders_path}/VertexShader.hlsl
)

set_property(SOURCE ${pixel_shaders} PROPERTY VS_SHADER_ENTRYPOINT main)
set_property(SOURCE ${pixel_shaders} PROPERTY VS_SHADER_TYPE Pixel)
set_property(SOURCE ${pixel_shaders} PROPERTY VS_SHADER_MODEL 6.0)
set_property(SOURCE ${pixel_shaders} PROPERTY VS_SHADER_FLAGS "/Zi /auto-binding-space 0")

set_property(SOURCE ${vertex_shaders} PROPERTY VS_SHADER_ENTRYPOINT main)
set_property(SOURCE ${vertex_shaders} PROPERTY VS_SHADER_TYPE Vertex)
set_property(SOURCE ${vertex_shaders} PROPERTY VS_SHADER_MODEL 6.0)
set_property(SOURCE ${vertex_shaders} PROPERTY VS_SHADER_FLAGS "/Zi /auto-binding-space 0")
set_property(SOURCE ${pixel_shaders} PROPERTY SHADER_ENTRYPOINT main)
set_property(SOURCE ${pixel_shaders} PROPERTY SHADER_TYPE Pixel)
set_property(SOURCE ${pixel_shaders} PROPERTY SHADER_MODEL 6.0)

set_property(SOURCE ${vertex_shaders} PROPERTY SHADER_ENTRYPOINT main)
set_property(SOURCE ${vertex_shaders} PROPERTY SHADER_TYPE Vertex)
set_property(SOURCE ${vertex_shaders} PROPERTY SHADER_MODEL 6.0)

set(shaders_files ${pixel_shaders} ${vertex_shaders})

Expand Down
16 changes: 7 additions & 9 deletions src/Apps/MeshShading/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@ set(mesh_shaders
${shaders_path}/MeshletMS.hlsl
)

set_property(SOURCE ${pixel_shaders} PROPERTY VS_SHADER_ENTRYPOINT main)
set_property(SOURCE ${pixel_shaders} PROPERTY VS_SHADER_TYPE Pixel)
set_property(SOURCE ${pixel_shaders} PROPERTY VS_SHADER_MODEL 6.3)
set_property(SOURCE ${pixel_shaders} PROPERTY VS_SHADER_FLAGS "/Zi /auto-binding-space 0")

set_property(SOURCE ${mesh_shaders} PROPERTY VS_SHADER_ENTRYPOINT main)
set_property(SOURCE ${mesh_shaders} PROPERTY VS_SHADER_TYPE Mesh)
set_property(SOURCE ${mesh_shaders} PROPERTY VS_SHADER_MODEL 6.5)
set_property(SOURCE ${mesh_shaders} PROPERTY VS_SHADER_FLAGS "/Zi /auto-binding-space 0")
set_property(SOURCE ${pixel_shaders} PROPERTY SHADER_ENTRYPOINT main)
set_property(SOURCE ${pixel_shaders} PROPERTY SHADER_TYPE Pixel)
set_property(SOURCE ${pixel_shaders} PROPERTY SHADER_MODEL 6.3)

set_property(SOURCE ${mesh_shaders} PROPERTY SHADER_ENTRYPOINT main)
set_property(SOURCE ${mesh_shaders} PROPERTY SHADER_TYPE Mesh)
set_property(SOURCE ${mesh_shaders} PROPERTY SHADER_MODEL 6.5)

set(shaders_files ${pixel_shaders} ${mesh_shaders})

Expand Down
16 changes: 7 additions & 9 deletions src/Apps/ModelView/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@ set(vertex_shaders
${shaders_path}/VertexShader.hlsl
)

set_property(SOURCE ${pixel_shaders} PROPERTY VS_SHADER_ENTRYPOINT main)
set_property(SOURCE ${pixel_shaders} PROPERTY VS_SHADER_TYPE Pixel)
set_property(SOURCE ${pixel_shaders} PROPERTY VS_SHADER_MODEL 6.0)
set_property(SOURCE ${pixel_shaders} PROPERTY VS_SHADER_FLAGS "/Zi /auto-binding-space 0")

set_property(SOURCE ${vertex_shaders} PROPERTY VS_SHADER_ENTRYPOINT main)
set_property(SOURCE ${vertex_shaders} PROPERTY VS_SHADER_TYPE Vertex)
set_property(SOURCE ${vertex_shaders} PROPERTY VS_SHADER_MODEL 6.0)
set_property(SOURCE ${vertex_shaders} PROPERTY VS_SHADER_FLAGS "/Zi /auto-binding-space 0")
set_property(SOURCE ${pixel_shaders} PROPERTY SHADER_ENTRYPOINT main)
set_property(SOURCE ${pixel_shaders} PROPERTY SHADER_TYPE Pixel)
set_property(SOURCE ${pixel_shaders} PROPERTY SHADER_MODEL 6.0)

set_property(SOURCE ${vertex_shaders} PROPERTY SHADER_ENTRYPOINT main)
set_property(SOURCE ${vertex_shaders} PROPERTY SHADER_TYPE Vertex)
set_property(SOURCE ${vertex_shaders} PROPERTY SHADER_MODEL 6.0)

set(shaders_files ${pixel_shaders} ${vertex_shaders})

Expand Down
7 changes: 3 additions & 4 deletions src/Apps/RayQuery/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ set(compute_shaders
${shaders_path}/RayQuery.hlsl
)

set_property(SOURCE ${compute_shaders} PROPERTY VS_SHADER_ENTRYPOINT MainCS)
set_property(SOURCE ${compute_shaders} PROPERTY VS_SHADER_TYPE Compute)
set_property(SOURCE ${compute_shaders} PROPERTY VS_SHADER_MODEL 6.5)
set_property(SOURCE ${compute_shaders} PROPERTY VS_SHADER_FLAGS "/Zi /auto-binding-space 0")
set_property(SOURCE ${compute_shaders} PROPERTY SHADER_ENTRYPOINT MainCS)
set_property(SOURCE ${compute_shaders} PROPERTY SHADER_TYPE Compute)
set_property(SOURCE ${compute_shaders} PROPERTY SHADER_MODEL 6.5)

set(shaders_files ${compute_shaders})

Expand Down
16 changes: 7 additions & 9 deletions src/Apps/Stencil/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@ set(vertex_shaders
${shaders_path}/VertexShader.hlsl
)

set_property(SOURCE ${pixel_shaders} PROPERTY VS_SHADER_ENTRYPOINT main)
set_property(SOURCE ${pixel_shaders} PROPERTY VS_SHADER_TYPE Pixel)
set_property(SOURCE ${pixel_shaders} PROPERTY VS_SHADER_MODEL 6.0)
set_property(SOURCE ${pixel_shaders} PROPERTY VS_SHADER_FLAGS "/Zi /auto-binding-space 0")

set_property(SOURCE ${vertex_shaders} PROPERTY VS_SHADER_ENTRYPOINT main)
set_property(SOURCE ${vertex_shaders} PROPERTY VS_SHADER_TYPE Vertex)
set_property(SOURCE ${vertex_shaders} PROPERTY VS_SHADER_MODEL 6.0)
set_property(SOURCE ${vertex_shaders} PROPERTY VS_SHADER_FLAGS "/Zi /auto-binding-space 0")
set_property(SOURCE ${pixel_shaders} PROPERTY SHADER_ENTRYPOINT main)
set_property(SOURCE ${pixel_shaders} PROPERTY SHADER_TYPE Pixel)
set_property(SOURCE ${pixel_shaders} PROPERTY SHADER_MODEL 6.0)

set_property(SOURCE ${vertex_shaders} PROPERTY SHADER_ENTRYPOINT main)
set_property(SOURCE ${vertex_shaders} PROPERTY SHADER_TYPE Vertex)
set_property(SOURCE ${vertex_shaders} PROPERTY SHADER_MODEL 6.0)

set(shaders_files ${pixel_shaders} ${vertex_shaders})

Expand Down
16 changes: 7 additions & 9 deletions src/Apps/Triangle/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@ set(vertex_shaders
${shaders_path}/VertexShader.hlsl
)

set_property(SOURCE ${pixel_shaders} PROPERTY VS_SHADER_ENTRYPOINT main)
set_property(SOURCE ${pixel_shaders} PROPERTY VS_SHADER_TYPE Pixel)
set_property(SOURCE ${pixel_shaders} PROPERTY VS_SHADER_MODEL 6.0)
set_property(SOURCE ${pixel_shaders} PROPERTY VS_SHADER_FLAGS "/Zi /auto-binding-space 0")

set_property(SOURCE ${vertex_shaders} PROPERTY VS_SHADER_ENTRYPOINT main)
set_property(SOURCE ${vertex_shaders} PROPERTY VS_SHADER_TYPE Vertex)
set_property(SOURCE ${vertex_shaders} PROPERTY VS_SHADER_MODEL 6.0)
set_property(SOURCE ${vertex_shaders} PROPERTY VS_SHADER_FLAGS "/Zi /auto-binding-space 0")
set_property(SOURCE ${pixel_shaders} PROPERTY SHADER_ENTRYPOINT main)
set_property(SOURCE ${pixel_shaders} PROPERTY SHADER_TYPE Pixel)
set_property(SOURCE ${pixel_shaders} PROPERTY SHADER_MODEL 6.0)

set_property(SOURCE ${vertex_shaders} PROPERTY SHADER_ENTRYPOINT main)
set_property(SOURCE ${vertex_shaders} PROPERTY SHADER_TYPE Vertex)
set_property(SOURCE ${vertex_shaders} PROPERTY SHADER_MODEL 6.0)

set(shaders_files ${pixel_shaders} ${vertex_shaders})

Expand Down
16 changes: 7 additions & 9 deletions src/Apps/VariableRateShading/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@ set(vertex_shaders
${shaders_path}/VertexShader.hlsl
)

set_property(SOURCE ${pixel_shaders} PROPERTY VS_SHADER_ENTRYPOINT main)
set_property(SOURCE ${pixel_shaders} PROPERTY VS_SHADER_TYPE Pixel)
set_property(SOURCE ${pixel_shaders} PROPERTY VS_SHADER_MODEL 6.0)
set_property(SOURCE ${pixel_shaders} PROPERTY VS_SHADER_FLAGS "/Zi /auto-binding-space 0")

set_property(SOURCE ${vertex_shaders} PROPERTY VS_SHADER_ENTRYPOINT main)
set_property(SOURCE ${vertex_shaders} PROPERTY VS_SHADER_TYPE Vertex)
set_property(SOURCE ${vertex_shaders} PROPERTY VS_SHADER_MODEL 6.0)
set_property(SOURCE ${vertex_shaders} PROPERTY VS_SHADER_FLAGS "/Zi /auto-binding-space 0")
set_property(SOURCE ${pixel_shaders} PROPERTY SHADER_ENTRYPOINT main)
set_property(SOURCE ${pixel_shaders} PROPERTY SHADER_TYPE Pixel)
set_property(SOURCE ${pixel_shaders} PROPERTY SHADER_MODEL 6.0)

set_property(SOURCE ${vertex_shaders} PROPERTY SHADER_ENTRYPOINT main)
set_property(SOURCE ${vertex_shaders} PROPERTY SHADER_TYPE Vertex)
set_property(SOURCE ${vertex_shaders} PROPERTY SHADER_MODEL 6.0)

set(shaders_files ${pixel_shaders} ${vertex_shaders})

Expand Down

0 comments on commit 354db86

Please sign in to comment.