Anteru's blog
  • Consulting
  • Research
    • Assisted environment probe placement
    • Assisted texture assignment
    • Error Metrics for Smart Image Refinement
    • High-Quality Shadows for Streaming Terrain Rendering
    • Hybrid Sample-based Surface Rendering
    • Interactive rendering of Giga-Particle Fluid Simulations
    • Quantitative Analysis of Voxel Raytracing Acceleration Structures
    • Real-time Hybrid Hair Rendering
    • Scalable rendering for very large meshes
    • Subpixel Reconstruction Antialiasing
    • Tiled light trees
  • About
  • Archive

Updating a DXTC texture with DX10

April 28, 2009
  • Direct3d
  • Graphics
approximately 1 minutes to read

Updating a texture is usually straightforward: You call map, and mem-copy the stuff over the returned pointer, taking the stride into account. This is not so simple for DXTC though, as the data is organised in 4x4 pixels blocks.

With DX10, you have to copy one row of blocks before adding the row-pitch, even though the documentation states that the pitch is the number of bytes in a block:

RowPitch is the number of bytes in a block of 4x4 texels

This is not true, it’s rather the number of bytes you have to skip after copying one row of blocks. Hope this helps you to save some time, I’ve been scratching my head for two hours yesterday, and I can tell you that even with Pix, debugging DXTC related problems is no fun, because you usually wind up with large randomly-colour texture areas with no clues where the problem appeared.

Previous post
Next post

Recent posts

  • Five years of GPU DB
    Posted on 2020-09-27
  • Enabling SSL in your local network
    Posted on 2020-05-17
  • Goodbye, Bitbucket!
    Posted on 2020-03-19
  • QEMU, KVM and trim
    Posted on 2020-01-26
  • Fixing network after Ubuntu 19.04 to 19.10 upgrade
    Posted on 2019-10-26
  • Older posts

Find me on the web

  • GitHub
  • GPU database
  • Projects

Follow me

NIV_Anteru

Contents © 2005-2021 | Anteru | Imprint/Impressum | Privacy policy/Datenschutz