Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Jeremy-Tess
Beginner
99 Views

Invalid compute shader output on Intel HD Graphics 530 and earlier

Jump to solution

I have a relatively simple HLSL compute shader for downsampling a luma texture:

SamplerState bilinearClamp : register(s0);
Texture2D<float> frame : register(t0);
RWTexture2D<float> result : register(u0);

cbuffer cb0 : register(b0)
{
	float2 inverseDimensions = float2(1.0f / 1920.0f, 1.0f / 1080.0f);
}

[numthreads(8, 8, 1)]
void main(uint3 DTid : SV_DispatchThreadID)
{
	float2 centerUV = float2(DTid.xy * 2.0f + 0.5f) * inverseDimensions;
	float luma = frame.SampleLevel(bilinearClamp, centerUV, 0.0f);
	result[DTid.xy] = luma;
}

 

This works as expected on Nvidia hardware and on Intel Iris Plus Graphics (the image is downsampled to half the size), but on Intel HD Graphics 530 and earlier the output texture is solid gray. Could this possibly be a driver issue? I've got the current latest driver installed on both systems (27.20.100.9316), both running Windows 10 64 bit 20H2 with all updates applied.

Changing the code to avoid SampleLevel gives the expected output on all systems, but I'm curious as to whether there is some hardware limitation or whether it's a bug.

float luma = frame[DTid.xy * 2];

 

Kind regards,

Jeremy

0 Kudos
1 Solution
Jeremy-Tess
Beginner
49 Views

Not to worry, I think this was actually due to a typo in the constant buffer description. I'd set it to unordered access which just happened to work on all the other test platforms (facepalm).

View solution in original post

1 Reply
Jeremy-Tess
Beginner
50 Views

Not to worry, I think this was actually due to a typo in the constant buffer description. I'd set it to unordered access which just happened to work on all the other test platforms (facepalm).

View solution in original post

Reply