Direct2D tile bug when size is over 4K?

Michael Chourdakis 66 Reputation points
2021-06-08T20:26:39.67+00:00

This is a follow up from https://stackoverflow.com/questions/67875906/direct2d-tile-limitation?noredirect=1#comment119984097_67875906.

It seems that, when creating custom Direct2D HLSL filters up to 4K resolution the SetRenderingControls work:

   D2D1_RENDERING_CONTROLS r4c = {};  
        m_d2dContext->GetRenderingControls(&r4c);  
        if (r4c.tileSize.width < (UINT32)wi || r4c.tileSize.height < (UINT32)he)  
        {  
            r4c.tileSize.width = wi;  
            r4c.tileSize.height = he;  
            m_d2dContext->SetRenderingControls(r4c);  
            m_d2dContext->GetRenderingControls(&r4c);  
            nop();  
        }  

103497-correct.jpg

This overrides the default 1024x1024 tiling. However this does not work on 8K resolution. It still has tiling and this is a killing for HLSL effects that rely on the entire texture to work, like this lighting.

103526-wrong.jpg

Is this a bug? Is it a limitation of Direct2D ?

Windows development | Windows API - Win32
Developer technologies | C++
{count} votes

Accepted answer
  1. Fei Xue - MSFT 1,111 Reputation points
    2021-07-28T03:03:48.577+00:00

    I would recommend using a bitmap as the input to the effect rather than the image source. Simply drawing the image source into that bitmap should work. They could also create the bitmap from a WIC bitmap source using the D2D API CreateBitmapFromWicBitmap.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.