Lines Matching refs:texture

468             mtltexture = data.mtlbackbuffer.texture;
479 data.mtlpassdesc.colorAttachments[0].texture = mtltexture;
484 if (data.mtlbackbuffer != nil && mtltexture == data.mtlbackbuffer.texture) {
550 METAL_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
555 switch (texture->format) {
569 … SDL_SetError("Texture format %s not supported by Metal", SDL_GetPixelFormatName(texture->format));
573 … width:(NSUInteger)texture->w height:(NSUInteger)texture->h mipmapped:NO];
577 if (texture->access == SDL_TEXTUREACCESS_TARGET) {
591 … BOOL yuv = (texture->format == SDL_PIXELFORMAT_IYUV) || (texture->format == SDL_PIXELFORMAT_YV12);
592 …BOOL nv12 = (texture->format == SDL_PIXELFORMAT_NV12) || (texture->format == SDL_PIXELFORMAT_NV21);
596 mtltexdesc.width = (texture->w + 1) / 2;
597 mtltexdesc.height = (texture->h + 1) / 2;
602 mtltexdesc.width = (texture->w + 1) / 2;
603 mtltexdesc.height = (texture->h + 1) / 2;
617 if (texture->scaleMode == SDL_ScaleModeNearest) {
630 } else if (texture->format == SDL_PIXELFORMAT_NV12) {
632 } else if (texture->format == SDL_PIXELFORMAT_NV21) {
640 … SDL_YUV_CONVERSION_MODE mode = SDL_GetYUVConversionModeForResolution(texture->w, texture->h);
650 texture->driverdata = (void*)CFBridgingRetain(texturedata);
662 METAL_UploadTextureData(id<MTLTexture> texture, SDL_Rect rect, int slice,
665 [texture replaceRegion:MTLRegionMake2D(rect.x, rect.y, rect.w, rect.h)
685 id<MTLTexture> texture, SDL_Rect rect, int slice,
692 /* If the texture is managed or shared and this is the first upload, we can
694 * to a staging texture and copy that over. */
695 if (!texturedata.hasdata && METAL_GetStorageMode(texture) != MTLStorageModePrivate) {
696 METAL_UploadTextureData(texture, rect, slice, pixels, pitch);
700 desc = [MTLTextureDescriptor texture2DDescriptorWithPixelFormat:texture.pixelFormat
710 * and release a staging texture back to the pool in the command buffer's
739 toTexture:texture
755 METAL_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
758 METAL_TextureData *texturedata = (__bridge METAL_TextureData *)texture->driverdata;
765 int Uslice = texture->format == SDL_PIXELFORMAT_YV12 ? 1 : 0;
766 int Vslice = texture->format == SDL_PIXELFORMAT_YV12 ? 0 : 1;
770 /* Skip to the correct offset into the next texture */
776 /* Skip to the correct offset into the next texture */
787 /* Skip to the correct offset into the next texture */
800 METAL_UpdateTextureYUV(SDL_Renderer * renderer, SDL_Texture * texture,
806 METAL_TextureData *texturedata = (__bridge METAL_TextureData *)texture->driverdata;
832 METAL_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
836 METAL_TextureData *texturedata = (__bridge METAL_TextureData *)texture->driverdata;
844 *pitch = SDL_BYTESPERPIXEL(texture->format) * rect->w;
870 METAL_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture)
873 METAL_TextureData *texturedata = (__bridge METAL_TextureData *)texture->driverdata;
875 int pitch = SDL_BYTESPERPIXEL(texture->format) * rect.w;
904 int Uslice = texture->format == SDL_PIXELFORMAT_YV12 ? 1 : 0;
905 int Vslice = texture->format == SDL_PIXELFORMAT_YV12 ? 0 : 1;
953 METAL_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture, SDL_ScaleMode scaleMode)
956 METAL_TextureData *texturedata = (__bridge METAL_TextureData *)texture->driverdata;
966 METAL_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture)
1086 METAL_QueueCopy(SDL_Renderer * renderer, SDL_RenderCommand *cmd, SDL_Texture * texture,
1089 const float texw = (float) texture->w;
1090 const float texh = (float) texture->h;
1100 /* Interleaved positions and texture coordinates */
1125 METAL_QueueCopyEx(SDL_Renderer * renderer, SDL_RenderCommand *cmd, SDL_Texture * texture,
1129 const float texw = (float) texture->w;
1130 const float texh = (float) texture->h;
1178 /* Interleaved positions and texture coordinates */
1213 SDL_Texture *texture; field
1294 SDL_Texture *texture = cmd->data.draw.texture;
1295 METAL_TextureData *texturedata = (__bridge METAL_TextureData *)texture->driverdata;
1299 if (texture != statecache->texture) {
1301 if (statecache->texture) {
1302 oldtexturedata = (__bridge METAL_TextureData *) statecache->texture->driverdata;
1313 statecache->texture = texture;
1329 statecache.texture = NULL;
1400 statecache.texture = NULL;
1478 id<MTLTexture> mtltexture = data.mtlpassdesc.colorAttachments[0].texture;
1482 * update the CPU-side copy of the texture data.
1536 METAL_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture)
1538 CFBridgingRelease(texture->driverdata);
1539 texture->driverdata = NULL;