⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 248277 in webkit


Ignore:
Timestamp:
Aug 5, 2019, 4:17:48 PM (7 years ago)
Author:
sbarati@apple.com
Message:

[WHLSL] Add compile time flag to dump metal compile times
https://bugs.webkit.org/show_bug.cgi?id=200447

Reviewed by Myles C. Maxfield.

  • Modules/webgpu/WHLSL/WHLSLPrepare.h:
  • platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm:

(WebCore::trySetFunctions):

  • platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:

(WebCore::trySetFunctions):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r248276 r248277  
     12019-08-05  Saam Barati  <sbarati@apple.com>
     2
     3        [WHLSL] Add compile time flag to dump metal compile times
     4        https://bugs.webkit.org/show_bug.cgi?id=200447
     5
     6        Reviewed by Myles C. Maxfield.
     7
     8        * Modules/webgpu/WHLSL/WHLSLPrepare.h:
     9        * platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm:
     10        (WebCore::trySetFunctions):
     11        * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
     12        (WebCore::trySetFunctions):
     13
    1142019-08-05  Chris Dumez  <cdumez@apple.com>
    215
  • trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLPrepare.h

    r248266 r248277  
    3737namespace WHLSL {
    3838
     39constexpr bool dumpMetalCompileTimes = false;
     40
    3941struct RenderPrepareResult {
    4042    String metalSource;
  • trunk/Source/WebCore/platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm

    r248266 r248277  
    3535#import <Metal/Metal.h>
    3636#import <wtf/BlockObjCExceptions.h>
     37#import <wtf/DataLog.h>
     38#import <wtf/MonotonicTime.h>
    3739#import <wtf/text/StringConcatenate.h>
    3840
     
    8688
    8789        BEGIN_BLOCK_OBJC_EXCEPTIONS;
     90        MonotonicTime startTime;
     91        if (WHLSL::dumpMetalCompileTimes)
     92            startTime = MonotonicTime::now();
    8893        computeLibrary = adoptNS([device.platformDevice() newLibraryWithSource:whlslCompileResult->metalSource options:nil error:&error]);
     94        if (WHLSL::dumpMetalCompileTimes)
     95            dataLogLn("Metal compile times: ", (MonotonicTime::now() - startTime).milliseconds(), " ms");
    8996        END_BLOCK_OBJC_EXCEPTIONS;
    9097#ifndef NDEBUG
  • trunk/Source/WebCore/platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm

    r248266 r248277  
    3838#import <wtf/BlockObjCExceptions.h>
    3939#import <wtf/CheckedArithmetic.h>
     40#import <wtf/DataLog.h>
    4041#import <wtf/HashSet.h>
     42#import <wtf/MonotonicTime.h>
    4143#import <wtf/OptionSet.h>
    4244#import <wtf/Optional.h>
     
    398400
    399401        BEGIN_BLOCK_OBJC_EXCEPTIONS;
     402        MonotonicTime startTime;
     403        if (WHLSL::dumpMetalCompileTimes)
     404            startTime = MonotonicTime::now();
    400405        vertexLibrary = adoptNS([device.platformDevice() newLibraryWithSource:whlslCompileResult->metalSource options:nil error:&error]);
     406        if (WHLSL::dumpMetalCompileTimes)
     407            dataLogLn("Metal compile times: ", (MonotonicTime::now() - startTime).milliseconds(), " ms");
    401408        END_BLOCK_OBJC_EXCEPTIONS;
    402409
Note: See TracChangeset for help on using the changeset viewer.