Skip to content

[HLSL][SPIRV] Hitting assert when compiling program with 'asint' in HLSL #146942

Open
@spall

Description

@spall

Hitting an assert when compiling this program with spirv: '-spirv -fspv-target-env=vulkan1.3 -T cs_6_5'

StructuredBuffer<float4> In3 : register(t2);
RWStructuredBuffer<int4> Out3 : register(u5);

[numthreads(1,1,1)]
void main() {
  // float
  Out3[0] = asint(In3[0]);
}
Assertion failed: TargetType->getElementType() == SourceType->getElementType(), file llvm-project/llvm/lib/Target/SPIRV/SPIRVLegalizePointerCast.cpp, line 78

https://godbolt.org/z/rfoGz3Kj9

Metadata

Metadata

Assignees

No one assigned

    Labels

    HLSLHLSL Language Supportbackend:SPIR-VcrashPrefer [crash-on-valid] or [crash-on-invalid]

    Type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions