Skip to content

Commit 8aed920

Browse files
jchen10wp
andauthored
Fix enable_pix_capture build for WebGPU (#23857)
The build option --enable_pix_capture is broken. This fixes the problem. --------- Co-authored-by: wp <[email protected]>
1 parent 788ca51 commit 8aed920

File tree

4 files changed

+4
-12
lines changed

4 files changed

+4
-12
lines changed

cmake/external/onnxruntime_external_deps.cmake

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ if(NOT TARGET Boost::mp11)
304304
EXCLUDE_FROM_ALL
305305
FIND_PACKAGE_ARGS NAMES Boost
306306
)
307-
onnxruntime_fetchcontent_makeavailable(mp11)
307+
onnxruntime_fetchcontent_makeavailable(mp11)
308308
if(NOT TARGET Boost::mp11)
309309
add_library(Boost::mp11 ALIAS Boost::headers)
310310
endif()
@@ -672,17 +672,10 @@ if (onnxruntime_USE_WEBGPU)
672672

673673
# disable things we don't use
674674
set(DAWN_DXC_ENABLE_ASSERTS_IN_NDEBUG OFF)
675-
set(DAWN_ENABLE_DESKTOP_GL OFF CACHE BOOL "" FORCE)
676-
set(DAWN_ENABLE_OPENGLES OFF CACHE BOOL "" FORCE)
677-
set(DAWN_SUPPORTS_GLFW_FOR_WINDOWING OFF CACHE BOOL "" FORCE)
678-
set(DAWN_USE_GLFW OFF CACHE BOOL "" FORCE)
679-
set(DAWN_USE_WINDOWS_UI OFF CACHE BOOL "" FORCE)
680675
set(DAWN_USE_X11 OFF CACHE BOOL "" FORCE)
681676

682677
set(TINT_BUILD_TESTS OFF CACHE BOOL "" FORCE)
683678
set(TINT_BUILD_CMD_TOOLS OFF CACHE BOOL "" FORCE)
684-
set(TINT_BUILD_GLSL_WRITER OFF CACHE BOOL "" FORCE)
685-
set(TINT_BUILD_GLSL_VALIDATOR OFF CACHE BOOL "" FORCE)
686679
set(TINT_BUILD_IR_BINARY OFF CACHE BOOL "" FORCE)
687680
set(TINT_BUILD_SPV_READER OFF CACHE BOOL "" FORCE) # don't need. disabling is a large binary size saving
688681
set(TINT_BUILD_WGSL_WRITER ON CACHE BOOL "" FORCE) # needed to create cache key. runtime error if not enabled.

onnxruntime/core/providers/webgpu/webgpu_context.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ void WebGpuContext::Initialize(const WebGpuBufferCacheConfig& buffer_cache_confi
165165
#if defined(ENABLE_PIX_FOR_WEBGPU_EP)
166166
// set pix frame generator
167167
pix_frame_generator_ = std::make_unique<WebGpuPIXFrameGenerator>(instance_,
168-
Adapter(),
169168
Device());
170169
#else
171170
ORT_THROW("Support PIX capture requires extra build flags (--enable_pix_capture)");

onnxruntime/core/providers/webgpu/webgpu_pix_frame_generator.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
namespace onnxruntime {
1212
namespace webgpu {
1313

14-
WebGpuPIXFrameGenerator::WebGpuPIXFrameGenerator(wgpu::Instance instance, wgpu::Adapter adapter, wgpu::Device device) {
14+
WebGpuPIXFrameGenerator::WebGpuPIXFrameGenerator(wgpu::Instance instance, wgpu::Device device) {
1515
// Trivial window size for surface texture creation and provide frame concept for PIX.
1616
static constexpr uint32_t kWidth = 512u;
1717
static constexpr uint32_t kHeight = 512u;
@@ -32,7 +32,7 @@ WebGpuPIXFrameGenerator::WebGpuPIXFrameGenerator(wgpu::Instance instance, wgpu::
3232

3333
wgpu::TextureFormat format;
3434
wgpu::SurfaceCapabilities capabilities;
35-
surface_.GetCapabilities(adapter, &capabilities);
35+
surface_.GetCapabilities(device.GetAdapter(), &capabilities);
3636
format = capabilities.formats[0];
3737

3838
wgpu::SurfaceConfiguration config;

onnxruntime/core/providers/webgpu/webgpu_pix_frame_generator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ namespace webgpu {
4141
// WebGpuContext destruction.
4242
class WebGpuPIXFrameGenerator {
4343
public:
44-
WebGpuPIXFrameGenerator(wgpu::Instance instance, wgpu::Adapter adapter, wgpu::Device device);
44+
WebGpuPIXFrameGenerator(wgpu::Instance instance, wgpu::Device device);
4545
~WebGpuPIXFrameGenerator();
4646
void GeneratePIXFrame();
4747

0 commit comments

Comments
 (0)