title: How do I pass a Float uniform to iOS Metal shader using Swift?
body: <p>I want to pass a float to my metal shader. I cannot figure out how.</p>
  
  <p>Here is my shader:</p>
  
  <pre><code>vertex float4 model_vertex(unsigned int iid[[instance_id]]
                             constant float angle) {
      float number = float(iid) / 64.0;
      return float4(number * sin(angle), number * cos(angle), 0.0, 1.0);
  }
  </code></pre>
  
  <p>Now I want to pass it to the shader:</p>
  
  <pre><code>let renderPassDescriptor = MTLRenderPassDescriptor()
  let renderEncoder = commandBuffer.renderCommandEncoderWithDescriptor(renderPassDescriptor)
  // ...
  let angle: Float = 0.5
  renderEncoder.setUniform1(angle) // What do I do here?
  </code></pre>
  
  <p>How do I pass the single float value?</p>