internal/graphicsdriver/metal/mtl/mtl.go
func (d Device) MakeRenderPipelineState(rpd RenderPipelineDescriptor) (RenderPipelineState, error) {
	blendingEnabled := C.BOOL(0)
	if rpd.ColorAttachments[0].BlendingEnabled {
		blendingEnabled = C.BOOL(1)
	}
	c := &rpd.ColorAttachments[0]
	descriptor := C.struct_RenderPipelineDescriptor{
		VertexFunction:                              rpd.VertexFunction.function,
		FragmentFunction:                            rpd.FragmentFunction.function,
		ColorAttachment0PixelFormat:                 C.uint16_t(c.PixelFormat),
		ColorAttachment0BlendingEnabled:             C.BOOL(blendingEnabled),
		ColorAttachment0DestinationAlphaBlendFactor: C.uint8_t(c.DestinationAlphaBlendFactor),
		ColorAttachment0DestinationRGBBlendFactor:   C.uint8_t(c.DestinationRGBBlendFactor),
		ColorAttachment0SourceAlphaBlendFactor:      C.uint8_t(c.SourceAlphaBlendFactor),
		ColorAttachment0SourceRGBBlendFactor:        C.uint8_t(c.SourceRGBBlendFactor),
	}
	rps := C.Device_MakeRenderPipelineState(d.device, descriptor)
	if rps.RenderPipelineState == nil {
		return RenderPipelineState{}, errors.New(C.GoString(rps.Error))
	}

	return RenderPipelineState{rps.RenderPipelineState}, nil
}
func (d Device) MakeRenderPipelineState(rpd RenderPipelineDescriptor) (RenderPipelineState, error) {
	blendingEnabled := C.BOOL(0)
	if rpd.ColorAttachments[0].BlendingEnabled {
		blendingEnabled = C.BOOL(1)
	}
	c := &rpd.ColorAttachments[0]
	descriptor := C.struct_RenderPipelineDescriptor{
		VertexFunction:                              rpd.VertexFunction.function,
		FragmentFunction:                            rpd.FragmentFunction.function,
		ColorAttachment0PixelFormat:                 C.uint16_t(c.PixelFormat),
		ColorAttachment0BlendingEnabled:             C.BOOL(blendingEnabled),
		ColorAttachment0DestinationAlphaBlendFactor: C.uint8_t(c.DestinationAlphaBlendFactor),
		ColorAttachment0DestinationRGBBlendFactor:   C.uint8_t(c.DestinationRGBBlendFactor),
		ColorAttachment0SourceAlphaBlendFactor:      C.uint8_t(c.SourceAlphaBlendFactor),
		ColorAttachment0SourceRGBBlendFactor:        C.uint8_t(c.SourceRGBBlendFactor),
	}
	rps := C.Device_MakeRenderPipelineState(d.device, descriptor)
	if rps.RenderPipelineState == nil {
		return RenderPipelineState{}, errors.New(C.GoString(rps.Error))
	}

	return RenderPipelineState{rps.RenderPipelineState}, nil
}
// MakeRenderPipelineState creates a render pipeline state object.
//
// Reference: https://developer.apple.com/documentation/metal/mtldevice/1433369-makerenderpipelinestate.