Skip to content
Snippets Groups Projects

vkd3d-shader/hlsl: Add support for fmod() intrinsic.

Merged Nikolay Sivov requested to merge nsivov/vkd3d:hlsl_fmod into master
1 unresolved thread

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
2751 if (!(x = intrinsic_float_convert_arg(ctx, params, params->args[0], loc)))
2752 return false;
2753
2754 if (!(y = intrinsic_float_convert_arg(ctx, params, params->args[1], loc)))
2755 return false;
2756
2757 if (!(div = add_binary_arithmetic_expr(ctx, params->instrs, HLSL_OP2_DIV, x, y, loc)))
2758 return false;
2759
2760 if (!(zero = hlsl_new_constant(ctx, div->data_type, loc)))
2761 return false;
2762 list_add_tail(params->instrs, &zero->node.entry);
2763
2764 count = hlsl_type_element_count(div->data_type);
2765 for (i = 0; i < count; ++i)
2766 zero->value.u[i].f = 0.0f;
  • Comment on lines +2764 to +2766

    I think we can take for granted that it's part of the contract of hlsl_new_constant() that the returned constant is zero for all numerical data types. Not that this code is wrong, but it can be dropped.

  • Please register or sign in to reply
  • Giovanni Mascellani approved this merge request

    approved this merge request

  • Henri Verbeet mentioned in merge request !196 (merged)

    mentioned in merge request !196 (merged)

  • Henri Verbeet approved this merge request

    approved this merge request

  • Alexandre Julliard approved this merge request

    approved this merge request

  • Alexandre Julliard added 22 commits

    added 22 commits

    Compare with previous version

  • Please register or sign in to reply
    Loading