forked from joejulian/gio
internal/vk: remove methods on C types, for Go 1.24 compatibility
Go 1.24 no longer allows methods on C types (golang.org/issue/60725). Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+1
-1
@@ -175,7 +175,7 @@ func (c *vkContext) refresh(surf vk.Surface, width, height int) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
minExt, maxExt := caps.MinExtent(), caps.MaxExtent()
|
minExt, maxExt := vk.SurfaceCapabilitiesMinExtent(caps), vk.SurfaceCapabilitiesMaxExtent(caps)
|
||||||
if width < minExt.X || maxExt.X < width || height < minExt.Y || maxExt.Y < height {
|
if width < minExt.X || maxExt.X < width || height < minExt.Y || maxExt.Y < height {
|
||||||
return errOutOfDate
|
return errOutOfDate
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -862,8 +862,8 @@ func (b *Backend) BindUniforms(buffer driver.Buffer) {
|
|||||||
buf := buffer.(*Buffer)
|
buf := buffer.(*Buffer)
|
||||||
cmdBuf := b.currentCmdBuf()
|
cmdBuf := b.currentCmdBuf()
|
||||||
for _, s := range b.pipe.pushRanges {
|
for _, s := range b.pipe.pushRanges {
|
||||||
off := s.Offset()
|
off := vk.PushConstantRangeOffset(s)
|
||||||
vk.CmdPushConstants(cmdBuf, b.pipe.desc.layout, s.StageFlags(), off, buf.store[off:off+s.Size()])
|
vk.CmdPushConstants(cmdBuf, b.pipe.desc.layout, vk.PushConstantRangeStageFlags(s), off, buf.store[off:off+vk.PushConstantRangeSize(s)])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1893,27 +1893,27 @@ func BuildWriteDescriptorSetBuffer(set DescriptorSet, binding int, typ Descripto
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r PushConstantRange) StageFlags() ShaderStageFlags {
|
func PushConstantRangeStageFlags(r PushConstantRange) ShaderStageFlags {
|
||||||
return r.stageFlags
|
return r.stageFlags
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r PushConstantRange) Offset() int {
|
func PushConstantRangeOffset(r PushConstantRange) int {
|
||||||
return int(r.offset)
|
return int(r.offset)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r PushConstantRange) Size() int {
|
func PushConstantRangeSize(r PushConstantRange) int {
|
||||||
return int(r.size)
|
return int(r.size)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p QueueFamilyProperties) Flags() QueueFlags {
|
func QueueFamilyPropertiesFlags(p QueueFamilyProperties) QueueFlags {
|
||||||
return p.queueFlags
|
return p.queueFlags
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c SurfaceCapabilities) MinExtent() image.Point {
|
func SurfaceCapabilitiesMinExtent(c SurfaceCapabilities) image.Point {
|
||||||
return image.Pt(int(c.minImageExtent.width), int(c.minImageExtent.height))
|
return image.Pt(int(c.minImageExtent.width), int(c.minImageExtent.height))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c SurfaceCapabilities) MaxExtent() image.Point {
|
func SurfaceCapabilitiesMaxExtent(c SurfaceCapabilities) image.Point {
|
||||||
return image.Pt(int(c.maxImageExtent.width), int(c.maxImageExtent.height))
|
return image.Pt(int(c.maxImageExtent.width), int(c.maxImageExtent.height))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user