Jump to content
  • Advertisement
w359405949

DX11 sample code to use tiled resource technology in d3d11.2?

Recommended Posts

 

i got a strange result in calling UpdateTileMapping and UpdateTiles every frame like this which as same as the Mars Tiled Resource Sample do:

void CalledEveryFrame()
{
    vector<D3D11_TILED_RESOURCE_COORDINATE> coordinates; // 4 diffrent coordinates
    vector<D3D11_TIL_REGION_SIZE> regions; // 4 as same. but only set the NumTiles=1
    vector<UINT> offsets(4, 0);
    vector<UINT> rangeFlags(4, 0);
    vector<UINT> rangeTileCounts(4, 1);

    deviceContext->UpdateTileMappings(myMiscTexture, 4, coordinates.data(), 
        regions.data(), myMiscBuffer, 4, rangFlags.data(), offsets.data(). 
        rangeTileCounts.data(), D3D11_TILE_MAPPING_NO_OVERWRITE);

    map<int, vector<float>> myTileData; // 4 with different data.
    for (int index = 0; index < coordinates.size(); index++)
    {
         D3D11_TILED_RESOURCE_COORDINATE coord = coordinate[index];
         D3D11_TILE_REGION_SIZE region = regions[index];
         deviceContext->UpdateTiles(myMiscTexture, &coord, &region, myTileData[index].data(), D3D11_TILE_COPY_NO_OVERWRITE);
    }
}

i alway got 4 same TileData show in different coordinate.

if i copy the code above with another 4 coordinate like this:

void CalledEveryFrame()
{
    UpdateTileMappings(coordinates);
    for(coordinates)        
    {
        UpdateTiles(TileData);
    }

    UpdateTileMappings(coordinates2);
    for(coordinates2)
    {
        UpdateTiles(TileData2);
    }
}

i alway got 8 same TileData showing, why?

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!