Track recreation of DxgiTextureStaging
I am not sure memcmp is the right tool to compare two D3D11_TEXTURE2D_DESC instances. So the staging texture may be recreated for each frame, which hurts the performance. Bug: webrtc:8046 Change-Id: I60a94f468599b23dec168de55c9bc8c787ab9b7d Reviewed-on: https://chromium-review.googlesource.com/592088 Reviewed-by: Jamie Walch <jamiewalch@chromium.org> Commit-Queue: Zijie He <zijiehe@chromium.org> Cr-Commit-Position: refs/heads/master@{#19193}
This commit is contained in:
parent
df6e07c7e2
commit
ae1532a214
@ -17,6 +17,7 @@
|
||||
|
||||
#include "webrtc/rtc_base/checks.h"
|
||||
#include "webrtc/rtc_base/logging.h"
|
||||
#include "webrtc/system_wrappers/include/metrics.h"
|
||||
|
||||
using Microsoft::WRL::ComPtr;
|
||||
|
||||
@ -44,7 +45,11 @@ bool DxgiTextureStaging::InitializeStage(ID3D11Texture2D* texture) {
|
||||
AssertStageAndSurfaceAreSameObject();
|
||||
D3D11_TEXTURE2D_DESC current_desc;
|
||||
stage_->GetDesc(¤t_desc);
|
||||
if (memcmp(&desc, ¤t_desc, sizeof(D3D11_TEXTURE2D_DESC)) == 0) {
|
||||
const bool recreate_needed = (
|
||||
memcmp(&desc, ¤t_desc, sizeof(D3D11_TEXTURE2D_DESC)) != 0);
|
||||
RTC_HISTOGRAM_BOOLEAN("WebRTC.DesktopCapture.StagingTextureRecreate",
|
||||
recreate_needed);
|
||||
if (!recreate_needed) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user