Skip to content

SamplerDescriptorHeap can be used to load textures. #6649

Open

Description

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

Activity

  1. added
    bug
    needs-triage
    on May 27, 2024
  2. damyanp commented on May 28, 2024

    @damyanp
    Member

    Yes, it shouldn't accept this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions