Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/dxil.c:
- size = max(size, sizeof(icb->data[0]));
- count = operands ? type->u.array.count * size / sizeof(icb->data[0]) : 0;
- if (!(icb = vkd3d_malloc(offsetof(struct vkd3d_shader_immediate_constant_buffer, data[count]))))
- {
ERR("Failed to allocate buffer, count %u.\n", count);
vkd3d_shader_parser_error(&sm6->p, VKD3D_SHADER_ERROR_DXIL_OUT_OF_MEMORY,
"Out of memory allocating an immediate constant buffer of count %u.", count);
return VKD3D_ERROR_OUT_OF_MEMORY;
- }
- if ((reg->idx[0].offset = shader_instruction_array_add_icb(&sm6->p.instructions, icb)) == UINT_MAX)
- {
ERR("Failed to cache icb object.\n");
vkd3d_free(icb);
vkd3d_shader_parser_error(&sm6->p, VKD3D_SHADER_ERROR_DXIL_OUT_OF_MEMORY,
"Out of memory caching an immediate constant buffer object.");
Minor, but is "caching" really the right word here? I would have rather said "storing" or "recording". Or even nothing: out of memory errors appear somewhat randomly, I guess there is little value in knowing what precisely you were doing when available memory happened to finish.