[vulkan] Default a view's format to that of its image

Just one less thing to duplicate.
This commit is contained in:
Bill Currie 2023-06-30 03:03:21 +09:00
parent 154d1cbfcb
commit 665d88c353

View file

@ -289,6 +289,10 @@ create_resources (vulkan_ctx_t *ctx, objcount_t *counts)
if (img) { if (img) {
uint32_t ind = img - job->resources->objects; uint32_t ind = img - job->resources->objects;
job->image_views[i].image_view.image = ind; job->image_views[i].image_view.image = ind;
// fall back to the image's format if not overriden
if (!job->image_views[i].image_view.format) {
job->image_views[i].image_view.format = img->image.format;
}
} else { } else {
Sys_Printf ("%d: unknown image reference: %s\n", Sys_Printf ("%d: unknown image reference: %s\n",
view->image.line, view->image.name); view->image.line, view->image.name);