Advertisement

X3664 vs_2_0 does not support synchronization operations

Started by January 14, 2025 11:33 AM
1 comment, last by Tom Sloper 3 days, 6 hours ago

Hi,

I am trying to compile following shader code written for DX12_1 feature level with shader model cs_5_1.

Hitting following error -

X3664 vs_2_0 does not support synchronization operations

I tried to change shader model from VS_studio HLSL properties but didn't worked.

I have Intel GPU with DX 12_1 feature level support.

Shader code

// Input texture
Texture2D<float> inputTexture : register(t0);

// Intermediate buffer for storing maximum values from each thread group
RWBuffer<float> intermediateBuffer : register(u0);

// Define the number of threads per group
[numthreads(16, 16, 1)]
void CSMain(uint3 DTid : SV_DispatchThreadID, uint3 GTid : SV_GroupThreadID, uint3 GID : SV_GroupID)
{
// Calculate the index based on the thread ID
uint index = GTid.y * 16 + GTid.x;

// Read the value from the input texture
float value = inputTexture.Load(int3(DTid.xy, 0));

// Perform reduction to find the maximum value in the group
for (uint stride = 8; stride > 0; stride >>= 1)
{
if (GTid.x < stride)
{
value = max(value, inputTexture.Load(int3(DTid.xy + int2(stride, 0), 0)));
value = max(value, inputTexture.Load(int3(DTid.xy + int2(0, stride), 0)));
}
GroupMemoryBarrierWithGroupSync();
}

// Write the maximum value to the intermediate buffer
if (GTid.x == 0 && GTid.y == 0)
{
intermediateBuffer[GID.y * (16) + GID.x] = value;
}
}

@dilipshirke , this post was off-topic in the Writing forum, so it has been moved to General and Gameplay Programming. Before posting again, please Browse the forums and familiarize yourself with the various forum topics. It's non-obvious how to find the Browse page. Here's how:

  1. Click Forums in the navbar at left.
  2. Click the Browse tab atop the Forums page. Then scroll down to find the Programming section (it's the fifth category of forums).

Also before posting again, please review our community guidelines. Good luck with your project, and welcome to gamedev.net.

-- Tom Sloper -- sloperama.com

Advertisement