Skip to content
Snippets Groups Projects

vkd3d-shader: Point sprite.

Merged Elizabeth Figura requested to merge zfigura/vkd3d:mr2 into master
2 unresolved threads

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
6151 /* .x */ VKD3D_SHADER_SWIZZLE(X, _, _, _),
6152 /* .y */ VKD3D_SHADER_SWIZZLE(_, X, _, _),
6153 /* .xy */ VKD3D_SHADER_SWIZZLE(X, Y, _, _),
6154 /* .z */ VKD3D_SHADER_SWIZZLE(_, _, X, _),
6155 /* .xz */ VKD3D_SHADER_SWIZZLE(X, _, Y, _),
6156 /* .yz */ VKD3D_SHADER_SWIZZLE(_, X, Y, _),
6157 /* .xyz */ VKD3D_SHADER_SWIZZLE(X, Y, Z, _),
6158 /* .w */ VKD3D_SHADER_SWIZZLE(_, _, _, X),
6159 /* .xw */ VKD3D_SHADER_SWIZZLE(X, _, _, Y),
6160 /* .yw */ VKD3D_SHADER_SWIZZLE(_, X, _, Y),
6161 /* .xyw */ VKD3D_SHADER_SWIZZLE(X, Y, _, Z),
6162 /* .zw */ VKD3D_SHADER_SWIZZLE(_, _, X, Y),
6163 /* .xzw */ VKD3D_SHADER_SWIZZLE(X, _, Y, Z),
6164 /* .yzw */ VKD3D_SHADER_SWIZZLE(_, X, Y, Z),
6165 /* .xyzw */ VKD3D_SHADER_SWIZZLE(X, Y, Z, W),
6166 #undef _
  • Giovanni Mascellani
  • 6165 /* .xyzw */ VKD3D_SHADER_SWIZZLE(X, Y, Z, W),
    6166 #undef _
    6167 };
    6168
    6169 if (src->reg.type != VKD3DSPR_INPUT)
    6170 return false;
    6171 e = &program->input_signature.elements[src->reg.idx[0].offset];
    6172
    6173 if (ascii_strcasecmp(e->semantic_name, "TEXCOORD"))
    6174 return false;
    6175
    6176 src->reg.type = VKD3DSPR_TEMP;
    6177 src->reg.idx[0].offset = coord_temp;
    6178
    6179 /* If the mask is already contiguous and zero-based, no need to remap
    6180 * the swizzle. */
    • Comment on lines +6179 to +6180

      Given the discussion in !1183 (merged) we should probably make mask contiguous anyway, which, unless I am getting confused (and the probability of me getting confused is certainly not negligible), should make this algorithm simpler: you just need to call vsir_write_mask_get_component_idx() on the mask and shift by that amount.

      This MR is also racing with !1184, I think. If that gets accepted (I haven't reviewed it yet) you don't need to touch the swizzle anymore.

    • We don't currently validate that the mask is contiguous in the sm4 frontend, do we? We have a WARN() and compiler warning, but that's it.

    • Apparently not. Maybe that should be raised to an error.

    • Please register or sign in to reply
  • added 2 commits

    • ed2c1336 - vkd3d-shader: Allow controlling point sprite through a parameter.
    • f84bcf98 - tests: Test point sprite.

    Compare with previous version

  • +        if (used_texcoord && !coord_written)
    +        {
    +            if (!shader_instruction_array_insert_at(&program->instructions, i, 2))
    +                return VKD3D_ERROR_OUT_OF_MEMORY;
    +
    +            ins = &program->instructions.elements[i];

    Is that safe? I.e., suppose we have a shader like this:

    if_lt r0.x, r1.x
        mov r2.xy, v0
    else
        mov r2.xy, v0
    endif

    we'd put the coord_temp write only in the first branch, right? And in principle that's something we could test, of course.

  • added 2 commits

    • e4513b24 - vkd3d-shader: Allow controlling point sprite through a parameter.
    • 9112965e - tests: Test point sprite.

    Compare with previous version

  • added 2 commits

    • e70a1752 - vkd3d-shader: Allow controlling point sprite through a parameter.
    • 6d3c59ba - tests: Test point sprite.

    Compare with previous version

  • Henri Verbeet approved this merge request

    approved this merge request

  • Henri Verbeet added 93 commits

    added 93 commits

    • 6d3c59ba...8a3fe9cd - 91 commits from branch wine:master
    • a492d64f - vkd3d-shader/ir: Allow controlling point sprite through a parameter.
    • 6fd1a1ce - tests: Test point sprite.

    Compare with previous version

  • Please register or sign in to reply
    Loading