gpu: add binding flags to Backend.NewTexture

Direct3D needs to know the texture bind usage up front, in particular
whether the texture is going to be used as a render target.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-02-20 23:21:06 +01:00
parent 411f566e3f
commit cae97a9861
4 changed files with 7 additions and 4 deletions
+1 -1
View File
@@ -378,7 +378,7 @@ func (r *renderer) texHandle(t *texture) Texture {
if t.tex != nil {
return t.tex
}
t.tex = r.ctx.NewTexture(TextureFormatSRGB, t.src.Bounds().Dx(), t.src.Bounds().Dy(), FilterLinear, FilterLinear)
t.tex = r.ctx.NewTexture(TextureFormatSRGB, t.src.Bounds().Dx(), t.src.Bounds().Dy(), FilterLinear, FilterLinear, BufferBindingTexture)
t.tex.Upload(t.src)
return t.tex
}