Skip to content

[SPIR-V] GetAttributeAtVertex(0,0) fails validation #6382

@sudonatalie

Description

@sudonatalie

Description
Follow-up from #6041 (comment)

This invalid usage of GetAttributeAtVertex fails at validation rather than providing a useful error message.

Steps to Reproduce

dxc -T ps_6_0 -spirv
float main() : SV_Target
{
  return GetAttributeAtVertex(0, 0);
}

Actual Behavior
SPIR-V compilation fails with a validation error message:

fatal error: generated SPIR-V is invalid: The Base <id> '7[%int_0]' in OpAccessChain instruction must be a pointer.
  %14 = OpAccessChain %_ptr_Function_int %int_0 %uint_0

DXIL fails with:

<source>:6:10: error: attribute evaluation can only be done on values taken directly from inputs.
  return GetAttributeAtVertex(0, 0);
         ^

The SPIR-V backend should produce a similarly helpful error message.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug, regression, crashspirvWork related to SPIR-V

    Type

    No type

    Projects

    Status

    Triaged

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions