- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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).
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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).

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page