Metal Programming Guide
Introduction
Fundamental Metal Concepts
Command Organization and Execution Model
The Device Object Represents a GPU
Transient and Non-transient Objects in Metal
Command Queue
Command Buffer
Creating a Command Buffer
Executing Commands
Registering Handler Blocks for Command Buffer Execution
Monitoring Command Buffer Execution Status
Command Encoder
Creating a Command Encoder Object
Render Command Encoder
Compute Command Encoder
Blit Command Encoder
Multiple Threads, Command Buffers, and Command Encoders
Resource Objects: Buffers and Textures
Buffers Are Typeless Allocations of Memory
Creating a Buffer Object
Buffer Methods
Textures Are Formatted Image Data
Creating a Texture Object
Pixel Formats for Textures
Creating a Sampler States Object for Texture Lookup
Maintaining Coherency Between CPU and GPU Memory
Functions and Libraries
MTLFunction Represents a Shader or Compute Function
A Library Is a Repository of Functions
Creating a Library from Compiled Code
Creating a Library from Source Code
Getting a Function from a Library
Determining Function Details at Runtime
Graphics Rendering: Render Command Encoder
Creating and Using a Render Command Encoder
Creating a Render Pass Descriptor
Using the Render Pass Descriptor to Create a Render Command Encoder
Displaying Rendered Content with Core Animation
Creating a Render Pipeline State
Creating and Configuring a Render Pipeline Descriptor
Creating a Render Pipeline State from a Descriptor
Configuring Blending in a Render Pipeline Attachment Descriptor
Specifying Resources for a Render Command Encoder
Vertex Descriptor for Data Organization
Performing Fixed-Function Render Command Encoder Operations
Working with Viewport and Pixel Coordinate Systems
Performing Depth and Stencil Operations
Drawing Geometric Primitives
Ending a Rendering Pass
Code Example: Drawing a Triangle
Encoding a Single Rendering Pass Using Multiple Threads
Data-Parallel Compute Processing: Compute Command Encoder
Creating a Compute Pipeline State
Specifying a Compute State and Resources for a Compute Command Encoder
Executing a Compute Command
Code Example: Executing Data-Parallel Functions
Buffer and Texture Operations: Blit Command Encoder
Copying Data in GPU Memory Between Resource Objects
Copying Data Between Two Buffers
Copying Data from a Buffer to a Texture
Copying Data Between Two Textures
Copying Data from a Texture to a Buffer
Generating Mipmaps
Filling the Contents of a Buffer
Ending Encoding for the Blit Command Encoder
Metal Tools
Creating Libraries During the App Build Process
Using Xcode to Build a Library
Using Command Line Utilities to Build a Library
Xcode Scheme Settings and Performance
Debugging
File Extension for Metal Shading Language Source Files
Performing Frame Capture with Xcode
The Label Property
Metal System Trace
Metal Feature Set Tables
What's New in iOS 9 and OS X 10.11
Feature Sets
Device Selection
Resource Storage Modes and Device Memory Models
Shared
Private
Managed
Choosing a Resource Storage Mode
Setting and Querying a Resource Storage Mode
Textures
Compressed Textures
PVRTC Blit Operations
Depth/Stencil Render Targets
Cube Array Textures
Texture Usage
Detailed Texture Views
IOSurface Support
Render Additions
Render Command Encoder
Layered Rendering
Compute Additions
Supporting Frameworks
MetalKit
Metal Performance Shaders
What’s New in iOS 10, tvOS 10, and macOS 10.12
Tessellation
Metal Tessellation Pipeline
Compute Kernel
Tessellator
Post-Tessellation Vertex Function
Per-Patch Tessellation Factors
Understanding Quad Patches
Understanding Triangle Patches
Rules for Discarding Patches
Specifying the Per-Patch Tessellation Factors Buffer
Patch Functions
Creating a Compute Kernel
Creating a Post-Tessellation Vertex Function
Tessellation Pipeline State
Building a Compute Pipeline
Building a Render Pipeline
Patch Draw Calls
Drawing Tessellated Patches
Sample Code
Porting DirectX 11-Style Tessellation Shaders to Metal
Resource Heaps
Heaps
Creating a Heap
Sub-Allocating Heap Resources
Fences
Creating a Fence
Tracking Fences Across Blit and Compute Command Encoders
Tracking Fences Across Render Command Encoders
Fence Examples
Best Practices
Separate Heaps for Render Target Types
Separate Heaps for Aliasable and Non-Aliasable Resources
Separate Heaps to Reduce Fragmentation
Minimize Fencing
Consider Tracking Non-Heap Resources
Sample Code
Document Revision History
Powered by
GitBook
Understanding Quad Patches
results matching "
"
No results matching "
"