Skip to content

HLSL: Struct/class members #535

@xen2

Description

@xen2

Didn't see this mentionned in #362:

  • Struct members are not supported (such as Test.T1() in the next example)
  • Optional: class keyword doesn't work (I think class and struct are the same thing?)
struct Test
{
    float4 T;
    float4 T1(float4 a)
    {
        return T + a;
    }
};

float4 PSMain() : SV_Target0 {
   Test test;
   test.T = 3.0f;
   return test.T1(5.0f);
}
ERROR: test.frag:4: ',' : Expected
ERROR: test.frag:4: 'struct member declarations' : Expected
test.frag(4): error at column 14, HLSL parsing failed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions