Skip to content
Snippets Groups Projects

vkd3d-shader/hlsl: Support all() intrinsic.

Merged Nikolay Sivov requested to merge nsivov/vkd3d:hlsl_all into master
2 unresolved threads

Merge request reports

Merge request pipeline #7786 skipped

Merge request pipeline skipped for e5b40092

Merged by Alexandre JulliardAlexandre Julliard 2 years ago (Feb 20, 2023 9:45pm UTC)

Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
2382 if (!(one = hlsl_new_float_constant(ctx, 1.0f, loc)))
2383 return false;
2384 list_add_tail(params->instrs, &one->node.entry);
2385
2386 if (!(zero = hlsl_new_float_constant(ctx, 0.0f, loc)))
2387 return false;
2388 list_add_tail(params->instrs, &zero->node.entry);
2389
2390 mul = &one->node;
2391
2392 for (i = 0; i < arg_type->dimx; ++i)
2393 {
2394 for (j = 0; j < arg_type->dimy; ++j)
2395 {
2396 if (!(load = add_load_component(ctx, params->instrs, arg, j * arg->data_type->dimx + i, loc)))
2397 return false;
  • Giovanni Mascellani approved this merge request

    approved this merge request

  • At first, I was suspicious of implementing all() using multiplication, but that seems to be what the native compiler does...

    float4 main() : sv_target
    {
        float4 a = {1, 1, 1, 0};
        float4 b = {1e20, 1e20, 1e20, 0};
    
        return float4(all(a), all(b), -1, -1);
    }

    this actually returns (0, 1, -1, -1) both in native and using this patch, so it is correct in giving the incorrect result.

  • Francisco Casas approved this merge request

    approved this merge request

  • Nikolay Sivov added 3 commits

    added 3 commits

    Compare with previous version

  • Henri Verbeet approved this merge request

    approved this merge request

  • added 3 commits

    Compare with previous version

  • Alexandre Julliard approved this merge request

    approved this merge request

  • Please register or sign in to reply
    Loading