m_CameraStencilBufferCopy=newRenderTexture(camera.pixelWidth,camera.pixelHeight,0,RenderTextureFormat.R8,RenderTextureReadWrite.Linear);// DXGI_FORMAT_R8_UINT is not supported by Unity
//m_CameraStencilBufferCopy = CreateRenderTexture(hdCamera, 0, RenderTextureFormat.R8, RenderTextureReadWrite.Linear); // DXGI_FORMAT_R8_UINT is not supported by Unity
// We use 8x8 tiles in order to match the native GCN HTile as closely as possible.
m_HTile=newRenderTexture((camera.pixelWidth+7)/8,(camera.pixelHeight+7)/8,0,RenderTextureFormat.R8,RenderTextureReadWrite.Linear);// DXGI_FORMAT_R8_UINT is not supported by Unity
//var desc = hdCamera.renderTextureDesc;
//desc.width = (desc.width + 7) / 8;
//desc.height = (desc.height + 7) / 8;
//desc.depthBufferBits = 0;
//desc.colorFormat = RenderTextureFormat.R8;
//desc.sRGB = false;
//m_HTile = new RenderTexture((camera.pixelWidth + 7) / 8, (camera.pixelHeight + 7) / 8, 0, RenderTextureFormat.R8, RenderTextureReadWrite.Linear); // DXGI_FORMAT_R8_UINT is not supported by Unity
m_HTile.filterMode=FilterMode.Point;
m_HTile.enableRandomWrite=true;
m_HTile.Create();
}
voidResize(Cameracamera)
voidResize(HDCamerahdCamera)
varcamera=hdCamera.camera;
// TODO: Detect if renderdoc just load and force a resize in this case, as often renderdoc require to realloc resource.
// TODO: This is the wrong way to handle resize/allocation. We can have several different camera here, mean that the loop on camera will allocate and deallocate