This function expects that the offsets are already calculated! I.e, if the types are created manually you can use the UpdateShaderTypesOffsets function (graphics_private.h) first.
| 1874 | // This function expects that the offsets are already calculated! I.e, if the types are created manually |
| 1875 | // you can use the UpdateShaderTypesOffsets function (graphics_private.h) first. |
| 1876 | void GetUniformBufferLayout(uint32_t root_type_index, const ShaderResourceTypeInfo* types, uint32_t num_types, UniformBufferLayout* layout_desc) |
| 1877 | { |
| 1878 | HashState32 hash_state; |
| 1879 | dmHashInit32(&hash_state, false); |
| 1880 | assert(root_type_index < num_types); |
| 1881 | |
| 1882 | bool* visited = (bool*)dmAlloca(sizeof(bool) * num_types); |
| 1883 | memset(visited, 0, sizeof(bool) * num_types); |
| 1884 | |
| 1885 | HashTypeRecursive(root_type_index, types, num_types, &hash_state, visited); |
| 1886 | |
| 1887 | layout_desc->m_Hash = dmHashFinal32(&hash_state); |
| 1888 | layout_desc->m_Size = CalculateShaderTypesSize(root_type_index, types, num_types); |
| 1889 | } |
| 1890 | void GetGraphicsContextLimits(HContext context, GraphicsContextLimits& limits) |
| 1891 | { |
| 1892 | GraphicsContext* gc = (GraphicsContext*) context; |