all: replace unsafe slice operations with unsafe.Slice

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2022-03-02 15:37:34 +01:00
parent af8ca96414
commit fea2f888bb
6 changed files with 13 additions and 38 deletions
+1 -1
View File
@@ -1172,7 +1172,7 @@ func newUniformBuffer(b driver.Device, uniformBlock interface{}) *uniformBuffer
// Determine the size of the uniforms structure, *uniforms.
size := ref.Elem().Type().Size()
// Map the uniforms structure as a byte slice.
ptr := (*[1 << 30]byte)(unsafe.Pointer(ref.Pointer()))[:size:size]
ptr := unsafe.Slice((*byte)(unsafe.Pointer(ref.Pointer())), size)
ubuf, err := b.NewBuffer(driver.BufferBindingUniforms, len(ptr))
if err != nil {
panic(err)