* Create a new compute program from file. * Note that this call merely creates a program object. The actual compilation and link happens at a later time. * @param[in] pDevice GPU device. * @param[in] path Compute program file path. * @param[in] csEntry Name of the entry point in the program. * @param[in] programDefines Optional list of macro definitions to set into the pro
| 602 | * @return A new object, or an exception is thrown if creation failed. |
| 603 | */ |
| 604 | static ref<Program> createCompute( |
| 605 | ref<Device> pDevice, |
| 606 | const std::filesystem::path& path, |
| 607 | const std::string& csEntry, |
| 608 | DefineList programDefines = {}, |
| 609 | SlangCompilerFlags flags = SlangCompilerFlags::None, |
| 610 | ShaderModel shaderModel = ShaderModel::Unknown |
| 611 | ) |
| 612 | { |
| 613 | ProgramDesc d; |
| 614 | d.addShaderLibrary(path); |
| 615 | if (shaderModel != ShaderModel::Unknown) |
| 616 | d.setShaderModel(shaderModel); |
| 617 | d.setCompilerFlags(flags); |
| 618 | d.csEntry(csEntry); |
| 619 | return create(std::move(pDevice), std::move(d), std::move(programDefines)); |
| 620 | } |
| 621 | |
| 622 | /** |
| 623 | * Create a new graphics program from file. |