Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/dxil.c:
- if (!(ptr = sm6_parser_get_value_by_ref(sm6, record, NULL, &i))
|| !sm6_value_validate_is_pointer_to_i32(ptr, sm6))
return;
- if (ptr->u.reg.type != VKD3DSPR_GROUPSHAREDMEM)
- {
WARN("Register is not groupshared.\n");
vkd3d_shader_parser_error(&sm6->p, VKD3D_SHADER_ERROR_DXIL_INVALID_OPERAND,
"The destination register for an atomicrmw instruction is not groupshared memory.");
return;
- }
- dst->type = ptr->type->u.pointer.type;
- if (!(src = sm6_parser_get_value_by_ref(sm6, record, dst->type, &i))
|| !sm6_value_validate_is_i32(src, sm6))
I wonder whether this is useful, given that we already checked the pointer type and in `sm6_parser_get_value_idx_by_ref()` we check that the value has the expected type.