vkd3d: Implement support for D3D12_FEATURE_SHADER_CACHE.

Signed-off-by: Conor McCarthy <conor.mccarthy.444@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Conor McCarthy 2020-05-22 16:27:17 +04:30 committed by Alexandre Julliard
parent 6e0590adf6
commit 16882d1a50
2 changed files with 34 additions and 0 deletions

View File

@ -191,6 +191,15 @@ typedef enum D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER
D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER_2 = 0x2,
} D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER;
typedef enum D3D12_SHADER_CACHE_SUPPORT_FLAGS
{
D3D12_SHADER_CACHE_SUPPORT_NONE = 0x0,
D3D12_SHADER_CACHE_SUPPORT_SINGLE_PSO = 0x1,
D3D12_SHADER_CACHE_SUPPORT_LIBRARY = 0x2,
D3D12_SHADER_CACHE_SUPPORT_AUTOMATIC_INPROC_CACHE = 0x4,
D3D12_SHADER_CACHE_SUPPORT_AUTOMATIC_DISK_CACHE = 0x8,
} D3D12_SHADER_CACHE_SUPPORT_FLAGS;
interface ID3D12Fence;
interface ID3D12RootSignature;
interface ID3D12Heap;
@ -1647,6 +1656,11 @@ typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS2
D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER ProgrammableSamplePositionsTier;
} D3D12_FEATURE_DATA_D3D12_OPTIONS2;
typedef struct D3D12_FEATURE_DATA_SHADER_CACHE
{
D3D12_SHADER_CACHE_SUPPORT_FLAGS SupportFlags;
} D3D12_FEATURE_DATA_SHADER_CACHE;
typedef enum D3D12_FEATURE
{
D3D12_FEATURE_D3D12_OPTIONS = 0,

View File

@ -2768,6 +2768,26 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CheckFeatureSupport(ID3D12Device *
return S_OK;
}
case D3D12_FEATURE_SHADER_CACHE:
{
D3D12_FEATURE_DATA_SHADER_CACHE *data = feature_data;
if (feature_data_size != sizeof(*data))
{
WARN("Invalid size %u.\n", feature_data_size);
return E_INVALIDARG;
}
/* FIXME: The d3d12 documentation states that
* D3D12_SHADER_CACHE_SUPPORT_SINGLE_PSO is always supported, but
* the CachedPSO field of D3D12_GRAPHICS_PIPELINE_STATE_DESC is
* ignored and GetCachedBlob() is a stub. */
data->SupportFlags = D3D12_SHADER_CACHE_SUPPORT_NONE;
TRACE("Shader cache support %#x.\n", data->SupportFlags);
return S_OK;
}
default:
FIXME("Unhandled feature %#x.\n", feature);
return E_NOTIMPL;