mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-04 08:55:35 +00:00
gpu/internal/driver: introduce and use FeatureSRGB
No functional changes; a follow-up will implement graceful fallback in the compute renderer. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -128,6 +128,7 @@ func newDirect3D11Device(api driver.Direct3D11) (driver.Device, error) {
|
||||
ctx: dev.GetImmediateContext(),
|
||||
caps: driver.Caps{
|
||||
MaxTextureSize: 2048, // 9.1 maximum
|
||||
Features: driver.FeatureSRGB,
|
||||
},
|
||||
depthStates: make(map[depthState]*d3d11.DepthStencilState),
|
||||
blendStates: make(map[blendState]*d3d11.BlendState),
|
||||
|
||||
@@ -212,6 +212,7 @@ const (
|
||||
FeatureTimers Features = 1 << iota
|
||||
FeatureFloatRenderTargets
|
||||
FeatureCompute
|
||||
FeatureSRGB
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -182,10 +182,7 @@ func newOpenGLDevice(api driver.OpenGL) (driver.Device, error) {
|
||||
return nil, err
|
||||
}
|
||||
floatTriple, ffboErr := floatTripleFor(f, ver, exts)
|
||||
srgbaTriple, err := srgbaTripleFor(ver, exts)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
srgbaTriple, srgbErr := srgbaTripleFor(ver, exts)
|
||||
gles30 := gles && ver[0] >= 3
|
||||
gles31 := gles && (ver[0] > 3 || (ver[0] == 3 && ver[1] >= 1))
|
||||
gl40 := !gles && ver[0] >= 4
|
||||
@@ -199,6 +196,9 @@ func newOpenGLDevice(api driver.OpenGL) (driver.Device, error) {
|
||||
srgbaTriple: srgbaTriple,
|
||||
}
|
||||
b.feats.BottomLeftOrigin = true
|
||||
if srgbErr == nil {
|
||||
b.feats.Features |= driver.FeatureSRGB
|
||||
}
|
||||
if ffboErr == nil {
|
||||
b.feats.Features |= driver.FeatureFloatRenderTargets
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user