# buffer

### Uniform Buffer

* Vulkan : BufferUsageFlags : UNIFORM BUFFER
* Dx : Constant Buffer
* OpenGL : Uniform Buffer Object
* HLSL : cbuffer \_ : register(b##bind, space##set){type param;};
* GLSL : layout (set = 3, binding = 2) uniform in\_lights { Light light;};
* 一般 Alignment 16 bytes, 大小限制为 16 KiB
* Unity : Shader Properties, CBUFFER

### Shader Storage Buffer Objects (SSBOs)

* 现代图形 api 上才有, GLES 3.1 以上
* GLSL : layout(std430, binding = 2) buffer MyBuffer
* HLSL : RW/StructuredBuffer\<MyStructType> myBuffer : register(t2);
* Vulkan : STORAGE\_BUFFER

#### Push Constants

* 只有 Vulkan 才有, 每次提交时要设置


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://okzkx.gitbook.io/blogs/game-tech/engine/render/render-pipeline/buffer.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
