mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-04-13 05:43:18 -07:00
vkd3d: Send typed UAV unknown format read support info to vkd3d-shader.
Fixes reflections in Control appearing with only their red component. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52146 Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
This commit is contained in:
committed by
Alexandre Julliard
parent
971ab01add
commit
4afe69d04a
Notes:
Alexandre Julliard
2022-10-18 00:13:00 +02:00
Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/2
@@ -1464,6 +1464,7 @@ static HRESULT vkd3d_init_device_caps(struct d3d12_device *device,
|
||||
vulkan_info->sparse_properties = physical_device_info->properties2.properties.sparseProperties;
|
||||
vulkan_info->rasterization_stream = physical_device_info->xfb_properties.transformFeedbackRasterizationStreamSelect;
|
||||
vulkan_info->transform_feedback_queries = physical_device_info->xfb_properties.transformFeedbackQueries;
|
||||
vulkan_info->uav_read_without_format = features->shaderStorageImageReadWithoutFormat;
|
||||
vulkan_info->max_vertex_attrib_divisor = max(physical_device_info->vertex_divisor_properties.maxVertexAttribDivisor, 1);
|
||||
|
||||
device->feature_options.DoublePrecisionFloatShaderOps = features->shaderFloat64;
|
||||
|
@@ -1944,6 +1944,13 @@ struct d3d12_pipeline_state *unsafe_impl_from_ID3D12PipelineState(ID3D12Pipeline
|
||||
return impl_from_ID3D12PipelineState(iface);
|
||||
}
|
||||
|
||||
static inline unsigned int typed_uav_compile_option(const struct d3d12_device *device)
|
||||
{
|
||||
return device->vk_info.uav_read_without_format
|
||||
? VKD3D_SHADER_COMPILE_OPTION_TYPED_UAV_READ_FORMAT_UNKNOWN
|
||||
: VKD3D_SHADER_COMPILE_OPTION_TYPED_UAV_READ_FORMAT_R32;
|
||||
}
|
||||
|
||||
static HRESULT create_shader_stage(struct d3d12_device *device,
|
||||
struct VkPipelineShaderStageCreateInfo *stage_desc, enum VkShaderStageFlagBits stage,
|
||||
const D3D12_SHADER_BYTECODE *code, const struct vkd3d_shader_interface_info *shader_interface)
|
||||
@@ -1955,9 +1962,10 @@ static HRESULT create_shader_stage(struct d3d12_device *device,
|
||||
VkResult vr;
|
||||
int ret;
|
||||
|
||||
static const struct vkd3d_shader_compile_option options[] =
|
||||
const struct vkd3d_shader_compile_option options[] =
|
||||
{
|
||||
{VKD3D_SHADER_COMPILE_OPTION_API_VERSION, VKD3D_SHADER_API_VERSION_1_4},
|
||||
{VKD3D_SHADER_COMPILE_OPTION_TYPED_UAV, typed_uav_compile_option(device)},
|
||||
};
|
||||
|
||||
stage_desc->sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO;
|
||||
@@ -2001,14 +2009,15 @@ static HRESULT create_shader_stage(struct d3d12_device *device,
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static int vkd3d_scan_dxbc(const D3D12_SHADER_BYTECODE *code,
|
||||
static int vkd3d_scan_dxbc(const struct d3d12_device *device, const D3D12_SHADER_BYTECODE *code,
|
||||
struct vkd3d_shader_scan_descriptor_info *descriptor_info)
|
||||
{
|
||||
struct vkd3d_shader_compile_info compile_info;
|
||||
|
||||
static const struct vkd3d_shader_compile_option options[] =
|
||||
const struct vkd3d_shader_compile_option options[] =
|
||||
{
|
||||
{VKD3D_SHADER_COMPILE_OPTION_API_VERSION, VKD3D_SHADER_API_VERSION_1_4},
|
||||
{VKD3D_SHADER_COMPILE_OPTION_TYPED_UAV, typed_uav_compile_option(device)},
|
||||
};
|
||||
|
||||
compile_info.type = VKD3D_SHADER_STRUCTURE_TYPE_COMPILE_INFO;
|
||||
@@ -2170,7 +2179,7 @@ static HRESULT d3d12_pipeline_state_find_and_init_uav_counters(struct d3d12_pipe
|
||||
|
||||
shader_info.type = VKD3D_SHADER_STRUCTURE_TYPE_SCAN_DESCRIPTOR_INFO;
|
||||
shader_info.next = NULL;
|
||||
if ((ret = vkd3d_scan_dxbc(code, &shader_info)) < 0)
|
||||
if ((ret = vkd3d_scan_dxbc(device, code, &shader_info)) < 0)
|
||||
{
|
||||
WARN("Failed to scan shader bytecode, stage %#x, vkd3d result %d.\n", stage_flags, ret);
|
||||
return hresult_from_vkd3d_result(ret);
|
||||
|
@@ -143,6 +143,8 @@ struct vkd3d_vulkan_info
|
||||
bool rasterization_stream;
|
||||
bool transform_feedback_queries;
|
||||
|
||||
bool uav_read_without_format;
|
||||
|
||||
bool vertex_attrib_zero_divisor;
|
||||
unsigned int max_vertex_attrib_divisor;
|
||||
|
||||
|
Reference in New Issue
Block a user