mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 04:58:05 +02:00
screenshot-layer: Wait on the fence before fallible operations.
We want to be sure that the fence isn't destroyed before we've waited on it, so do that before the fallible fs/png operations. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41299>
This commit is contained in:
parent
25b2865146
commit
5674327297
1 changed files with 3 additions and 1 deletions
|
|
@ -798,6 +798,9 @@ void writePNG(void *job, void *gdata, UNUSED int thread_index) {
|
|||
int matrixSize = localHeight * rowPitch;
|
||||
strcpy(tmpFilename, threadData->filename);
|
||||
strcat(tmpFilename, tmpStr);
|
||||
|
||||
device_data->vtable.WaitForFences(device_data->device, 1, &threadData->cleanup.fence, VK_TRUE, UINT64_MAX);
|
||||
|
||||
file = fopen(tmpFilename, "wb"); //create file for output
|
||||
if (!file) {
|
||||
LOG(ERROR, "Failed to open output file, '%s', error(%d): %s\n", tmpFilename, errno, strerror(errno));
|
||||
|
|
@ -818,7 +821,6 @@ void writePNG(void *job, void *gdata, UNUSED int thread_index) {
|
|||
LOG(ERROR, "setjmp() failed\n");
|
||||
goto cleanup;
|
||||
}
|
||||
device_data->vtable.WaitForFences(device_data->device, 1, &threadData->cleanup.fence, VK_TRUE, UINT64_MAX);
|
||||
threadData->pFramebuffer += threadData->srLayout.offset;
|
||||
start_time = get_time();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue