go.*,gpu: use gioui.org/cpu.Supported to determine CPU fallback support

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2021-08-17 09:44:17 +02:00
parent c7ea90c4e2
commit 8140e39c20
4 changed files with 4 additions and 6 deletions
+1 -1
View File
@@ -403,7 +403,7 @@ func newCompute(ctx driver.Device) (*compute, error) {
{&g.programs.kernel4, piet.Shader_kernel4_comp, piet.Kernel4ProgramInfo},
}
if !caps.Features.Has(driver.FeatureCompute) {
if !supportsCPUCompute {
if !cpu.Supported {
return nil, errors.New("gpu: missing support for compute programs")
}
g.useCPU = true
-3
View File
@@ -3,14 +3,11 @@
package gpu
import (
"runtime"
"unsafe"
"gioui.org/cpu"
)
const supportsCPUCompute = runtime.GOARCH == "amd64" || runtime.GOARCH == "arm64" || runtime.GOARCH == "arm"
// This file contains code specific to running compute shaders on the CPU.
// dispatcher dispatches CPU compute programs across multiple goroutines.