Skip to content

Validation errors when using Register Swizzling with bool type. #1700

Description

@JPMMaia

Minimal repro steps

Given the following shader (vs_example.hlsl):

struct VertexShaderInput
{
    float3 position : POSITION;
};

struct VertexShaderOutput
{
    float4 position : SV_POSITION;
};

VertexShaderOutput main(VertexShaderInput input)
{
    bool booleanVar = true;
    bool2 extra = booleanVar.xx;

    VertexShaderOutput output;
    output.position = float4(input.position, 1.0f);
    return output;
}

Compile with: dxc /T vs_6_0 /Od vs_example.hlsl

Tested with version from Windows SDK 10.0.17763.0.

Expected result

The shader should be compiled successfully as if it was compiled with FXC using: fxc /T vs_5_1 /Od vs_example.hlsl

Actual result

The shader fails to be compiled with the following validation errors:

error: validation errors
at 0x1e4c9ff18d8 inside block #0 of function main Pointer type bitcast must be have same size
Vector type '<1 x i1>' is not allowed
at 0x1e4c9fee440 inside block #0 of function main Instructions must be of an allowed type

Validation failed.

Activity

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

Metadata

Metadata

Labels

bugBug, regression, crash

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions