microsoft / DirectXShaderCompiler

This repo hosts the source for the DirectX Shader Compiler which is based on LLVM/Clang.
Other
3.09k stars 690 forks source link

[SPIR-V] DXC crashes when sampling float1 texture #6782

Closed shobomaru closed 3 months ago

shobomaru commented 3 months ago

Description LLVM assertion failed.

Steps to Reproduce dxc -T ps_6_0 -spirv path/to/file.hlsl

HLSL code:

Texture2D<float1> Texture;
SamplerState Sampler;

float4 main() : SV_Target
{
    float bar = Texture.Sample(Sampler, (float2)0);
    return bar.xxxx;
}

If change the code in one of the following ways, the issue is not occurred.

Actual Behavior

Assertion failed: (vecType->isBuiltinType() || vecType->isDependentType()), function getExtVectorType, file ASTContext.cpp, line 2941.

Environment

damyanp commented 3 months ago

@s-perron - is this something you want to have a look at? I'm not sure if it is spirv specific or not.

s-perron commented 3 months ago

This was a duplicate of https://github.com/microsoft/DirectXShaderCompiler/issues/6568, and it is already fixed.

https://godbolt.org/z/4crTMo89v