Skip to content

[SPIR-V] Counter is emitted when RWStructuredBuffer is passed into a function #7867

@Raikiri

Description

@Raikiri

Description

[[vk::binding(0, 0)]]
StructuredBuffer<int> buf;

void Func(StructuredBuffer<int> b){}

void main()
{
  Func(buf);
}

Compiling with

dxc -spirv -T ps_6_0 -E main `"$srcPath`" -fspv-preserve-interface -fspv-preserve-bindings -Fo `"$dstPath`"

This code emits a binding for buf, but also for counter.var.buf. If I comment out the function call Func(buf), the second binding disappears.

Seems possibly related to #3287 ?

Environment

  • DXC version libdxcompiler.so: 1.8(dev;0-00000000); libdxil.so: 1.8
  • Host Operating System NixOS (not sure how this is relevant)

Metadata

Metadata

Assignees

Labels

bugBug, regression, crashspirvWork related to SPIR-V

Type

No type

Projects

Status

In progress

Status

Triaged

Relationships

None yet

Development

No branches or pull requests

Issue actions