vkd3d: Validate shader meta against features.
We're supposed to validate and fail compilation if certain features are not supported. Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
This commit is contained in:
parent
5df4a5c083
commit
5b013d0b02
|
@ -5161,6 +5161,18 @@ out_free_mutex:
|
|||
return hr;
|
||||
}
|
||||
|
||||
bool d3d12_device_validate_shader_meta(struct d3d12_device *device, const struct vkd3d_shader_meta *meta)
|
||||
{
|
||||
/* TODO: Add more as required. */
|
||||
if (meta->uses_native_16bit_operations && !device->d3d12_caps.options4.Native16BitShaderOpsSupported)
|
||||
{
|
||||
WARN("Attempting to use 16-bit operations in shader %016"PRIx64", but this is not supported.", meta->hash);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
HRESULT d3d12_device_create(struct vkd3d_instance *instance,
|
||||
const struct vkd3d_device_create_info *create_info, struct d3d12_device **device)
|
||||
{
|
||||
|
|
|
@ -975,6 +975,9 @@ static HRESULT d3d12_state_object_compile_pipeline(struct d3d12_state_object *ob
|
|||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
if (!d3d12_device_validate_shader_meta(object->device, &spirv.meta))
|
||||
return E_INVALIDARG;
|
||||
|
||||
stage->module = create_shader_module(object->device, spirv.code, spirv.size);
|
||||
|
||||
if (spirv.meta.uses_subgroup_size &&
|
||||
|
|
|
@ -2095,6 +2095,9 @@ static HRESULT create_shader_stage(struct d3d12_device *device,
|
|||
shader_desc.pCode = spirv.code;
|
||||
*meta = spirv.meta;
|
||||
|
||||
if (!d3d12_device_validate_shader_meta(device, &spirv.meta))
|
||||
return E_INVALIDARG;
|
||||
|
||||
if (spirv.meta.uses_subgroup_size && device->device_info.subgroup_size_control_features.subgroupSizeControl)
|
||||
{
|
||||
/* GravityMark checks minSubgroupSize and based on that uses a shader variant.
|
||||
|
|
|
@ -2670,6 +2670,7 @@ bool d3d12_device_is_uma(struct d3d12_device *device, bool *coherent);
|
|||
void d3d12_device_mark_as_removed(struct d3d12_device *device, HRESULT reason,
|
||||
const char *message, ...) VKD3D_PRINTF_FUNC(3, 4);
|
||||
struct d3d12_device *unsafe_impl_from_ID3D12Device(d3d12_device_iface *iface);
|
||||
bool d3d12_device_validate_shader_meta(struct d3d12_device *device, const struct vkd3d_shader_meta *meta);
|
||||
|
||||
HRESULT d3d12_device_get_scratch_buffer(struct d3d12_device *device, VkDeviceSize min_size, struct vkd3d_scratch_buffer *scratch);
|
||||
void d3d12_device_return_scratch_buffer(struct d3d12_device *device, const struct vkd3d_scratch_buffer *scratch);
|
||||
|
|
Loading…
Reference in New Issue