MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-Tools / demo_update_data_buffer

Function demo_update_data_buffer

cube/cube.c:1023–1036  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1021}
1022
1023void demo_update_data_buffer(struct demo *demo, void *uniform_memory_ptr) {
1024 mat4x4 MVP, Model, VP;
1025 int matrixSize = sizeof(MVP);
1026
1027 mat4x4_mul(VP, demo->projection_matrix, demo->view_matrix);
1028
1029 // Rotate around the Y axis
1030 mat4x4_dup(Model, demo->model_matrix);
1031 mat4x4_rotate_Y(demo->model_matrix, Model, (float)degreesToRadians(demo->spin_angle));
1032 mat4x4_orthonormalize(demo->model_matrix, demo->model_matrix);
1033 mat4x4_mul(MVP, VP, demo->model_matrix);
1034
1035 memcpy(uniform_memory_ptr, (const void *)&MVP[0][0], matrixSize);
1036}
1037
1038void DemoUpdateTargetIPD(struct demo *demo) {
1039 // Look at what happened to previous presents, and make appropriate

Callers 1

demo_drawFunction · 0.85

Calls 4

mat4x4_mulFunction · 0.85
mat4x4_dupFunction · 0.85
mat4x4_rotate_YFunction · 0.85
mat4x4_orthonormalizeFunction · 0.85

Tested by

no test coverage detected