Skip to content

"found unregistered decl" when compiling partial template specialization for SPIR-V #5563

Open

Description

@neversleeping

Description
Got message with request for new bug report during development for SPIR-V using HLSL 2021 features. Reduced reproduction to a small snippet with partial template specialization.

Steps to Reproduce
Shader Playground link: https://shader-playground.timjones.io/d89cc1395544165f3afe124c26429752
Compiling with -spirv -HV 2021

template <
   bool PARAM1,
   bool PARAM2>
struct TEST_STRUCT{};


template <bool PARAM1>
struct TEST_STRUCT<PARAM1, true> {
   static const bool FIELD = PARAM1;
};

struct PSInput
{
	float4 color : COLOR;
};

float4 PSMain(PSInput input) : SV_TARGET
{
	bool test = TEST_STRUCT<true, true>::FIELD;
	return input.color;
}

Actual Behavior

C:\local\Temp\3c0b2c72-ea2c-4f3d-b4fe-87dad7782596.hlsl:7:16: fatal error: found unregistered decl
template
^
note: please file a bug report on https://github.com/Microsoft/DirectXShaderCompiler/issues with source code if possible

Environment

  • DXC version: 1.7 - 1.7.0.3939 (5e080a7)
  • Host Operating System: Windows 10/Shader Playground

Activity

  1. added
    bug
    needs-triage
    on Aug 17, 2023
  2. added
    spirv
    and removed
    needs-triage
    on Aug 23, 2023
  3. neversleeping commented on Nov 27, 2023

    @neversleeping
    Author

    What are chances for this to be fixed in next few months?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugspirv

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions