Skip to content
Snippets Groups Projects

vkd3d-shader/hlsl: Implement overload resolution.

Merged Henri Verbeet requested to merge hverbeet/vkd3d:for_upstream_0 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
3012 {
3013 switch (t)
3014 {
3015 case HLSL_TYPE_HALF:
3016 case HLSL_TYPE_FLOAT:
3017 case HLSL_TYPE_DOUBLE:
3018 return HLSL_TYPE_FLOAT;
3019
3020 case HLSL_TYPE_INT:
3021 case HLSL_TYPE_UINT:
3022 case HLSL_TYPE_BOOL:
3023 return HLSL_TYPE_INT;
3024 }
3025
3026 return 0;
3027 }
  • Comment on lines +3011 to +3027

    I think bool should be a separate base type class. Consider adding the following test:

    [pixel shader fail]
    float4 func(int x)
    {
        return 1.0;
    }
    
    float4 func(float x)
    {
        return 2.0;
    }
    
    float4 main() : sv_target
    {
        return func(true);
    }

    Which results in ambiguous function call in native but compiles in this patch.

  • Please register or sign in to reply
  • Francisco Casas requested changes

    requested changes

  • Henri Verbeet added 6 commits

    added 6 commits

    • fb96219c - tests: Add yet more overload resolution tests.
    • 1025f2de - vkd3d-shader/hlsl: Prefer overload candidates without component count narrowing.
    • 9ca3c2be - vkd3d-shader/hlsl: Prefer overload candidates with matching component type classes.
    • 3286a8dd - vkd3d-shader/hlsl: Prefer overload candidates with matching component types.
    • d63913fe - vkd3d-shader/hlsl: Prefer overload candidates without component type narrowing.
    • 55feeab2 - vkd3d-shader/hlsl: Prefer overload candidates without component count widening.

    Compare with previous version

  • Author Maintainer

    I think bool should be a separate base type class.

    Thanks, I've pushed an updated version.

  • Francisco Casas approved this merge request

    approved this merge request

  • Henri Verbeet approved this merge request

    approved this merge request

  • Henri Verbeet added 26 commits

    added 26 commits

    • 55feeab2...58271972 - 20 commits from branch wine:master
    • cdf6100f - tests: Add yet more overload resolution tests.
    • 63fce306 - vkd3d-shader/hlsl: Prefer overload candidates without component count narrowing.
    • 6b887837 - vkd3d-shader/hlsl: Prefer overload candidates with matching component type classes.
    • 32d432ab - vkd3d-shader/hlsl: Prefer overload candidates with matching component types.
    • 64bb4150 - vkd3d-shader/hlsl: Prefer overload candidates without component type narrowing.
    • c4f69f4d - vkd3d-shader/hlsl: Prefer overload candidates without component count widening.

    Compare with previous version

  • Please register or sign in to reply
    Loading