mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 18:35:34 +00:00
gpu/internal/opengl,internal: move sRGB emulation to OpenGL driver
There is only one driver but several backends (EGL, WebGL). Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -10,6 +10,7 @@ type (
|
||||
const (
|
||||
ALL_BARRIER_BITS = 0xffffffff
|
||||
ARRAY_BUFFER = 0x8892
|
||||
BACK = 0x0405
|
||||
BLEND = 0xbe2
|
||||
CLAMP_TO_EDGE = 0x812f
|
||||
COLOR_ATTACHMENT0 = 0x8ce0
|
||||
|
||||
@@ -436,6 +436,15 @@ func (f *Functions) GetFramebufferAttachmentParameteri(target, attachment, pname
|
||||
return int(f.ints[0])
|
||||
}
|
||||
|
||||
func (f *Functions) GetInteger4(pname Enum) [4]int {
|
||||
C.glGetIntegerv(C.GLenum(pname), &f.ints[0])
|
||||
var r [4]int
|
||||
for i := range r {
|
||||
r[i] = int(f.ints[i])
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
func (f *Functions) GetInteger(pname Enum) int {
|
||||
C.glGetIntegerv(C.GLenum(pname), &f.ints[0])
|
||||
return int(f.ints[0])
|
||||
|
||||
@@ -292,6 +292,14 @@ func (c *Functions) GetFramebufferAttachmentParameteri(target, attachment, pname
|
||||
p, _, _ := syscall.Syscall(_glGetFramebufferAttachmentParameteri.Addr(), 3, uintptr(target), uintptr(attachment), uintptr(pname))
|
||||
return int(p)
|
||||
}
|
||||
func (c *Functions) GetInteger4(pname Enum) [4]int {
|
||||
syscall.Syscall(_glGetIntegerv.Addr(), 2, uintptr(pname), uintptr(unsafe.Pointer(&c.int32s[0])), 0)
|
||||
var r [4]int
|
||||
for i := range r {
|
||||
r[i] = int(c.int32s[i])
|
||||
}
|
||||
return r
|
||||
}
|
||||
func (c *Functions) GetInteger(pname Enum) int {
|
||||
syscall.Syscall(_glGetIntegerv.Addr(), 2, uintptr(pname), uintptr(unsafe.Pointer(&c.int32s[0])), 0)
|
||||
return int(c.int32s[0])
|
||||
|
||||
@@ -14,6 +14,10 @@ type (
|
||||
Object struct{ V uint }
|
||||
)
|
||||
|
||||
func (u Framebuffer) Valid() bool {
|
||||
return u.V != 0
|
||||
}
|
||||
|
||||
func (u Uniform) Valid() bool {
|
||||
return u.V != -1
|
||||
}
|
||||
|
||||
@@ -16,6 +16,10 @@ type (
|
||||
Object js.Value
|
||||
)
|
||||
|
||||
func (f Framebuffer) Valid() bool {
|
||||
return !js.Value(f).IsUndefined() && !js.Value(f).IsNull()
|
||||
}
|
||||
|
||||
func (p Program) Valid() bool {
|
||||
return !js.Value(p).IsUndefined() && !js.Value(p).IsNull()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user