Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualMigi0027

Posted 29 January 2014 - 03:53 PM

Hi guys wink.png .

 

I've got my UAV, initialized with the SRV like this:

D3D11_SUBRESOURCE_DATA data;
data.pSysMem = texArray;
data.SysMemPitch = width * type;
//data.SysMemSlicePitch = width * height * type;

// Build the texture header descriptor
D3D11_TEXTURE2D_DESC descTex;
descTex.Width = width;
descTex.Height = height;
descTex.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
descTex.Usage = D3D11_USAGE_DEFAULT;
descTex.BindFlags = D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_UNORDERED_ACCESS | D3D11_BIND_RENDER_TARGET;
descTex.CPUAccessFlags = 0;
descTex.MipLevels = 1;
descTex.ArraySize = 1;
descTex.SampleDesc.Count = 1;
descTex.SampleDesc.Quality = 0;
descTex.MiscFlags = D3D11_RESOURCE_MISC_GENERATE_MIPS;

// Create the 2d texture from data
ID3D11Texture2D * pTexture_t = NULL;
HV( dev->CreateTexture2D( &descTex, &data, &pTexture_t ));

// Create resource view descriptor
D3D11_UNORDERED_ACCESS_VIEW_DESC uavDesc;
uavDesc.Format = descTex.Format;
uavDesc.ViewDimension = D3D11_UAV_DIMENSION_TEXTURE2D;

uavDesc.Texture2D.MipSlice = 0;

// Create the shader resource view
HV( dev->CreateUnorderedAccessView( pTexture_t, &uavDesc, &pTexture ));

// Create resource view descriptor
D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc;
srvDesc.Format = descTex.Format;
srvDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;

srvDesc.Texture2D.MostDetailedMip = 0;
srvDesc.Texture2D.MipLevels = D3D11_RESOURCE_MISC_GENERATE_MIPS;

// Create the shader resource view
HV( dev->CreateShaderResourceView( pTexture_t, &srvDesc, &SRV ));

 
I've chosen to bind this UAV to the compute shader, for now it's simply only writing a white color to it, which works fine ( debugged it ). I set it like this:

devcon->CSSetUnorderedAccessViews(0, 1, &pOUT, 0);

 
Now I'd imagine that I'd need to unbind it for a simple shader resource to be accessed, like so:

devcon->CSSetShader(NULL,0,0);
devcon->CSSetUnorderedAccessViews(0, 0, NULL, 0); // This one

 
But, when trying to access/send the SRV which points to the same data to the GPU, the debug layer gives me the following warning (or threat really):

Resource being set to PS shader resource slot 0 is still bound on output! Forcing to NULL

 
Suggesting that the UAV might still be bound somehow, I think, so the SRV is never sent.

 

What could I have done wrong in this? Do you need anything else?

 

Thank you for your time, as always. 

-MIGI0027


#3Migi0027

Posted 29 January 2014 - 03:46 PM

Hi guys wink.png .

 

I've got my UAV, initialized with the SRV like this:

D3D11_SUBRESOURCE_DATA data;
data.pSysMem = texArray;
data.SysMemPitch = width * type;
//data.SysMemSlicePitch = width * height * type;

// Build the texture header descriptor
D3D11_TEXTURE2D_DESC descTex;
descTex.Width = width;
descTex.Height = height;
descTex.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
descTex.Usage = D3D11_USAGE_DEFAULT;
descTex.BindFlags = D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_UNORDERED_ACCESS | D3D11_BIND_RENDER_TARGET;
descTex.CPUAccessFlags = 0;
descTex.MipLevels = 1;
descTex.ArraySize = 1;
descTex.SampleDesc.Count = 1;
descTex.SampleDesc.Quality = 0;
descTex.MiscFlags = D3D11_RESOURCE_MISC_GENERATE_MIPS;

// Create the 2d texture from data
ID3D11Texture2D * pTexture_t = NULL;
HV( dev->CreateTexture2D( &descTex, &data, &pTexture_t ));

// Create resource view descriptor
D3D11_UNORDERED_ACCESS_VIEW_DESC uavDesc;
uavDesc.Format = descTex.Format;
uavDesc.ViewDimension = D3D11_UAV_DIMENSION_TEXTURE2D;

uavDesc.Texture2D.MipSlice = 0;

// Create the shader resource view
HV( dev->CreateUnorderedAccessView( pTexture_t, &uavDesc, &pTexture ));

// Create resource view descriptor
D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc;
srvDesc.Format = descTex.Format;
srvDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;

srvDesc.Texture2D.MostDetailedMip = 0;
srvDesc.Texture2D.MipLevels = D3D11_RESOURCE_MISC_GENERATE_MIPS;

// Create the shader resource view
HV( dev->CreateShaderResourceView( pTexture_t, &srvDesc, &SRV ));

 
I've chosen to bind this one to my UAV, for now it's simply only writing a white color to it, which works fine ( debugged it ). I set it like this:

devcon->CSSetUnorderedAccessViews(0, 1, &pOUT, 0);

 
Now I'd imagine that I'd need to unbind it for a simple shader resource to be accessed, like so:

devcon->CSSetShader(NULL,0,0);
devcon->CSSetUnorderedAccessViews(0, 0, NULL, 0); // This one

 
But, when trying to access/send the SRV which points to the same data to the GPU, the debug layer gives me the following warning (or threat really):

Resource being set to PS shader resource slot 0 is still bound on output! Forcing to NULL

 
Suggesting that the UAV might still be bound somehow, I think, so the SRV is never sent.

 

What could I have done wrong in this? Do you need anything else?

 

Thank you for your time, as always. 

-MIGI0027


#2Migi0027

Posted 29 January 2014 - 03:46 PM

Hi guys wink.png .

 

I've got my UAV, initialized with the SRV like this:

D3D11_SUBRESOURCE_DATA data;
data.pSysMem = texArray;
data.SysMemPitch = width * type;
//data.SysMemSlicePitch = width * height * type;

// Build the texture header descriptor
D3D11_TEXTURE2D_DESC descTex;
descTex.Width = width;
descTex.Height = height;
descTex.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
descTex.Usage = D3D11_USAGE_DEFAULT;
descTex.BindFlags = D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_UNORDERED_ACCESS | D3D11_BIND_RENDER_TARGET;
descTex.CPUAccessFlags = 0;
descTex.MipLevels = 1;
descTex.ArraySize = 1;
descTex.SampleDesc.Count = 1;
descTex.SampleDesc.Quality = 0;
descTex.MiscFlags = D3D11_RESOURCE_MISC_GENERATE_MIPS;

// Create the 2d texture from data
ID3D11Texture2D * pTexture_t = NULL;
HV( dev->CreateTexture2D( &descTex, &data, &pTexture_t ));

// Create resource view descriptor
D3D11_UNORDERED_ACCESS_VIEW_DESC uavDesc;
uavDesc.Format = descTex.Format;
uavDesc.ViewDimension = D3D11_UAV_DIMENSION_TEXTURE2D;

uavDesc.Texture2D.MipSlice = 0;

// Create the shader resource view
HV( dev->CreateUnorderedAccessView( pTexture_t, &uavDesc, &pTexture ));

// Create resource view descriptor
D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc;
srvDesc.Format = descTex.Format;
srvDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;

srvDesc.Texture2D.MostDetailedMip = 0;
srvDesc.Texture2D.MipLevels = D3D11_RESOURCE_MISC_GENERATE_MIPS;

// Create the shader resource view
HV( dev->CreateShaderResourceView( pTexture_t, &srvDesc, &SRV ));

I've chosen to bind this one to my UAV, for now it's simply only writing a white color to it, which works fine ( debugged it ). I set it like this:

devcon->CSSetUnorderedAccessViews(0, 1, &pOUT, 0);

Now I'd imagine that I'd need to unbind it for a simple shader resource to be accessed, like so:

devcon->CSSetShader(NULL,0,0);
devcon->CSSetUnorderedAccessViews(0, 0, NULL, 0); // This one

But, when trying to access/send the SRV which points to the same data to the GPU, the debug layer gives me the following warning (or threat really):

Resource being set to PS shader resource slot 0 is still bound on output! Forcing to NULL

Suggesting that the UAV might still be bound somehow, I think, so the SRV is never sent.

 

What could I have done wrong in this? Do you need anything else?

 

Thank you for your time, as always. 

-MIGI0027


#1Migi0027

Posted 29 January 2014 - 03:44 PM

Hi guys wink.png .

 

I've got my UAV, initialized with the SRV like this:

D3D11_SUBRESOURCE_DATA data;
data.pSysMem = texArray;
data.SysMemPitch = width * type;
//data.SysMemSlicePitch = width * height * type;

// Build the texture header descriptor
D3D11_TEXTURE2D_DESC descTex;
descTex.Width = width;
descTex.Height = height;
descTex.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
descTex.Usage = D3D11_USAGE_DEFAULT;
descTex.BindFlags = D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_UNORDERED_ACCESS | D3D11_BIND_RENDER_TARGET;
descTex.CPUAccessFlags = 0;
descTex.MipLevels = 1;
descTex.ArraySize = 1;
descTex.SampleDesc.Count = 1;
descTex.SampleDesc.Quality = 0;
descTex.MiscFlags = D3D11_RESOURCE_MISC_GENERATE_MIPS;

// Create the 2d texture from data
ID3D11Texture2D * pTexture_t = NULL;
HV( dev->CreateTexture2D( &descTex, &data, &pTexture_t ));

// Create resource view descriptor
D3D11_UNORDERED_ACCESS_VIEW_DESC uavDesc;
uavDesc.Format = descTex.Format;
uavDesc.ViewDimension = D3D11_UAV_DIMENSION_TEXTURE2D;

uavDesc.Texture2D.MipSlice = 0;

// Create the shader resource view
HV( dev->CreateUnorderedAccessView( pTexture_t, &uavDesc, &pTexture ));

// Create resource view descriptor
D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc;
srvDesc.Format = descTex.Format;
srvDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;

srvDesc.Texture2D.MostDetailedMip = 0;
srvDesc.Texture2D.MipLevels = D3D11_RESOURCE_MISC_GENERATE_MIPS;

// Create the shader resource view
HV( dev->CreateShaderResourceView( pTexture_t, &srvDesc, &SRV ));

I've chosen to bind this one to my UAV, for now it's simply only writing a white color to it, which works fine ( debugged it ). I set it like this:

devcon->CSSetUnorderedAccessViews(0, 1, &pOUT, 0);

Now I'd imagine that I'd need to unbind it for a simple shader resource to be accessed, like so:

devcon->CSSetShader(NULL,0,0);
devcon->CSSetUnorderedAccessViews(0, 0, NULL, 0); // This one

But, when trying to access/send the SRV which points to the same data to the GPU, the debug layer gives me the following warning (or threat really):

Resource being set to PS shader resource slot 0 is still bound on output! Forcing to NULL

Suggesting that the UAV might still be bound somehow, I think, so the SRV is never sent.

 

What could I have done wrong in this? Do you need anything else?

 

Thank you for your time, as always. 

-MIGI0027


PARTNERS