Skip to content
Snippets Groups Projects

vkd3d-shader/fx: Initial support for writing sample state objects.

Merged Nikolay Sivov requested to merge nsivov/vkd3d:fx_sampler_state into master
4 unresolved threads

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

Merge request reports

Merge request pipeline #26176 skipped

Merge request pipeline skipped for 0053cc52

Merged by Alexandre JulliardAlexandre Julliard 11 months ago (May 8, 2024 8:49pm 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
  • Francisco Casas
    Francisco Casas @fcasas started a thread on an outdated change in commit 7a5660e3
  • 1092 { "AddressV", HLSL_TYPE_SAMPLER, HLSL_TYPE_UINT, 1, 47, address_values },
    1093 { "AddressW", HLSL_TYPE_SAMPLER, HLSL_TYPE_UINT, 1, 48, address_values },
    1094 { "MipLODBias", HLSL_TYPE_SAMPLER, HLSL_TYPE_FLOAT, 1, 49 },
    1095 { "MaxAnisotropy", HLSL_TYPE_SAMPLER, HLSL_TYPE_UINT, 1, 50 },
    1096 { "ComparisonFunc", HLSL_TYPE_SAMPLER, HLSL_TYPE_UINT, 1, 51, compare_func_values },
    1097 { "BorderColor", HLSL_TYPE_SAMPLER, HLSL_TYPE_FLOAT, 4, 52 },
    1098 { "MinLOD", HLSL_TYPE_SAMPLER, HLSL_TYPE_FLOAT, 1, 53 },
    1099 { "MaxLOD", HLSL_TYPE_SAMPLER, HLSL_TYPE_FLOAT, 1, 54 },
    1100 { "Texture", HLSL_TYPE_SAMPLER, HLSL_TYPE_TEXTURE, 1, 55 },
    1101 };
    1102
    1103 const struct hlsl_type *type = hlsl_get_multiarray_element_type(var->data_type);
    1104 uint32_t i, value_offset = 0, assignment_type = 0, rhs_offset;
    1105 uint32_t type_offset;
    1106 struct vkd3d_bytecode_buffer *buffer = &fx->structured;
    1107 struct hlsl_ir_node *value = *entry->args;
  • Francisco Casas
  • Nikolay Sivov added 24 commits

    added 24 commits

    • dec65a27...4a209efb - 15 commits from branch wine:master
    • cb18d8e2 - vkd3d-shader/hlsl: Turn hlsl_state_block_entry arguments into hlsl_src.
    • 807b8f73 - vkd3d-shader/hlsl: Transfer state_blocks to the uniform copy.
    • bd1c56bc - vkd3d-shader/fx: Write depth stencil view object variables.
    • ab07a4c2 - vkd3d-shader/fx: Set RTV counter in the header.
    • ab011925 - vkd3d-shader/fx: Set texture count in the header.
    • bf763289 - vkd3d-shader/fx: Fix shader counter in the header.
    • 177c5cd5 - vkd3d-shader/fx: Filter out unsupported object types.
    • e3ec5eee - vkd3d-shader/fx: Set UAV count in the header.
    • 6a26a4c1 - vkd3d-shader/fx: Initial support for writing sample state objects.

    Compare with previous version

  • The code seems correct to me and after rebasing these patches on top of !813 (merged) the tests pass.

    Albeit, I haven't compared side-by-side the binary output between native and what these patches write, I am assuming that is correct.

  • Francisco Casas approved this merge request

    approved this merge request

    • 3/9 ("vkd3d-shader/hlsl: Transfer state_blocks to the uniform copy.") makes me wince a little.

      What is the uniform copy getting us? It's mainly there in HLSL to deal with writes to uniforms (and frankly I'm not even convinced it's the best way of doing that anymore, but anyway.) Is that a concern for effects? I think last time I brought it up, the only real reason to have it is for populating extern_vars, but we can do that in other ways...

    • Author Developer

      Last time it was brought up when I used global scope instead of extern_vars, and it was suggested not to do that.

    • Eh. extern_vars exists as a way to collect together globals, entry point parameters, and the entry point retval, for the benefit of the multiple places which need to deal with vars with external linkage. But only globals are relevant to effects, as I understand, and as I kind of said in 443 I don't object to just using globals instead of extern_vars here.

      On the other hand, we could use extern_vars but then manually populate it. Though that does seem a bit roundabout. While there is some measure of declarativeness in using extern_vars, I don't think we need to go out of our way to do so.

    • Author Developer

      The extern_vars is already used and works fine, we can change it later if a good reason comes up.

    • Well, 3/9 is a bit unfortunate [although, looking at it again, I think my main issue is that I don't see why it's a helper in hlsl.c and not just inline in prepend_uniform_copy()]. The use of a dummy block in fx_write_context_init() is also awkward.

      Not using extern_vars turns out to be awkward after all, because hlsl_calculate_buffer_offsets() consumes it, but the attached diff simplifies the code a bit, I think, and it avoids the need for 3/9.

    • Author Developer

      Ah, I see. I'm going to try that now.

    • Author Developer

      Pushed with that one, replacing the 'transfer' helper.

    • Please register or sign in to reply
    • Wrt 9/9, do we want resolve_fx_4_state_block_values() and write_fx_4_state_assignment() to be separate functions? In particular it doesn't seem like we should need to stash the name_id in struct hlsl_state_block_entry.

    • Author Developer

      Not all entries are written as is, some of them like OMSetRenderTargets() will produce up to 9 entries in the binary. Having name_id in there will make it easier to decompose them before writing.

    • Author Developer

      There is not a lot of cases like that, I think all can only appear in passes and will have to be handled manually, for example in OMSetRenderTargets() there has to be [1+1, 8+1] for number of arguments, where last one is a depth stencil view, and others are rtvs. My plan was to check for those cases, replace such entries with actual entries that are going to be written (order how those are written is also a bit weird). Now, it's possible to add names for such new entries, but then those will be in the list next to state names that can actually appear in sources. That's why I think having null names and ids instead is better.

    • Not all entries are written as is, some of them like OMSetRenderTargets() will produce up to 9 entries in the binary. Having name_id in there will make it easier to decompose them before writing.

      Makes sense, though it could still be a local variable.

    • Author Developer

      Another case of such decomposition is assigning a value to an array field, that produces a number of assignment of individual elements to the same value. This is also cleanup up so that only the very last assignment to the same field is kept. Cases like that are very limited thankfully. So far I'm talking about fx_4/fx_5 only, I haven't looked at what happens in fx_2 where there is no state objects, maybe it's simply everything assigned at pass level, with similar cleanups.

    • Please register or sign in to reply
  • Nikolay Sivov added 31 commits

    added 31 commits

    • 6a26a4c1...7b4a1fdf - 22 commits from branch wine:master
    • 293860fe - vkd3d-shader/hlsl: Turn hlsl_state_block_entry arguments into hlsl_src.
    • f0ee1e90 - vkd3d-shader/hlsl: Transfer state_blocks to the uniform copy.
    • 95c44efb - vkd3d-shader/fx: Write depth stencil view object variables.
    • c266c493 - vkd3d-shader/fx: Set RTV counter in the header.
    • e1053b02 - vkd3d-shader/fx: Set texture count in the header.
    • 26cf42f2 - vkd3d-shader/fx: Fix shader counter in the header.
    • 94d8961d - vkd3d-shader/fx: Filter out unsupported object types.
    • a0ec8d8a - vkd3d-shader/fx: Set UAV count in the header.
    • 0552c70a - vkd3d-shader/fx: Initial support for writing sample state objects.

    Compare with previous version

  • Nikolay Sivov added 8 commits

    added 8 commits

    • bce6ae6c - vkd3d-shader/fx: Skip uniform copy logic for global variables.
    • 5ebc06e9 - vkd3d-shader/fx: Write depth stencil view object variables.
    • 0f00f062 - vkd3d-shader/fx: Set RTV counter in the header.
    • 54ea7100 - vkd3d-shader/fx: Set texture count in the header.
    • 1dbbfd78 - vkd3d-shader/fx: Fix shader counter in the header.
    • 80104834 - vkd3d-shader/fx: Filter out unsupported object types.
    • 05db0f4d - vkd3d-shader/fx: Set UAV count in the header.
    • 8e4bb992 - vkd3d-shader/fx: Initial support for writing sample state objects.

    Compare with previous version

  • Nikolay Sivov added 26 commits

    added 26 commits

    • 8e4bb992...46fca3f9 - 17 commits from branch wine:master
    • 547e28a1 - vkd3d-shader/hlsl: Turn hlsl_state_block_entry arguments into hlsl_src.
    • 27532bc9 - vkd3d-shader/fx: Skip uniform copy logic for global variables.
    • a540598f - vkd3d-shader/fx: Write depth stencil view object variables.
    • b4bdd08c - vkd3d-shader/fx: Set RTV counter in the header.
    • 396ba197 - vkd3d-shader/fx: Set texture count in the header.
    • fca25877 - vkd3d-shader/fx: Fix shader counter in the header.
    • a86c68f8 - vkd3d-shader/fx: Filter out unsupported object types.
    • 41948a64 - vkd3d-shader/fx: Set UAV count in the header.
    • ff321944 - vkd3d-shader/fx: Initial support for writing sample state objects.

    Compare with previous version

  • Elizabeth Figura approved this merge request

    approved this merge request

  • Nikolay Sivov added 85 commits

    added 85 commits

    • ff321944...cefd6f9d - 76 commits from branch wine:master
    • 700cbdf7 - vkd3d-shader/hlsl: Turn hlsl_state_block_entry arguments into hlsl_src.
    • 2262120e - vkd3d-shader/fx: Skip uniform copy logic for global variables.
    • bb1573eb - vkd3d-shader/fx: Write depth stencil view object variables.
    • 21fb360e - vkd3d-shader/fx: Set RTV counter in the header.
    • caacecf3 - vkd3d-shader/fx: Set texture count in the header.
    • ba9272f6 - vkd3d-shader/fx: Fix shader counter in the header.
    • 29cf50cd - vkd3d-shader/fx: Filter out unsupported object types.
    • d9fa9826 - vkd3d-shader/fx: Set UAV count in the header.
    • 9c2bb096 - vkd3d-shader/fx: Initial support for writing sample state objects.

    Compare with previous version

  • Henri Verbeet approved this merge request

    approved this merge request

  • added 9 commits

    • 68483d07 - vkd3d-shader/hlsl: Turn hlsl_state_block_entry arguments into hlsl_src.
    • c2eb563e - vkd3d-shader/fx: Skip uniform copy logic for global variables.
    • a879ac55 - vkd3d-shader/fx: Write depth stencil view object variables.
    • 162d8760 - vkd3d-shader/fx: Set RTV counter in the header.
    • cb1a2711 - vkd3d-shader/fx: Set texture count in the header.
    • 9bbed149 - vkd3d-shader/fx: Fix shader counter in the header.
    • 1a79d1e9 - vkd3d-shader/fx: Filter out unsupported object types.
    • 3c6470e3 - vkd3d-shader/fx: Set UAV count in the header.
    • 0053cc52 - vkd3d-shader/fx: Initial support for writing sample state objects.

    Compare with previous version

  • Alexandre Julliard approved this merge request

    approved this merge request

  • Please register or sign in to reply
    Loading