0
\$\begingroup\$

I have 2 textures in 2 different ShaderResourceViews. What's the fastest/least expensive way to merge them into one? I would use CopySubresourceRegion but copying a texture is quite a bit expensive. I'm using DirectXTex toolkit for loading textures.

\$\endgroup\$
5
  • \$\begingroup\$ Have you actually measured performance of the copy call? You say it's expensive, but what are you comparing it to? \$\endgroup\$
    – MooseBoys
    Feb 2, 2015 at 22:23
  • \$\begingroup\$ @MooseBoys It's expensive for sure. I have 500 textures to merge \$\endgroup\$
    – Quest
    Feb 3, 2015 at 19:05
  • \$\begingroup\$ How expensive? I wouldn't expect copying 500 textures to take more than 100ms even on the slowest GPUs. It should be way faster than the time it takes to get them to the GPU in the first place. Of course I assume you're doing this once at load time, not per-frame. \$\endgroup\$
    – MooseBoys
    Feb 4, 2015 at 1:40
  • \$\begingroup\$ @MooseBoys I though it will be more expensive, thanks for your reply. \$\endgroup\$
    – Quest
    Feb 4, 2015 at 15:16
  • 1
    \$\begingroup\$ I did a quick test on my mid-high end machine and copying 500 1MB textures took 1.891ms. It's best to avoid spending too much time on these kinds of optimizations until you discover there's a bottleneck through measurement, or you're certain that there will be one based on experience. \$\endgroup\$
    – MooseBoys
    Feb 4, 2015 at 16:41

1 Answer 1

1
\$\begingroup\$

You can do the next trick: make a destination texture, set it as render target, draw a quad to it covering all the texture area, in pixel shader make any kind of blending from two (or even more) textures.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .