# Metal shader language Question

**URL:** <https://forums.kodeco.com/t/metal-shader-language-question/107120>\
**Category:** Metal by Tutorials\
**Created:** [April 28, 2020, 9:00am UTC](https://forums.kodeco.com/t/metal-shader-language-question/107120 "2020-04-28T09:00:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![richmond\_jam](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/richmond_jam/32/102075_2.png) [@richmond\_jam](https://forums.kodeco.com/u/richmond_jam)\
**Post date:** [April 28, 2020, 9:00am UTC](https://forums.kodeco.com/t/metal-shader-language-question/107120/1 "2020-04-28T09:00:12Z")

</div>

I am this book whose named \<\> reader. I bought this book to study Metal. But now I have some question about Metal shader language. I wanna know what “stage\_in” is. So I hope doctor Caroline can show me answer. Thanks!

---

<div class="post-metadata">

**Author:** ![caroline](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/caroline/32/111867_2.png) [@caroline](https://forums.kodeco.com/u/caroline)\
**Post date:** [April 28, 2020, 9:37am UTC](https://forums.kodeco.com/t/metal-shader-language-question/107120/2 "2020-04-28T09:37:36Z")

</div>

Hi @richmond_jam 😃

Coincidentally, someone else asked this question a couple of weeks ago. Perhaps you could review the answer, and see if it helps your understanding:

> [@Chapter 5 : Meaning of stage\_in](https://forums.kodeco.com/t/chapter-5-meaning-of-stage-in/105161):
>
> Hello I hope you are have spending a nice Monday. I have a question that is maybe too early in my learning curve of Metal but … in « fragment float4 fragment\_main(VertexOut in [[stage\_in]]) { return float4(in.normal, 1); } » in Shaders.metal So far (chapter5), I do not really understand what does stage\_in mean. Can you provide a short explanation and point out what to read to understand better what it means ? Regards Behr

How far into the book are you?

---

<div class="post-metadata">

**Author:** ![richmond\_jam](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/richmond_jam/32/102075_2.png) [@richmond\_jam](https://forums.kodeco.com/u/richmond_jam)\
**Post date:** [April 28, 2020, 9:56am UTC](https://forums.kodeco.com/t/metal-shader-language-question/107120/3 "2020-04-28T09:56:27Z")

</div>

Hello doctor, I read this book in chapter 6 – Textures. And I wanna get some suggestion from you whether I need to remember all step about Metal. If I do that, maybe too many work to do.

---

<div class="post-metadata">

**Author:** ![caroline](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/caroline/32/111867_2.png) [@caroline](https://forums.kodeco.com/u/caroline)\
**Post date:** [April 28, 2020, 10:21am UTC](https://forums.kodeco.com/t/metal-shader-language-question/107120/4 "2020-04-28T10:21:26Z")

</div>

There is a lot of work to learn Metal - it’s not an easy job!

If you keep practicing, then the steps will be come easier.

Remember the basic procedure:

1. Setup all buffers and textures and pipeline states when initialising the renderer.

2. In draw(in:), set up a render command encoder to encode all the steps that the GPU must take during the draw call. eg. set buffers and textures and pipeline state for each draw call.

3. Create a vertex shader and a fragment shader.

Did you understand about the `[[stage_in]]` attribute from the link I gave you?

---

<div class="post-metadata">

**Author:** ![richmond\_jam](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/richmond_jam/32/102075_2.png) [@richmond\_jam](https://forums.kodeco.com/u/richmond_jam)\
**Post date:** [April 28, 2020, 11:09am UTC](https://forums.kodeco.com/t/metal-shader-language-question/107120/5 "2020-04-28T11:09:01Z")

</div>

I got it doctor Caroline. Thank you too much.
