mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 18:05:35 +00:00
gpu/gl: add detail to the float FBO error message
Updates gio#49 Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+5
-2
@@ -473,15 +473,18 @@ func floatTripleFor(f Functions, ver [2]int, exts []string) (textureTriple, erro
|
|||||||
defFBO := Framebuffer(f.GetBinding(FRAMEBUFFER_BINDING))
|
defFBO := Framebuffer(f.GetBinding(FRAMEBUFFER_BINDING))
|
||||||
f.BindFramebuffer(FRAMEBUFFER, fbo)
|
f.BindFramebuffer(FRAMEBUFFER, fbo)
|
||||||
defer f.BindFramebuffer(FRAMEBUFFER, defFBO)
|
defer f.BindFramebuffer(FRAMEBUFFER, defFBO)
|
||||||
|
var attempts []string
|
||||||
for _, tt := range triples {
|
for _, tt := range triples {
|
||||||
const size = 256
|
const size = 256
|
||||||
f.TexImage2D(TEXTURE_2D, 0, tt.internalFormat, size, size, tt.format, tt.typ, nil)
|
f.TexImage2D(TEXTURE_2D, 0, tt.internalFormat, size, size, tt.format, tt.typ, nil)
|
||||||
f.FramebufferTexture2D(FRAMEBUFFER, COLOR_ATTACHMENT0, TEXTURE_2D, tex, 0)
|
f.FramebufferTexture2D(FRAMEBUFFER, COLOR_ATTACHMENT0, TEXTURE_2D, tex, 0)
|
||||||
if st := f.CheckFramebufferStatus(FRAMEBUFFER); st == FRAMEBUFFER_COMPLETE {
|
st := f.CheckFramebufferStatus(FRAMEBUFFER)
|
||||||
|
if st == FRAMEBUFFER_COMPLETE {
|
||||||
return tt, nil
|
return tt, nil
|
||||||
}
|
}
|
||||||
|
attempts = append(attempts, fmt.Sprintf("(0x%x, 0x%x, 0x%x): 0x%x", tt.internalFormat, tt.format, tt.typ, st))
|
||||||
}
|
}
|
||||||
return textureTriple{}, errors.New("floating point fbos not supported")
|
return textureTriple{}, fmt.Errorf("floating point fbos not supported (attempted %s)", attempts)
|
||||||
}
|
}
|
||||||
|
|
||||||
func srgbaTripleFor(ver [2]int, exts []string) (textureTriple, error) {
|
func srgbaTripleFor(ver [2]int, exts []string) (textureTriple, error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user