DirectXTex
Copilot instructions2.2k starsChanged 4 months agoMITView on GitHub
These instructions define how GitHub Copilot should assist with this project. The goal is to ensure consistent, high-quality code generation aligned with our conventions, stack, and best practices. - Code Style: The project uses an .editorconfig file to enforce coding standards. Follow the rules defined in .editorconfig for indentation, line endings, and other formatting. Additional information can be found on the wiki at Implementation. The library's public API requires C++11, and the project builds with C++17 (CMAKE_CXX_STANDARD 17). The command-line…
Trending
Quiet since August.about the whole repository
Who's talking about microsoft/DirectXTex
- woelper/oculante“DDS BC7, cubemaps, volume maps, or texture arrays”GitHub · Mar 6, 2023 · 3 reactions
- aleko2144/KoTR_Modern_Patch“D2GI: Taking screenshots leaks a lot of resources”GitHub · Jan 4, 2026 · 1 reactions
- FlaxEngine/FlaxEngine“Add options to reconstruct z channel for textures.”GitHub · Oct 4, 2024 · 1 reactions
- RimSort/RimSort“Implement texture compression/conversion utilities”GitHub · Feb 21, 2023 · 1 reactions
- vrm-c/vrm-specification“テクスチャ圧縮の検討について”GitHub · Dec 4, 2019 · 1 reactions
The biggest 5 of 30 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 30
Talked about on GitHub (30 times).
On GitHub · 30
- Mar 6, 2023DDS BC7, cubemaps, volume maps, or texture arrays — woelper/oculante3 reactions · 7 comments
- Jan 4, 2026D2GI: Taking screenshots leaks a lot of resources — aleko2144/KoTR_Modern_Patch1 reaction · 10 comments
- Oct 4, 2024Add options to reconstruct z channel for textures. — FlaxEngine/FlaxEngine1 reaction
- Feb 21, 2023Implement texture compression/conversion utilities — RimSort/RimSort1 reaction · 3 comments
- Dec 4, 2019テクスチャ圧縮の検討について — vrm-c/vrm-specification1 reaction · 6 comments
25 more on GitHub
- Aug 30, 2016Resized .dds Texture (BCn format) With Alpha Shows Corrupted Edges — GameTechDev/Intel-Texture-Works-Plugin1 reaction
- Aug 5, 2026Bump deps/DirectXTex from `f06dd7e` to `cd6e576` — Joelrau/x64-zt0 reactions
- Apr 28, 2025FL_IMAGE_PACKER — Facta-Leopard/FL_IMAGE_PACKER0 reactions
- Nov 19, 2024Bump deps/DirectXTex from `e102d0b` to `d095bec` — Antiwoll/mwr0 reactions
- Jun 7, 2024Reading and decoding image files with DirectXTex — dejan-xd/Game_Engine_MBRS0 reactions
- Apr 28, 2023Bump directxtex_desktop_win10 from 2021.1.10.2 to 2023.1.31.1 in /Samples/Desktop/D3D12Raytracing/src/D3D12RaytracingMiniEngineSample — sarvex/DirectxGraphicsSamples0 reactions
- Apr 28, 2023Bump directxtex_desktop_win10 from 2019.2.7.1 to 2023.1.31.1 in /MiniEngine/ModelConverter — sarvex/DirectxGraphicsSamples0 reactions
- Apr 28, 2023Bump directxtex_uwp from 2018.8.5.1 to 2023.1.31.1 in /glTF-Toolkit.UWP — sarvex/glTF-Toolkit0 reactions
- Apr 28, 2023Bump directxtex_desktop_win10 from 2021.1.10.2 to 2023.1.31.1 in /MiniEngine/ModelViewer — sarvex/DirectxGraphicsSamples0 reactions
- Feb 17, 2023Bump deps/DirectXTex from `679538e` to `0f77045` — alicealys/h2-zonetool0 reactions
- Feb 1, 2023Bump directxtex_desktop_win10 from 2021.1.10.2 to 2023.1.31.1 in /MiniEngine/ModelViewer — NOUIY/DirectX-Graphics-Samples0 reactions
- Feb 1, 2023Bump directxtex_desktop_win10 from 2019.8.23.1 to 2023.1.31.1 in /Engine — DznEggs4Keira/Engine5020 reactions
- Feb 1, 2023Bump directxtex_desktop_win10 from 2021.1.10.2 to 2023.1.31.1 in /MiniEngine/ModelViewer — bl1mp/DirectX-Graphics-Samples0 reactions
- Feb 1, 2023Bump directxtex_desktop_win10 from 2019.2.7.1 to 2023.1.31.1 in /MiniEngine/ModelConverter — NOUIY/DirectX-Graphics-Samples0 reactions
- Feb 1, 2023Bump directxtex_desktop_win10 from 2019.2.7.1 to 2023.1.31.1 in /MiniEngine/ModelConverter — bl1mp/DirectX-Graphics-Samples0 reactions
- Feb 1, 2023Bump directxtex_desktop_win10 from 2019.8.23.1 to 2023.1.31.1 in /EpionNodeShaderTool — 13treize/EpionNodeEditorProject0 reactions
- Feb 1, 2023Bump directxtex_desktop_win10 from 2019.8.23.1 to 2023.1.31.1 in /NodeDataLib — 13treize/EpionNodeEditorProject0 reactions
- Feb 1, 2023Bump directxtex_desktop_win10 from 2019.8.23.1 to 2023.1.31.1 in /AliceGames/AliceLibrary — kaosu7201/AliceGames0 reactions
- Feb 1, 2023Bump directxtex_desktop_win10 from 2020.9.30.1 to 2023.1.31.1 — 13treize/Epion-Graphics0 reactions
- Feb 1, 2023Bump directxtex_desktop_win10 from 2018.11.20.1 to 2023.1.31.1 in /ElixirEngine — nitvic793/dx12-engine-elixir0 reactions
- Feb 1, 2023Bump directxtex_uwp from 2022.12.18.1 to 2023.1.31.1 in /UnitTests — 13thsymphony/HDRImageViewer0 reactions
- Feb 1, 2023Bump directxtex_uwp from 2022.12.18.1 to 2023.1.31.1 in /DXRenderer — 13thsymphony/HDRImageViewer0 reactions
- Oct 14, 2021[PROPOSAL] Add bindings for DirectXTex — terrafx/terrafx.interop.windows0 reactions
- Oct 16, 2020[REQ] Allow importing of BC7 .dds textures — monkeyman192/NMSDK0 reactions
- Apr 12, 2019Roundtrip Texture Files — kk49/deca0 reactions · 5 comments
In this repository4 other files it gives its agents.
- Release ProcessSkill
- directxtex-usageSkill
- texture-assemblerSkill
- texture-converterSkill
The file
Show its rules and text
We split this copilot-instructions.md into the rules it gives an agent
38 rules. About 0 are common, 24 are distinctive, and 14 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈24
Distinctive · estimate
This author's own choices. Worth a look.
14
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 25
Error Handling: Use C++ exceptions for error handling and uses RAII smart pointers to ensure resources are properly managed.
- Distinctive: line 61
Use RAII for all resource ownership (memory, file handles, etc.).
- Very specific: line 63
Use std::unique_ptr for exclusive ownership.
- Very specific: line 64
Use Microsoft::WRL::ComPtr for COM object management.
- Very specific: line 69
Use 16-byte alignment (_aligned_malloc / _aligned_free) to support SIMD operations in the implementation, but do not expose this …
- Very specific: line 71
All implementation .cpp files include DirectXTexP.h as their first include (precompiled header).
- Very specific: line 75
All public API functions must use SAL annotations on every parameter.
- Very specific: line 109
All public functions use __cdecl explicitly for ABI stability.
- Very specific: line 110
All public function declarations are prefixed with DIRECTX_TEX_API, which wraps __declspec(dllexport) / __declspec(dllimport) (or the MinGW …
- Very specific: line 114
All query and utility functions that cannot fail (e.g., IsCompressed, IsCubemap, ComputePitch) are marked noexcept.
- Very specific: line 115
All HRESULT-returning I/O and processing functions are also noexcept — errors are communicated via return code, never via exceptions.
- Very specific: line 140
Avoid macros for constants—prefer constexpr or inline const.
- Very specific: line 141
Don't put implementation logic in header files unless using templates, although the DirectXTex library does use an .inl file for …
- Very specific: line 142
Avoid using using namespace in header files to prevent polluting the global namespace.
- Very specific: line 158
Every source file (.cpp, .h, .hlsl, etc.) must begin with this block:
- Very specific: line 185
Use CompileShaders.cmd in DirectXTex/Shaders/ to regenerate the .inc files.
- Distinctive: line 206
Only document features, patterns, and decisions that are explicitly present in the source code.
- Distinctive: line 207
Only include configurations and requirements that are clearly specified.
- Distinctive: line 208
Do not make assumptions about implementation details.
- Distinctive: line 212
Ask the user questions to gather missing information.
- Distinctive: line 213
Document gaps in current implementation or specifications.
- Distinctive: line 218
Always cite the specific source file and line numbers for documented features.
- Distinctive: line 225
Remove any speculative content.
- Distinctive: line 226
Ensure all documentation is verifiable against the current state of the codebase.
- Distinctive: line 238
Use these established guards — do not invent new ones:
- Distinctive: line 276
When reviewing code, focus on the following aspects:
- Distinctive: line 290
Ensure that all public functions and classes are covered by unit tests located on GitHub where applicable.
- Distinctive: line 291
Check for performance implications, especially in texture processing algorithms.
- Distinctive: line 296
When reviewing documentation, do the following:
- Distinctive: line 298
Read the code located in this git repository in the main branch.
- Distinctive: line 300
Read the documentation on the wiki located in this git repository.
- Distinctive: line 306
Don't fix pre-existing issues unrelated to your task.
- Distinctive: line 307
Update documentation if it is directly related to the changes you are making.
- Distinctive: line 308
Always validate that your changes don't break existing behavior.
- Distinctive: line 312
Only run linters, builds and tests that already exist.
- Distinctive: line 313
Use the smallest targeted test, build, or lint command that covers the changed behavior.
- Distinctive: line 318
Prefer ecosystem tools (package managers, scaffolding, refactoring tools, linters) over manual changes.
- Distinctive: line 323
Only comment code that needs a bit of clarification.
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
GitHub Copilot Instructions
These instructions define how GitHub Copilot should assist with this project. The goal is to ensure consistent, high-quality code generation aligned with our conventions, stack, and best practices.
Context
- Project Type: Graphics Library / DirectX / Direct3D 11 / Direct3D 12 / Image Processing
- Project Name: DirectXTex Texture Processing Library
- Language: C++
- Framework / Libraries: STL / CMake / CTest
- Architecture: Modular / RAII / OOP
Getting Started
- See the tutorial at Getting Started.
- The recommended way to integrate DirectXTex into your project is by using the vcpkg Package Manager.
- You can make use of the nuget.org packages directxtex_desktop_win10, or directxtex_uwp.
- You can also use the library source code directly in your project or as a git submodule.
General Guidelines
- Code Style: The project uses an .editorconfig file to enforce coding standards. Follow the rules defined in
.editorconfigfor indentation, line endings, and other formatting. Additional information can be found on the wiki at Implementation. The library's public API requires C++11, and the project builds with C++17 (CMAKE_CXX_STANDARD 17). The command-line tools also use C++17, including<filesystem>for long file path support. This code is designed to build with Visual Studio 2022, Visual Studio 2026, clang for Windows v12 or later, MinGW, and GCC on Linux.
Notable
.editorconfigrules: C/C++ and HLSL files use 4-space indentation,crlfline endings, andlatin1charset — avoid non-ASCII characters in source files. HLSL files have separate indent/spacing rules defined in.editorconfig.
- Documentation: The project provides documentation in the form of wiki pages available at Documentation.
- Error Handling: Use C++ exceptions for error handling and uses RAII smart pointers to ensure resources are properly managed. For some functions that return HRESULT error codes, they are marked
noexcept, usestd::nothrowfor memory allocation, and should not throw exceptions. - Testing: Unit tests for this project are implemented in this repository Test Suite and can be run using CTest per the instructions at Test Documentation. See test copilot instructions for additional information on the tests.
- Security: This project uses secure coding practices from the Microsoft Secure Coding Guidelines, and is subject to the
SECURITY.mdfile in the root of the repository. Functions that read input from image files are subject to OneFuzz fuzz testing to ensure they are secure against malformed files. - Dependencies: The project uses CMake and VCPKG for managing dependencies, making optional use of DirectXMath and DirectX-Headers. The project can be built without these dependencies, relying on the Windows SDK for core functionality.
- Continuous Integration: This project implements GitHub Actions for continuous integration, ensuring that all code changes are tested and validated before merging. Platforms tested include Windows (MSVC, clang-cl, MinGW), Windows on ARM64, Xbox, UWP, WSL (Linux with GCC), and macOS (Apple Clang). This includes building the project for a number of configurations and toolsets, running a subset of unit tests, and static code analysis including GitHub super-linter, CodeQL, and MSVC Code Analysis.
- Code of Conduct: The project adheres to the Microsoft Open Source Code of Conduct. All contributors are expected to follow this code of conduct in all interactions related to the project.
File Structure
.azuredevops/ # Azure DevOps pipeline configuration and policy files.
.github/ # GitHub Actions workflow files and linter configuration files.
.nuget/ # NuGet package configuration files.
build/ # Miscellaneous build files and scripts.
Auxiliary/ # Auxiliary functions such as Xbox tiling extensions, OpenEXR support, etc.
Common/ # Common utility functions shared between the library and command-line tools.
DirectXTex/ # DirectXTex implementation files.
Shaders/ # HLSL shader files.
DDSView/ # Sample application for viewing DDS texture files using DirectXTex.
Texassemble/ # CLI tool for creating complex DDS files from multiple image files.
Texconv/ # CLI tool for converting image files to DDS texture files including block compression, mipmaps, and resizing.
Texdiag/ # CLI tool for diagnosing and validating DDS texture files.
DDSTextureLoader/ # Standalone version of the DDS texture loader for Direct3D 9/11/12.
ScreenGrab/ # Standalone version of the screenshot capture utility for Direct3D 9/11/12.
WICTextureLoader/ # Standalone version of the WIC texture loader for Direct3D 9/11/12.
skills/ # Published CoPilot skills for use by developers.
Tests/ # Tests are designed to be cloned from a separate repository at this location.
wiki/ # Local clone of the GitHub wiki documentation repository.Note that DDSTextureLoader, ScreenGrab, and WICTextureLoader are standalone version of utilities which are also included in the DirectX Tool Kit for DirectX 11 and DirectX Tool Kit for DirectX 12.
Patterns
Patterns to Follow
- Use RAII for all resource ownership (memory, file handles, etc.).
- Many classes utilize the pImpl idiom to hide implementation details, and to enable optimized memory alignment in the implementation.
- Use
std::unique_ptrfor exclusive ownership. - Use
Microsoft::WRL::ComPtrfor COM object management. - Make use of anonymous namespaces to limit scope of functions and variables.
- Make use of
assertfor debugging checks, but be sure to validate input parameters in release builds. - Explicitly
= deletecopy constructors and copy-assignment operators on all classes that use the pImpl idiom. - Explicitly utilize
= defaultor=deletefor copy constructors, assignment operators, move constructors and move-assignment operators where appropriate. - Use 16-byte alignment (
_aligned_malloc/_aligned_free) to support SIMD operations in the implementation, but do not expose this requirement in public APIs.
For non-Windows support, the implementation uses C++17
aligned_allocinstead of_aligned_malloc.
- All implementation
.cppfiles includeDirectXTexP.has their first include (precompiled header). MinGW builds skip precompiled headers.
SAL Annotations
All public API functions must use SAL annotations on every parameter. Use _Use_decl_annotations_ at the top of each implementation that has SAL in the header declaration — never repeat the annotations in the .cpp or .inl file.
Common annotations:
| Annotation | Meaning |
_In_ | Input parameter |
_Out_ | Output parameter |
_Inout_ | Bidirectional parameter |
_In_reads_bytes_(n) | Input buffer with byte count |
_In_reads_(n) | Input array with element count |
_In_z_ | Null-terminated input string |
_Out_opt_ | Optional output parameter |
Example:
// Header (DirectXTex.h)
DIRECTX_TEX_API HRESULT __cdecl GetMetadataFromDDSMemory(
_In_reads_bytes_(size) const uint8_t* pSource, _In_ size_t size,
_In_ DDS_FLAGS flags,
_Out_ TexMetadata& metadata) noexcept;
// Implementation (.cpp)
_Use_decl_annotations_
HRESULT __cdecl GetMetadataFromDDSMemory(
const uint8_t* pSource, size_t size,
DDS_FLAGS flags,
TexMetadata& metadata) noexcept
{ ... }Calling Convention and DLL Export
- All public functions use
__cdeclexplicitly for ABI stability. - All public function declarations are prefixed with
DIRECTX_TEX_API, which wraps__declspec(dllexport)/__declspec(dllimport)(or the MinGW__attribute__equivalent) when theDIRECTX_TEX_EXPORTorDIRECTX_TEX_IMPORTpreprocessor symbols are defined. CMake sets these automatically whenBUILD_SHARED_LIBS=ON.
noexcept Rules
- All query and utility functions that cannot fail (e.g.,
IsCompressed,IsCubemap,ComputePitch) are markednoexcept. - All HRESULT-returning I/O and processing functions are also
noexcept— errors are communicated via return code, never via exceptions.
Note that HRESULT-returning functions that use
std::functionare not markednoexceptbecause the user-provided function could throw.
Enum Flags Pattern
Flags enums follow this pattern — a uint32_t-based unscoped enum with a _NONE = 0 or _DEFAULT = 0 base case, followed by a call to DEFINE_ENUM_FLAG_OPERATORS (invoked in DirectXTex.inl) to enable |, &, and ~ operators:
enum TEX_FILTER_FLAGS : uint32_t
{
TEX_FILTER_DEFAULT = 0,
TEX_FILTER_WRAP_U = 0x1,
// Enables wrapping addressing on U coordinate
...
};
DEFINE_ENUM_FLAG_OPERATORS(TEX_FILTER_FLAGS);See this blog post for more information on this pattern.
Patterns to Avoid
- Don’t use raw pointers for ownership.
- Avoid macros for constants—prefer
constexprorinlineconst. - Don't put implementation logic in header files unless using templates, although the DirectXTex library does use an .inl file for performance for a few specific utility functions that are called in tight loops (e.g.,
IsValid,IsCompressed). - Avoid using
using namespacein header files to prevent polluting the global namespace.
Naming Conventions
| Element | Convention | Example |
| Classes / structs | PascalCase | ScratchImage, TexMetadata |
| Public functions | PascalCase + __cdecl | ComputePitch, IsCompressed |
| Private data members | m_ prefix | m_nimages, m_metadata |
| Enum type names | UPPER_SNAKE_CASE | TEX_DIMENSION, CP_FLAGS |
| Enum values | UPPER_SNAKE_CASE | CP_FLAGS_NONE, TEX_ALPHA_MODE_PREMULTIPLIED |
| Flag enum suffix | _FLAGS with _NONE = 0 or _DEFAULT = 0 base | DDS_FLAGS, WIC_FLAGS |
| Files | PascalCase | DirectXTex.h, BC6HEncode.hlsl |
File Header Convention
Every source file (.cpp, .h, .hlsl, etc.) must begin with this block:
//-------------------------------------------------------------------------------------
// {FileName}
//
// {One-line description}
//
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//
// https://go.microsoft.com/fwlink/?LinkId=248926
//-------------------------------------------------------------------------------------Section separators within files use:
- Major sections:
//------------------------------------------------------------------------------------- - Subsections:
//---------------------------------------------------------------------------------
The project does not use Doxygen. API documentation is maintained exclusively on the GitHub wiki.
HLSL Shader Compilation
Shaders in DirectXTex/Shaders/ are compiled with FXC (not DXC), producing embedded C++ header files (.inc):
- Each shader is compiled twice:
cs_5_0(primary) andcs_4_0with/DEMULATE_F16C(legacy fallback). - Standard compiler flags:
/nologo /WX /Ges /Zi /Zpc /Qstrip_reflect /Qstrip_debug - Use
CompileShaders.cmdinDirectXTex/Shaders/to regenerate the.incfiles. - The CMake option
USE_PREBUILT_SHADERScontrols whether pre-compiled shaders are used.
References
- Source git repository on GitHub
- DirectXTex documentation git repository on GitHub
- DirectXTex test suite git repository on GitHub.
- C++ Core Guidelines
- Microsoft Secure Coding Guidelines
- CMake Documentation
- VCPKG Documentation
- Games for Windows and the DirectX SDK blog - October 2021
- Games for Windows and the DirectX SDK blog - April 2025
No speculation
When creating documentation:
Document Only What Exists
- Only document features, patterns, and decisions that are explicitly present in the source code.
- Only include configurations and requirements that are clearly specified.
- Do not make assumptions about implementation details.
Handle Missing Information
- Ask the user questions to gather missing information.
- Document gaps in current implementation or specifications.
- List open questions that need to be addressed.
Source Material
- Always cite the specific source file and line numbers for documented features.
- Link directly to relevant source code when possible.
- Indicate when information comes from requirements vs. implementation.
Verification Process
- Review each documented item against source code whenever related to the task.
- Remove any speculative content.
- Ensure all documentation is verifiable against the current state of the codebase.
Cross-platform Support Notes
- The code targets Win32 desktop applications for Windows 8.1 or later, Xbox One, Xbox Series X|S, Universal Windows Platform (UWP) apps for Windows 10 and Windows 11, and Windows Subsystem for Linux (WSL).
- macOS is not officially supported due to a lack of support for Direct3D, which is reflected in the fact that the directx-headers VCPKG port is not supported for macOS.
- Portability and conformance of the code is validated by building with Visual C++ (MSVC), clang/LLVM for Windows (clang-cl), MinGW, GCC for Linux, and Apple Clang for macOS.
- The project ships MSBuild projects for Visual Studio 2022 (
.sln/.vcxproj) and Visual Studio 2026 (.slnx/.vcxproj). VS 2019 projects have been retired. - CMake is the primary build system and can be used on all supported platforms.
Platform and Compiler #ifdef Guards
Use these established guards — do not invent new ones:
| Guard | Purpose |
_WIN32 | Windows platform (desktop, UWP, Xbox) |
_GAMING_XBOX | Xbox platform (GDK - covers both Xbox One and Xbox Series X|S) |
_GAMING_XBOX_SCARLETT | Xbox Series X|S (GDK with Xbox Extensions) |
_GAMING_XBOX_XBOXONE | Xbox One (GDK with Xbox Extensions) |
_XBOX_ONE && _TITLE | Legacy Xbox One XDK |
_MSC_VER | MSVC-specific (and MSVC-like clang-cl) pragmas and warning suppression |
__clang__ | Clang/LLVM diagnostic suppressions |
__MINGW32__ | MinGW compatibility headers |
__GNUC__ | MinGW/GCC DLL attribute equivalents |
_M_ARM64 / _M_X64 / _M_IX86 | Architecture-specific code paths for MSVC (#ifdef) |
_M_ARM64EC | ARM64EC ABI (ARM64 code with x64 interop) for MSVC |
__aarch64__ / __x86_64__ / __i386__ | Additional architecture-specific symbols for MinGW/GNUC (#if) |
USING_DIRECTX_HEADERS | External DirectX-Headers package in use |
_M_ARM/__arm__is legacy 32-bit ARM which is deprecated.
Non-Windows builds (Linux/WSL/macOS) omit WIC entirely and use <directx/dxgiformat.h> and <wsl/winadapter.h> from the DirectX-Headers package instead of the Windows SDK.
Error Codes
The following symbols are not custom error codes, but aliases for HRESULT_FROM_WIN32 error codes.
| Symbol | Standard Win32 HRESULT |
HRESULT_ERROR_FILE_NOT_FOUND | HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) |
HRESULT_E_ARITHMETIC_OVERFLOW | HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW) |
HRESULT_E_NOT_SUPPORTED | HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED) |
HRESULT_E_HANDLE_EOF | HRESULT_FROM_WIN32(ERROR_HANDLE_EOF) |
HRESULT_E_INVALID_DATA | HRESULT_FROM_WIN32(ERROR_INVALID_DATA) |
HRESULT_E_FILE_TOO_LARGE | HRESULT_FROM_WIN32(ERROR_FILE_TOO_LARGE) |
HRESULT_E_CANNOT_MAKE | HRESULT_FROM_WIN32(ERROR_CANNOT_MAKE) |
Code Review Instructions
When reviewing code, focus on the following aspects:
- Adherence to coding standards defined in
.editorconfigand on the wiki. - Make coding recommendations based on the C++ Core Guidelines.
- Proper use of RAII and smart pointers.
- Correct error handling practices and C++ Exception safety.
- Clarity and maintainability of the code.
- Adequate comments where necessary.
- Public interfaces located in
DirectXTex.hshould be clearly defined and documented on the GitHub wiki. - Optional functions are located in
DirectXTexEXR.h,DirectXTexJPEG.h,DirectXTexPNG.h, andDirectXTexXbox.hin theAuxiliaryfolder. - Standalone modules for loading textures from DDS Files are located in
DDSTextureLoader9.h,DDSTextureLoader11.h, andDDSTextureLoader12.hin theDDSTextureLoaderfolder. - Standalone modules for loading textures using WIC are located in
WICTextureLoader9.h,WICTextureLoader11.h, andWICTextureLoader12.hin theWICTextureLoaderfolder. - Standalone modules for capturing screenshots are located in
ScreenGrab9.h,ScreenGrab11.h, andScreenGrab12.hin theScreenGrabfolder. - Compliance with the project's architecture and design patterns.
- Ensure that all public functions and classes are covered by unit tests located on GitHub where applicable. Report any gaps in test coverage.
- Check for performance implications, especially in texture processing algorithms.
- Provide brutally honest feedback on code quality, design, and potential improvements as needed.
Documentation Review Instructions
When reviewing documentation, do the following:
- Read the code located in this git repository in the main branch.
- Review the public interface defined in
DirectXTex.h. - Read the documentation on the wiki located in this git repository.
- Report any specific gaps in the documentation compared to the public interface.
Code Change Rules
- Make precise, surgical changes that fully address the request. Don't modify unrelated code, but ensure changes are complete and correct.
- Don't fix pre-existing issues unrelated to your task. However, if you discover bugs directly caused by or tightly coupled to the code you're changing, fix those too.
- Update documentation if it is directly related to the changes you are making.
- Always validate that your changes don't break existing behavior.
Linting, Building, Testing
- Only run linters, builds and tests that already exist. Do not add new linting, building or testing tools unless necessary for the task.
- Use the smallest targeted test, build, or lint command that covers the changed behavior. When related targeted selectors use the same runner, include them in one invocation; escalate to full-suite or baseline runs only when targeted validation shows they are needed.
- Documentation changes do not need to be linted, built or tested unless there are specific tests for documentation.
Using Ecosystem Tools
- Prefer ecosystem tools (package managers, scaffolding, refactoring tools, linters) over manual changes.
- Install packages only when changing dependencies or after a missing-dependency failure.
Code Commenting Style
- Only comment code that needs a bit of clarification. Do not comment otherwise.
Release Process
The release process is documented in the release skill. Invoke the release skill for step-by-step guidance when performing a release.
The release workflow includes:
- Preparing release branch with version updates in
CMakeLists.txt,README.md, and.nuspecfiles - Tagging releases with verified GPG signatures
- Creating GitHub releases with release notes from
CHANGELOG.md - Publishing to MSCodeHub mirror, Azure DevOps signed binaries, and NuGet packages
- Source archive signing with minisign
- NuGet package validation and publishing to nuget.org
CoPilot Skills
The project includes published CoPilot skills for developers:
- Release-Process: Guide for performing the DirectXTex release process. Invoked when asked to help with releasing a new version, publishing packages, or updating ports. See Release Process skill for details.
- directxtex-usage: Provides usage guidance for the DirectXTex library. Located in the
skills/directxtex-usage/directory. - texture-assembler: Provides guidance for using the texassemble command-line tool. Located in the
skills/texture-assembler/directory. - texture-converter: Provides guidance for using the texconv command-line tool. Located in the
skills/texture-converter/directory.
To use these skills in the Copilot CLI:
/skills list
/skills search directxtexDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

