Method for modifying graphics processing unit (GPU) operations to track

By introducing the logging function in the GPU coloring device, the key parameters during the execution period are recorded, the problem of inaccurate information of the GPU command execution of the GPU command in the existing technology has been solved, and more accurate performance analysis and debugging are achieved.

CN111788609BActive Publication Date: 2025-01-24MICROSOFT TECHNOLOGY LICENSING LLC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN201980016302.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2018-03-02
Filing Date
2019-02-21
Publication Date
2025-01-24
Estimated Expiration
2039-02-21

AI Technical Summary

Technical Problem

The prior art is difficult to provide accurate timing information when commands of graphics processing units (GPUs) are executed, resulting in inaccuracy of logging.

Method used

By modifying the shader to generate a modified shader, add logging functionality to record key parameters during execution, such as shader name, execution time, etc., and store this information in the log.

Benefits of technology

It achieves accurate timing recording of GPU command execution, provides more accurate performance analysis and debugging tools, and helps developers better understand and optimize the GPU workflow.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111788609B_ABST
    Figure CN111788609B_ABST
Patent Text Reader

Abstract

Examples described herein generally relate to modifying the operation of a graphics processing unit (GPU) for tracing. Indications of a plurality of shaders to be executed when drawing an image may be obtained from a command buffer of commands to be provided to the GPU for drawing an image. At least one of the plurality of shaders may be modified to generate a modified shader, the modified shader including commands for logging one or more parameters when executing the modified shader. The command buffer may be provided to the GPU for executing the commands for drawing the image, including executing the modified shader.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0001] Today, the use of computing devices is becoming more and more common. Computing devices range from standard desktop computers to wearable computing technologies, etc. One area of ​​computing devices that has grown in recent years is in the context of image rendering, such as the rendering of games, video streaming, etc., which typically relies on a graphics processing unit (GPU) to render graphics from the computing device to a display device based on rendering instructions received from the computing device. The GPU can typically perform rasterization operations to render images based on rendering instructions and / or ray tracing to simulate photons of light emitted via rays and determine where the rays reflect, trace where the rays return from the scene, etc., to generate an image.

[0002] Tools have been developed for logging draw instructions received from applications, from which a graphics driver can generate GPU-specific commands for execution on a GPU. However, the graphics driver and / or the corresponding GPU may defer execution of the GPU-specific commands to an indeterminate time in the future, and thus logging related to draw instructions may not provide ideal or accurate timing information related to GPU performance and command execution. Summary of the invention

[0003] A simplified overview of one or more examples is given below in order to provide a basic understanding of such examples. This overview is not an exhaustive overview of all contemplated examples, and is neither intended to identify key or important elements of all examples nor to define the scope of any or all examples. Its sole purpose is to present certain concepts of one or more examples in a simplified form as a prelude to a more detailed description presented later.

[0004] In one example, a method for modifying the operation of a graphics processing unit (GPU) for tracing is provided. The method includes: obtaining an indication of a plurality of shaders to be executed when drawing an image from a command buffer of commands to be provided to the GPU for drawing an image; modifying at least one of the plurality of shaders to generate a modified shader, the modified shader including a command for logging one or more parameters when executing the modified shader; and providing the command buffer to the GPU for executing the commands for drawing the image, including executing the modified shader.

[0005] In another example, a computing device for modifying the operation of a GPU for tracing is provided. The computing device includes: a memory storing one or more parameters or instructions for executing an operating system, and one or more applications including a logging application; and at least one processor coupled to the memory. The at least one processor is configured to: obtain an indication of a plurality of shaders to be executed when drawing an image from a command buffer of commands to be provided to the GPU for drawing an image; modify at least one of the plurality of shaders to generate a modified shader, the modified shader including a command for logging one or more parameters when executing the modified shader; and provide the command buffer to the GPU for executing the commands for drawing an image, including executing the modified shader.

[0006] In another example, a computer-readable medium is provided, the computer-readable medium including code executable by one or more processors for modifying the operation of a GPU for tracing. The code includes code for the following operations: obtaining an indication of a plurality of shaders to be executed when drawing an image from a command buffer of commands to be provided to the GPU for drawing an image; modifying at least one of the plurality of shaders to generate a modified shader, the modified shader including a command for logging one or more parameters when executing the modified shader; and providing the command buffer to the GPU for executing the commands for drawing the image, including executing the modified shader.

[0007] To accomplish the foregoing and related ends, one or more examples include features fully described below and particularly pointed out in the claims. The following description and the accompanying drawings set forth in detail certain illustrative features of one or more examples. However, these features are indicative of only a few of the various ways in which the principles of the various examples may be employed, and this description is intended to include all such examples and their equivalents. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] Figure 1 is a schematic diagram of an example of a computing device for modifying the operation of a graphics processing unit (GPU) according to examples described herein.

[0009] Figure 2 is an example of a data flow graph for use in modifying GPU operations according to examples described herein.

[0010] Figure 3 is a flow chart of an example of a method for modifying one or more shaders to track GPU operations according to examples described herein.

[0011] Figure 4An example of an interface for displaying a timeline related to operation of a GPU according to examples described herein is shown.

[0012] Figure 5 is a schematic diagram of an example of a computing device for performing the functions described herein. DETAILED DESCRIPTION

[0013] The detailed description set forth below in conjunction with the accompanying drawings is intended as a description of various configurations and is not intended to represent the only configuration in which the concepts described herein may be practiced. In order to provide a thorough understanding of the various concepts, the detailed description includes specific details. However, it is clear to those skilled in the art that these concepts may be practiced without these specific details. In some cases, well-known components are shown in block diagram form to avoid obscuring these concepts.

[0014] Various examples related to modifying the operation of a graphics processing unit (GPU) to track and / or analyze it are described herein. In one example, one or more shaders or other executable components associated with drawing graphics on the GPU can be modified to include a logging function for logging one or more parameters during execution. For example, an application can generate a set of drawing instructions, which can include calling one or more shaders or other execution threads when processing the drawing instructions. In one example, a logging application can obtain a list of commands in a command buffer to be sent to the GPU (or an associated graphics driver) for processing, which list can include drawing commands, ray assignment commands, commands related to executing one or more shaders, etc. In this example, the logging application can modify at least a portion of one or more shaders to include instructions for logging one or more parameters, so that a portion of one or more shaders can log one or more parameters in a log when executing, wherein the log can be stored in a file, in a buffer in a memory, or in any other storage location from which the logged information can be retrieved later.

[0015] For example, the logging application may modify a portion of one or more shaders to include instructions for logging shader names or identifiers, the time when the execution of the shader starts and / or completes, the total time of the execution of the shader, etc. In addition, for example, (multiple) shaders may be modified to log parameters related to the execution of rasterization, ray tracing, etc., such as memory access, ray allocation, and / or reflection information. The logging application may replace a portion of one or more shaders with a modified shader, which may include replacing a pointer or other identifier in a command buffer with a pointer or other identifier of the modified (multiple) shader. In another example, the logging application may directly modify a portion of the shader to include a logging function so that logging can be activated without updating the command buffer. In addition, for example, the logging application may modify one or more shaders in a command buffer, wherein the command buffer involves commands to be executed in real time on the GPU and / or playback captured GPU commands and / or associated drawing instructions. In any case, at this point, logging may be performed by or based on the GPU executing the commands in the command buffer without requiring support or other functionality in the GPU or corresponding graphics driver.

[0016] Now turn to Figures 1 to 5 , examples are depicted with reference to one or more components and one or more methods that can perform the actions or operations described herein, where the components and / or actions / operations in dashed lines may be optional. Figure 3 The operations described in the description are presented in a particular order and / or performed by example components, but in some examples, the order of actions and the components performing the actions may be changed depending on the implementation. In addition, in some examples, one or more of the following actions, functions, and / or described components may be performed by a specially programmed processor, a processor executing specially programmed software or computer-readable media, or by any other combination of hardware components and / or software components capable of performing the described actions or functions.

[0017] Figure 11 is a schematic diagram of an example of a computing device 100 and / or related components for providing logging of GPU operations in drawing graphics. For example, the computing device 100 may include a processor 104 and / or a memory 106, or may be otherwise coupled to a processor 104 and / or a memory 106, wherein the processor 104 and / or the memory 106 may be configured to execute or store instructions or other parameters related to facilitating logging operations for the GPU, as described herein. The computing device 100 may execute an operating system 108 (e.g., via the processor 104 and / or the memory 106) to provide an environment for executing one or more applications. The computing device 100 may also include a GPU 114 for processing drawing instructions and / or transmitting associated commands to a display interface 116 to cause display of one or more images on a display, which may be coupled to the computing device 100 via a display port 118.

[0018] In one example, the display interface 116 can be communicatively coupled to the processor 104 and / or the memory 106 to communicate with a display (not shown) via a display port 118. The display port 118 mentioned herein can include one or more of various types of ports, including a High Definition Multimedia Interface (HDMI) port, a Display Serial Interface (DSI) port, a Mobile Industry Processor Interface (MIPI) DSI port, a Universal Serial Bus (USB) port, a FireWire port, or other embedded or external wired or wireless display ports that can enable communication between the computing device 100 and the display.

[0019] In one example, the GPU 114 may be part of the display interface 116 (e.g., a processor on a circuit board of the display interface 116). In another example, the GPU 114, the display interface 116, etc. may be integrated with the processor 104. Substantially any combination of hardware is possible, such that the GPU 114, the display interface 116, etc. may communicate with the processor 104 via a bus to facilitate providing drawing instructions to the GPU 114. The GPU 114 may process the drawing instructions to draw an image, and may initiate display of at least a portion of the image on a display by transmitting associated signals to the display via a display port 118 of the display interface 116. In one example, the GPU 114 may support ray tracing, rasterization, or other mechanisms for generating images based on received drawing instructions.

[0020] In one example, the application 124 may operate (e.g., via the operating system 108) to generate an image for display via the display interface 116. The application 124 may generate drawing instructions 130 and / or one or more shaders 132 to draw the image, wherein the drawing instructions 130 may define the geometry of the image related to operations such as ray tracing the image, rasterizing the image, and the like, and the shader 132 may be operable to further modify the geometry of the image (e.g., add color, lighting, or substantially any feature) or for other purposes. For example, the shader 132 may be a program implemented to be executed via the GPU 114 to perform shading or other operations on the image, wherein the shader 132 may operate in a highly parallel manner, which is well suited to the GPU 114 architecture. In some examples, the shader 132 may be executed for substantially any purpose that may or may not be related to modifying the image, to perform shading related to applying levels of light, darkness, color, etc. within the image, to perform other types of post-processing on the image, and / or to perform substantially any definable operation on the GPU 114. In one example, the application 124 may generate the drawing instructions 130 using an application programming interface (API) provided by the graphics driver 122 for defining image geometry. Additionally, the application 124 may define one or more shaders 132 or other execution threads to modify geometry, etc., which may also be supported by the graphics driver 122. The graphics driver 122 may generate GPU-specific commands based on the drawing instructions, and the shaders 132 may be executed via the GPU 114 to facilitate drawing of the image via the GPU 114. In one example, the graphics driver 122 may generate the GPU-specific commands and provide them to the GPU 114 in a separate execution thread, and the GPU 114 may execute the commands and / or shaders in a different time domain than the generation and provision of the instructions for the drawing instructions 130 and shaders 132 to the graphics driver 122 (e.g., some indeterminate time after the generation / providing of the drawing instructions 130). This may be referred to as delayed execution, and may complicate the determination of the timing of operations associated with the GPU 114 (e.g., when trying to track time using an application executed via the processor 104).

[0021] In this regard, a logging application 126 may be provided to modify one or more shaders in a command buffer to include instructions for logging one or more parameters during execution. For example, the logging application 126 may include a shader modification component 136 for identifying and modifying one or more shaders specified in a command buffer to include logging instructions 134 for logging one or more parameters during execution of the (multiple) shaders. For example, the logging instructions 134 may correspond to instructions for writing one or more log parameters to a log and / or causing the logging application 126 to write a log on behalf of the shader (e.g., based on the shader calling a callback function registered by the logging application 126 when modifying the shader). The logging application 126 may also optionally include an output component 138 for outputting a log and / or a representation thereof, such as a timeline, to allow visualization of the log data collected from the one or more shaders 132.

[0022] In one example, logging application 126 may be executed on the same computing device 100, or may be executed as logging application 156 running on a different computing device 150 (where different computing device 150 may have a separate processor, memory, operating system, etc. to execute logging application 156), so long as logging application 126, 156 can at least communicate with GPU 114, graphics driver 122, or related components (e.g., via an API) to modify shader 132 to include logging instructions 134, receive log events or callbacks during execution of the shader, etc. Although these components are only in Figure 1 1 , but the logging application 156 when configured to operate on a different computing device 150 may include similar or identical components to implement similar or identical functionality as described herein for the logging application 126 .

[0023] Figure 2 2 shows an example of a data flow 200 of image data including drawing instructions 130 and shaders 132 to a drawn scene 204 that may be defined by an application. The data flow 200 may be in a computer program such as Figure 1 The computing device 100 shown is implemented on a system architecture such as the computing device 100, and thus in a non-limiting example, is combined with Figure 1 Give a description.

[0024] For example, the drawing instructions 130 and / or the shaders 132 may be input as commands into the command buffer 202 for execution on a GPU (e.g., the GPU 114). In one example, the graphics driver 122 may generate the command buffer 202 as a list of GPU-specific commands based on the drawing instructions 130, and include commands for executing one or more shaders 132 for post-processing or otherwise assisting in generating an image of the drawn scene 204. In this example, the logging application 126 may identify the shader specified in the command buffer 202, and may modify the shader to include the logging instructions. In one example, the logging application 126 may modify the shader to include certain logging instructions, may generate a copy of the shader to modify and replace in the command buffer 202 (e.g., by replacing a pointer or other identifier of the shader with a pointer or other identifier of the modified shader), and the like.

[0025] For example, in this regard, the logging application 126 may modify the shader as part of replaying the commands in the command buffer 202 for generating the drawn scene 204 to regenerate the drawn scene 204 as part of a tool for analyzing GPU performance. In this regard, the logging application 126 may include an interface for replaying commands or drawing instructions 130 / shaders 132 with logging enabled, and the logging application 126 may cause playback of the captured drawing instructions 130. The shader 132 has a modified shader. In another example, the logging application 126 may modify the shader 132 to execute the commands in the command buffer 202 when generating the drawn scene 204 in real time. In this example, the logging application 126 may include an interface for indicating to log shader operations, as further described herein, the interface may include options for indicating information to be logged (e.g., shader identifier or name, start time, stop time, total execution time, drawing parameters related to features for rasterization or ray tracing, etc.).

[0026] When the command buffer 202 is executed on a GPU (e.g., GPU 114), the GPU may execute a modified shader inserted into the command buffer 202, which may include one or more logging instructions. For example, one or more logging instructions may generate a log command for logging parameters in a log 206, which may be maintained by a logging application 126. For example, the log may be stored in a file, in a buffer in the memory 106, or in substantially any storage location from which the logged information may be retrieved later. In one example, the logging instructions in the shader may indicate that the parameters are logged in the log 206, a function (e.g., a callback function) on the logging application 126 is called to log the parameters, and the like. In addition, as described above, the logging instructions may be incorporated into the shader so that the shader executes the logging instructions as one of a plurality of instructions during execution of the shader to cause logging of the one or more parameters described above. Thus, more accurate logging information for GPU execution may be provided by varying the shaders executed by the GPU during deferred execution compared to information obtained by logging based on an application providing draw instructions 130 / shaders 132 to command buffer 202 .

[0027] Figure 3 1 is a flowchart of an example of a method 300 for modifying a shader or other execution thread to be executed when drawing graphics to log GPU-related operations. For example, the method 300 may be performed by the computing device 100, and thus reference is made to Figure 1 and 2 The description is provided as a non-limiting example of an environment for performing method 300 .

[0028] In the method 300, at act 302, an indication of a plurality of shaders to be executed when drawing an image may be obtained from a command buffer of commands to be provided to a GPU for drawing an image. In one example, a shader modification component 136 (e.g., in conjunction with a processor 104, a memory 106, a logging application 126, 156, etc.) may obtain an indication of a plurality of shaders (e.g., shaders 132) to be executed when drawing an image from a command buffer (e.g., command buffer 202) of commands to be provided to a GPU (e.g., GPU 114) for drawing an image. For example, an application 124 may generate a drawing instruction 130 for drawing an image, the drawing instruction 130 may include one or more drawing commands, memory access commands, etc., and / or may specify one or more shaders 132 to be applied to the image. As described, the application 124 may generate one or more drawing instructions 130, specify one or more shaders 132, and the like via an API provided by a graphics driver 122 for operating the GPU 114.

[0029] For example, the application 124 may specify one or more shaders 132 in a drawing instruction, which may also include one or more parameters for executing the shader, such as shading rate, color modification parameters, tile size, or substantially any parameter that may be image-related or image-independent. The application 124 may provide the drawing instructions 130 and indications of the shaders 132 to the command buffer 202 for processing when drawing the image, and the graphics driver 122 may, for example, process the drawing instructions 130, apply or otherwise call the shaders 132 on the image to be drawn, etc., to generate GPU-specific commands that may cause the GPU 114 to draw the image (e.g., via rasterization, ray tracing, or otherwise). In one example, the shader modification component 136 may obtain indications of multiple shaders from the command buffer 202 during initial drawing of the image and / or during playback of commands in the command buffer 202 (e.g., as specified by the logging application 126, e.g., for the purpose of debugging the drawing of the image).

[0030] In method 300, at act 304, at least one of the plurality of shaders may be modified to generate a modified shader, the modified shader including commands for logging one or more parameters when the modified shader is executed. In one example, a shader modification component 136 (e.g., in conjunction with processor 104, memory 106, logging application 126, 156, etc.) may modify at least one of the plurality of shaders (e.g., shader 132) to generate a modified shader, the modified shader including commands for logging one or more parameters when the modified shader is executed (e.g., logging instructions 134). For example, the shader modification component 136 may introduce logging instructions 134 into one or more shaders 132 as additional software code to call one or more functions that cause logging, wherein the logging instructions 134 may indicate parameters for logging. For example, the parameters can specify data to be logged, such as a shader name or identifier, the current time, parameters related to the processing performed by the shader (such as one or more rasterization or ray tracing characteristics, which may include shading rate, tile size, ray reflection information, number of execution threads, etc.), a logging location (e.g., the location or pointer of the log, etc.), and the like.

[0031] In one example, the shader modification component 136 can automatically insert logging instructions 134 into the shader 132 to include at least instructions for the following operations: when the shader 132 executes, the shader name (or other identifier) ​​and / or the start time are logged as initial instructions, and / or before the shader 132 terminates, the end time or the calculated total execution time is logged as the last instruction. In one example, the shader modification component 136 can insert such logging instructions 134 based on an indication via a user interface to enable shader logging. In one example, the shader 132 can be provided in a high-level source code form (e.g., such as a high-level shader language (HLSL), an OpenGL shader language (GLSL), a metal shading language, etc.) using an intermediate language, or provided using an intermediate compiled format (such as DirectX bytecode (DXBC), DirectX intermediate language (DXIL), a standard portable intermediate representation (SPIR) (such as SPIR-V, etc.)), or directly provided using a native compiled instruction format of a specific target GPU model. In any case, for example, the shader modification component 136 can modify the (multiple) shader 132 based at least in part on identifying the location in the intermediate language where logging is to be inserted (e.g., the beginning of the shader program, the end of the shader program, or a specific location within the shader identified by scanning the shader to find a specific type of instruction to be detected, etc.). Once the location is identified, the shader modification component 136 can insert a new instruction at the location, which, when executed, can perform the action of logging data as described above. The result is a modified shader that uses the same format as the original shader (high-level source code, intermediate compiled format, or native GPU instructions, etc.) and has the logging instructions inserted into the code using the appropriate syntax (e.g., based on the format). If the high-level source code is being modified, the shader modification component 136 can also recompile the (multiple) shader 132 (via a conventional shader compiler) to produce an intermediate compiled format, which can then be provided to the graphics driver 122 for execution.

[0032] In another example, the logging application 126, 156 may provide a user interface to allow modification of the shader 132 software code instructions to include logging instructions 134 and / or include certain logging parameters at a location specified via the user interface (e.g., by a developer). In one example, the shader modification component 136 may modify the shader 132 indicated in the command buffer. In another example, the shader modification component 136 may generate a modified shader based on a copy of the shader 132, the shader being modified to include the logging instructions 134. In yet another example, the shader modification component 136 may store a modified shader associated with one or more shaders 132, and may use the modified (multiple) shaders instead, where a given shader maps to the modified shader.

[0033] In some of these examples, when modifying at least one shader in act 304, at least one shader may be replaced with the modified shader within the command buffer, optionally in act 306. In one example, the shader modification component 136 (e.g., in conjunction with the processor 104, the memory 106, the logging application 126, 156, etc.) may replace at least one shader (e.g., at least one shader 132) with the modified shader within the command buffer (e.g., the command buffer 202), wherein the modified shader includes the logging instructions 134. Thus, for example, where at least one shader itself is not modified and another shader is modified or associated with the at least one shader, the shader modification component 136 may replace the at least one shader with the modified shader, which may include replacing a pointer or other designator of the at least one shader within the command buffer 202 with a pointer or other designator of the modified shader.

[0034] In method 300, at act 308, the command buffer may be provided to the GPU for execution of commands for drawing an image. In one example, graphics driver 122 (e.g., in conjunction with processor 104, memory 106, logging application 126, 156, etc.) may provide the command buffer (e.g., command buffer 202 with modified shaders) to a GPU (e.g., GPU 114) for execution of commands for drawing an image. For example, graphics driver 122 may generate GPU-specific commands for executing drawing instructions 130 and / or applying shaders 132 indicated in the command buffer. In any case, graphics driver 122 may apply or instruct GPU 114 to apply the modified shader(s) to facilitate execution of logging instructions 134 in shader(s) 132. This may be done prior to playback of the command buffer 202 , where the logging application 126 , 156 plays back the command buffer 202 using the modified shader 132 after an initial draw of the image (eg, to debug or otherwise view metrics related to shader execution).

[0035] As a result, optionally, in action 310, the log may be modified by the modified shader to indicate one or more parameters. In one example, the shader 132 (e.g., in conjunction with the processor 104, the memory 106, the logging application 126, 156, the GPU 114, etc.) may modify a log (e.g., the log 206 or another log) to indicate one or more parameters. For example, when the GPU 114 causes execution of the shader 132, the shader 132 may execute the logging instructions 134. In one example, the logging instructions 134 may indicate the log 206 (e.g., or a pointer thereto) to indicate a log for logging the parameters indicated in the logging instructions 134. In another example, the logging instructions 134 may include a callback to the logging application 126, 156 with one or more parameters to cause the logging application 126, 156 to log the one or more parameters in the log 206, and so on. In any case, the GPU 114 executing the shader 132 may obtain the requested parameters (eg, shader identifier, current time, etc.) based on the logging instructions 134 , and may cause logging of the parameters based on the logging instructions 134 introduced into the shader 132 .

[0036] In method 300, optionally, in action 312, a timeline associated with executing the modified shader can be generated on a display based at least in part on one or more parameters logged in the log. In one example, the output component 138 (e.g., in conjunction with the processor 104, the memory 106, and / or the logging application 126, 156, etc.) can generate a timeline associated with executing the modified shader on a display (e.g., a display of the computing device 100, 150) based at least in part on one or more parameters logged in the log (e.g., the log 206). For example, the logging application 126, 156 can read and process the log 206 (e.g., after, during, etc., the drawing of the image) to obtain the logged shader information, such as a shader identifier, a start time of a given shader, or one or more other parameters related to the processing of the shader, etc., and the output component 138 can display the timeline of the shader execution. In other examples, the output component 138 can display other representations of supplemental or alternative outputs indicated in the log 206 based on the logging instructions 134.

[0037] Figure 4 An example is shown in Figure 4 An example of an interface 400 for displaying on a display to indicate the execution time of different shaders when drawing an image is shown. For example, the data of the interface 400 can be obtained from a log (such as log 206) generated by one or more shaders 132 modified to include logging instructions 134. In this example, the log 206 may include a log event from the shader 132, which indicates the identifier, start time, and end time of the shader used to execute a given shader. Therefore, the interface 400 can be a graphical representation of a timeline 402 indicating the timing for executing different shaders, wherein each bar 404, 406, 408 represents the execution time of the shader executed in a different order along the timeline 402. In this example, the selection of a bar such as bar 406 may cause the display of a box 410, which indicates other information about the shader represented by the bar 406, such as the shader identifier, start time, and end time, as recorded in the log 206. The interface can provide a graphical representation of the shader execution time, which can enable developers to visualize the execution time based on the data in the log 206. Furthermore, given the GPU 114's delayed drawing behavior, logging data using the shader 132 may at least more accurately represent timing data regarding when the shader actually executes.

[0038] Figure 4The interface 400 in is a non-limiting example, and substantially any set of parameters in the logging log 206 may be logged to display a graphical representation thereof. Moreover, the log 206 may be viewed to determine metrics associated with the shader. Additionally, for example, the logging instructions 134 may cause different logs to be created for different purposes (e.g., different logs for different shaders or groups of shaders). In one example, the output component 138 may combine data from one or more logs to create an interface that provides a graphical representation of the logged data. In any case, in some examples, logging may be implemented in the shader 132 without requiring other modifications or functionality of the GPU 114, in addition to the ability of the GPU 114 to determine the current logging time.

[0039] Figure 5 Shown include Figure 1 Examples of computing devices 100 with other optional component details shown. In one example, computing device 100 may include a processor 104 for performing processing functions associated with one or more components and functions described herein. Processor 104 may include a single or multiple processors or a multi-core processor. In addition, processor 104 may be implemented as an integrated processing system and / or a distributed processing system.

[0040] The computing device 100 may also include a memory 106, such as for storing local versions of applications executed by the processor 104, related instructions, parameters, etc. The memory 106 may include computer-usable memory types such as random access memory (RAM), read-only memory (ROM), tape, disk, optical disk, volatile memory, non-volatile memory, and any combination thereof. In addition, the processor 104 and the memory 106 may include and execute an operating system, one or more applications (such as the graphics driver 122, the logging application 126 and / or components thereof, the display driver, etc., as described herein), and / or other components of the computing device 100 that are executed on the processor 104.

[0041] In addition, the computing device 100 may include a communication component 502 for providing for establishing and maintaining communications with one or more other devices, parties, entities, etc. using the hardware, software, and services described herein. The communication component 502 can communicate between components on the computing device 100 and between the computing device 100 and external devices (such as devices located on a communication network and / or devices connected serially or locally to the computing device 100). For example, the communication component 502 may include one or more buses, and may also include a transmit chain component and a receive chain component associated with a wireless or wired transmitter and receiver, respectively, that are operable to interface with the external device. For example, the communication component 502 can communicate between the logging application 126 and a GPU on another device, between distributed components of the logging application 126, and the like.

[0042] In addition, the computing device 100 may include a data repository 504, which may be any suitable combination of hardware and / or software, that provides mass storage of information, databases, and programs used in conjunction with the examples described herein. For example, the data repository 504 may be or may include a data repository for applications and / or related parameters that are not currently being executed by the processor 104. Furthermore, the data repository 504 may be a data repository for an operating system, an application (such as a graphics driver 122 executing on the processor 104, a diary application 126 and / or components thereof, a display driver, etc.), and / or one or more other components of the computing device 100.

[0043] The computing device 100 may also include a user interface 506 that is operable to receive input from a user of the computing device 100 and may also be operable to generate output for presentation to the user (e.g., via the display interface 116 to the display device). The user interface 506 may include one or more input devices, including, but not limited to, a keyboard, a numeric keypad, a mouse, a touch-sensitive display, navigation keys, function keys, a microphone, a speech recognition component, a gesture recognition component, a depth sensor, a gaze tracking sensor, any other mechanism capable of receiving input from a user, or any combination thereof. In addition, the user interface 506 may include one or more output devices, including, but not limited to, the display interface 116, a speaker, a tactile feedback mechanism, a printer, any other mechanism capable of presenting output to a user, or any combination thereof. In one example, the user interface 506 may display or may include an interface 400 or a similar interface to display memory usage information, as described herein.

[0044] The computing device 100 may also include a GPU 114 for rendering an image based on ray tracing instructions received from the processor 104, as described herein. The GPU 114 may additionally send a signal via the display interface 116 to cause the rendered image to be displayed on a display (not shown). Additionally, the computing device 100 may include a graphics driver 122 as described herein to provide GPU-specific commands for rasterizing, ray tracing, etc., images, as described herein. Additionally, the computing device 100 may include a logging application 126 to instrument the shader with logging instructions to cause the shader to log information as it is executed, as described herein.

[0045] For example, an element or any part of an element or any combination of elements can be implemented with a "processing system" including one or more processors. Examples of processors include microprocessors, microcontrollers, digital signal processors (DSPs), field programmable gate arrays (FPGAs), programmable logic devices (PLDs), state machines, gated logic, discrete hardware circuits, and other suitable hardware configured to perform the various functions described throughout this disclosure. One or more processors in a processing system can execute software. Software should be broadly interpreted as referring to instructions, instruction sets, codes, code segments, program codes, programs, subroutines, software modules, applications, software applications, software packages, routines, subroutines, objects, executable files, execution threads, processes, functions, etc., whether referred to as software, firmware, middleware, microcode, hardware description languages, or other forms.

[0046] Therefore, in one or more examples, one or more functions described can be implemented in accordance with hardware, software, firmware or any combination thereof. If implemented in software, the function can be stored or encoded as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media. Storage media can be any available media that a computer can access. As an example and not limitation, such a computer-readable medium may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage, disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired program codes in the form of instructions or data structures and can be accessed by a computer. Disks and optical disks used herein include compact disks (CDs), laser optical disks, optical disks, digital versatile disks (DVDs) and floppy disks, wherein disks usually copy data magnetically, while optical disks copy data optically by lasers. The above combination should also be included in the scope of computer-readable media.

[0047] The previous description is provided to enable any person skilled in the art to practice the various examples described herein. Various modifications to these examples will be clear to those skilled in the art, and the general principles defined herein can be applied to other examples. Therefore, the claims are not intended to be limited to the examples shown herein, but to be consistent with the full range consistent with the language claims, wherein unless explicitly stated, reference to an element in the singular is not intended to mean "one and only one", but to mean "one or more". Unless otherwise specifically stated, the term "some" refers to one or more. All structural and functional equivalents of the elements of the various examples described herein that are known or will be known to those of ordinary skill in the art are intended to be covered by the claims. Moreover, whether or not the content disclosed herein is explicitly stated in the claims, it is not intended to be disclosed to the public. Unless the element is explicitly stated using the phrase "means for ...", no claim element should be interpreted as a means plus function.

Claims

1. A method for modifying the operation of a graphics processing unit (GPU) for tracking, comprising: obtaining, from a command buffer of commands to be provided to the GPU for drawing an image, indications of a plurality of shaders to be executed when drawing the image; inserting one or more logging instructions into at least one shader of the plurality of shaders to generate a modified shader that logs one or more parameters when executed; replacing within the command buffer an indication of the at least one shader with a second indication of the modified shader; providing the command buffer including the second indication of the modified shader to the GPU for executing the commands for drawing the image, including executing the modified shader; as well as When the modified shader is executed, a log is modified by the modified shader and based on the one or more logging instructions to indicate the one or more parameters. 2 . The method of claim 1 , wherein the modified shader includes a command for logging the one or more parameters, the command including a command for logging an identifier of the modified shader. 3 . The method of claim 1 , wherein the modified shader includes commands for logging the one or more parameters, the commands including commands for logging a time associated with executing the modified shader.

4. The method of claim 1, wherein the modified shader includes commands for logging the one or more parameters, the commands including commands for logging ray tracing or rasterization features associated with executing the modified shader. 5 . The method of claim 1 , further comprising generating, on a display, a timeline associated with executing the modified shader among the plurality of shaders based at least in part on the one or more parameters logged in the log.

6. A computing device for modifying the operation of a graphics processing unit (GPU) for tracking, comprising: a memory storing one or more parameters or instructions for executing an operating system and one or more applications including a logging application; as well as at least one processor coupled to the memory, wherein the at least one processor is configured to: obtaining, from a command buffer of commands to be provided to the GPU for drawing an image, indications of a plurality of shaders to be executed when drawing the image; inserting one or more logging instructions into at least one shader of the plurality of shaders to generate a modified shader that logs one or more parameters when executed; replacing within the command buffer an indication of the at least one shader with a second indication of the modified shader; as well as The command buffer including the second indication of the modified shader is provided to the GPU for executing the commands for drawing the image, including executing the modified shader. 7 . The computing device of claim 6 , wherein the modified shader includes a command for logging the one or more parameters, the command including a command for logging an identifier of the modified shader.

8. The computing device of claim 6, wherein the modified shader includes commands for logging the one or more parameters, the commands including commands for logging a time associated with executing the modified shader.

9. The computing device of claim 6, wherein the modified shader includes commands for logging the one or more parameters, the commands including commands for logging ray tracing or rasterization features associated with executing the modified shader.

10. The computing device of claim 6, wherein the at least one processor is further configured to, when executing the modified shader, modify a log by the modified shader to indicate the one or more parameters.

11. The computing device of claim 10, wherein the at least one processor is further configured to generate, on a display, a timeline associated with executing the modified shader among the plurality of shaders based at least in part on the one or more parameters logged in the log.

12. A non-transitory computer readable medium comprising code executable by one or more processors for modifying operation of a graphics processing unit (GPU) for tracing, the code comprising code for: obtaining, from a command buffer of commands to be provided to the GPU for drawing an image, indications of a plurality of shaders to be executed when drawing the image; inserting one or more logging instructions into at least one shader of the plurality of shaders to generate a modified shader that logs one or more parameters when executed; replacing within the command buffer an indication of the at least one shader with a second indication of the modified shader; as well as The command buffer including the second indication of the modified shader is provided to the GPU for executing the commands for drawing the image, including executing the modified shader.

13. The non-transitory computer readable medium of claim 12, wherein the modified shader includes a command for logging the one or more parameters, the command including a command for logging an identifier of the modified shader.

14. The non-transitory computer readable medium of claim 12, wherein the modified shader includes commands for logging the one or more parameters, the commands including commands for logging a time associated with executing the modified shader.

15. The non-transitory computer-readable medium of claim 12, wherein the modified shader includes commands for logging the one or more parameters, the commands including commands for logging ray tracing or rasterization features associated with executing the modified shader. 16 . The non-transitory computer-readable medium of claim 12 , further comprising code for modifying, by the modified shader when the modified shader is executed, a log to indicate the one or more parameters.

17. The non-transitory computer-readable medium of claim 16, further comprising code for generating, on a display, a timeline associated with executing the modified shader among the plurality of shaders based at least in part on the one or more parameters logged in the log.

Citation Information

Patent Citations

  • Application-transparent resolution control by way of command stream interception

    CN105719229A

  • Automatic Real-Time Shader Modification for Texture Fetch Instrumentation

    US20110084964A1