Skip to content

[SPIR-V] Fix bug using Texture2D with alias template for SpirvType #6498

Open

Description

Description
For the (currently unmerged) SpirvType PR, Texture2D (and presumably other built-in types) cannot be used as an argument to an alias template for SpirvType

Steps to Reproduce

Compile

template<typename SomeType, uint Length>
using Array = vk::SpirvOpaqueType</* OpTypeArray */ 28, SomeType, vk::integral_constant<uint, Length> >;

void main() {
  Array<Texture2D, 4> image;
}

With the command

dxc -T ps_6_0 -E main -spirv

Actual Behavior
Error:

foo.hlsl:2:1: error: 'Texture2D<vector<float, 4> >' is an object and cannot be used as a type parameter
using Array = vk::SpirvOpaqueType</* OpTypeArray */ 28, SomeType, vk::integral_constant<uint, Length> >;
^
foo.hlsl:5:3: note: in instantiation of template type alias 'Array' requested here
  Array<Texture2D, 4> image;
  ^

Environment

Activity

  1. added
    bug
    spirv
    needs-triage
    on Apr 4, 2024
  2. devshgraphicsprogramming commented on Apr 19, 2024

    @devshgraphicsprogramming

    This problem isn't limited to built-in types, its also when you put one vk::SpirvType inside another: https://godbolt.org/z/sxejh1q7W

    its whats blocking my "user space solution" to #5092

  3. added a commit that references this issue on Oct 8, 2024
    7d2702d
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