Skip to content

dxc fails to compile InterlockedAdd intrinsic #41

Closed

Description

The below program compiles with fxc but fails with error: Invalid operation on typed buffer on dxc.


// RUN: dxc /Tcs_5_1 /DDX12  %s

struct Foo {
    int a;
    int b;
    int c;
    int d;
};

Buffer<Foo> inputs : register(t1);
RWBuffer< int > g_Intensities : register(u1);

groupshared Foo sharedData;

#ifdef DX12
[RootSignature("DescriptorTable(UAV(u1, numDescriptors=1), SRV(t1), visibility=SHADER_VISIBILITY_ALL)")]
#endif
[ numthreads( 64, 2, 2 ) ]
void main( uint GI : SV_GroupIndex)
{
	sharedData = inputs[GI];
	int rtn;
	InterlockedAdd(sharedData.d, g_Intensities[GI], rtn);
	g_Intensities[GI] = rtn + sharedData.d;
}

Activity

  1. dmpots commented on Feb 3, 2017

    @dmpots
    ContributorAuthor

    Fixed by #43

  2. added a commit that references this issue on Jan 2, 2024
    96d9d4c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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