MCPcopy Create free account
hub / github.com/cogentcore/core / CompileFile

Function CompileFile

vgpu/gosl/process.go:168–183  ·  view source on GitHub ↗
(fn string)

Source from the content-addressed store, hash-verified

166}
167
168func 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}

Callers 1

ProcessFilesFunction · 0.85

Calls 3

PrintlnMethod · 0.80
AbsMethod · 0.45
PrintfMethod · 0.45

Tested by

no test coverage detected