Compare commits
17 Commits
master
...
pso-creati
Author | SHA1 | Date |
---|---|---|
Hans-Kristian Arntzen | 3a1e6de93d | |
Hans-Kristian Arntzen | 191214899d | |
Hans-Kristian Arntzen | 221c47d0fd | |
Hans-Kristian Arntzen | f322491964 | |
Hans-Kristian Arntzen | 1f7f924662 | |
Hans-Kristian Arntzen | 43b7cc8278 | |
Hans-Kristian Arntzen | 66ab0e52c7 | |
Hans-Kristian Arntzen | adf03e7a4b | |
Hans-Kristian Arntzen | fdf5ec705c | |
Hans-Kristian Arntzen | d45b3a0dc7 | |
Hans-Kristian Arntzen | 742ee58b50 | |
Hans-Kristian Arntzen | 5798f5827b | |
Hans-Kristian Arntzen | f78b635d54 | |
Hans-Kristian Arntzen | 54a6605edf | |
Hans-Kristian Arntzen | 818773d920 | |
Hans-Kristian Arntzen | c1bc442742 | |
Hans-Kristian Arntzen | 8deb9050c2 |
|
@ -764,6 +764,8 @@ static VkResult vkd3d_serialize_pipeline_state_inline(const struct d3d12_pipelin
|
||||||
chunk = finish_and_iterate_blob_chunk(chunk);
|
chunk = finish_and_iterate_blob_chunk(chunk);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!state->pso_is_loaded_from_cached_blob)
|
||||||
|
{
|
||||||
if (d3d12_pipeline_state_is_graphics(state))
|
if (d3d12_pipeline_state_is_graphics(state))
|
||||||
{
|
{
|
||||||
for (i = 0; i < state->graphics.stage_count; i++)
|
for (i = 0; i < state->graphics.stage_count; i++)
|
||||||
|
@ -777,6 +779,7 @@ static VkResult vkd3d_serialize_pipeline_state_inline(const struct d3d12_pipelin
|
||||||
vkd3d_shader_code_serialize_inline(&state->compute.code, VK_SHADER_STAGE_COMPUTE_BIT,
|
vkd3d_shader_code_serialize_inline(&state->compute.code, VK_SHADER_STAGE_COMPUTE_BIT,
|
||||||
varint_size[0], &chunk);
|
varint_size[0], &chunk);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return VK_SUCCESS;
|
return VK_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -843,6 +846,8 @@ static VkResult vkd3d_serialize_pipeline_state_referenced(struct d3d12_pipeline_
|
||||||
chunk = finish_and_iterate_blob_chunk(chunk);
|
chunk = finish_and_iterate_blob_chunk(chunk);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!state->pso_is_loaded_from_cached_blob)
|
||||||
|
{
|
||||||
if (d3d12_pipeline_state_is_graphics(state))
|
if (d3d12_pipeline_state_is_graphics(state))
|
||||||
{
|
{
|
||||||
for (i = 0; i < state->graphics.stage_count; i++)
|
for (i = 0; i < state->graphics.stage_count; i++)
|
||||||
|
@ -858,6 +863,7 @@ static VkResult vkd3d_serialize_pipeline_state_referenced(struct d3d12_pipeline_
|
||||||
&state->compute.code, VK_SHADER_STAGE_COMPUTE_BIT,
|
&state->compute.code, VK_SHADER_STAGE_COMPUTE_BIT,
|
||||||
varint_size[0], &chunk);
|
varint_size[0], &chunk);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return VK_SUCCESS;
|
return VK_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -900,6 +906,8 @@ VkResult vkd3d_serialize_pipeline_state(struct d3d12_pipeline_library *pipeline_
|
||||||
vk_blob_size += VKD3D_PIPELINE_BLOB_CHUNK_SIZE_RAW(vk_blob_size_pipeline_cache);
|
vk_blob_size += VKD3D_PIPELINE_BLOB_CHUNK_SIZE_RAW(vk_blob_size_pipeline_cache);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!state->pso_is_loaded_from_cached_blob)
|
||||||
|
{
|
||||||
if (d3d12_pipeline_state_is_graphics(state))
|
if (d3d12_pipeline_state_is_graphics(state))
|
||||||
{
|
{
|
||||||
for (i = 0; i < state->graphics.stage_count; i++)
|
for (i = 0; i < state->graphics.stage_count; i++)
|
||||||
|
@ -913,6 +921,7 @@ VkResult vkd3d_serialize_pipeline_state(struct d3d12_pipeline_library *pipeline_
|
||||||
vk_blob_size += vkd3d_shader_code_compute_serialized_size(&state->compute.code,
|
vk_blob_size += vkd3d_shader_code_compute_serialized_size(&state->compute.code,
|
||||||
need_blob_sizes ? &varint_size[0] : NULL, !pipeline_library);
|
need_blob_sizes ? &varint_size[0] : NULL, !pipeline_library);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
total_size += vk_blob_size;
|
total_size += vk_blob_size;
|
||||||
|
|
||||||
|
@ -1386,10 +1395,11 @@ static HRESULT d3d12_pipeline_library_load_pipeline(struct d3d12_pipeline_librar
|
||||||
if (root_signature)
|
if (root_signature)
|
||||||
pipeline_cache_compat.root_signature_compat_hash = root_signature->compatibility_hash;
|
pipeline_cache_compat.root_signature_compat_hash = root_signature->compatibility_hash;
|
||||||
}
|
}
|
||||||
else if (!cached_state->private_root_signature)
|
else if (cached_state->root_signature_compat_hash_is_dxbc_derived)
|
||||||
{
|
{
|
||||||
/* If we have no explicit root signature and the existing PSO didn't either,
|
/* If we have no explicit root signature and the existing PSO didn't either,
|
||||||
* just inherit the compat hash from PSO to avoid comparing them. */
|
* just inherit the compat hash from PSO to avoid comparing them.
|
||||||
|
* The hash depends entirely on the DXBC blob either way. */
|
||||||
pipeline_cache_compat.root_signature_compat_hash = cached_state->pipeline_cache_compat.root_signature_compat_hash;
|
pipeline_cache_compat.root_signature_compat_hash = cached_state->pipeline_cache_compat.root_signature_compat_hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1327,6 +1327,7 @@ struct d3d12_root_signature
|
||||||
{
|
{
|
||||||
ID3D12RootSignature ID3D12RootSignature_iface;
|
ID3D12RootSignature ID3D12RootSignature_iface;
|
||||||
LONG refcount;
|
LONG refcount;
|
||||||
|
LONG internal_refcount;
|
||||||
|
|
||||||
vkd3d_shader_hash_t compatibility_hash;
|
vkd3d_shader_hash_t compatibility_hash;
|
||||||
|
|
||||||
|
@ -1386,6 +1387,9 @@ struct d3d12_root_signature
|
||||||
|
|
||||||
HRESULT d3d12_root_signature_create(struct d3d12_device *device, const void *bytecode,
|
HRESULT d3d12_root_signature_create(struct d3d12_device *device, const void *bytecode,
|
||||||
size_t bytecode_length, struct d3d12_root_signature **root_signature);
|
size_t bytecode_length, struct d3d12_root_signature **root_signature);
|
||||||
|
/* Private ref counts, for pipeline library. */
|
||||||
|
void d3d12_root_signature_inc_ref(struct d3d12_root_signature *state);
|
||||||
|
void d3d12_root_signature_dec_ref(struct d3d12_root_signature *state);
|
||||||
|
|
||||||
static inline struct d3d12_root_signature *impl_from_ID3D12RootSignature(ID3D12RootSignature *iface)
|
static inline struct d3d12_root_signature *impl_from_ID3D12RootSignature(ID3D12RootSignature *iface)
|
||||||
{
|
{
|
||||||
|
@ -1452,6 +1456,20 @@ enum vkd3d_plane_optimal_flag
|
||||||
VKD3D_DEPTH_STENCIL_PLANE_GENERAL = (1 << 2),
|
VKD3D_DEPTH_STENCIL_PLANE_GENERAL = (1 << 2),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct d3d12_graphics_pipeline_state_cached_desc
|
||||||
|
{
|
||||||
|
/* Information needed to compile to SPIR-V. */
|
||||||
|
unsigned int ps_output_swizzle[D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT];
|
||||||
|
struct vkd3d_shader_parameter ps_shader_parameters[1];
|
||||||
|
bool is_dual_source_blending;
|
||||||
|
VkShaderStageFlagBits xfb_stage;
|
||||||
|
struct vkd3d_shader_transform_feedback_info *xfb_info;
|
||||||
|
|
||||||
|
D3D12_SHADER_BYTECODE bytecode[VKD3D_MAX_SHADER_STAGES];
|
||||||
|
VkShaderStageFlagBits bytecode_stages[VKD3D_MAX_SHADER_STAGES];
|
||||||
|
uint32_t bytecode_duped_mask;
|
||||||
|
};
|
||||||
|
|
||||||
struct d3d12_graphics_pipeline_state
|
struct d3d12_graphics_pipeline_state
|
||||||
{
|
{
|
||||||
struct vkd3d_shader_debug_ring_spec_info spec_info[VKD3D_MAX_SHADER_STAGES];
|
struct vkd3d_shader_debug_ring_spec_info spec_info[VKD3D_MAX_SHADER_STAGES];
|
||||||
|
@ -1459,6 +1477,8 @@ struct d3d12_graphics_pipeline_state
|
||||||
struct vkd3d_shader_code code[VKD3D_MAX_SHADER_STAGES];
|
struct vkd3d_shader_code code[VKD3D_MAX_SHADER_STAGES];
|
||||||
size_t stage_count;
|
size_t stage_count;
|
||||||
|
|
||||||
|
struct d3d12_graphics_pipeline_state_cached_desc cached_desc;
|
||||||
|
|
||||||
VkVertexInputAttributeDescription attributes[D3D12_VS_INPUT_REGISTER_COUNT];
|
VkVertexInputAttributeDescription attributes[D3D12_VS_INPUT_REGISTER_COUNT];
|
||||||
VkVertexInputRate input_rates[D3D12_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT];
|
VkVertexInputRate input_rates[D3D12_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT];
|
||||||
VkVertexInputBindingDivisorDescriptionEXT instance_divisors[D3D12_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT];
|
VkVertexInputBindingDivisorDescriptionEXT instance_divisors[D3D12_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT];
|
||||||
|
@ -1534,11 +1554,13 @@ struct d3d12_pipeline_state
|
||||||
};
|
};
|
||||||
VkPipelineBindPoint vk_bind_point;
|
VkPipelineBindPoint vk_bind_point;
|
||||||
VkPipelineCache vk_pso_cache;
|
VkPipelineCache vk_pso_cache;
|
||||||
spinlock_t lock;
|
rwlock_t lock;
|
||||||
|
|
||||||
struct vkd3d_pipeline_cache_compatibility pipeline_cache_compat;
|
struct vkd3d_pipeline_cache_compatibility pipeline_cache_compat;
|
||||||
ID3D12RootSignature *private_root_signature;
|
struct d3d12_root_signature *root_signature;
|
||||||
struct d3d12_device *device;
|
struct d3d12_device *device;
|
||||||
|
bool root_signature_compat_hash_is_dxbc_derived;
|
||||||
|
bool pso_is_loaded_from_cached_blob;
|
||||||
|
|
||||||
struct vkd3d_private_store private_store;
|
struct vkd3d_private_store private_store;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue