mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 09:55:40 +00:00
gpu,app,internal/glimpl: update GL backend for the compute renderer
Modern graphics APIs have immutable objects, with mutable data. For example, a texture's dimensions are immutable, while the texture contents is not. Change the GPU API abstraction to match. Clearing a Texture is convenient to do with a plain []byte. Generalize Texture.Upload to take a plain byte slice and introduce a helper function for uploading *image.RGBA data. Add TextureFormatRGBA8 a format for the linear RGB colorspace. Add OpenGL ES 3.1 functions for compute programs. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -1127,14 +1127,14 @@ func (c *_ID3D11DeviceContext) PSSetShader(s *_ID3D11PixelShader) {
|
||||
)
|
||||
}
|
||||
|
||||
func (c *_ID3D11DeviceContext) UpdateSubresource(res *_ID3D11Resource, rowPitch, depthPitch uint32, data []byte) {
|
||||
func (c *_ID3D11DeviceContext) UpdateSubresource(res *_ID3D11Resource, dstBox *_D3D11_BOX, rowPitch, depthPitch uint32, data []byte) {
|
||||
syscall.Syscall9(
|
||||
c.vtbl.UpdateSubresource,
|
||||
7,
|
||||
uintptr(unsafe.Pointer(c)),
|
||||
uintptr(unsafe.Pointer(res)),
|
||||
0, // DstSubresource
|
||||
0, // pDstBox
|
||||
uintptr(unsafe.Pointer(dstBox)),
|
||||
uintptr(unsafe.Pointer(&data[0])),
|
||||
uintptr(rowPitch),
|
||||
uintptr(depthPitch),
|
||||
|
||||
Reference in New Issue
Block a user