mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-01-28 13:05:02 -08:00
libs/vkd3d: Rename default sampler to dummy sampler.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
a87b3f3fb2
commit
b5d1dbd182
@ -1075,7 +1075,7 @@ static HRESULT vkd3d_create_vk_device(struct d3d12_device *device,
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT d3d12_device_create_default_sampler(struct d3d12_device *device)
|
||||
static HRESULT d3d12_device_create_dummy_sampler(struct d3d12_device *device)
|
||||
{
|
||||
D3D12_STATIC_SAMPLER_DESC sampler_desc;
|
||||
|
||||
@ -1084,7 +1084,7 @@ static HRESULT d3d12_device_create_default_sampler(struct d3d12_device *device)
|
||||
sampler_desc.AddressU = D3D12_TEXTURE_ADDRESS_MODE_CLAMP;
|
||||
sampler_desc.AddressV = D3D12_TEXTURE_ADDRESS_MODE_CLAMP;
|
||||
sampler_desc.AddressW = D3D12_TEXTURE_ADDRESS_MODE_CLAMP;
|
||||
return vkd3d_create_static_sampler(device, &sampler_desc, &device->vk_default_sampler);
|
||||
return vkd3d_create_static_sampler(device, &sampler_desc, &device->vk_dummy_sampler);
|
||||
}
|
||||
|
||||
static void d3d12_device_init_pipeline_cache(struct d3d12_device *device)
|
||||
@ -1273,7 +1273,7 @@ static ULONG STDMETHODCALLTYPE d3d12_device_Release(ID3D12Device *iface)
|
||||
|
||||
vkd3d_gpu_va_allocator_cleanup(&device->gpu_va_allocator);
|
||||
vkd3d_fence_worker_stop(&device->fence_worker, device);
|
||||
VK_CALL(vkDestroySampler(device->vk_device, device->vk_default_sampler, NULL));
|
||||
VK_CALL(vkDestroySampler(device->vk_device, device->vk_dummy_sampler, NULL));
|
||||
if (device->vk_pipeline_cache)
|
||||
VK_CALL(vkDestroyPipelineCache(device->vk_device, device->vk_pipeline_cache, NULL));
|
||||
d3d12_device_destroy_vkd3d_queues(device);
|
||||
@ -2222,10 +2222,10 @@ static HRESULT d3d12_device_init(struct d3d12_device *device,
|
||||
return hr;
|
||||
}
|
||||
|
||||
if (FAILED(hr = d3d12_device_create_default_sampler(device)))
|
||||
if (FAILED(hr = d3d12_device_create_dummy_sampler(device)))
|
||||
{
|
||||
const struct vkd3d_vk_device_procs *vk_procs = &device->vk_procs;
|
||||
ERR("Failed to create default sampler, hr %#x.\n", hr);
|
||||
ERR("Failed to create dummy sampler, hr %#x.\n", hr);
|
||||
VK_CALL(vkDestroyDevice(device->vk_device, NULL));
|
||||
vkd3d_instance_decref(device->vkd3d_instance);
|
||||
return hr;
|
||||
@ -2234,7 +2234,7 @@ static HRESULT d3d12_device_init(struct d3d12_device *device,
|
||||
if (FAILED(hr = vkd3d_fence_worker_start(&device->fence_worker, device)))
|
||||
{
|
||||
const struct vkd3d_vk_device_procs *vk_procs = &device->vk_procs;
|
||||
VK_CALL(vkDestroySampler(device->vk_device, device->vk_default_sampler, NULL));
|
||||
VK_CALL(vkDestroySampler(device->vk_device, device->vk_dummy_sampler, NULL));
|
||||
VK_CALL(vkDestroyDevice(device->vk_device, NULL));
|
||||
vkd3d_instance_decref(device->vkd3d_instance);
|
||||
return hr;
|
||||
|
@ -769,19 +769,19 @@ static HRESULT d3d12_root_signature_init_root_descriptors(struct d3d12_root_sign
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT d3d12_root_signature_init_default_sampler(struct d3d12_root_signature *root_signature,
|
||||
static HRESULT d3d12_root_signature_init_dummy_sampler(struct d3d12_root_signature *root_signature,
|
||||
struct d3d12_device *device, struct vkd3d_descriptor_set_context *context)
|
||||
{
|
||||
VkDescriptorSetLayoutBinding *binding = context->current_binding;
|
||||
|
||||
root_signature->default_sampler.set = context->set_index;
|
||||
root_signature->default_sampler.binding = context->descriptor_binding++;
|
||||
root_signature->dummy_sampler.set = context->set_index;
|
||||
root_signature->dummy_sampler.binding = context->descriptor_binding++;
|
||||
|
||||
binding->binding = root_signature->default_sampler.binding;
|
||||
binding->binding = root_signature->dummy_sampler.binding;
|
||||
binding->descriptorType = VK_DESCRIPTOR_TYPE_SAMPLER;
|
||||
binding->descriptorCount = 1;
|
||||
binding->stageFlags = VK_SHADER_STAGE_ALL;
|
||||
binding->pImmutableSamplers = &device->vk_default_sampler;
|
||||
binding->pImmutableSamplers = &device->vk_dummy_sampler;
|
||||
|
||||
++context->current_binding;
|
||||
return S_OK;
|
||||
@ -877,7 +877,7 @@ static HRESULT d3d12_root_signature_init(struct d3d12_root_signature *root_signa
|
||||
VkDescriptorSetLayoutBinding *binding_desc;
|
||||
struct d3d12_root_signature_info info;
|
||||
VkDescriptorSetLayout set_layouts[2];
|
||||
bool needs_default_sampler;
|
||||
bool needs_dummy_sampler;
|
||||
HRESULT hr;
|
||||
|
||||
memset(&context, 0, sizeof(context));
|
||||
@ -917,8 +917,8 @@ static HRESULT d3d12_root_signature_init(struct d3d12_root_signature *root_signa
|
||||
root_signature->root_descriptor_count = info.root_descriptor_count;
|
||||
|
||||
/* An additional sampler is created for SpvOpImageFetch. */
|
||||
needs_default_sampler = info.srv_count || info.buffer_srv_count;
|
||||
if (needs_default_sampler)
|
||||
needs_dummy_sampler = info.srv_count || info.buffer_srv_count;
|
||||
if (needs_dummy_sampler)
|
||||
{
|
||||
++info.sampler_count;
|
||||
++info.descriptor_count;
|
||||
@ -970,7 +970,7 @@ static HRESULT d3d12_root_signature_init(struct d3d12_root_signature *root_signa
|
||||
goto fail;
|
||||
if (FAILED(hr = d3d12_root_signature_init_static_samplers(root_signature, device, desc, &context)))
|
||||
goto fail;
|
||||
if (needs_default_sampler && FAILED(hr = d3d12_root_signature_init_default_sampler(root_signature,
|
||||
if (needs_dummy_sampler && FAILED(hr = d3d12_root_signature_init_dummy_sampler(root_signature,
|
||||
device, &context)))
|
||||
goto fail;
|
||||
|
||||
@ -1429,7 +1429,7 @@ static HRESULT d3d12_pipeline_state_init_compute(struct d3d12_pipeline_state *st
|
||||
shader_interface.binding_count = root_signature->descriptor_count;
|
||||
shader_interface.push_constant_buffers = root_signature->root_constants;
|
||||
shader_interface.push_constant_buffer_count = root_signature->root_constant_count;
|
||||
shader_interface.dummy_sampler = root_signature->default_sampler;
|
||||
shader_interface.dummy_sampler = root_signature->dummy_sampler;
|
||||
shader_interface.uav_counters = state->uav_counters;
|
||||
shader_interface.uav_counter_count = vkd3d_popcount(state->uav_counter_mask);
|
||||
|
||||
@ -1945,7 +1945,7 @@ static HRESULT d3d12_pipeline_state_init_graphics(struct d3d12_pipeline_state *s
|
||||
shader_interface.binding_count = root_signature->descriptor_count;
|
||||
shader_interface.push_constant_buffers = root_signature->root_constants;
|
||||
shader_interface.push_constant_buffer_count = root_signature->root_constant_count;
|
||||
shader_interface.dummy_sampler = root_signature->default_sampler;
|
||||
shader_interface.dummy_sampler = root_signature->dummy_sampler;
|
||||
shader_interface.uav_counters = NULL;
|
||||
shader_interface.uav_counter_count = 0;
|
||||
|
||||
|
@ -426,7 +426,7 @@ struct d3d12_root_signature
|
||||
|
||||
unsigned int descriptor_count;
|
||||
struct vkd3d_shader_resource_binding *descriptor_mapping;
|
||||
struct vkd3d_shader_descriptor_binding default_sampler;
|
||||
struct vkd3d_shader_descriptor_binding dummy_sampler;
|
||||
|
||||
unsigned int root_constant_count;
|
||||
struct vkd3d_shader_push_constant_buffer *root_constants;
|
||||
@ -664,7 +664,7 @@ struct d3d12_device
|
||||
VkPipelineCache vk_pipeline_cache;
|
||||
|
||||
/* A sampler used for SpvOpImageFetch. */
|
||||
VkSampler vk_default_sampler;
|
||||
VkSampler vk_dummy_sampler;
|
||||
|
||||
VkPhysicalDeviceMemoryProperties memory_properties;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user