Skip to content

[SPIR-V] Multidimensional array of constant buffers crashes dxc #4506

@kuhar

Description

@kuhar
$ bin/dxc -T ps_6_0 -E psmain ./test.hlsl -spirv 
dxc: /usr/local/google/home/kubak/dxc/DirectXShaderCompiler/include/llvm/Support/Casting.h:96: static bool llvm::isa_impl_cl<clang::FieldDecl, const clang::Decl *>::doit(const From *) [To = clang::FieldDecl, From = const clang::Decl *]: Assertion `Val && "isa<> used on a null pointer"' failed.
[1]    318156 IOT instruction  bin/dxc -T ps_6_0 -E psmain ./test5.hlsl -spirv

Repro:

struct Foo {
  float4 a;
  int2 b;
};
ConstantBuffer<Foo> myCB2[2][3]: register(b0, space1);

struct VSOutput {
  float2 TexCoord : TEXCOORD;
};

float4 psmain(VSOutput input) : SV_TARGET {
  return 0;
}

This is based on the example in https://docs.microsoft.com/en-us/windows/win32/direct3d12/resource-binding-in-hlsl#constant-buffers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug, regression, crashspirvWork related to SPIR-V

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions