0

我正在开发一个集成 WPF 和 DirectX 的应用程序。我的目标是拥有一个共享表面,用于:

  1. 加载初始图像数据。
  2. 运行 DirectX 11 Compute Shaders 进行一些图像处理。
  3. 使用 Direct2D 在顶部绘图。
  4. 在我的 WPF 应用程序中显示结果。

我想我已经弄清楚了 1、3 和 4,但是 2 让我很头疼。我的基本问题归结为:我认为共享表面格式必须B8G8R8A8_UNorm用于 WPF 和 Direct2D 互操作,但我无法在该类型的纹理上为我的计算着色器创建无序访问视图。

我该怎么做才能让计算着色器在这种情况下工作?我是否错过了一些创建无人机的棘手方法?我是否需要重组我的应用程序以某种方式使用多个纹理?

4

1 回答 1

0

This is not possible given the limited format support of these DirectX features and WPF interop (using D3D9Image).

One way to achieve interop between all these features is to do almost everything in R8G8B8A8_UNorm, then at the very end use Direct2D to write the result to a B8G8R8A8_UNorm render target that is used for interop with WPF. Direct2D can write the RGB result to a BGR target so it's quite simple.

于 2013-04-08T15:07:06.623 回答