Returns true if |offset| satsifies an alignment to |alignment|. In the case of |alignment| of zero, the |offset| must also be zero.
| 429 | // Returns true if |offset| satsifies an alignment to |alignment|. In the case |
| 430 | // of |alignment| of zero, the |offset| must also be zero. |
| 431 | bool IsAlignedTo(uint32_t offset, uint32_t alignment) { |
| 432 | if (alignment == 0) return offset == 0; |
| 433 | return 0 == (offset % alignment); |
| 434 | } |
| 435 | |
| 436 | // Returns SPV_SUCCESS if the given struct satisfies standard layout rules for |
| 437 | // Block or BufferBlocks in Vulkan. Otherwise emits a diagnostic and returns |