Added sources function to python
This commit is contained in:
parent
f9c3feccfe
commit
ade261fc3a
1 changed files with 11 additions and 1 deletions
|
|
@ -40,7 +40,17 @@ PYBIND11_MODULE(kp, m) {
|
|||
return py::bytes((const char*)spirv.data(), spirv.size() * sizeof(uint32_t));
|
||||
},
|
||||
"Compiles string source provided and returns the value in bytes",
|
||||
py::arg("source"), py::arg("entryPoint") = "main", py::arg("definitions") = std::vector<std::pair<std::string,std::string>>() );
|
||||
py::arg("source"), py::arg("entryPoint") = "main", py::arg("definitions") = std::vector<std::pair<std::string,std::string>>() )
|
||||
.def_static("compile_sources", [](
|
||||
const std::vector<std::string>& source,
|
||||
const std::vector<std::string>& files,
|
||||
const std::string& entryPoint,
|
||||
const std::vector<std::pair<std::string,std::string>>& definitions) {
|
||||
std::vector<uint32_t> spirv = kp::Shader::compile_sources(source, files, entryPoint, definitions);
|
||||
return py::bytes((const char*)spirv.data(), spirv.size() * sizeof(uint32_t));
|
||||
},
|
||||
"Compiles sources provided with file names and returns the value in bytes",
|
||||
py::arg("sources"), py::arg("files") = std::vector<std::string>(), py::arg("entryPoint") = "main", py::arg("definitions") = std::vector<std::pair<std::string,std::string>>() );
|
||||
|
||||
py::class_<kp::Tensor, std::shared_ptr<kp::Tensor>>(m, "Tensor", DOC(kp, Tensor))
|
||||
.def(py::init(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue