title: issues in Apple Metal API "setVertexBuffer:offset:atIndex:"
body: <p>I am new in Apple Metal, when running the apple sample code "<a href="https://developer.apple.com/documentation/metal/creating_and_sampling_textures?language=objc" rel="nofollow noreferrer">Creating and Sampling Textures</a>", I fond something strange, "<em>Figure 1</em>" is the result in my <strong>Macmini 2018 (the GPU is Intel(R) UHD Graphics 630)</strong>, you can see the quad's left bottom corner is squeezed, the origin source use <code>setVertexBuffer:offset:atIndex:</code> to set vertex buffer, I replace it to <code>setVertexBytes:length:atIndex:</code> and run, the result show as "<em>Figure 2</em>", it seems everything going fine, then I build and run the origin source in another machine(<strong>Macbookpro, GPU is GeForce GT 750M</strong>), the quad is render correct, result is show as "<em>Figure 2</em>", so does the source missing something or is there some issues in the function <code>setVertexBuffer:offset:atIndex:</code>?</p>
  
  <p>Figure 1</p>
  
  <p><a href="https://i.stack.imgur.com/XRSJX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XRSJX.png" alt=" figure 1 "></a></p>
  
  <p>Figure 2</p>
  
  <p><a href="https://i.stack.imgur.com/H2hSO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/H2hSO.png" alt=" Figure 2 "></a></p>
  
  <pre><code>// Apple's origin source
  //
  static const AAPLVertex quadVertices[] =
      {
          // Pixel positions, Texture coordinates
          { {  250,  -250 },  { 1.f, 1.f } },
          { { -250,  -250 },  { 0.f, 1.f } },
          { { -250,   250 },  { 0.f, 0.f } },
  
          { {  250,  -250 },  { 1.f, 1.f } },
          { { -250,   250 },  { 0.f, 0.f } },
          { {  250,   250 },  { 1.f, 0.f } },
      };
  ...
  ...
  ...
  //Create a vertex buffer, and initialize it with the quadVertices array
  _vertices = [_device newBufferWithBytes:quadVertices
                                  length:sizeof(quadVertices)
                                 options:MTLResourceOptionCPUCacheModeDefault];
  ...
  ...
  // set the vertex buffer
  [renderEncoder setVertexBuffer:_vertices
                          offset:0
                        atIndex:AAPLVertexInputIndexVertices];
  </code></pre>
  
  <p>I make the quadVertices as a global array, and replace the 
  "setVertexBuffer:offset:atIndex:" to "setVertexBytes:length:atIndex:" </p>
  
  <pre><code>[renderEncoder setVertexBytes:&amp;quadVertices
                         length:sizeof(quadVertices)
                         atIndex:AAPLVertexInputIndexVertices];
  </code></pre>