[graphics][compute] Build HotSort targets with GN and add a test.
Tracked by: SPN-8 Test: fx shell run fuchsia-pkg://fuchsia.com/hotsort_vk_bench#meta/hotsort_vk_bench.cmx" - CL following 277184. This CL replaces shell scripts with GN. The GN build invokes the 'hotsort_gen' code generator and builds architecture-specific shader "targets" (bundles of shaders and algorithm configuration info) using a custom GN template. The target outputs are placed in their respective $target_gen_dirs for later inclusion of either a source set or its equivalent binary image. The hotsort_target.gni template performs the following steps: 1. Produce list of compute shaders that *will* be generated. 2. Invoke hotsort_gen to generate compute shaders. 3. Compile the shaders to SPIR-V modules with glslangValidator 4. Invoke spirv-opt to optimize and shrink the SPIR-V modules. 5. Invoke spirv-remap to improve compressibility of modules. 6. Convert SPIR-V modules to array of C literals. 7. Dump a binary image of the HotSort target bundle of modules. 8. The GN template returns a source set of the target. Steps to verify target outputs are being created: 1. fx build graphics 2. ls -R out/default/gen/src/graphics/lib/compute/hotsort/platforms/vk/tests/hotsort_vk_bench/ Change-Id: Ic98c374c70e4fda2c1d8d3284a8cbc46443eaffc
Showing
- src/graphics/lib/compute/hotsort/BUILD.gn 8 additions, 1 deletionsrc/graphics/lib/compute/hotsort/BUILD.gn
- src/graphics/lib/compute/hotsort/hotsort_gen/gen.h 11 additions, 0 deletionssrc/graphics/lib/compute/hotsort/hotsort_gen/gen.h
- src/graphics/lib/compute/hotsort/hotsort_gen/main.c 48 additions, 9 deletionssrc/graphics/lib/compute/hotsort/hotsort_gen/main.c
- src/graphics/lib/compute/hotsort/hotsort_gen/target_glsl.c 16 additions, 7 deletionssrc/graphics/lib/compute/hotsort/hotsort_gen/target_glsl.c
- src/graphics/lib/compute/hotsort/platforms/vk/BUILD.gn 22 additions, 0 deletionssrc/graphics/lib/compute/hotsort/platforms/vk/BUILD.gn
- src/graphics/lib/compute/hotsort/platforms/vk/hotsort_vk.c 90 additions, 100 deletionssrc/graphics/lib/compute/hotsort/platforms/vk/hotsort_vk.c
- src/graphics/lib/compute/hotsort/platforms/vk/hotsort_vk.h 27 additions, 48 deletionssrc/graphics/lib/compute/hotsort/platforms/vk/hotsort_vk.h
- src/graphics/lib/compute/hotsort/platforms/vk/hotsort_vk_target.h 6 additions, 6 deletions...hics/lib/compute/hotsort/platforms/vk/hotsort_vk_target.h
- src/graphics/lib/compute/hotsort/platforms/vk/targets/BUILD.gn 15 additions, 0 deletions...raphics/lib/compute/hotsort/platforms/vk/targets/BUILD.gn
- src/graphics/lib/compute/hotsort/platforms/vk/targets/hotsort_comp_names.py 124 additions, 0 deletions...ompute/hotsort/platforms/vk/targets/hotsort_comp_names.py
- src/graphics/lib/compute/hotsort/platforms/vk/targets/hotsort_modules_to_literals.c 146 additions, 0 deletions...otsort/platforms/vk/targets/hotsort_modules_to_literals.c
- src/graphics/lib/compute/hotsort/platforms/vk/targets/hotsort_target.gni 249 additions, 0 deletions...b/compute/hotsort/platforms/vk/targets/hotsort_target.gni
- src/graphics/lib/compute/hotsort/platforms/vk/targets/hs_glsl_macros.h 59 additions, 42 deletions...lib/compute/hotsort/platforms/vk/targets/hs_glsl_macros.h
- src/graphics/lib/compute/hotsort/platforms/vk/targets/hs_target_config_init.inl 35 additions, 0 deletions...te/hotsort/platforms/vk/targets/hs_target_config_init.inl
- src/graphics/lib/compute/hotsort/platforms/vk/targets/hs_target_modules_dump.inl 58 additions, 0 deletions...e/hotsort/platforms/vk/targets/hs_target_modules_dump.inl
- src/graphics/lib/compute/hotsort/platforms/vk/targets/vendors/amd/hs_glsl_macros_vendor.h 1 addition, 1 deletion.../platforms/vk/targets/vendors/amd/hs_glsl_macros_vendor.h
- src/graphics/lib/compute/hotsort/platforms/vk/targets/vendors/intel/hs_glsl_macros_vendor.h 1 addition, 1 deletion...latforms/vk/targets/vendors/intel/hs_glsl_macros_vendor.h
- src/graphics/lib/compute/hotsort/platforms/vk/targets/vendors/nvidia/hs_glsl_macros_vendor.h 1 addition, 1 deletion...atforms/vk/targets/vendors/nvidia/hs_glsl_macros_vendor.h
- src/graphics/lib/compute/hotsort/platforms/vk/tests/BUILD.gn 9 additions, 0 deletionssrc/graphics/lib/compute/hotsort/platforms/vk/tests/BUILD.gn
- src/graphics/lib/compute/hotsort/platforms/vk/tests/hotsort_vk_bench/BUILD.gn 75 additions, 0 deletions...pute/hotsort/platforms/vk/tests/hotsort_vk_bench/BUILD.gn
Loading
Please register or sign in to comment