render/vulkan: Dynamically create texture views

Now that we are dynamically creating pipeline layouts, we need separate
texture views for each pipeline layout we choose to use with a texture.
This commit is contained in:
Alexander Orzechowski 2023-06-16 20:10:01 -04:00
parent 7c5a3afd60
commit 3ee0f52e09
4 changed files with 62 additions and 33 deletions

View file

@ -1419,13 +1419,19 @@ static bool vulkan_render_subtexture_with_matrix(struct wlr_renderer *wlr_render
return false;
}
struct wlr_vk_texture_view *view =
vulkan_texture_get_or_create_view(texture, pipe->layout);
if (!view) {
return false;
}
if (pipe->vk != renderer->bound_pipe) {
vkCmdBindPipeline(cb, VK_PIPELINE_BIND_POINT_GRAPHICS, pipe->vk);
renderer->bound_pipe = pipe->vk;
}
vkCmdBindDescriptorSets(cb, VK_PIPELINE_BIND_POINT_GRAPHICS,
pipe->layout->vk, 0, 1, &texture->ds, 0, NULL);
pipe->layout->vk, 0, 1, &view->ds, 0, NULL);
float final_matrix[9];
wlr_matrix_multiply(final_matrix, renderer->projection, matrix);