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

SamplerDescriptorHeap can be used to load textures. #6649

Open
Keenuts opened this issue May 27, 2024 · 1 comment · May be fixed by #6780
Open

SamplerDescriptorHeap can be used to load textures. #6649

Keenuts opened this issue May 27, 2024 · 1 comment · May be fixed by #6780
Labels
bug Bug, regression, crash
Milestone

Comments

@Keenuts
Copy link
Collaborator

Keenuts commented May 27, 2024

Description

From HLSL_SM_6_6_DynamicResources, it looks like SamplerDescriptorHeap must be used to access Samplers, not textures.
But if we use it to load a texture, DXC says OK.

Steps to Reproduce

float4 main() : SV_Target {
  SamplerState Sampler = SamplerDescriptorHeap[2];
  Texture2D Texture = SamplerDescriptorHeap[3];
  return Texture.Sample(Sampler, float2(0, 0));
}
dxc -T ps_6_6 repro.hlsl

Actual Behavior

DXC compiles. dx.op.createHandleFromHeap is created, loading a texture from a sampler heap.
As I'm adding this feature in the SPIR-V backend, I'm fine accepting this (since for us both heaps would be the same). But it looks like this should be illegal.

Environment

  • DXC version: HEAD
  • Host Operating System: linux
@Keenuts Keenuts added bug Bug, regression, crash needs-triage Awaiting triage labels May 27, 2024
@damyanp damyanp removed the needs-triage Awaiting triage label May 28, 2024
@damyanp damyanp moved this to Triaged in HLSL Triage May 28, 2024
@damyanp damyanp added this to the Backlog milestone May 28, 2024
@damyanp
Copy link
Member

damyanp commented May 28, 2024

Yes, it shouldn't accept this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug, regression, crash
Projects
Status: New
Status: Triaged
2 participants