@derfs
Quote:
Ah ok - it looks like the following was added after you looked at the Vulkan spec.
VkVertexInputAttributeDescription in the pipeline's vertex input state gives:
- format (e.g. VK_FORMAT_R8G8B8A8_UNORM, VK_FORMAT_R16G16_SFLOAT, VK_FORMAT_R32G32B32_SFLOAT)
- offset within the vertex buffer
- binding number
That might have been in the draft too.
What about other data buffers, such as shader constants? IIRC, you could bulk upload data to the GPU, and then let the shaders read from anywhere within the buffer. In this situation, you only know the data layout when it's actually being used by a shader.
Being able to share pointers and data directly between CPU & GPU is really nice, from an API perspective, because it simplifies things (handling the different address spaces was a driver nightmare). From memory, Apple's Metal API has this thanks to a unified memory architecture where both the CPU and GPU use the same address space. Unfortunately, this is only possible if the CPU and GPU use the same endianness, and have MMUs set up to match each other. So the hardware needs to be designed for it.
Hans