Skip to content

[spirv] -fspv-flatten-resource-arrays crashes reflection #2413

@xxxbxxx

Description

@xxxbxxx

when compiling the following code with -fspv-flatten-resource-arrays,
no %OpName is generated for Tex

and if I add -fspv-reflect, dxc aborts with:
external/SPIRV-Tools/source/opt/desc_sroa.cpp:238: uint32_t spvtools::opt::DescriptorScalarReplacement::CreateReplacementVariable(spvtools::opt::Instruction*, uint32_t): Assertion old_decoration->opcode() == SpvOpDecorate' failed.`

struct PS_INPUT {
	float4 Pos		: SV_Position;
};
struct PS_OUTPUT {
	float4	Color	: SV_Target0;
};

SamplerState		S;
Texture2D<float>	Tex[4];

PS_OUTPUT psMain(const PS_INPUT In)
{
	PS_OUTPUT	Out;
	Out.Color = float4(1,0,0,1);

	Out.Color.y += Tex[0].SampleLevel(S, In.Pos.xy, 0).x;

	return Out;
}

Metadata

Metadata

Assignees

Labels

spirvWork related to SPIR-V

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions