Jump to content

  • Log In with Google      Sign In   
  • Create Account

steven166

Member Since 22 Nov 2011
Offline Last Active Dec 02 2014 05:15 AM

Posts I've Made

In Topic: Why is a result different with output value in hlsl?

01 December 2014 - 02:34 AM

Thank unbird. You are right. The problem is caused by gamma-correction. The solution is just disable gamma-correction before creating the device (DXUTSetIsInGammaCorrectMode( false )).


In Topic: Cannot save values into fragment using unordered access view buffer

28 March 2014 - 09:49 AM

One more thing that I do not use Compute Shader in this program, is there possible to use UAV without Compute shader?


In Topic: Cannot save values into fragment using unordered access view buffer

28 March 2014 - 06:51 AM

I have already tested with the number of fragments in UAV. I figured out that only a part of UAV is occupied, so that the empty elements have its ID value is 0. However, in the second pass, after saving all fragments into a UAV, I get all fragments belongs to the current pixel as following:

    uint nIndex = (uint)input.pos.y * g_nFrameWidth + (uint)input.pos.x;
    
    uint x = (uint)input.pos.x;
    uint y = (uint)input.pos.y;

    FragmentData aData[ MAX_ELEMENTS ];            
    uint nNumFragment = 0;                         
    uint nNext = StartOffsetSRV.Load(nIndex);

    // early exit if no fragments in the linked list.
    if( nNext == 0xFFFFFFFF )
		return BACKGROUND;

    while( nNext != 0xFFFFFFFF ) 
    {		
        FragmentLink element = FragmentLinkSRV[nNext];		        
        aData[nNumFragment] = element.fragmentData;

	//Test
	int j = nNumFragment;
	while ( (j>0) && (aData[max(j-1, 0)].nDepthAndCoverage > aData[j].nDepthAndCoverage) )
	{
		uint jminusone = max(j-1, 0);
		FragmentData temp = aData[j];
		aData[j] = aData[jminusone];
		aData[jminusone] = temp;
		j--;
	}
	++nNumFragment;

	//check if the next fragment's index is greater than the number of fragments in the UAV
	if (element.nNext >= UAV_Counter)
		return GREEN;

	nNext = element.nNext;
    }

The problem is sometimes the next fragment's index is greater than the number of fragments in the UAV. Is there anybody know the reason? Please, help me. Thanks


In Topic: Problem with mapping a constant buffer resource

18 March 2014 - 05:33 AM

Yes, I am using D3D11_CPU_ACCESS_WRITE for CPUAccessFlags and D3D11_USAGE_DYNAMIC for Usage.


In Topic: Problem with mapping a constant buffer resource

16 March 2014 - 09:39 PM

Samith, thank for the reply. The error message which I get as my program is stopped is "D3D11: Removing Device.

D3D11 ERROR: ID3D11Device::RemoveDevice: Device removal has been triggered for the following reason (DXGI_ERROR_DEVICE_HUNG: The Device took an unreasonable amount of time to execute its commands, or the hardware crashed/hung. As a result, the TDR (Timeout Detection and Recovery) mechanism has been triggered. The current Device Context was executing commands when the hang occurred. The application may want to respawn and fallback to less aggressive use of the display hardware). [ EXECUTION ERROR #378: DEVICE_REMOVAL_PROCESS_AT_FAULT]"

 

Do you know the exact reason?


PARTNERS