Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPIR-V][Feature Request][SM6.5] Add support for FeedbackTexture2D #6614

Closed
Keenuts opened this issue May 13, 2024 · 2 comments
Closed

[SPIR-V][Feature Request][SM6.5] Add support for FeedbackTexture2D #6614

Keenuts opened this issue May 13, 2024 · 2 comments
Labels
enhancement Feature suggestion spirv Work related to SPIR-V

Comments

@Keenuts
Copy link
Collaborator

Keenuts commented May 13, 2024

The SPIR-V backend currently doesn't support FeedbackTextures.

Not sure if that's high priority as this support seems optional even on the DirectX side, but creating an issue to track this, and define its priotity.

Texture2D<uint> tex;
SamplerState samplerState;
FeedbackTexture2D<SAMPLER_FEEDBACK_MIP_REGION_USED> feedback;

float4 main() : SV_Target {
  feedback.WriteSamplerFeedback(tex, samplerState, uint2(0, 0));
  uint tmp = tex.Sample(samplerState, uint2(0, 0));
  return float(tmp).xxxx;
}
$ dxc -T ps_6_7 shader.hlsl -spirv
shader.hlsl:6:12: error: intrinsic 'WriteSamplerFeedback' method unimplemented
  feedback.WriteSamplerFeedback(tex, samplerState, uint2(0, 0));
@Keenuts Keenuts added enhancement Feature suggestion spirv Work related to SPIR-V labels May 13, 2024
@devshgraphicsprogramming

Vulkan & SPIR-V is a bit less managed than DX12 & HLSL, I'm not sure same functionality exists in Vulkan

For sample we have no Append/Consume etc.

there's VK_NV_shader_image_footprint but that doesn't give you a thing to write the feedback to, only query the region accessed

emulating this DX12 feature in SPIR-V would require cooperation from the application to supply a BDA ponter, SSBO or Storage Image to use as the feedback and a contract on how to interpret this data

sudonatalie added a commit to sudonatalie/DirectXShaderCompiler that referenced this issue May 21, 2024
Sampler feedback resource types are not supported by the SPIR-V backend,
but they would previously fail silently until a function was called on
them. This change makes the error message more explicit on the type.

Related to microsoft#6614
sudonatalie added a commit to sudonatalie/DirectXShaderCompiler that referenced this issue May 21, 2024
Sampler feedback resource types are not supported by the SPIR-V backend,
but they would previously fail silently until a function was called on
them. This change makes the error message more explicit on the type.

Related to microsoft#6614
@sudonatalie
Copy link
Collaborator

After further investigation, we've decided not to implement this feature in the SPIR-V backend at this time because there is not a solid mapping from DX to Vulkan that would support the full feature's requirements, or most Vulkan end users.

We are open to feedback so additional comments/issues are welcome if this is a high-priority feature for your use case.

Improving the error messaging with #6640

@sudonatalie sudonatalie closed this as not planned Won't fix, can't repro, duplicate, stale May 21, 2024
sudonatalie added a commit that referenced this issue May 24, 2024
Sampler feedback resource types are not supported by the SPIR-V backend,
but they would previously fail silently until a function was called on
them. This change makes the error message more explicit on the type.

Related to #6614
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature suggestion spirv Work related to SPIR-V
Projects
None yet
Development

No branches or pull requests

3 participants