mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
libs/vkd3d: Implement d3d12_command_list_SetComputeRoot32BitConstant().
This commit is contained in:
@@ -74,6 +74,8 @@ static void d3d12_root_signature_cleanup(struct d3d12_root_signature *root_signa
|
||||
|
||||
if (root_signature->descriptor_mapping)
|
||||
vkd3d_free(root_signature->descriptor_mapping);
|
||||
if (root_signature->constants)
|
||||
vkd3d_free(root_signature->constants);
|
||||
|
||||
for (i = 0; i < root_signature->static_sampler_count; ++i)
|
||||
{
|
||||
@@ -335,6 +337,7 @@ static HRESULT d3d12_root_signature_init(struct d3d12_root_signature *root_signa
|
||||
root_signature->pool_sizes = NULL;
|
||||
root_signature->vk_set_layout = VK_NULL_HANDLE;
|
||||
root_signature->descriptor_mapping = NULL;
|
||||
root_signature->constants = NULL;
|
||||
root_signature->static_sampler_count = 0;
|
||||
root_signature->static_samplers = NULL;
|
||||
|
||||
@@ -396,6 +399,13 @@ static HRESULT d3d12_root_signature_init(struct d3d12_root_signature *root_signa
|
||||
hr = E_OUTOFMEMORY;
|
||||
goto fail;
|
||||
}
|
||||
root_signature->constant_count = push_count;
|
||||
if (!(root_signature->constants = vkd3d_calloc(root_signature->constant_count,
|
||||
sizeof(*root_signature->constants))))
|
||||
{
|
||||
hr = E_OUTOFMEMORY;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* Map root constants to push constants. */
|
||||
for (i = 0, j = 0; i < desc->NumParameters; ++i)
|
||||
@@ -414,7 +424,12 @@ static HRESULT d3d12_root_signature_init(struct d3d12_root_signature *root_signa
|
||||
|
||||
push_constants[j].stageFlags = stage_flags_from_visibility(p->ShaderVisibility);
|
||||
push_constants[j].offset = 0;
|
||||
push_constants[j].size = 4 * p->u.Constants.Num32BitValues;
|
||||
push_constants[j].size = p->u.Constants.Num32BitValues * sizeof(uint32_t);
|
||||
|
||||
root_signature->constants[j].root_parameter_index = i;
|
||||
root_signature->constants[j].stage_flags = push_constants[j].stageFlags;
|
||||
root_signature->constants[j].offset = push_constants[j].offset;
|
||||
|
||||
++j;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user