mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 17:35:36 +00:00
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:
+1
-1
@@ -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,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.
|
||||
|
||||
Reference in New Issue
Block a user