From b3a8c24334a0f52b350e25deedbfdde99f56e7d8 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Wed, 28 Jul 2021 14:25:13 +0200 Subject: [PATCH] gpu/internal/driver: rename TextureFormatSRGB to TextureFormatSRGBA The format implies an alpha channel; name it accordingly. Signed-off-by: Elias Naur --- gpu/compute.go | 2 +- gpu/gpu.go | 2 +- gpu/headless/driver_test.go | 2 +- gpu/headless/headless.go | 2 +- gpu/internal/d3d11/d3d11_windows.go | 2 +- gpu/internal/driver/driver.go | 2 +- gpu/internal/opengl/opengl.go | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gpu/compute.go b/gpu/compute.go index e328f0f3..335d9fa7 100644 --- a/gpu/compute.go +++ b/gpu/compute.go @@ -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) } diff --git a/gpu/gpu.go b/gpu/gpu.go index f7673130..78bdcf6a 100644 --- a/gpu/gpu.go +++ b/gpu/gpu.go @@ -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) } diff --git a/gpu/headless/driver_test.go b/gpu/headless/driver_test.go index a0b69389..f23e7b7a 100644 --- a/gpu/headless/driver_test.go +++ b/gpu/headless/driver_test.go @@ -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, diff --git a/gpu/headless/headless.go b/gpu/headless/headless.go index 859fdef3..6d6bd63b 100644 --- a/gpu/headless/headless.go +++ b/gpu/headless/headless.go @@ -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, diff --git a/gpu/internal/d3d11/d3d11_windows.go b/gpu/internal/d3d11/d3d11_windows.go index 671cdb74..c63dffde 100644 --- a/gpu/internal/d3d11/d3d11_windows.go +++ b/gpu/internal/d3d11/d3d11_windows.go @@ -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) diff --git a/gpu/internal/driver/driver.go b/gpu/internal/driver/driver.go index c3332812..e1547f92 100644 --- a/gpu/internal/driver/driver.go +++ b/gpu/internal/driver/driver.go @@ -193,7 +193,7 @@ const ( ) const ( - TextureFormatSRGB TextureFormat = iota + TextureFormatSRGBA TextureFormat = iota TextureFormatFloat TextureFormatRGBA8 ) diff --git a/gpu/internal/opengl/opengl.go b/gpu/internal/opengl/opengl.go index e31670f4..dc628f0c 100644 --- a/gpu/internal/opengl/opengl.go +++ b/gpu/internal/opengl/opengl.go @@ -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}