MetalByTutorials/01-introduction-to-metal
daemyung jang 72bf3a16e5 Apply the list on README.md 2021-04-21 00:10:11 +09:00
..
challenge/Chapter1.playground Summerize Chapter 1: Hello, Metal 2021-04-16 17:08:38 +09:00
final/Chapter1.playground Copy source code from the official website 2021-04-15 11:39:00 +09:00
projects Summerize Chapter 1: Hello, Metal 2021-04-16 17:08:38 +09:00
README.md Apply the list on README.md 2021-04-21 00:10:11 +09:00

README.md

Chapter 1: Hello, Metal!

As I read this book, I summarize what I think is wrong. If you think my comments are wrong then please let me know. We can dicuss more and update your opinion.

The pipeline state

  • When this book creates a pipeline state, they manually set the output pixel format like below.
pipelineDescriptor.colorAttachments[0].pixelFormat = .bgra8Unorm

This is fine but the output pixel format of view isn't always .bgra8Unorm. It can be .rgba8Unorm or other formats. Thus we need to get this information from a view like below.

pipelineDescriptor.colorAttachments[0].pixelFormat = view.colorPixelFormat;