mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
libs/vkd3d: Partially implement d3d12_command_list_SetComputeRootDescriptorTable().
This commit is contained in:
@@ -2246,51 +2246,75 @@ static void STDMETHODCALLTYPE d3d12_command_list_SetGraphicsRootSignature(ID3D12
|
|||||||
list->graphics_root_signature = rs;
|
list->graphics_root_signature = rs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void d3d12_command_list_set_descriptor_table(struct d3d12_command_list *list,
|
||||||
|
VkDescriptorSet descriptor_set, unsigned int index, D3D12_GPU_DESCRIPTOR_HANDLE base_descriptor)
|
||||||
|
{
|
||||||
|
const struct vkd3d_vk_device_procs *vk_procs = &list->device->vk_procs;
|
||||||
|
struct VkWriteDescriptorSet descriptor_write;
|
||||||
|
struct d3d12_cbv_srv_uav_desc *descriptor;
|
||||||
|
struct VkDescriptorImageInfo image_info;
|
||||||
|
|
||||||
|
/* FIXME: Only a single descriptor is supported currently. */
|
||||||
|
descriptor = (struct d3d12_cbv_srv_uav_desc *)(intptr_t)base_descriptor.ptr;
|
||||||
|
|
||||||
|
descriptor_write.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
|
||||||
|
descriptor_write.pNext = NULL;
|
||||||
|
descriptor_write.dstSet = descriptor_set;
|
||||||
|
descriptor_write.dstBinding = index;
|
||||||
|
descriptor_write.dstArrayElement = 0;
|
||||||
|
descriptor_write.descriptorCount = 1;
|
||||||
|
descriptor_write.descriptorType = descriptor->vk_descriptor_type;
|
||||||
|
descriptor_write.pImageInfo = NULL;
|
||||||
|
descriptor_write.pBufferInfo = NULL;
|
||||||
|
descriptor_write.pTexelBufferView = NULL;
|
||||||
|
|
||||||
|
if (descriptor->magic == VKD3D_DESCRIPTOR_MAGIC_SRV)
|
||||||
|
{
|
||||||
|
image_info.sampler = VK_NULL_HANDLE;
|
||||||
|
image_info.imageView = descriptor->u.vk_image_view;
|
||||||
|
image_info.imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
|
||||||
|
|
||||||
|
descriptor_write.pImageInfo = &image_info;
|
||||||
|
}
|
||||||
|
else if (descriptor->magic == VKD3D_DESCRIPTOR_MAGIC_UAV)
|
||||||
|
{
|
||||||
|
if (descriptor->vk_descriptor_type == VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER)
|
||||||
|
{
|
||||||
|
descriptor_write.pTexelBufferView = &descriptor->u.vk_buffer_view;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
image_info.sampler = VK_NULL_HANDLE;
|
||||||
|
image_info.imageView = descriptor->u.vk_image_view;
|
||||||
|
image_info.imageLayout = VK_IMAGE_LAYOUT_GENERAL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
VK_CALL(vkUpdateDescriptorSets(list->device->vk_device, 1, &descriptor_write, 0, NULL));
|
||||||
|
}
|
||||||
|
|
||||||
static void STDMETHODCALLTYPE d3d12_command_list_SetComputeRootDescriptorTable(ID3D12GraphicsCommandList *iface,
|
static void STDMETHODCALLTYPE d3d12_command_list_SetComputeRootDescriptorTable(ID3D12GraphicsCommandList *iface,
|
||||||
UINT root_parameter_index, D3D12_GPU_DESCRIPTOR_HANDLE base_descriptor)
|
UINT root_parameter_index, D3D12_GPU_DESCRIPTOR_HANDLE base_descriptor)
|
||||||
{
|
{
|
||||||
FIXME("iface %p, root_parameter_index %u, base_descriptor %#"PRIx64" stub!\n",
|
struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList(iface);
|
||||||
|
|
||||||
|
FIXME("iface %p, root_parameter_index %u, base_descriptor %#"PRIx64" partial-stub!\n",
|
||||||
iface, root_parameter_index, base_descriptor.ptr);
|
iface, root_parameter_index, base_descriptor.ptr);
|
||||||
|
|
||||||
|
d3d12_command_list_set_descriptor_table(list, list->compute_descriptor_set,
|
||||||
|
root_parameter_index, base_descriptor);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void STDMETHODCALLTYPE d3d12_command_list_SetGraphicsRootDescriptorTable(ID3D12GraphicsCommandList *iface,
|
static void STDMETHODCALLTYPE d3d12_command_list_SetGraphicsRootDescriptorTable(ID3D12GraphicsCommandList *iface,
|
||||||
UINT root_parameter_index, D3D12_GPU_DESCRIPTOR_HANDLE base_descriptor)
|
UINT root_parameter_index, D3D12_GPU_DESCRIPTOR_HANDLE base_descriptor)
|
||||||
{
|
{
|
||||||
struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList(iface);
|
struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList(iface);
|
||||||
const struct vkd3d_vk_device_procs *vk_procs;
|
|
||||||
struct VkWriteDescriptorSet descriptor_write;
|
|
||||||
struct d3d12_cbv_srv_uav_desc *descriptor;
|
|
||||||
struct VkDescriptorImageInfo image_info;
|
|
||||||
|
|
||||||
FIXME("iface %p, root_parameter_index %u, base_descriptor %#"PRIx64" partial-stub!\n",
|
FIXME("iface %p, root_parameter_index %u, base_descriptor %#"PRIx64" partial-stub!\n",
|
||||||
iface, root_parameter_index, base_descriptor.ptr);
|
iface, root_parameter_index, base_descriptor.ptr);
|
||||||
|
|
||||||
vk_procs = &list->device->vk_procs;
|
d3d12_command_list_set_descriptor_table(list, list->graphics_descriptor_set,
|
||||||
|
root_parameter_index, base_descriptor);
|
||||||
/* FIXME: Only a single descriptor is supported currently. */
|
|
||||||
descriptor = (struct d3d12_cbv_srv_uav_desc *)(intptr_t)base_descriptor.ptr;
|
|
||||||
|
|
||||||
if (descriptor->magic != VKD3D_DESCRIPTOR_MAGIC_SRV)
|
|
||||||
{
|
|
||||||
FIXME("Unhandled descriptor %#x.\n", descriptor->magic);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
image_info.sampler = VK_NULL_HANDLE;
|
|
||||||
image_info.imageView = descriptor->u.vk_image_view;
|
|
||||||
image_info.imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
|
|
||||||
|
|
||||||
descriptor_write.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
|
|
||||||
descriptor_write.pNext = NULL;
|
|
||||||
descriptor_write.dstSet = list->graphics_descriptor_set;
|
|
||||||
descriptor_write.dstBinding = root_parameter_index;
|
|
||||||
descriptor_write.dstArrayElement = 0;
|
|
||||||
descriptor_write.descriptorCount = 1;
|
|
||||||
descriptor_write.descriptorType = VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE;
|
|
||||||
descriptor_write.pImageInfo = &image_info;
|
|
||||||
descriptor_write.pBufferInfo = NULL;
|
|
||||||
descriptor_write.pTexelBufferView = NULL;
|
|
||||||
VK_CALL(vkUpdateDescriptorSets(list->device->vk_device, 1, &descriptor_write, 0, NULL));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void STDMETHODCALLTYPE d3d12_command_list_SetComputeRoot32BitConstant(ID3D12GraphicsCommandList *iface,
|
static void STDMETHODCALLTYPE d3d12_command_list_SetComputeRoot32BitConstant(ID3D12GraphicsCommandList *iface,
|
||||||
|
Reference in New Issue
Block a user