lionheart / openradar-mirror

A mirror of radars pulled from http://openradar.me/.
246 stars 17 forks source link

26038856: CoreImage rendering to Metal texture does not expose compositing options, like OpenGL does. #14612

Open openradar-mirror opened 8 years ago

openradar-mirror commented 8 years ago

Description

When rendering to a Metal texture using Core Image API,

-[CIContext render:toMTLTexture:commandBuffer:bounds:colorSpace:]

CIImage contents replaced texture contents. There is no way of specifying basic blending options like it is when using CoreImage with OpenGL:

glDepthMask(GL_FALSE);
glDisable(GL_DEPTH_TEST);
glViewport(0, 0, (GLsizei)bounds.size.width, (GLsizei)bounds.size.height);
glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
glEnable (GL_BLEND);

glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
glOrtho (0, bounds.size.width, 0, bounds.size.height, -1, 1);

glMatrixMode (GL_MODELVIEW);
glLoadIdentity ();

CGRect r = CGRectIntersection(image.extent, drawable.extent);
[context drawImage:image inRect:r fromRect:r];

This blending capability is available within the metal encoder used internally by Core Image.

I would like to suggest exposing an API that makes it possible to composite Core Image rendering onto existing texture contents, and thus make it on par with OpenGL implementation.

Product Version: 10.11.x Created: 2016-05-02T12:50:52.916480 Originated: 2016-05-02T14:50:00 Open Radar Link: http://www.openradar.me/26038856

openradar-mirror commented 8 years ago

Modified: 2016-05-02T12:50:52.916750