internal/graphicsdriver/metal/mtl/mtl.go
func (cb CommandBuffer) MakeRenderCommandEncoder(rpd RenderPassDescriptor) RenderCommandEncoder {
	descriptor := C.struct_RenderPassDescriptor{
		ColorAttachment0LoadAction:  C.uint8_t(rpd.ColorAttachments[0].LoadAction),
		ColorAttachment0StoreAction: C.uint8_t(rpd.ColorAttachments[0].StoreAction),
		ColorAttachment0ClearColor: C.struct_ClearColor{
			Red:   C.double(rpd.ColorAttachments[0].ClearColor.Red),
			Green: C.double(rpd.ColorAttachments[0].ClearColor.Green),
			Blue:  C.double(rpd.ColorAttachments[0].ClearColor.Blue),
			Alpha: C.double(rpd.ColorAttachments[0].ClearColor.Alpha),
		},
		ColorAttachment0Texture: rpd.ColorAttachments[0].Texture.texture,
	}
	return RenderCommandEncoder{CommandEncoder{C.CommandBuffer_MakeRenderCommandEncoder(cb.commandBuffer, descriptor)}}
}
func (cb CommandBuffer) MakeRenderCommandEncoder(rpd RenderPassDescriptor) RenderCommandEncoder {
	descriptor := C.struct_RenderPassDescriptor{
		ColorAttachment0LoadAction:  C.uint8_t(rpd.ColorAttachments[0].LoadAction),
		ColorAttachment0StoreAction: C.uint8_t(rpd.ColorAttachments[0].StoreAction),
		ColorAttachment0ClearColor: C.struct_ClearColor{
			Red:   C.double(rpd.ColorAttachments[0].ClearColor.Red),
			Green: C.double(rpd.ColorAttachments[0].ClearColor.Green),
			Blue:  C.double(rpd.ColorAttachments[0].ClearColor.Blue),
			Alpha: C.double(rpd.ColorAttachments[0].ClearColor.Alpha),
		},
		ColorAttachment0Texture: rpd.ColorAttachments[0].Texture.texture,
	}
	return RenderCommandEncoder{CommandEncoder{C.CommandBuffer_MakeRenderCommandEncoder(cb.commandBuffer, descriptor)}}
}
func ( cb CommandBuffer ) MakeRenderCommandEncoder ( rpd RenderPassDescriptor ) RenderCommandEncoder { descriptor := C . struct_RenderPassDescriptor { ColorAttachment0LoadAction : C . uint8_t ( rpd . ColorAttachments [ 0 ] . LoadAction ) , ColorAttachment0StoreAction : C . uint8_t ( rpd . ColorAttachments [ 0 ] . StoreAction ) , ColorAttachment0ClearColor : C . struct_ClearColor { Red : C . double ( rpd . ColorAttachments [ 0 ] . ClearColor . Red ) , Green : C . double ( rpd . ColorAttachments [ 0 ] . ClearColor . Green ) , Blue : C . double ( rpd . ColorAttachments [ 0 ] . ClearColor . Blue ) , Alpha : C . double ( rpd . ColorAttachments [ 0 ] . ClearColor . Alpha ) , } , ColorAttachment0Texture : rpd . ColorAttachments [ 0 ] . Texture . texture , } return RenderCommandEncoder { CommandEncoder { C . CommandBuffer_MakeRenderCommandEncoder ( cb . commandBuffer , descriptor ) } } }
// MakeRenderCommandEncoder creates an encoder object that can
// encode graphics rendering commands into this command buffer.
//
// Reference: https://developer.apple.com/documentation/metal/mtlcommandbuffer/1442999-makerendercommandencoder.
MakeRenderCommandEncoder creates an encoder object that can encode graphics rendering commands into this command buffer . Reference : https : // developer . apple . com / documentation / metal / mtlcommandbuffer / 1442999 - makerendercommandencoder .