Skip to content

Add error for non-vector arguments of Texture2D #1695

Description

@hekota

The following code crashes the compiler. Expected behavior is an error that Struct cannot be used as Texture2D template argument.

struct PSInput
{
    float2 uv : TEXCOORD0;
};

struct Struct
{
    float x;
};

Texture2D<Struct> t;
SamplerState s;

float4 PSMain(PSInput input) : SV_TARGET
{
    return float4(t.GatherRed( s, input.uv), 0, 0, 0);
}

dxc -T ps_6_0 -E PSMain test.hlsl.

Activity

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions