Graphics
Intel® graphics drivers and software, compatibility, troubleshooting, performance, and optimization
22672 Discussions

Slowdown at ID2D1DeviceContext::SetTarget

Evgeny_K_
Beginner
2,113 Views

We found a slowdown (about 10x) at ID2D1DeviceContext::SetTarget. We check it at Intel HD 4600 videocard (driver version is 10.18.14.4264).

  m_pDeviceContext->SetAntialiasMode(D2D1_ANTIALIAS_MODE_ALIASED);
  m_pDeviceContext->SetTextRenderingParams(m_pTextRenderingParams);//DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC
  m_pDeviceContext->BeginDraw();
  m_pDeviceContext->SetTarget(m_pBitmap);
  // there is no draw commands
  m_pDeviceContext->EndDraw();

We have two blocks of code for m_pBitmap creation. The first has normal performance, but the second has slowdown.


1. Create bitmap for a swachain surface

  auto props = D2D1::BitmapProperties1(D2D1_BITMAP_OPTIONS_TARGET | D2D1_BITMAP_OPTIONS_CANNOT_DRAW, D2D1::PixelFormat(format, D2D1_ALPHA_MODE_IGNORE));
  m_pDeviceContext->CreateBitmapFromDxgiSurface(pSurface, props, &m_pBitmap);

2. Create bitmap for a newly created texture

  m_pDevice->CreateTexture2D(&descTexture, NULL, &m_pRenderTexture);
  m_pDevice->CreateRenderTargetView(m_pRenderTexture, NULL, &m_pRTV);
  m_pRenderTexture.QueryInterface(pRenderSurface);
  auto props = D2D1::BitmapProperties1(D2D1_BITMAP_OPTIONS_TARGET | D2D1_BITMAP_OPTIONS_CANNOT_DRAW, D2D1::PixelFormat(format, D2D1_ALPHA_MODE_IGNORE));
  m_pDeviceContext->CreateBitmapFromDxgiSurface(pRenderSurface, props, &m_pBitmap);

There are equal texture descriptions in the both. And NVIDIA and AMD video cards have equal performance in these cases

0 Kudos
6 Replies
Michael_C_Intel2
Employee
2,113 Views

Hi Evengy,

I will take this to the driver team and see what is going on. In order ti help us can you fill complete the template below. We need the info to aid in our investigation.

System Setup Information:
-----------------------------------------

System Used: (Manufacturer/Model)
CPU SKU: (i3, i5, Pentium, Celeron, etc.)
GPU SKU: (HD4400, HD5100, etc.)
Processor Line: (Y-Series, U-Series, etc.)
System BIOS Version:
CMOS settings:
Graphics Driver Version:
GOP/VBIOS Version:
Operating System:
OS Version:
API:
Occurs on non-Intel GPUs?:

Steps to Reproduce:
-------------------------------
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.

Expected Results:
-------------------------------

Actual Results:
-------------------------------

Additional Information:
-------------------------------

0 Kudos
Evgeny_K_
Beginner
2,113 Views

System Setup Information:
-----------------------------------------

System Used: Gigabyte Technology Co. Ltd. H81M-S2PV
CPU SKU: i5
GPU SKU: HD4600
Processor Line:
System BIOS Version: American Megatrends Inc. F4, 14.08.2013
CMOS settings: default
Graphics Driver Version:  10.18.14.4264
GOP/VBIOS Version:
Operating System: Windows 7 X64
OS Version: 6.1.7601 Service Pack 1
API: Direct2D 1.1 + Direct3D11
Occurs on non-Intel GPUs?: no

Steps to Reproduce:
-------------------------------

1. Create 2d texture

desc.Width = width;
desc.Height = height;
desc.MipLevels = 1;
desc.ArraySize = 1;
desc.Format = DXGI_FORMAT_B8G8R8A8_UNORM;
desc.Usage = D3D11_USAGE_DEFAULT;
desc.BindFlags = D3D11_BIND_RENDER_TARGET;
desc.CPUAccessFlags = 0;
desc.MiscFlags = 0;
desc.SampleDesc.Count = 1;
desc.SampleDesc.Quality = 0;

2. Create ID2D1Bitmap1

m_pDevice->CreateTexture2D(&descTexture, NULL, &m_pRenderTexture);
m_pDevice->CreateRenderTargetView(m_pRenderTexture, NULL, &m_pRTV);
m_pRenderTexture.QueryInterface(pRenderSurface);
auto props = D2D1::BitmapProperties1(D2D1_BITMAP_OPTIONS_TARGET | D2D1_BITMAP_OPTIONS_CANNOT_DRAW, D2D1::PixelFormat(format, D2D1_ALPHA_MODE_IGNORE));
m_pDeviceContext->CreateBitmapFromDxgiSurface(pRenderSurface, props, &m_pBitmap);

3. ID2D1DeviceContext::SetTarget

m_pDeviceContext->SetAntialiasMode(D2D1_ANTIALIAS_MODE_ALIASED);
m_pDeviceContext->SetTextRenderingParams(m_pTextRenderingParams);//DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC
m_pDeviceContext->BeginDraw();
m_pDeviceContext->SetTarget(m_pBitmap);
m_pDeviceContext->EndDraw();

Additional Information:
-------------------------------

There is slowdown. But performance is ok if we use ID2D1Bitmap1 attached to IDXGSwapchain.

0 Kudos
Michael_C_Intel2
Employee
2,113 Views

Thanks Evgeny,

I have filed a ticket and am working with our driver team to get this investigated.

-Michael

0 Kudos
Evgeny_K_
Beginner
2,113 Views

Thanks. I'm waiting your response.

0 Kudos
Evgeny_K_
Beginner
2,113 Views

Could you inform how long to wait for an answer to my ticket?

0 Kudos
Michael_C_Intel2
Employee
2,113 Views

Hi Evgeny,

I do not have a time estimate yet. The performance team has a lot of issues to look at right now, including this one. Performance issues are complex and take time to properly investigate.I hope to have an update this week.

-Michael

0 Kudos
Reply