Skip to content
Snippets Groups Projects

vkd3d-shader/dxil: SamplePosition and SampleCount.

Merged Conor McCarthy requested to merge cmccarthy/vkd3d:dx_sample_pos into master

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
  • Can we have tests here too?

  • Conor McCarthy added 3 commits

    added 3 commits

    • 6a131582 - tests/hlsl: Add tests for GetSamplePosition() and GetSampleCount().
    • 6f7b812a - vkd3d-shader/dxil: Implement DX intrinsics Texture2DMSGetSamplePosition and...
    • 282ad5ae - vkd3d-shader/dxil: Implement DX intrinsic RenderTargetGetSampleCount.

    Compare with previous version

  • Conor McCarthy added 3 commits

    added 3 commits

    • 88a74dd3 - tests/hlsl: Add tests for GetSamplePosition() and GetSampleCount().
    • 67ced60a - vkd3d-shader/dxil: Implement DX intrinsics Texture2DMSGetSamplePosition and...
    • 0791536b - vkd3d-shader/dxil: Implement DX intrinsic RenderTargetGetSampleCount.

    Compare with previous version

  • Conor McCarthy added 3 commits

    added 3 commits

    • f9e460ca - tests/hlsl: Add tests for GetSamplePosition() and GetSampleCount().
    • 4311bb98 - vkd3d-shader/dxil: Implement DX intrinsics Texture2DMSGetSamplePosition and...
    • acf79c90 - vkd3d-shader/dxil: Implement DX intrinsic RenderTargetGetSampleCount.

    Compare with previous version

  • Conor McCarthy added 3 commits

    added 3 commits

    • 5e782116 - tests/hlsl: Add tests for GetSamplePosition() and GetSampleCount().
    • 2ebfe450 - vkd3d-shader/dxil: Implement DX intrinsics Texture2DMSGetSamplePosition and...
    • 7d70fb15 - vkd3d-shader/dxil: Implement DX intrinsic RenderTargetGetSampleCount.

    Compare with previous version

  • Conor McCarthy added 1 commit

    added 1 commit

    • 25a25b5e - tests/shader-runner: Check for D3D11 MSAA support.

    Compare with previous version

  • Conor McCarthy added 3 commits

    added 3 commits

    • a70ccdda - tests/hlsl: Add tests for GetSamplePosition() and GetSampleCount().
    • 0efbaa7b - vkd3d-shader/dxil: Implement DX intrinsics Texture2DMSGetSamplePosition and...
    • 6775570d - vkd3d-shader/dxil: Implement DX intrinsic RenderTargetGetSampleCount.

    Compare with previous version

  • Conor McCarthy added 3 commits

    added 3 commits

    • 952e2568 - tests/hlsl: Add tests for GetSamplePosition() and GetSampleCount().
    • 54fcfcf0 - vkd3d-shader/dxil: Implement DX intrinsics Texture2DMSGetSamplePosition and...
    • 8b46c830 - vkd3d-shader/dxil: Implement DX intrinsic RenderTargetGetSampleCount.

    Compare with previous version

  • Conor McCarthy added 3 commits

    added 3 commits

    • 5bd942dc - tests/hlsl: Add tests for GetSamplePosition() and GetSampleCount().
    • 1f0b5c81 - vkd3d-shader/dxil: Implement DX intrinsics Texture2DMSGetSamplePosition and...
    • 43ceda62 - vkd3d-shader/dxil: Implement DX intrinsic RenderTargetGetSampleCount.

    Compare with previous version

  • Conor McCarthy added 67 commits

    added 67 commits

    • 43ceda62...4b0a328a - 64 commits from branch wine:master
    • 086819f5 - tests/hlsl: Add tests for GetSamplePosition() and GetSampleCount().
    • 41541c24 - vkd3d-shader/dxil: Implement DX intrinsics Texture2DMSGetSamplePosition and...
    • 8bb2fa75 - vkd3d-shader/dxil: Implement DX intrinsic RenderTargetGetSampleCount.

    Compare with previous version

  • Giovanni Mascellani approved this merge request

    approved this merge request

  • Conor McCarthy added 18 commits

    added 18 commits

    • 8bb2fa75...9c0d04c8 - 15 commits from branch wine:master
    • 2eee0804 - tests/hlsl: Add tests for GetSamplePosition() and GetSampleCount().
    • b1c16964 - vkd3d-shader/dxil: Implement DX intrinsics Texture2DMSGetSamplePosition and...
    • 4b6e0d12 - vkd3d-shader/dxil: Implement DX intrinsic RenderTargetGetSampleCount.

    Compare with previous version

    • +#define create_default_texture2dms(a, b, c, d, e, f, g, h) create_default_texture2dms_(__LINE__, a, b, c, d, e, f, g, h)
      +static inline ID3D12Resource *create_default_texture2dms_(unsigned int line, ID3D12Device *device,
      +        unsigned int width, unsigned int height, unsigned int array_size, unsigned int sample_count,
      +        DXGI_FORMAT format, D3D12_RESOURCE_FLAGS flags, D3D12_RESOURCE_STATES initial_state)
      +{
      +    return create_default_texture_(line, device, D3D12_RESOURCE_DIMENSION_TEXTURE2D, width, height, array_size, 1,
      +            format, sample_count, flags | D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET, initial_state);
       }

      It doesn't seem ideal to swap the order of "format" and "sample_count" between create_default_texture_() and create_default_texture2dms_(). Also, why are we adding D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET here?

      +[srv 0]
      +% r32g32b32a32 is not necessarily supported with 4x MSAA.
      +format r32 float
      +size (2dms, 4, 2, 2)
      +% Data upload is not supported.

      Sure, but I don't think data upload is needed here either.

      +% 4.1 supports GetRenderTargetSamplePosition/Count but not UAVs, and returning
      +% results in the RTV brings complications in D3D11.

      Which complications would those be?

      -            resource->resource = create_default_texture2d(device, params->width, params->height, 1, params->level_count,
      -                    params->format, D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET, D3D12_RESOURCE_STATE_RENDER_TARGET);
      +            if (params->sample_count)
      +            {
      +                if (params->level_count > 1)
      +                    fatal_error("Multisample resource has multiple levels.\n");
      +                resource->resource = create_default_texture2dms(device, params->width, params->height, 1, params->sample_count,
      +                        params->format, D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET, D3D12_RESOURCE_STATE_RENDER_TARGET);
      +            }
      +            else
      +            {
      +                resource->resource = create_default_texture2d(device, params->width, params->height, 1, params->level_count,
      +                        params->format, D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET, D3D12_RESOURCE_STATE_RENDER_TARGET);
      +            }

      It seems tempting to just use create_default_texture_().

    • Author Developer

      Which complications would those be?

      ResolveSubresource(), which I think we would also need in D3D12. It can be done but do we need it?

    • Please register or sign in to reply
  • Which complications would those be?

    ResolveSubresource(), which I think we would also need in D3D12. It can be done but do we need it?

    Well, get_resource_readback_with_command_list_and_states() already handles multi-sampled readback for d3d12, so that part should be fine. It doesn't seem especially complicated to add to the d3d11 runner either?

  • Conor McCarthy added 3 commits

    added 3 commits

    • 6e6cc6eb - tests/hlsl: Add tests for GetSamplePosition() and GetSampleCount().
    • db1caeaf - vkd3d-shader/dxil: Implement DX intrinsics Texture2DMSGetSamplePosition and...
    • e822a0fa - vkd3d-shader/dxil: Implement DX intrinsic RenderTargetGetSampleCount.

    Compare with previous version

  • Conor McCarthy added 3 commits

    added 3 commits

    • ea8fcd28 - tests/hlsl: Add tests for GetSamplePosition() and GetSampleCount().
    • 287747ba - vkd3d-shader/dxil: Implement DX intrinsics Texture2DMSGetSamplePosition and...
    • 0b174786 - vkd3d-shader/dxil: Implement DX intrinsic RenderTargetGetSampleCount.

    Compare with previous version

  • Conor McCarthy added 3 commits

    added 3 commits

    • 51a98b6c - tests/hlsl: Add tests for GetSamplePosition() and GetSampleCount().
    • 28680648 - vkd3d-shader/dxil: Implement DX intrinsics Texture2DMSGetSamplePosition and...
    • dfc3bbfc - vkd3d-shader/dxil: Implement DX intrinsic RenderTargetGetSampleCount.

    Compare with previous version

  • Conor McCarthy added 3 commits

    added 3 commits

    • 45cec1f1 - tests/hlsl: Add tests for GetSamplePosition() and GetSampleCount().
    • c9fbf0fa - vkd3d-shader/dxil: Implement DX intrinsics Texture2DMSGetSamplePosition and...
    • 6d0fa2ce - vkd3d-shader/dxil: Implement DX intrinsic RenderTargetGetSampleCount.

    Compare with previous version

  • Conor McCarthy added 3 commits

    added 3 commits

    • 3d7e66d8 - tests/hlsl: Add tests for GetSamplePosition() and GetSampleCount().
    • d263c619 - vkd3d-shader/dxil: Implement DX intrinsics Texture2DMSGetSamplePosition and...
    • 6efac3ed - vkd3d-shader/dxil: Implement DX intrinsic RenderTargetGetSampleCount.

    Compare with previous version

  • @@ -132,6 +134,7 @@ struct shader_runner_caps
         bool float64;
         bool int64;
         bool rov;
    +    bool rgba_float_4xmsaa;
     };
     
     static inline unsigned int shader_runner_caps_get_feature_flags(const struct shader_runner_caps *caps)

    I suppose that's fine for a single format and sample count combination, but I'm not sure that can scale. Could we just allow runner->ops->create_resource() to optionally fail, and then skip any tests referencing such a failed resource?

    +            if (params->sample_count)
    +            {
    +                if (params->level_count > 1)
    +                    fatal_error("Multisample resource has multiple levels.\n");
    +                resource->resource = create_default_texture_(__LINE__, device, D3D12_RESOURCE_DIMENSION_TEXTURE2D,
    +                        params->width, params->height, 1, 1, params->sample_count, params->format,
    +                        D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET, D3D12_RESOURCE_STATE_RENDER_TARGET);
    +            }
    +            else
    +            {
    +                resource->resource = create_default_texture2d(device, params->width, params->height, 1, params->level_count,
    +                        params->format, D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET, D3D12_RESOURCE_STATE_RENDER_TARGET);
    +            }

    Right, but create_default_texture2d() can be trivially replaced with create_default_texture_() as well, and then the two branches can be merged.

    +        if ((glGetInternalformativ = (void *)eglGetProcAddress("glGetInternalformativ")))
    +        {
    +            glGetInternalformativ(GL_TEXTURE_2D_MULTISAMPLE, GL_RGBA32F, GL_SAMPLES, 1, &tex_max_sample_count);
    +            glGetInternalformativ(GL_RENDERBUFFER, GL_RGBA32F, GL_SAMPLES, 1, &rt_max_sample_count);
    +            runner->caps.rgba_float_4xmsaa = tex_max_sample_count >= 4 && rt_max_sample_count >= 4;
    +        }

    You don't need to use eglGetProcAddress() for glGetInternalformativ(), libOpenGL.so exports all the OpenGL 4.5 core and compat entry points, and glGetInternalformativ() is GL 4.2. You probably do need to check that GL_ARB_internalformat_query is supported. We don't use renderbuffers.

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading