vkd3d: Implement simple pipeline cache.

Ideally, we would like to introduce a Vulkan extension to make vertex
buffer strides and primitive topology dynamic in Vulkan.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia
2018-09-12 15:20:02 +02:00
committed by Alexandre Julliard
parent e7eb9ca936
commit 11c00a157c
4 changed files with 201 additions and 46 deletions

View File

@@ -1095,11 +1095,15 @@ static ULONG STDMETHODCALLTYPE d3d12_pipeline_state_Release(ID3D12PipelineState
if (state->vk_bind_point == VK_PIPELINE_BIND_POINT_GRAPHICS)
{
for (i = 0; i < state->u.graphics.stage_count; ++i)
struct d3d12_graphics_pipeline_state *graphics = &state->u.graphics;
for (i = 0; i < graphics->stage_count; ++i)
{
VK_CALL(vkDestroyShaderModule(device->vk_device, state->u.graphics.stages[i].module, NULL));
VK_CALL(vkDestroyShaderModule(device->vk_device, graphics->stages[i].module, NULL));
}
VK_CALL(vkDestroyRenderPass(device->vk_device, state->u.graphics.render_pass, NULL));
VK_CALL(vkDestroyRenderPass(device->vk_device, graphics->render_pass, NULL));
d3d12_device_destroy_compiled_pipelines(device, &graphics->compiled_pipelines);
}
else if (state->vk_bind_point == VK_PIPELINE_BIND_POINT_COMPUTE)
{
@@ -2185,6 +2189,8 @@ static HRESULT d3d12_pipeline_state_init_graphics(struct d3d12_pipeline_state *s
graphics->root_signature = root_signature;
list_init(&graphics->compiled_pipelines);
state->vk_bind_point = VK_PIPELINE_BIND_POINT_GRAPHICS;
state->device = device;
ID3D12Device_AddRef(&device->ID3D12Device_iface);