(fn string)
| 166 | } |
| 167 | |
| 168 | func CompileFile(fn string) error { |
| 169 | ext := filepath.Ext(fn) |
| 170 | ofn := fn[:len(fn)-len(ext)] + ".spv" |
| 171 | // todo: figure out how to use 1.2 here -- see bug issue #1 |
| 172 | // cmd := exec.Command("glslc", "-fshader-stage=compute", "-O", "--target-env=vulkan1.1", "-o", ofn, fn) |
| 173 | // dxc is the reference compiler for hlsl! |
| 174 | cmd := exec.Command("dxc", "-spirv", "-O3", "-T", "cs_6_0", "-E", "main", "-Fo", ofn, fn) |
| 175 | cmd.Dir, _ = filepath.Abs(*outDir) |
| 176 | out, err := cmd.CombinedOutput() |
| 177 | fmt.Printf("\n-----------------------------------------------------\ndxc output for: %s\n%s", fn, out) |
| 178 | if err != nil { |
| 179 | log.Println(err) |
| 180 | return err |
| 181 | } |
| 182 | return nil |
| 183 | } |
no test coverage detected