Commit Graph

9 Commits

Author SHA1 Message Date
Elias Naur c19ce8e1d7 gpu/internal/convertshaders: don't require GL_ARB_shading_language_420pack
It's not supported on macOS.

Updates gio#216

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2021-04-17 11:10:20 +02:00
Elias Naur e9a020f774 gpu/internal/convertshaders: build compute shaders in HLSL cs_5_0 profile
The recent changes to the compute shaders have fixed all errors
previously reported by fxc. Switch from dxc to fxc to target shader
model 5.0, supported by Direct3D 11.

Because we know dxc must be available, always build compute shaders even
though the result is not yet used.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2021-04-12 12:49:49 +02:00
Elias Naur e3bb153274 gpu/internal/convertshaders: don't wait for winepath to exit
Apparently, exec.Command.Output waits for winepath's grandchildren to
exit. However, that may take several seconds if wineserver was started
by winepath.

exec.Command.StdoutPipe works better, in that it is closed when the
winepath process exits.

A similar change may help run the fxc.exe tool under Wine, if that ever
turns out to have the same problem.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2021-04-12 12:44:06 +02:00
Elias Naur 8adcf25049 gpu/internal/convertshaders: batch calls to winepath
Wine tools can be slow to run, so it makes sense to batch their use.
Fortunately, winepath supports resolving multiple paths in one
execution.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2021-04-12 12:44:06 +02:00
Elias Naur 3b3d41a7ea gpu/internal/convertshaders: don't use Wine for the dxc tool
dxc exists for Linux, and seems to work.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2021-04-12 12:44:06 +02:00
Elias Naur 23e0c898ef gpu/internal/driver: use strings for generated DXIL assembly
Literal strings are a more compact than literal byte slices. A future
change will switch to go:embed to save even more space.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2021-04-12 12:44:06 +02:00
Elias Naur fbee13a07d gpu/internal/convertshaders,gpu: represent converted shaders with raw literals
Raw strings with linebreaks are easier to read and produce smaller
diffs.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2021-04-12 12:43:46 +02:00
Elias Naur c799452c57 gpu/internal/driver: rename gpu/backend
There are no longer any importers of package backend outside of
gioui.org/gpu. Move it internally, and rename it to the slightly more
specific "driver" while we're at it.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2021-03-06 14:27:34 +01:00
Elias Naur 2c7aba9e7c gpu/internal/convertshaders: move internal/cmd/convertshaders
The convert program is only used by the shaders from package gpu, and
we're about to make the backend package imported by the program internal
to package gpu. Move the converter below package gpu.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2021-03-06 14:26:47 +01:00