Skip to content
This repository was archived by the owner on Aug 19, 2019. It is now read-only.
This repository was archived by the owner on Aug 19, 2019. It is now read-only.

Multiview UBO copies are seemed to be broken #111

@DrSergey84

Description

@DrSergey84

The function here looks wrong:
https://github.com/KhronosGroup/Vulkan-Samples/blob/master/samples/apps/atw/scenes/scene_perf.h#L1706

The UBO buffers are being copied from a wrong memory in case of multiview. I think that it should look like this:

static void ksPerfScene_UpdateBuffers( ksGpuCommandBuffer * commandBuffer, ksPerfScene * scene, const ksViewState * viewState, const int eye )
{
ksMatrix4x4f * sceneMatrices = NULL;
ksGpuBuffer * sceneMatricesBuffer = ksGpuCommandBuffer_MapBuffer( commandBuffer, &scene->sceneMatrices, (void **)&sceneMatrices );
const int count = ( eye == 2 ) ? 2 : 1;
const int offset = ( eye == 2) ? 0 : eye;

memcpy( sceneMatrices + 0 * count, &viewState->viewMatrix[offset], count * sizeof( ksMatrix4x4f ) );
memcpy( sceneMatrices + 1 * count, &viewState->projectionMatrix[offset], count * sizeof( ksMatrix4x4f ) );
ksGpuCommandBuffer_UnmapBuffer( commandBuffer, &scene->sceneMatrices, sceneMatricesBuffer, KS_GPU_BUFFER_UNMAP_TYPE_COPY_BACK );
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions