mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
gpu/internal/driver: rename TextureFormatSRGB to TextureFormatSRGBA
The format implies an alpha channel; name it accordingly. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+1
-1
@@ -952,7 +952,7 @@ restart:
|
||||
a.tex = nil
|
||||
}
|
||||
sz := a.packer.maxDim
|
||||
handle, err := g.ctx.NewTexture(driver.TextureFormatSRGB, sz, sz, driver.FilterLinear, driver.FilterLinear, driver.BufferBindingTexture)
|
||||
handle, err := g.ctx.NewTexture(driver.TextureFormatSRGBA, sz, sz, driver.FilterLinear, driver.FilterLinear, driver.BufferBindingTexture)
|
||||
if err != nil {
|
||||
return fmt.Errorf("compute: failed to create image atlas: %v", err)
|
||||
}
|
||||
|
||||
+1
-1
@@ -484,7 +484,7 @@ func (r *renderer) texHandle(cache *resourceCache, data imageOpData) driver.Text
|
||||
if tex.tex != nil {
|
||||
return tex.tex
|
||||
}
|
||||
handle, err := r.ctx.NewTexture(driver.TextureFormatSRGB, data.src.Bounds().Dx(), data.src.Bounds().Dy(), driver.FilterLinear, driver.FilterLinear, driver.BufferBindingTexture)
|
||||
handle, err := r.ctx.NewTexture(driver.TextureFormatSRGBA, data.src.Bounds().Dx(), data.src.Bounds().Dy(), driver.FilterLinear, driver.FilterLinear, driver.BufferBindingTexture)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ func setupFBO(t *testing.T, b driver.Device, size image.Point) driver.Framebuffe
|
||||
|
||||
func newFBO(t *testing.T, b driver.Device, size image.Point) driver.Framebuffer {
|
||||
fboTex, err := b.NewTexture(
|
||||
driver.TextureFormatSRGB,
|
||||
driver.TextureFormatSRGBA,
|
||||
size.X, size.Y,
|
||||
driver.FilterNearest, driver.FilterNearest,
|
||||
driver.BufferBindingFramebuffer,
|
||||
|
||||
@@ -49,7 +49,7 @@ func NewWindow(width, height int) (*Window, error) {
|
||||
}
|
||||
dev.Viewport(0, 0, width, height)
|
||||
fboTex, err := dev.NewTexture(
|
||||
driver.TextureFormatSRGB,
|
||||
driver.TextureFormatSRGBA,
|
||||
width, height,
|
||||
driver.FilterNearest, driver.FilterNearest,
|
||||
driver.BufferBindingFramebuffer,
|
||||
|
||||
@@ -211,7 +211,7 @@ func (b *Backend) NewTexture(format driver.TextureFormat, width, height int, min
|
||||
switch format {
|
||||
case driver.TextureFormatFloat:
|
||||
d3dfmt = b.floatFormat
|
||||
case driver.TextureFormatSRGB:
|
||||
case driver.TextureFormatSRGBA:
|
||||
d3dfmt = d3d11.DXGI_FORMAT_R8G8B8A8_UNORM_SRGB
|
||||
default:
|
||||
return nil, fmt.Errorf("unsupported texture format %d", format)
|
||||
|
||||
@@ -193,7 +193,7 @@ const (
|
||||
)
|
||||
|
||||
const (
|
||||
TextureFormatSRGB TextureFormat = iota
|
||||
TextureFormatSRGBA TextureFormat = iota
|
||||
TextureFormatFloat
|
||||
TextureFormatRGBA8
|
||||
)
|
||||
|
||||
@@ -704,7 +704,7 @@ func (b *Backend) NewTexture(format driver.TextureFormat, width, height int, min
|
||||
switch format {
|
||||
case driver.TextureFormatFloat:
|
||||
tex.triple = b.floatTriple
|
||||
case driver.TextureFormatSRGB:
|
||||
case driver.TextureFormatSRGBA:
|
||||
tex.triple = b.srgbaTriple
|
||||
case driver.TextureFormatRGBA8:
|
||||
tex.triple = textureTriple{gl.RGBA8, gl.RGBA, gl.UNSIGNED_BYTE}
|
||||
|
||||
Reference in New Issue
Block a user