mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 09:55:40 +00:00
gpu: introduce driver.Device.PrepareTexture and use it in renderers
Vulkan textures (VkImage) are always in a particular layout, where each layout is optimized for a particular use (transfer, sampling, compute storage). Vulkan allows layout transitions everywhere except inside render passes. This change adds driver.Device.PrepareTexture for instructing the driver to switch a texture to a layout for sampling in preparation for using it in a render pass. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -75,9 +75,9 @@ func TestInputShader(t *testing.T) {
|
||||
defer pipe.Release()
|
||||
buf, err := b.NewImmutableBuffer(driver.BufferBindingVertices,
|
||||
byteslice.Slice([]float32{
|
||||
0, .5, .5, 1,
|
||||
-.5, -.5, .5, 1,
|
||||
.5, -.5, .5, 1,
|
||||
0, -.5, .5, 1,
|
||||
-.5, +.5, .5, 1,
|
||||
.5, +.5, .5, 1,
|
||||
}),
|
||||
)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user