Constant address space buffer and 64KB limits

I’m using constant address space MTLBuffer to implement instanced rendering using -[MTLRenderCommandEncoder drawIndexedPrimitives:indexCount:indexType:indexBuffer:indexBufferOffset:instanceCount:].

When I tested on the NVIDIA GPU (Geforce GT 650M) the buffer’s contents was truncated over 64KB in the shader program. However the content was not truncated on AMD or Intel GPUs. (I tested on Intel HD Graphics 4000, Intel UHD 630, Radeon Pro 5500M)

I found a specification on Metal Feature Set Tables document “Maximum function memory allocation for a buffer in the constant address space” is 64KB in GPUFamilyMac1/2. It looks like why the buffer is truncated on NVIDIA GPU.

  1. When I target my app to Intel Mac, should I always limit constant address space buffer size maximum to 64KB even if running on AMD or Intel GPU?

  2. When I use device address space instead of constant address space, Is there any performance difference between constant and device address space? (I heard that there's constant buffer cache on DirectX GPUs)

Thanks!

Constant address space buffer and 64KB limits
 
 
Q