Texture Sampler in Compute Shader
Hi.

I'm trying to use Texture Sampler in Compute Shader,
but the error code "E_NOTIMPL" is returned from D3DX11CompileFromFile().

OS: Windows 7 64 bit Ultimate
CPU: Xeon W3530
CUDA version: 3.2
GPU: GTX470
DirectX version: 11

The following is my HLSL code.

[code]
ByteAddressBuffer src0 : register(t0);
ByteAddressBuffer src1 : register(t1);
RWByteAddressBuffer dst : register(u0);

Texture2D<float> InputTexture : register(t2);

SamplerState LinearSampler
{
Filter = MIN_MAG_MIP_LINEAR;
AddressU = Clamp;
AddressV = Clamp;
};

[numthreads(1, 1, 1)]
void CSMain(uint3 DTid : SV_DispatchThreadID)
{
float p=0.0;

float2 coord;
coord.x = (float)DTid.x;
coord.y = (float)DTid.y;
p += asfloat(InputTexture.Sample(LinearSampler, coord));

dst.Store(DTid.x*4, asuint(p) );
}
[/code]

What is causing this error?
Code, hlsl compiler version, GPU version?
Or, we cannot use texture sampler in ComputeShader?

Please help me.

Thanks in advance!
Hi.



I'm trying to use Texture Sampler in Compute Shader,

but the error code "E_NOTIMPL" is returned from D3DX11CompileFromFile().



OS: Windows 7 64 bit Ultimate

CPU: Xeon W3530

CUDA version: 3.2

GPU: GTX470

DirectX version: 11



The following is my HLSL code.





ByteAddressBuffer src0 : register(t0);

ByteAddressBuffer src1 : register(t1);

RWByteAddressBuffer dst : register(u0);



Texture2D<float> InputTexture : register(t2);



SamplerState LinearSampler

{

Filter = MIN_MAG_MIP_LINEAR;

AddressU = Clamp;

AddressV = Clamp;

};



[numthreads(1, 1, 1)]

void CSMain(uint3 DTid : SV_DispatchThreadID)

{

float p=0.0;



float2 coord;

coord.x = (float)DTid.x;

coord.y = (float)DTid.y;

p += asfloat(InputTexture.Sample(LinearSampler, coord));



dst.Store(DTid.x*4, asuint(p) );

}




What is causing this error?

Code, hlsl compiler version, GPU version?

Or, we cannot use texture sampler in ComputeShader?



Please help me.



Thanks in advance!

#1
Posted 04/28/2011 06:04 AM   
Instead of Sample(), I tried to use SampleLevel().
Then my code works well !

In ComputeShader, Sample() seems to be not supported.
Instead of Sample(), I tried to use SampleLevel().

Then my code works well !



In ComputeShader, Sample() seems to be not supported.

#2
Posted 05/13/2011 02:56 AM   
Yes, this is because texture LOD is not defined in the Compute shader (there's no fixed mapping between threads and pixels), so you need to specify the LOD.
Yes, this is because texture LOD is not defined in the Compute shader (there's no fixed mapping between threads and pixels), so you need to specify the LOD.

#3
Posted 05/18/2011 12:33 PM   
Thanks for posted [url=http://www.1st-levitra-pharmacy.com]buy levitra online[/url] info...it's really hel[ful...that's the real point to resolve the problem...

This Comment Has Been Nuked

#4
Posted 08/08/2011 12:37 PM   
Scroll To Top