error: llvm::cast<X>() argument of incompatible type! only with ShaderModel 6.6 and above
Mantenedores costumam responder em até 2 dias
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 30/100
Direção de pesquisa
Reproduce the crash by compiling the attached compute shader with -T cs_6_6 and comparing against -T cs_6_5 to confirm the shader-model gate. The llvm::cast assertion means the backtrace from a debug build should point to the pass that fails. Done means the shader compiles at 6.6 without the error, with a regression test added. The issue names no source files, so locating the pass is the first real task.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Description
Getting a llvm::cast error when compiling a shader with shader model 6.6 or above.
Steps to Reproduce
Please visit https://godbolt.org/z/nKMbf1xqr
or compile the following compute shader (with "-T cs_6_6")
`struct SourceInfo__Constants
{
float2 textureOffsets;
};
struct SourceInfo
{
SourceInfo__Constants constants;
};
SourceInfo CreateSourceInfo_(SourceInfo__Constants constants)
{
SourceInfo i;
i.constants = constants;
return i;
}
struct CommonParams__Constants
{
SourceInfo__Constants depthSepthSourceInfo;
};
cbuffer CommonParams_cbuffer { CommonParams__Constants CommonParams__constants; };
Texture2D tex_test;
SamplerState pointClamp;
[numthreads(64, 1, 1)]
void main()
{
uint depthTextureCount = 10;
const uint flags = asuint(depthTextureCount);
float3 startParams;
uint textureID = ~0;
for (uint i = 0; i < depthTextureCount; ++i)
{
startParams.x = 0;
if (startParams.z > 0.0f)
textureID = 0;
}
if (textureID == 0)
{
bool collideWithStaticDisabled = !((flags >> 15) & 1);
if (collideWithStaticDisabled )
{
bool isCharacter = false;
if (collideWithStaticDisabled && !(isCharacter))
return;
}
}
SourceInfo sourceInfo = CreateSourceInfo_(CommonParams__constants.depthSepthSourceInfo);
if (textureID == 0)
float3 normal = float3(0,0,0);
float4 p = tex_test.SampleLevel(pointClamp, sourceInfo.constants.textureOffsets.xy, 0);
}
`
Actual Behavior
The following error is reported:
error: llvm::cast() argument of incompatible type!
Note that the provided shader is completely bogus and is a massive simplification from a much larger shader.
Also note that there are all kinds of changes that can be done to the provided shader that "fix" the problem:
-Moving textureOffsets directly in SourceInfo
-Moving the declaration of SourceInfo sourceInfo to after the following "if"
-Removing "if (textureID == 0)" statements
-and others
Environment
- DXC versions:
official release: dxcompiler.dll: 1.9(5512-01b62ad4)(1.9.2609.5) - 1.9.2609.5 (01b62ad47)
locally built trunk version: dxcompiler.dll: 1.11(1-78d896ef)(1.10.0.10001) - 1.10.0.10001 (main, 78d896ef) - Host Operating System Windows 11 24h2
- Linguagem predominante
- C++
- Estrelas
- 3.7k
- Forks
- 926
- Merge médio
- 3d 22h
- PRs com merge (30d)
- 45
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de microsoft/DirectXShaderCompiler
-
bug needs-triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
microsoft/DirectXShaderCompiler#9173 ·
Mantenedores costumam responder em até 2 dias
-
bug needs-triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
microsoft/DirectXShaderCompiler#9155 · 4 comentários ·
Mantenedores costumam responder em até 2 dias
-
bug needs-triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
microsoft/DirectXShaderCompiler#9135 ·
Mantenedores costumam responder em até 2 dias
-
DXC emits DW_LANG_C_plus_plus instead of DW_LANG_HLSL for HLSLTalvez já em andamento @rj123-nv assumiu há 18 dias. Abertabug needs-triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
microsoft/DirectXShaderCompiler#9087 ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
microsoft/DirectXShaderCompiler#9086 ·
Mantenedores costumam responder em até 2 dias
Todas as issues de microsoft/DirectXShaderCompiler
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
Mantenedores costumam responder em até 1 dia
-
table_translator 当一个 Prism 键映射到多个原码时,首个候选未按权重排序Talvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Abertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
-
feature:config kind:docs os:windows toolchain:cmake triaged
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
arch-based bug niri
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
noctalia-dev/noctalia#5552 ·
Mantenedores costumam responder em até 1 dia