Skip to content
Snippets Groups Projects

vkd3d-shader/hlsl: Produce 2D resource declarations and loads for tex1D().

Merged Nikolay Sivov requested to merge nsivov/vkd3d:tex1d_dcl into master
3 unresolved threads

Signed-off-by: Nikolay Sivov nsivov@codeweavers.com

Merge request reports

Merge request pipeline #14916 skipped

Merge request pipeline skipped for 45541dd9

Merged by Alexandre JulliardAlexandre Julliard 1 year ago (Sep 13, 2023 9:18pm 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
  • Elizabeth Figura approved this merge request

    approved this merge request

    • I'm accepting this because I think this needs to get fixed before the release, but as I said in 219, I don't think we really need to care about the difference between profile version. It's possible to get sm1 to put other junk in the y coordinate; I think we can just use the sm4 behaviour always.

    • Author Developer

      Compiling for ps_2_0 produces:

      mov r0.xy, c0.y
      texld ..., r0, ...

      For ps_3_0 it does:

      texld .., c0.y, ...

      I'm not sure what it means. Is it possible c0.y here means c0.yyyy?

      My point is, I'm not sure it's exactly junk that it's putting there.

    • For example this shader will use c0.y:

      uniform float4 f;
      sampler1D t;
      
      float4 main(float4 tex : texcoord0) : color
      {
      return tex1D(t, f.x);
      }

      I'm not sure what it means. Is it possible c0.y here means c0.yyyy?

      Yes, a single component implies replicate swizzle. Similarly omitted swizzle means .xyzw.

    • Please register or sign in to reply
    • I'm accepting this because I think this needs to get fixed before the release,

      Could you elaborate on that? I'm probably missing some context, and the commits in this MR unfortunately don't provide it.

    • Author Developer

      Current code is simply using 1D types for tex1D(), which is my fault. In reality it should never use 1D sampler type, but 2D type instead. That applies for sm4+ profiles as well.

    • Could you elaborate on that? I'm probably missing some context, and the commits in this MR unfortunately don't provide it.

      Yes, sorry for the lack of context. To be clear, as of c5d680d1 we're outputting incorrect code for uses of tex1D(), and unfortunately despite two reviewers nobody noticed that.

    • Please register or sign in to reply
  • Francisco Casas
  • Nikolay Sivov added 3 commits

    added 3 commits

    • 2d79d8b6 - vkd3d-shader/hlsl: Produce 2D resource declarations and loads for tex1D().
    • 0580ced3 - vkd3d-shader/d3dbc: Disallow 1D sampler types when writing sampler declaration.
    • 2f636d66 - vkd3d-shader/asm: Tweak TEXCOORD declaration name.

    Compare with previous version

  • Giovanni Mascellani
    Giovanni Mascellani @giomasce started a thread on commit 2d79d8b6
  • 3471 unsigned int idx = 0;
    3472
    3473 if (!(var = hlsl_new_synthetic_var(ctx, "coords", hlsl_get_vector_type(ctx, HLSL_TYPE_FLOAT, 2), loc)))
    3474 return false;
    3475
    3476 initialize_var_components(ctx, params->instrs, var, &idx, coords);
    3477 if (shader_profile_version_ge(ctx, 4, 0))
    3478 {
    3479 if (!(half = hlsl_new_float_constant(ctx, 0.5f, loc)))
    3480 return false;
    3481 hlsl_block_add_instr(params->instrs, half);
    3482
    3483 initialize_var_components(ctx, params->instrs, var, &idx, half);
    3484 }
    3485 else
    3486 initialize_var_components(ctx, params->instrs, var, &idx, coords);
  • Giovanni Mascellani approved this merge request

    approved this merge request

  • Henri Verbeet approved this merge request

    approved this merge request

  • Francisco Casas approved this merge request

    approved this merge request

  • Alexandre Julliard added 37 commits

    added 37 commits

    • 2f636d66...61b403a0 - 34 commits from branch wine:master
    • 177ea3bc - vkd3d-shader/hlsl: Produce 2D resource declarations and loads for tex1D().
    • ee6c66eb - vkd3d-shader/d3dbc: Disallow 1D sampler types when writing sampler declaration.
    • 45541dd9 - vkd3d-shader/asm: Tweak TEXCOORD declaration name.

    Compare with previous version

  • Alexandre Julliard approved this merge request

    approved this merge request

  • Please register or sign in to reply
    Loading