mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
docs: add v shader
section, add help text (#12594)
This commit is contained in:
14
doc/docs.md
14
doc/docs.md
@ -124,6 +124,7 @@ For more details and troubleshooting, please visit the [vab GitHub repository](h
|
||||
* [Writing documentation](#writing-documentation)
|
||||
* [Tools](#tools)
|
||||
* [v fmt](#v-fmt)
|
||||
* [v shader](#v-shader)
|
||||
* [Profiling](#profiling)
|
||||
* [Package Management](#package-management)
|
||||
* [Publish package](#publish-package)
|
||||
@ -4121,6 +4122,19 @@ A vfmt run is usually pretty cheap (takes <30ms).
|
||||
|
||||
Always run `v fmt -w file.v` before pushing your code.
|
||||
|
||||
### v shader
|
||||
|
||||
You can use GPU shaders with V graphical apps. You write your shaders in an
|
||||
[annotated GLSL dialect](https://github.com/vlang/v/blob/1d8ece7/examples/sokol/02_cubes_glsl/cube_glsl.glsl)
|
||||
and use `v shader` to compile them for all supported target platforms.
|
||||
|
||||
```shell
|
||||
v shader /path/to/project/dir/or/file.v
|
||||
```
|
||||
|
||||
Currently you need to include a header and declare a glue function before
|
||||
using the shader in your code.
|
||||
|
||||
### Profiling
|
||||
|
||||
V has good support for profiling your programs: `v -profile profile.txt run file.v`
|
||||
|
Reference in New Issue
Block a user