Anteru's blog
  • Consulting
  • Research
    • Assisted environment probe placement
    • Assisted texture assignment
    • Edge-Friend: Fast and Deterministic Catmull-Clark Subdivision Surfaces
    • 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
    • Real-Time Procedural Generation with GPU Work Graphs
    • Scalable rendering for very large meshes
    • Spatiotemporal Variance-Guided Filtering for Motion Blur
    • Subpixel Reconstruction Antialiasing
    • Tiled light trees
    • Towards Practical Meshlet Compression
  • 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

  • Data formats: Why CSV and JSON aren't the best
    Posted on 2024-12-29
  • Replacing cron with systemd-timers
    Posted on 2024-04-21
  • Open Source Maintenance
    Posted on 2024-04-02
  • Angular, Caddy, Gunicorn and Django
    Posted on 2023-10-21
  • Effective meetings
    Posted on 2022-09-12
  • Older posts

Find me on the web

  • GitHub
  • GPU database
  • Projects

Follow me

Anteru NIV_Anteru
Contents © 2005-2025
Anteru
Imprint/Impressum
Privacy policy/Datenschutz
Made with Liara
Last updated February 03, 2019