# DX12HelloTexture **Repository Path**: tisandman/dx12-hello-texture ## Basic Information - **Project Name**: DX12HelloTexture - **Description**: 测试D3D12和D3D11共享texture2D资源 - **Primary Language**: C++ - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2023-04-13 - **Last Updated**: 2024-08-05 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # DX12HelloTexture #### Description 测试D3D12和D3D11共享texture2D资源, 软件基于微软官方DX12的例子 https://github.com/microsoft/DirectX-Graphics-Samples/tree/master/Samples/Desktop/D3D12HelloWorld/src/HelloTexture 修改。原始代码创建了一个DX12的纹理资源,并且贴在了一个三角形上并显示;本例程将这个DX12的纹理资源共享给了另外一个DX11的Texture2D对象,并且用DX11的API直接修改了这个DX12纹理的像素。整个共享过程操作均在GPU显存内直接操作,省去了不同框架间拷出->修改->拷回的过程 共享的流程参考 https://learn.microsoft.com/en-us/windows/win32/direct3darticles/surface-sharing-between-windows-graphics-apis 和 https://stackoverflow.com/questions/52869111/sharing-id3d11buffer-and-id3d12resource。 所有的改动在D3D12HelloTexture.cpp里,可以从github拖一个微软原始版本用代码比较工具对照着看 #### 使用说明 Instructions 1. 最好用VS2019来编译,因为VS2017在有些机器上默认安装的Windows SDK的版本过低,不包含DX12的库 2. Windows SDK版本需要高于19041, 否则编译会报"error C2504: 'D3D12_RESOURCE_DESC1':"。 建议用win11或者比较新的Win10版本,https://stackoverflow.com/questions/65294611/d3dx12-h-gives-a-bunch-of-errors 3. 其他编译方法参考微软官方github的教程 #### Contribution 1. Fork the repository 2. Create Feat_xxx branch 3. Commit your code 4. Create Pull Request