diff --git a/docs/behind_scenes/how_works.rst b/docs/behind_scenes/how_works.rst index 87180e4e9..8a4ac7050 100644 --- a/docs/behind_scenes/how_works.rst +++ b/docs/behind_scenes/how_works.rst @@ -29,9 +29,9 @@ The replay process is ostensibly simple, but as with the capturing the devil is When replaying, the initial section of the capture (up to the beginning of the frame) is read and executed verbatim. Each resource created is mapped to the live version and vice versa so later parts of the capture can obtain the replayed representation of the original resource. -RenderDoc then does an initial pass over the captured frame. This allows us to build up a list of all the 'drawcall' events, analyse dependencies and check which resources are used at each drawcall for read, write, and so on. An internal tree is built up similar to what you see in the Event Browser & API Inspector, as well as a linked list with the linear sequence of drawcalls, since both representations are useful for iterating over the frame. +RenderDoc then does an initial pass over the captured frame. This allows us to build up a list of all the actions, analyse dependencies and check which resources are used at each action for read, write, and so on. An internal tree is built up similar to what you see in the Event Browser & API Inspector, as well as a linked list with the linear sequence of actions, since both representations are useful for iterating over the frame. -After this point most work is done in response to user actions. The basic building block is replaying a partial frame. Most analysis tools are built out of either replaying up to the current event, replaying up to the event - not including the current drawcall - and replaying *only* the current drawcall. +After this point most work is done in response to user actions. The basic building block is replaying a partial frame. Most analysis tools are built out of either replaying up to the current event, replaying up to the event - not including the current action - and replaying *only* the current action. Care is taken to minimise this as much as possible as this tends to be the slowest operation given the overheads of serialisation and decoding the command stream. @@ -39,8 +39,8 @@ When replaying from the beginning of a frame (and not a partial subset of the fr For example, let's assume the user has the 'depth test' overlay enabled, and selects a new event. This is the order of events that occur for the Texture Viewer - other viewers follow similar patterns, with a certain degree of sharing to reduce redundant replays: -#. The capture is replayed up to, but not including, the selected drawcall. After doing this the current pipeline state and contents of all resources exactly match the state at the point of this drawcall. -#. We then save a copy of the pristine depth buffer, save the current pipeline state, and set the reversed depth test. Replacing the pixel shader with one that just writes red, we repeat the drawcall to draw all the areas that fail the depth test. +#. The capture is replayed up to, but not including, the selected action. After doing this the current pipeline state and contents of all resources exactly match the state at the point of this action. +#. We then save a copy of the pristine depth buffer, save the current pipeline state, and set the reversed depth test. Replacing the pixel shader with one that just writes red, we repeat the action to draw all the areas that fail the depth test. #. Restoring the depth buffer and repeating this with a pixel shader which writes green, we fill in the overlay. Both of these renders happen to an off-screen buffer. -#. After restoring the pipeline state we finally replay the original drawcall to get the final image. +#. After restoring the pipeline state we finally replay the original action to get the final image. #. When we want to re-paint the viewed texture (either regular painting, or if the user changed a visualisation option which is just a constant buffer value) we bind the current render target as a resource and render it to the texture viewer control, then render the overlay texture on top of that. diff --git a/docs/behind_scenes/planned_features.rst b/docs/behind_scenes/planned_features.rst index 4837673de..d444dc026 100644 --- a/docs/behind_scenes/planned_features.rst +++ b/docs/behind_scenes/planned_features.rst @@ -15,7 +15,7 @@ Planned features * Diffing events in a given frame. * Modifying the pipeline on the fly to change state. * Highlighting redundant state-setting. -* Tracking the dependencies or dependants of a given drawcall. +* Tracking the dependencies or dependants of a given action. * Exposing an API to applications so they can give more details or annotation, more tightly integrating with the app itself. * A low-resource mode so RenderDoc can be left on by default whenever running an app, so it's always available if a bug appears. * Attaching to an already-running application diff --git a/docs/getting_started/faq.rst b/docs/getting_started/faq.rst index 6f8d04f64..d2d54c611 100644 --- a/docs/getting_started/faq.rst +++ b/docs/getting_started/faq.rst @@ -255,3 +255,13 @@ By default RenderDoc will try to use the closest matching GPU to the one used on If a compatible GPU cannot be found - e.g. if the capture was made on an Intel GPU then the default - then the system default will be used. This selection process can be overridden using :ref:`the GPU selection replay option ` on a per-capture or global basis. + +.. _what-is-an-action: +.. _what-is-a-drawcall: + +What is an Action? +------------------ + +RenderDoc uses 'action' as an umbrella term to cover events like draws, dispatches, copies, clears, resolves, and other calls that cause the GPU to do work or can affect memory and resources like textures and buffers. This is sometimes referred to as a drawcall, but the term action is used to be less ambiguous compared to actual rasterization drawing. + +This means that when browsing in the event browser by default only actions will be shown, meaning you can only see the list of actions and user-defined markers. diff --git a/docs/getting_started/features.rst b/docs/getting_started/features.rst index 638b3912e..5be608c2f 100644 --- a/docs/getting_started/features.rst +++ b/docs/getting_started/features.rst @@ -24,9 +24,9 @@ Current Common Feature set * Timeline bar of the scene hierarchy. * Displays scene left-to-right in time, event hierarchy top-to-bottom. - * *Not* scaled based on time of each drawcall - * Individual draw events are shown as dots when the tree is full expanded. - * The currently selected resource in the texture viewer is highlighted below individual drawcalls visible that use it - e.g. orange for 'used for read', pale blue for 'used for write' + * *Not* scaled based on time of each action + * Individual actions are shown as dots when the tree is full expanded. + * The currently selected resource in the texture viewer is highlighted below individual actions visible that use it - e.g. orange for 'used for read', pale blue for 'used for write' * Flexible resource inspector. @@ -36,7 +36,7 @@ Current Common Feature set * The API calls used to create the object before its use in the frame are displayed. * Any object can be renamed, and its name automatically updates everywhere in the UI. -* For each drawcall, a list of all API calls (state/resource setting) is available, with each call optionally having a complete callstack to locate where it came from in-app. +* For each action, a list of all API calls (state/resource setting) is available, with each call optionally having a complete callstack to locate where it came from in-app. * Mesh buffer inspection and visualisation before/after vertex shader and at the end of the geometry pipeline (after GS or DS, whichever is later). All views have arcball and flycam controls, Projected data is not limited to the 2D viewport, RenderDoc attempts to unproject to allow viewing in world-space. * More advanced mesh visualisation such as viewing other components as position (e.g. to render a mesh in UV space), and visual mesh picking from both input and output panes. * 'Raw' buffer inspection for buffers. Custom format can be set with HLSL-lite or GLSL-lite syntax. @@ -56,7 +56,7 @@ Current Common Feature set * Custom visualisation shader support - e.g. decode custom packed formats or gbuffers. * Hot shader editing and replacement. * Auto-range fitting to min/max values in texture data, and histogram display. -* Simple per-drawcall timings and tabular view of GPU counter data. +* Simple per-action timings and tabular view of GPU counter data. * Python scripting console with full documented API, giving complete access to RenderDoc internals, core data structures, and the Qt UI itself. * Import and Export of captures diff --git a/docs/getting_started/quick_start.rst b/docs/getting_started/quick_start.rst index 758080847..acc75f5c5 100644 --- a/docs/getting_started/quick_start.rst +++ b/docs/getting_started/quick_start.rst @@ -89,7 +89,7 @@ More details can be found on the :doc:`../window/event_browser` page. .. |timeline_marker| image:: ../imgs/icons/timeline_marker.png -The Event Browser is the primary method of stepping through the frame and browsing the events that occurred within. The first column EID (Event ID) indicates which event or API call this was in the frame, chronologically. Events which are listed here are generally output/draw type events, including Clears. Copy and Map type calls are not included and are available in the API Calls view (see below). +The Event Browser is the primary method of stepping through the frame and browsing the events that occurred within. The first column EID (Event ID) indicates which event or API call this was in the frame, chronologically. Events which are listed here are known as actions. Actions are draws and dispatches but also events that modify resources like clears and copies. State setting and other CPU-update calls like Maps are not included and are available in the API Calls view (see below). The columns can be customised and reordered, the |timeline_marker| select columns button (or right-click) will allow you to choose which columns are displayed. @@ -136,11 +136,11 @@ More details can be found on the :doc:`../window/timeline_bar` page. The timeline bar is essentially an alternate view of the frame, with the horizontal axis being time in the frame. The horizontal axis is scaled evenly by API calls, such that every API call has the same width at any given zoom level. -The frame marker hierarchy is top-down in this case, and can be expanded or collapsed by clicking on each section. In this image, "Render Scene" and "Toon shading draw" are both expanded, but the other sections remain collapsed. Each drawcall is rendered as a blue pip underneath the section of the hierarchy that it is a child of. The current drawcall (if visible) is rendered as a green circle. +The frame marker hierarchy is top-down in this case, and can be expanded or collapsed by clicking on each section. In this image, "Render Scene" and "Toon shading draw" are both expanded, but the other sections remain collapsed. Each action is rendered as a blue pip underneath the section of the hierarchy that it is a child of. The current action (if visible) is rendered as a green circle. -There is a vertical line around the current drawcall, as well as a |flag_green| above, and a gray outline around the event where the mouse is hovering. +There is a vertical line around the current action, as well as a |flag_green| above, and a gray outline around the event where the mouse is hovering. -When the currently selected texture is used in the frame, each drawcall that references it draws a marker below the bar. The different colours of marker indicate whether the drawcall at that point is writing to the texture, reading, both reading & writing simultaneously, etc. If the markers are too close together they will space themselves to be readable and will not necessarily line up to a particular drawcall unless you zoom in. +When the currently selected texture is used in the frame, each action that references it draws a marker below the bar. The different colours of marker indicate whether the action at that point is writing to the texture, reading, both reading & writing simultaneously, etc. If the markers are too close together they will space themselves to be readable and will not necessarily line up to a particular action unless you zoom in. This can be a very useful tool to trace data through a frame, as well as highlighting potential redundancy or errors if a target is being written to where it should not. diff --git a/docs/getting_started/tips_tricks.rst b/docs/getting_started/tips_tricks.rst index ec60269e2..90ad9f351 100644 --- a/docs/getting_started/tips_tricks.rst +++ b/docs/getting_started/tips_tricks.rst @@ -80,5 +80,5 @@ Keyboard Shortcuts #. In the texture viewer you can hit :kbd:`Ctrl-G` to open a popup that lets you jump to a particular pixel co-ordinate. #. In the texture viewer, after selecting a pixel you can use the arrow keys to 'nudge' one pixel at a time in any direction to fine-tune the selection. #. To close a capture, press :kbd:`Ctrl-F4`. This will prompt to save if there are any unsaved changes. -#. Anywhere in the UI, you can use :kbd:`Ctrl-Left` and :kbd:`Ctrl-Right` to jump to the previous or next drawcall. +#. Anywhere in the UI, you can use :kbd:`Ctrl-Left` and :kbd:`Ctrl-Right` to jump to the previous or next action. #. If you :doc:`add some bookmarks <../how/how_annotate_capture>` you can globally press any key from :kbd:`Ctrl-1` to :kbd:`Ctrl-0` to jump to the first 10 bookmarks. diff --git a/docs/how/how_capture_callstack.rst b/docs/how/how_capture_callstack.rst index c19fb5409..bae8d04de 100644 --- a/docs/how/how_capture_callstack.rst +++ b/docs/how/how_capture_callstack.rst @@ -14,7 +14,7 @@ It can be useful when tracking down problems to have an idea of where each API c .. note:: - Callstack gathering has a reasonable overhead during capture and can slow things down as well as cause more memory overhead. This can be mitigated with the 'only drawcall callstacks' option that only lists callstacks for each drawcall event. + Callstack gathering has a reasonable overhead during capture and can slow things down as well as cause more memory overhead. This can be mitigated with the 'only action callstacks' option that only lists callstacks for each action. Launching Capture ----------------- @@ -25,7 +25,7 @@ When launching a capture (as in :doc:`how_capture_frame`) you should enable :gui Collect Callstacks: Option enabled on the capture dialog. -If you wish to save some time & overhead you can then enable :guilabel:`Only drawcall stacks`. This will only collect callstacks when a drawcall-type API call is made. This can be a good-enough trade off that still gets you the information you need, at a lower cost. After this point you can run the program and capture as usual. +If you wish to save some time & overhead you can then enable :guilabel:`Only action stacks`. This will only collect callstacks when an action call is made. This can be a good-enough trade off that still gets you the information you need, at a lower cost. After this point you can run the program and capture as usual. Replaying the capture --------------------- @@ -48,4 +48,4 @@ By default a symbol server will be used, as well as a few default locations such If a PDB cannot be located then you have the option of permanently ignoring that PDB. This can be useful for third party libraries for which no PDB will ever be available. If you don't ignore the PDB you will be prompted to locate it the next time you open a capture that references it. -Once the symbols have been successfully resolved the callstack section of the API inspector will contain any callstack that was collected for the given drawcall or API call. You can select and copy any levels and paste them elsewhere if you wish. +Once the symbols have been successfully resolved the callstack section of the API inspector will contain any callstack that was collected for the given action or API call. You can select and copy any levels and paste them elsewhere if you wish. diff --git a/docs/how/how_debug_shader.rst b/docs/how/how_debug_shader.rst index 370eee3de..09ecb8d76 100644 --- a/docs/how/how_debug_shader.rst +++ b/docs/how/how_debug_shader.rst @@ -42,12 +42,12 @@ Pixel debugging is launched from the texture viewer. For more details on selecti When a given pixel is selected you can click the history button underneath the pixel context. This will launch the :ref:`pixel-history` window with the selected pixel showing every modification. You can then choose to debug any of the triangles that generated a change. -If you already have the current drawcall selected that you want to debug, you can click the debug button to skip the pixel history and jump straight to the debugger. The inputs to the pixel will be automatically filled in. +If you already have the current draw selected that you want to debug, you can click the debug button to skip the pixel history and jump straight to the debugger. The inputs to the pixel will be automatically filled in. There are a couple of things to note while pixel debugging: -* If the drawcall selected doesn't write to the pixel you have highlighted, the pixel history window will open to let you choose which draw call to debug. -* If a drawcall overdraws the same pixel several times then the results of debugging will come from the last fragment that passed the depth test. If you wish to choose a particular fragment from the list then first launch the pixel history and choose which fragment to debug from the list there. +* If the draw selected doesn't write to the pixel you have highlighted, the pixel history window will open to let you choose which draw call to debug. +* If a draw overdraws the same pixel several times then the results of debugging will come from the last fragment that passed the depth test. If you wish to choose a particular fragment from the list then first launch the pixel history and choose which fragment to debug from the list there. Debugging a Compute thread -------------------------- diff --git a/docs/how/how_edit_shader.rst b/docs/how/how_edit_shader.rst index 8c9b6829b..00ed02fb7 100644 --- a/docs/how/how_edit_shader.rst +++ b/docs/how/how_edit_shader.rst @@ -22,7 +22,7 @@ RenderDoc allows you to edit a shader used in the capture and make changes to it To launch the shader editor, go to the pipeline stage you wish to change in the :doc:`../window/pipeline_state` windows, and click on the edit button |page_white_edit| next to the shader. If there are multiple edit options, a drop-down menu will be available - see below for more information about shader processing tools. -Any changes to the shader will affect any drawcall using this shader, not just the currently-selected drawcall. The changes will persist until the edit window is closed. +Any changes to the shader will affect any action using this shader, not just the currently-selected action. The changes will persist until the edit window is closed. Shader processing tools ----------------------- diff --git a/docs/how/how_import_export.rst b/docs/how/how_import_export.rst index a77ab39b4..6b84dc263 100644 --- a/docs/how/how_import_export.rst +++ b/docs/how/how_import_export.rst @@ -10,12 +10,12 @@ In-capture access The structured data is available through the :doc:`python scripting <../window/python_shell>`. As an example, we look at one function call from a capture: -First we obtain the :py:class:`APIEvent` that we want to examine, as the last event in a drawcall's list of events and find the chunk index it refers to: +First we obtain the :py:class:`APIEvent` that we want to examine, as the last event in an action's list of events and find the chunk index it refers to: .. highlight:: python .. code:: python - event = pyrenderdoc.GetDrawcall(111).events[-1] + event = pyrenderdoc.GetAction(111).events[-1] print("event %d is at chunk %d" % (event.eventId, event.chunkIndex)) .. highlight:: none diff --git a/docs/in_application_api.rst b/docs/in_application_api.rst index 544216dc3..10aa6e483 100644 --- a/docs/in_application_api.rst +++ b/docs/in_application_api.rst @@ -1,7 +1,7 @@ In-application API ================== -Reference for RenderDoc in-application API version 1.4.1. This API is not necessary to use RenderDoc by default, but if you would like more control or custom triggering of captures this API can provide the mechanism to do so. +Reference for RenderDoc in-application API version 1.4.2. This API is not necessary to use RenderDoc by default, but if you would like more control or custom triggering of captures this API can provide the mechanism to do so. Make sure to use a matching API header for your build - if you use a newer header, the API version may not be available. All RenderDoc builds supporting this API ship the header in their root directory. @@ -112,9 +112,9 @@ To do this you'll use your platforms dynamic library functions to see if the lib specifies whether each API call should save a callstack. Default is off. -.. cpp:enumerator:: RENDERDOC_CaptureOption::eRENDERDOC_Option_CaptureCallstacksOnlyDraws +.. cpp:enumerator:: RENDERDOC_CaptureOption::eRENDERDOC_Option_CaptureCallstacksOnlyActions - specifies whether - if ``CaptureCallstacks`` is enabled - callstacks are only saved on drawcalls. Default is off. + specifies whether - if ``CaptureCallstacks`` is enabled - callstacks are only saved on actions. Default is off. .. cpp:enumerator:: RENDERDOC_CaptureOption::eRENDERDOC_Option_DelayForDebugger diff --git a/docs/python_api/examples/basics.rst b/docs/python_api/examples/basics.rst index c7cc916b2..ea09cec53 100644 --- a/docs/python_api/examples/basics.rst +++ b/docs/python_api/examples/basics.rst @@ -11,13 +11,13 @@ ReplayController The primary interface for accessing the low level of RenderDoc's replay analysis is :py:class:`~renderdoc.ReplayController`. -From this interface, information about the capture can be gathered, using e.g. :py:meth:`~renderdoc.ReplayController.GetDrawcalls` to return the list of root-level drawcalls in the frame, or :py:meth:`~renderdoc.ReplayController.GetResources` to return a list of all resources in the capture. +From this interface, information about the capture can be gathered, using e.g. :py:meth:`~renderdoc.ReplayController.GetRootActions` to return the list of root-level actions in the frame, or :py:meth:`~renderdoc.ReplayController.GetResources` to return a list of all resources in the capture. Some methods like the two above return information which is global and does not vary across the frame. Most functions however return information relative to the current point in the frame. During RenderDoc's replay, you can imagine a cursor that moves back and forth between the start and end of the frame. All requests for information that varies - such as texture and buffer contents, pipeline state, and other information will be relative to the current event. -Every function call within a frame is assigned an ascending ``eventId``, from ``1`` up to as many events as are in the frame. Within the drawcall list returned by :py:meth:`~renderdoc.ReplayController.GetDrawcalls`, each drawcall contains a list of events in :py:attr:`~renderdoc.DrawcallDescription.events`. These contain all of the ``eventId`` that immediately preceeded the draw. The details of the function call can be found by using :py:attr:`~renderdoc.APIEvent.chunkIndex` as an index into the structured data returned from :py:meth:`~renderdoc.GetStructuredFile`. The structured data contains the function name and the complete set of parameters passed to it, with their values. +Every function call within a frame is assigned an ascending ``eventId``, from ``1`` up to as many events as are in the frame. Within the action list returned by :py:meth:`~renderdoc.ReplayController.GetRootActions`, each action contains a list of events in :py:attr:`~renderdoc.ActionDescription.events`. These contain all of the ``eventId`` that immediately preceeded the action. The details of the function call can be found by using :py:attr:`~renderdoc.APIEvent.chunkIndex` as an index into the structured data returned from :py:meth:`~renderdoc.GetStructuredFile`. The structured data contains the function name and the complete set of parameters passed to it, with their values. To change the current active event and move the cursor, you can call :py:meth:`~renderdoc.ReplayController.SetFrameEvent`. This will move the replay to represent the current state immediately after the given event has executed. @@ -51,4 +51,4 @@ Functions such as :py:meth:`~qrenderdoc.CaptureContext.GetTextureViewer` will re You can also create new instances of windows such as buffer or shader viewers using :py:meth:`~qrenderdoc.CaptureContext.ViewBuffer` or :py:meth:`~qrenderdoc.CaptureContext.ViewShader`. -The :py:class:`~qrenderdoc.CaptureContext` interface also provides useful utility functions such as :py:meth:`~qrenderdoc.CaptureContext.GetTexture` or :py:meth:`~qrenderdoc.CaptureContext.GetDrawcall` to look up objects by id instead of needing your own caching and lookup from the lists returned by the lower level interface. +The :py:class:`~qrenderdoc.CaptureContext` interface also provides useful utility functions such as :py:meth:`~qrenderdoc.CaptureContext.GetTexture` or :py:meth:`~qrenderdoc.CaptureContext.GetAction` to look up objects by id instead of needing your own caching and lookup from the lists returned by the lower level interface. diff --git a/docs/python_api/examples/qrenderdoc_intro.rst b/docs/python_api/examples/qrenderdoc_intro.rst index ced66f204..4f81f7dc3 100644 --- a/docs/python_api/examples/qrenderdoc_intro.rst +++ b/docs/python_api/examples/qrenderdoc_intro.rst @@ -45,7 +45,7 @@ To invoke onto the right thread, you can use :py:meth:`~qrenderdoc.ReplayManager .. code:: python def myCallback(controller): - print("%d top-level drawcalls" % len(controller.GetDrawcalls())) + print("%d top-level actions" % len(controller.GetRootActions())) pyrenderdoc.Replay().BlockInvoke(myCallback) diff --git a/docs/python_api/examples/renderdoc/decode_mesh.py b/docs/python_api/examples/renderdoc/decode_mesh.py index d7c434b30..3fb413136 100644 --- a/docs/python_api/examples/renderdoc/decode_mesh.py +++ b/docs/python_api/examples/renderdoc/decode_mesh.py @@ -94,7 +94,7 @@ def getMeshInputs(controller, draw): meshInput.numIndices = draw.numIndices # If the draw doesn't use an index buffer, don't use it even if bound - if not (draw.flags & rd.DrawFlags.Indexed): + if not (draw.flags & rd.ActionFlags.Indexed): meshInput.indexResourceId = rd.ResourceId.Null() # The total offset is the attribute offset from the base of the vertex @@ -223,7 +223,7 @@ def printMeshData(controller, meshData): def sampleCode(controller): # Find the biggest drawcall in the whole capture draw = None - for d in controller.GetDrawcalls(): + for d in controller.GetRootActions(): draw = biggestDraw(draw, d) # Move to that draw diff --git a/docs/python_api/examples/renderdoc/decode_mesh.rst b/docs/python_api/examples/renderdoc/decode_mesh.rst index ec76a22b2..95d1bfee7 100644 --- a/docs/python_api/examples/renderdoc/decode_mesh.rst +++ b/docs/python_api/examples/renderdoc/decode_mesh.rst @@ -36,7 +36,7 @@ In the object we pass both the indices (which does not vary per attribute in our meshInput.numIndices = draw.numIndices # If the draw doesn't use an index buffer, don't use it even if bound - if not (draw.flags & rd.DrawFlags.Indexed): + if not (draw.flags & rd.ActionFlags.Indexed): meshInput.indexResourceId = rd.ResourceId.Null() # The total offset is the attribute offset from the base of the vertex diff --git a/docs/python_api/examples/renderdoc/display_window.py b/docs/python_api/examples/renderdoc/display_window.py index 566e7853d..2b1fb232c 100644 --- a/docs/python_api/examples/renderdoc/display_window.py +++ b/docs/python_api/examples/renderdoc/display_window.py @@ -68,8 +68,8 @@ out = controller.CreateOutput(windata, rd.ReplayOutputType.Texture) # Fetch the list of textures textures = controller.GetTextures() -# Fetch the list of drawcalls -draws = controller.GetDrawcalls() +# Fetch the list of actions +actions = controller.GetRootActions() # Function to look up the texture descriptor for a given resourceId def getTexture(texid): @@ -85,23 +85,23 @@ def paint(): out.Display() window.after(33, paint) -# Start on the first drawcall -curdraw = draws[0] +# Start on the first action +curact = actions[0] loopcount = 0 -# The advance function will be called every 50ms, to move to the next draw +# The advance function will be called every 50ms, to move to the next action def advance(): - global out, window, curdraw, draws, loopcount + global out, window, curact, actions, loopcount - # Move to the current drawcall - controller.SetFrameEvent(curdraw.eventId, False) + # Move to the current action + controller.SetFrameEvent(curact.eventId, False) # Initialise a default TextureDisplay object disp = rd.TextureDisplay() # Set the first colour output as the texture to display - disp.resourceId = curdraw.outputs[0] + disp.resourceId = curact.outputs[0] if disp.resourceId != rd.ResourceId.Null(): # Get the details of this texture @@ -117,13 +117,13 @@ def advance(): # Update the texture display out.SetTextureDisplay(disp) - # Set the next drawcall - curdraw = curdraw.next + # Set the next action + curact = curact.next - # If we have no next draw, start again from the first - if curdraw is None: + # If we have no next action, start again from the first + if curact is None: loopcount = loopcount + 1 - curdraw = draws[0] + curact = actions[0] # after 3 loops, quit if loopcount == 3: diff --git a/docs/python_api/examples/renderdoc/display_window.rst b/docs/python_api/examples/renderdoc/display_window.rst index 4b6bd5576..f3453690c 100644 --- a/docs/python_api/examples/renderdoc/display_window.rst +++ b/docs/python_api/examples/renderdoc/display_window.rst @@ -43,7 +43,7 @@ Once we have the :py:class:`~renderdoc.WindowingData`, we can create a :py:class # Create a texture output on the window out = controller.CreateOutput(windata, rd.ReplayOutputType.Texture) -In order to iterate over all drawcalls we need some global state first from :py:meth:`~renderdoc.ReplayController.GetTextures` and :py:meth:`~renderdoc.ReplayController.GetDrawcalls`, and we'll also define a helper function to fetch a particular texture by resourceId, so that we can easily look up the details for a texture. +In order to iterate over all actions we need some global state first from :py:meth:`~renderdoc.ReplayController.GetTextures` and :py:meth:`~renderdoc.ReplayController.GetRootActions`, and we'll also define a helper function to fetch a particular texture by resourceId, so that we can easily look up the details for a texture. .. highlight:: python .. code:: python @@ -51,8 +51,8 @@ In order to iterate over all drawcalls we need some global state first from :py: # Fetch the list of textures textures = controller.GetTextures() - # Fetch the list of drawcalls - draws = controller.GetDrawcalls() + # Fetch the list of actions + actions = controller.GetRootActions() # Function to look up the texture descriptor for a given resourceId def getTexture(texid): @@ -62,7 +62,7 @@ In order to iterate over all drawcalls we need some global state first from :py: return tex return None -We now define two callback functions - ``paint`` and ``advance``. ``paint`` will be called every 33ms, it will display the output with the latest state using :py:meth:`~renderdoc.ReplayOutput.Display`. ``advance`` changes the current state to reflect a new drawcall. +We now define two callback functions - ``paint`` and ``advance``. ``paint`` will be called every 33ms, it will display the output with the latest state using :py:meth:`~renderdoc.ReplayOutput.Display`. ``advance`` changes the current state to reflect a new action. .. highlight:: python .. code:: python @@ -73,48 +73,60 @@ We now define two callback functions - ``paint`` and ``advance``. ``paint`` will out.Display() window.after(33, paint) -Within ``advance`` we do a few things. First we move the current event to the current drawcall's ``eventId``, using :py:meth:`~renderdoc.ReplayController.SetFrameEvent`. Then we set up the texture display configuration with :py:meth:`~renderdoc.ReplayOutput.SetTextureDisplay`, to point to the first colour output at that drawcall. +Within ``advance`` we do a few things. First we move the current event to the current action's ``eventId``, using :py:meth:`~renderdoc.ReplayController.SetFrameEvent`. Then we set up the texture display configuration with :py:meth:`~renderdoc.ReplayOutput.SetTextureDisplay`, to point to the first colour output at that action. When we update to a new texture, we fetch its details using our earlier ``getTexture`` and calculate a scale that keeps the texture fully visible on screen. -Finally we move to the next drawcall in the list for the next time ``advance`` is called. +Finally we move to the next action in the list for the next time ``advance`` is called. .. highlight:: python .. code:: python - # Start on the first drawcall - curdraw = 0 + # Start on the first action + curact = actions[0] + + loopcount = 0 - # The advance function will be called every 150ms, to move to the next draw + # The advance function will be called every 50ms, to move to the next action def advance(): - global out, window, curdraw - - # Move to the current drawcall - controller.SetFrameEvent(draws[curdraw].eventId, False) - + global out, window, curact, actions, loopcount + + # Move to the current action + controller.SetFrameEvent(curact.eventId, False) + # Initialise a default TextureDisplay object disp = rd.TextureDisplay() - + # Set the first colour output as the texture to display - disp.resourceId = draws[curdraw].outputs[0] - - # Get the details of this texture - texDetails = getTexture(disp.resourceId) - - # Calculate the scale required in width and height - widthScale = window.winfo_width() / texDetails.width - heightScale = window.winfo_height() / texDetails.height - - # Use the lower scale to fit the texture on the window - disp.scale = min(widthScale, heightScale) - - # Update the texture display - out.SetTextureDisplay(disp) - - # Set the next drawcall - curdraw = (curdraw + 1) % len(draws) - - window.after(150, advance) + disp.resourceId = curact.outputs[0] + + if disp.resourceId != rd.ResourceId.Null(): + # Get the details of this texture + texDetails = getTexture(disp.resourceId) + + # Calculate the scale required in width and height + widthScale = window.winfo_width() / texDetails.width + heightScale = window.winfo_height() / texDetails.height + + # Use the lower scale to fit the texture on the window + disp.scale = min(widthScale, heightScale) + + # Update the texture display + out.SetTextureDisplay(disp) + + # Set the next action + curact = curact.next + + # If we have no next action, start again from the first + if curact is None: + loopcount = loopcount + 1 + curact = actions[0] + + # after 3 loops, quit + if loopcount == 3: + window.quit() + else: + window.after(50, advance) Once we have the callbacks defined, we call them once to initialise the display and set up the repeated callbacks, and start the tkinter main window loop. diff --git a/docs/python_api/examples/renderdoc/fetch_counters.py b/docs/python_api/examples/renderdoc/fetch_counters.py index f8952c047..6c2c04c1c 100644 --- a/docs/python_api/examples/renderdoc/fetch_counters.py +++ b/docs/python_api/examples/renderdoc/fetch_counters.py @@ -7,23 +7,23 @@ if 'renderdoc' not in sys.modules and '_renderdoc' not in sys.modules: # Alias renderdoc for legibility rd = renderdoc -draws = {} +actions = {} -# Define a recursive function for iterating over draws +# Define a recursive function for iterating over actions def iterDraw(d, indent = ''): - global draws + global actions - # save the drawcall by eventId - draws[d.eventId] = d + # save the action by eventId + actions[d.eventId] = d # Iterate over the draw's children for d in d.children: iterDraw(d, indent + ' ') def sampleCode(controller): - # Iterate over all of the root drawcalls, so we have names for each + # Iterate over all of the root actions, so we have names for each # eventId - for d in controller.GetDrawcalls(): + for d in controller.GetRootActions(): iterDraw(d) # Enumerate the available counters @@ -50,10 +50,10 @@ def sampleCode(controller): # Look in the results for any draws with 0 samples written - this is an indication # that if a lot of draws appear then culling could be better. for r in results: - draw = draws[r.eventId] + draw = actions[r.eventId] # Only care about draws, not about clears and other misc events - if not (draw.flags & rd.DrawFlags.Drawcall): + if not (draw.flags & rd.ActionFlags.Drawcall): continue if samplesPassedDesc.resultByteWidth == 4: diff --git a/docs/python_api/examples/renderdoc/fetch_counters.rst b/docs/python_api/examples/renderdoc/fetch_counters.rst index 3bcb87bcb..1986079df 100644 --- a/docs/python_api/examples/renderdoc/fetch_counters.rst +++ b/docs/python_api/examples/renderdoc/fetch_counters.rst @@ -1,7 +1,7 @@ Fetch GPU Counter Data ====================== -In this example we will gather GPU counter data over a capture and find any drawcalls that completely failed the depth/stencil test. +In this example we will gather GPU counter data over a capture and find any actions that completely failed the depth/stencil test. The first thing we do is enumerate a list of counters that the implementation supports using :py:meth:`~renderdoc.ReplayController.EnumerateCounters`. A few of these counters values are statically known - see :py:class:`~renderdoc.GPUCounter`. If you know which counter you want ahead of time you can continue straight away by calling :py:meth:`~renderdoc.ReplayController.FetchCounters` with a list of counters to sample from, or :py:meth:`~renderdoc.ReplayController.DescribeCounter` to obtain a :py:class:`~renderdoc.CounterDescription` of the counter itself: @@ -34,7 +34,7 @@ However we will also print all available counters. If the implementation support print(" %s" % desc.description) print(" Returns %d byte %s, representing %s" % (desc.resultByteWidth, desc.resultType, desc.unit)) -Once we have the list of :py:class:`~renderdoc.CounterResult` from sampling the specified counters, each result returned is for one counter on one event. Since we only fetched one counter we can simply iterate over the results looking up the drawcall for each. For actual draws (excluding clears and markers etc) we use the counter description to determine the data payload size, and get the value out. Interpreting this can either happen based on the description, or in our case we know that this counter returns a simple value we can check: +Once we have the list of :py:class:`~renderdoc.CounterResult` from sampling the specified counters, each result returned is for one counter on one event. Since we only fetched one counter we can simply iterate over the results looking up the action for each. For actual draws (excluding clears and markers etc) we use the counter description to determine the data payload size, and get the value out. Interpreting this can either happen based on the description, or in our case we know that this counter returns a simple value we can check: .. highlight:: python .. code:: python @@ -42,10 +42,10 @@ Once we have the list of :py:class:`~renderdoc.CounterResult` from sampling the # Look in the results for any draws with 0 samples written - this is an indication # that if a lot of draws appear then culling could be better. for r in results: - draw = draws[r.eventId] + draw = actions[r.eventId] # Only care about draws, not about clears and other misc events - if not (draw.flags & rd.DrawFlags.Drawcall): + if not (draw.flags & rd.ActionFlags.Drawcall): continue if samplesPassedDesc.resultByteWidth == 4: diff --git a/docs/python_api/examples/renderdoc/index.rst b/docs/python_api/examples/renderdoc/index.rst index 9560d6d8b..5415a5495 100644 --- a/docs/python_api/examples/renderdoc/index.rst +++ b/docs/python_api/examples/renderdoc/index.rst @@ -26,7 +26,7 @@ In order to help with this, the examples are organised such that most code is wr cap.Shutdown() .. toctree:: - iter_draws + iter_actions fetch_shader fetch_counters save_texture diff --git a/docs/python_api/examples/renderdoc/iter_draws.py b/docs/python_api/examples/renderdoc/iter_actions.py similarity index 62% rename from docs/python_api/examples/renderdoc/iter_draws.py rename to docs/python_api/examples/renderdoc/iter_actions.py index dd7d163f6..5ce31f5bc 100644 --- a/docs/python_api/examples/renderdoc/iter_draws.py +++ b/docs/python_api/examples/renderdoc/iter_actions.py @@ -7,56 +7,56 @@ if 'renderdoc' not in sys.modules and '_renderdoc' not in sys.modules: # Alias renderdoc for legibility rd = renderdoc -# Define a recursive function for iterating over draws -def iterDraw(d, indent = ''): - # Print this drawcall +# Define a recursive function for iterating over actions +def iterAction(d, indent = ''): + # Print this action print('%s%d: %s' % (indent, d.eventId, d.name)) - # Iterate over the draw's children + # Iterate over the action's children for d in d.children: - iterDraw(d, indent + ' ') + iterAction(d, indent + ' ') def sampleCode(controller): - # Iterate over all of the root drawcalls - for d in controller.GetDrawcalls(): - iterDraw(d) + # Iterate over all of the root actions + for d in controller.GetRootActions(): + iterAction(d) - # Start iterating from the first real draw as a child of markers - draw = controller.GetDrawcalls()[0] + # Start iterating from the first real action as a child of markers + action = controller.GetRootActions()[0] - while len(draw.children) > 0: - draw = draw.children[0] + while len(action.children) > 0: + action = action.children[0] # Counter for which pass we're in passnum = 0 - # Counter for how many draws are in the pass + # Counter for how many actions are in the pass passcontents = 0 - # Whether we've started seeing draws in the pass - i.e. we're past any + # Whether we've started seeing actions in the pass - i.e. we're past any # starting clear calls that may be batched together inpass = False - print("Pass #0 starts with %d: %s" % (draw.eventId, draw.name)) + print("Pass #0 starts with %d: %s" % (action.eventId, action.name)) - while draw != None: + while action != None: # When we encounter a clear - if draw.flags & rd.DrawFlags.Clear: + if action.flags & rd.ActionFlags.Clear: if inpass: - print("Pass #%d contained %d draws" % (passnum, passcontents)) + print("Pass #%d contained %d actions" % (passnum, passcontents)) passnum += 1 - print("Pass #%d starts with %d: %s" % (passnum, draw.eventId, draw.name)) + print("Pass #%d starts with %d: %s" % (passnum, action.eventId, action.name)) passcontents = 0 inpass = False else: passcontents += 1 inpass = True - # Advance to the next drawcall - draw = draw.next - if draw is None: + # Advance to the next action + action = action.next + if action is None: break if inpass: - print("Pass #%d contained %d draws" % (passnum, passcontents)) + print("Pass #%d contained %d actions" % (passnum, passcontents)) def loadCapture(filename): # Open a capture file handle diff --git a/docs/python_api/examples/renderdoc/iter_draws.rst b/docs/python_api/examples/renderdoc/iter_actions.rst similarity index 75% rename from docs/python_api/examples/renderdoc/iter_draws.rst rename to docs/python_api/examples/renderdoc/iter_actions.rst index 425a11b21..2daa1f064 100644 --- a/docs/python_api/examples/renderdoc/iter_draws.rst +++ b/docs/python_api/examples/renderdoc/iter_actions.rst @@ -1,24 +1,24 @@ -Iterate drawcall tree -===================== +Iterate Action tree +=================== -In this example we will show how to iterate over drawcalls. +In this example we will show how to iterate over actions. -The drawcalls returned from :py:meth:`~renderdoc.ReplayController.GetDrawcalls` are draws or marker regions at the root level - with no parent marker region. There are multiple ways to iterate through the list of draws. +The actions returned from :py:meth:`~renderdoc.ReplayController.GetRootActions` are actions or marker regions at the root level - with no parent marker region. There are multiple ways to iterate through the list of actions. -The first way illustrated in this sample is to walk the tree using :py:attr:`~renderdoc.DrawcallDescription.children`, which contains the list of child draws at any point in the tree. There is also :py:attr:`~renderdoc.DrawcallDescription.parent` which points to the parent drawcall. +The first way illustrated in this sample is to walk the tree using :py:attr:`~renderdoc.ActionDescription.children`, which contains the list of child actions at any point in the tree. There is also :py:attr:`~renderdoc.ActionDescription.parent` which points to the parent action. -The second is to use :py:attr:`~renderdoc.DrawcallDescription.previous` and :py:attr:`~renderdoc.DrawcallDescription.next`, which point to the previous and next draw respectively in a linear fashion, regardless of nesting depth. +The second is to use :py:attr:`~renderdoc.ActionDescription.previous` and :py:attr:`~renderdoc.ActionDescription.next`, which point to the previous and next action respectively in a linear fashion, regardless of nesting depth. -In the example we use this iteration to determine the number of passes, using the drawcall flags to denote the start of each pass by a starting clear call. +In the example we use this iteration to determine the number of passes, using the action flags to denote the start of each pass by a starting clear call. Example Source -------------- .. only:: html and not htmlhelp - :download:`Download the example script `. + :download:`Download the example script `. -.. literalinclude:: iter_draws.py +.. literalinclude:: iter_actions.py Sample output: @@ -95,11 +95,11 @@ Sample output: 652: API Calls 655: End of Frame Pass #0 starts with 2: ClearRenderTargetView(0.000000, 0.000000, 0.000000, 1.000000) - Pass #0 contained 24 draws + Pass #0 contained 24 actions Pass #1 starts with 319: ClearDepthStencilView(D=1.000000, S=00) - Pass #1 contained 24 draws + Pass #1 contained 24 actions Pass #2 starts with 558: ClearRenderTargetView(0.000000, 0.000000, 0.000000, 1.000000) - Pass #2 contained 3 draws + Pass #2 contained 3 actions Pass #3 starts with 617: ClearRenderTargetView(0.000000, 0.000000, 0.000000, 1.000000) - Pass #3 contained 4 draws + Pass #3 contained 4 actions diff --git a/docs/python_api/examples/renderdoc/save_texture.py b/docs/python_api/examples/renderdoc/save_texture.py index fe98f0023..8843685dd 100644 --- a/docs/python_api/examples/renderdoc/save_texture.py +++ b/docs/python_api/examples/renderdoc/save_texture.py @@ -24,7 +24,7 @@ def biggestDraw(prevBiggest, d): def sampleCode(controller): # Find the biggest drawcall in the whole capture draw = None - for d in controller.GetDrawcalls(): + for d in controller.GetRootActions(): draw = biggestDraw(draw, d) # Move to that draw diff --git a/docs/python_api/examples/renderdoc/save_texture.rst b/docs/python_api/examples/renderdoc/save_texture.rst index 366e4cf64..4f969384c 100644 --- a/docs/python_api/examples/renderdoc/save_texture.rst +++ b/docs/python_api/examples/renderdoc/save_texture.rst @@ -1,11 +1,11 @@ Save a texture to disk ====================== -In this example we will find a particular drawcall, and save the color output to disk as an image file. +In this example we will find a particular action, and save the color output to disk as an image file. -To begin with, so that we have an interesting drawcall selected we iterate over the list of draws finding the drawcall with the highest vertex count. For more on how to iterate through a capture's list of drawcalls, see :doc:`iter_draws`. +To begin with, so that we have an interesting action selected we iterate over the list of actions finding the draw with the highest vertex count. For more on how to iterate through a capture's list of actions, see :doc:`iter_actions`. -Once we have set the drawcall we want as the current event, we can configure the texture save operation. To do this we create a :py:class:`~renderdoc.TextureSave` object. The properties of the object determine how the texture will be mapped to an image file to be saved to disk. +Once we have set the draw we want as the current event, we can configure the texture save operation. To do this we create a :py:class:`~renderdoc.TextureSave` object. The properties of the object determine how the texture will be mapped to an image file to be saved to disk. At minimum you need to select a file format, and we'll try a few - :py:attr:`~renderdoc.FileType.JPG`, :py:attr:`~renderdoc.FileType.HDR`, :py:attr:`~renderdoc.FileType.PNG`, and :py:attr:`~renderdoc.FileType.DDS`. diff --git a/docs/python_api/examples/renderdoc_intro.py b/docs/python_api/examples/renderdoc_intro.py index cb2662750..7e93fd4d7 100644 --- a/docs/python_api/examples/renderdoc_intro.py +++ b/docs/python_api/examples/renderdoc_intro.py @@ -23,7 +23,7 @@ if status != rd.ReplayStatus.Succeeded: raise RuntimeError("Couldn't initialise replay: " + str(status)) # Now we can use the controller! -print("%d top-level drawcalls" % len(controller.GetDrawcalls())) +print("%d top-level actions" % len(controller.GetRootActions())) controller.Shutdown() diff --git a/docs/python_api/examples/renderdoc_intro.rst b/docs/python_api/examples/renderdoc_intro.rst index e37566880..f8c87592e 100644 --- a/docs/python_api/examples/renderdoc_intro.rst +++ b/docs/python_api/examples/renderdoc_intro.rst @@ -99,7 +99,7 @@ This function call will open the capture and begin to replay it, and initialise raise RuntimeError("Couldn't initialise replay: " + str(status)) # Now we can use the controller! - print("%d top-level drawcalls" % len(controller.GetDrawcalls())) + print("%d top-level actions" % len(controller.GetRootActions())) Once we're done with the interfaces, we should call the ``Shutdown`` function on each, this allows the C++ interface to release the resources allocated. diff --git a/docs/python_api/renderdoc/analysis.rst b/docs/python_api/renderdoc/analysis.rst index 97ab0bcc4..d1e2938ea 100644 --- a/docs/python_api/renderdoc/analysis.rst +++ b/docs/python_api/renderdoc/analysis.rst @@ -5,16 +5,16 @@ Replay Analysis .. currentmodule:: renderdoc -Frame and Drawcalls -------------------- +Frame and Actions +----------------- .. autoclass:: FrameDescription :members: -.. autoclass:: DrawcallDescription +.. autoclass:: ActionDescription :members: -.. autoclass:: DrawFlags +.. autoclass:: ActionFlags :members: .. autoclass:: APIEvent diff --git a/docs/python_api/ui_extension_tutorial/__init__.py b/docs/python_api/ui_extension_tutorial/__init__.py index 3de1e98df..587edf3f8 100644 --- a/docs/python_api/ui_extension_tutorial/__init__.py +++ b/docs/python_api/ui_extension_tutorial/__init__.py @@ -56,16 +56,16 @@ class Window(qrd.CaptureViewer): pass def OnEventChanged(self, event): - draw = self.ctx.GetDrawcall(event) + action = self.ctx.GetAction(event) breadcrumbs = '' - if draw is not None: - breadcrumbs = '@{}: {}'.format(draw.eventId, draw.name) + if action is not None: + breadcrumbs = '@{}: {}'.format(action.eventId, action.name) - while draw.parent is not None: - draw = draw.parent - breadcrumbs = '@{}: {}'.format(draw.eventId, draw.name) + '\n' + breadcrumbs + while action.parent is not None: + action = action.parent + breadcrumbs = '@{}: {}'.format(action.eventId, action.name) + '\n' + breadcrumbs self.mqt.SetWidgetText(self.breadcrumbs, "Breadcrumbs:\n{}".format(breadcrumbs)) diff --git a/docs/python_api/ui_extensions.rst b/docs/python_api/ui_extensions.rst index 32d0ed3c7..7edb92603 100644 --- a/docs/python_api/ui_extensions.rst +++ b/docs/python_api/ui_extensions.rst @@ -45,7 +45,7 @@ Now we have a new menu item which when clicked produces a popup message dialog! Python extension generating a message box -This is a good proof of concept, but really we want something more directly usable. Instead of showing a message box, let's show a window which reacts to the selected drawcall by showing a series of breadcrumbs for marker labels. +This is a good proof of concept, but really we want something more directly usable. Instead of showing a message box, let's show a window which reacts to the selected action by showing a series of breadcrumbs for marker labels. Adding a window and capture viewer ---------------------------------- @@ -110,16 +110,16 @@ And finally we can fill in the event functions to set the breadcrumbs. We use `` pass def OnEventChanged(self, event): - draw = self.ctx.GetDrawcall(event) + action = self.ctx.GetAction(event) breadcrumbs = '' - if draw is not None: - breadcrumbs = '@{}: {}'.format(draw.eventId, draw.name) + if action is not None: + breadcrumbs = '@{}: {}'.format(action.eventId, action.name) - while draw.parent is not None: - draw = draw.parent - breadcrumbs = '@{}: {}'.format(draw.eventId, draw.name) + '\n' + breadcrumbs + while action.parent is not None: + action = action.parent + breadcrumbs = '@{}: {}'.format(action.eventId, action.name) + '\n' + breadcrumbs self.mqt.SetWidgetText(self.breadcrumbs, "Breadcrumbs:\n{}".format(breadcrumbs)) @@ -176,12 +176,12 @@ With that we now have a new little breadcrumbs window that docks itself above ou .. figure:: ../imgs/python_ext/Step2.png - Python extension showing the current draw's breadcrumbs + Python extension showing the current action's breadcrumbs Calling onto replay thread -------------------------- -So far this has worked well, but we're only using information available on the UI thread. A good amount of useful information is cached on the UI thread including the current pipeline state and drawcalls, but for some work we might want to call into the underlying analysis functions. When we do this we must do it on the replay thread to avoid blocking the UI if the analysis work takes a long time. +So far this has worked well, but we're only using information available on the UI thread. A good amount of useful information is cached on the UI thread including the current pipeline state and actions, but for some work we might want to call into the underlying analysis functions. When we do this we must do it on the replay thread to avoid blocking the UI if the analysis work takes a long time. This can get quite complex so we will do something very simple, in the message box callback that we created earlier instead of displaying the message box immediately we will first figure out the minimum and maximum values for the current depth output or first colour output and display that. diff --git a/docs/renderdoc.hhk b/docs/renderdoc.hhk index 022270788..bb6d00d90 100644 --- a/docs/renderdoc.hhk +++ b/docs/renderdoc.hhk @@ -82,12 +82,12 @@
  • - - + +
  • - +
  • @@ -350,8 +350,8 @@
  • - - + +
  • diff --git a/docs/window/api_inspector.rst b/docs/window/api_inspector.rst index 98b14bf88..7f9740da6 100644 --- a/docs/window/api_inspector.rst +++ b/docs/window/api_inspector.rst @@ -6,20 +6,20 @@ Although not the most complex part of the RenderDoc's UI, this page details the UI Elements ----------- -The API Inspector is divided into two sections - the top section is the most common, detailing all of the API calls leading up to and including the current drawcall. The special case for this is the end of the frame where there may not be a final drawcall but the API Inspector lists the API calls that preceded the final flip of the backbuffer that marks the end of RenderDoc's captured frame. +The API Inspector is divided into two sections - the top section is the most common, detailing all of the API calls leading up to and including the current action. The special case for this is the end of the frame where there may not be a final action but the API Inspector lists the API calls that preceded the final flip of the backbuffer that marks the end of RenderDoc's captured frame. The bottom section is less commonly used but shows the callstack from user code into the API entry point, if such a callstack is available and the symbols are resolved. For more information check out the page on :doc:`../how/how_capture_callstack`. API Calls --------- -This section lists the series of API calls made between the preceding drawcall and the currently selected drawcall. The current drawcall is always the last element in this list and is highlighted in bold. By default it is also the selected element. +This section lists the series of API calls made between the preceding action and the currently selected action. The current action is always the last element in this list and is highlighted in bold. By default it is also the selected element. Each API call can be expanded to see the parameters that were passed to it, in the form that they were serialised out to the log file. .. figure:: ../imgs/Screenshots/APIList.png - API Calls: A list of API calls made up to the current draw. + API Calls: A list of API calls made up to the current action. Callstack --------- @@ -28,7 +28,7 @@ The callstack section can be expanded by double clicking on the separator and co This section will either show "No callstack available" or "Need to resolve symbols" as appropriate when the callstacks aren't ready for display. -The callstack follows the currently selected API call in the other section, and will update both as that selected call change and as the current event changes (as this implicitly changes the API call selected to whichever the current drawcall is). +The callstack follows the currently selected API call in the other section, and will update both as that selected call change and as the current event changes (as this implicitly changes the API call selected to whichever the current action is). For more information see :doc:`../how/how_capture_callstack` diff --git a/docs/window/buffer_viewer.rst b/docs/window/buffer_viewer.rst index 9d75d068f..e5e138721 100644 --- a/docs/window/buffer_viewer.rst +++ b/docs/window/buffer_viewer.rst @@ -60,7 +60,7 @@ In the 3D Mesh preview, you have the option to display the mesh with some solid To select which element will be displayed as secondary, simply right click on the column you would like to use. This can be done on the input and output separately, and 4-component columns have the option to either show RGB as color, or alpha as grayscale. -The selection will be remembered as long as the mesh format stays consistent between draws. +The selection will be remembered as long as the mesh format stays consistent between actions. You can also use this if the position data isn't detected in your inputs and you'd like to choose which element contains the positions, or if you'd like to visualise some other data such as UV co-ordinates as positional (in effect rendering the mesh in uv-space). diff --git a/docs/window/capture_attach.rst b/docs/window/capture_attach.rst index df97202b2..1945fa403 100644 --- a/docs/window/capture_attach.rst +++ b/docs/window/capture_attach.rst @@ -91,9 +91,9 @@ This option will cause RenderDoc to save a callstack from user code into the API ---------- - | :guilabel:`Only Drawcall Callstacks` Default: ``Disabled`` + | :guilabel:`Only Action Callstacks` Default: ``Disabled`` -This option modifies the above capturing of callstacks to only be saved for drawcall-type API calls. This can reduce the CPU load, as well as file-size and memory overhead of capturing callstacks for every API call which may not be desired. Only valid if ``Collect Callstacks`` is enabled. +This option modifies the above capturing of callstacks to only be saved for action calls. This can reduce the CPU load, as well as file-size and memory overhead of capturing callstacks for every API call which may not be desired. Only valid if ``Collect Callstacks`` is enabled. ---------- diff --git a/docs/window/event_browser.rst b/docs/window/event_browser.rst index c57694350..cd3216d3d 100644 --- a/docs/window/event_browser.rst +++ b/docs/window/event_browser.rst @@ -1,7 +1,7 @@ Event Browser ============= -The Event Browser is the primary method of browsing the frame and selecting different drawcalls. It displays the user-annotated hierarchical display of sections. +The Event Browser is the primary method of browsing the frame and selecting different actions. It displays the user-annotated hierarchical display of sections. Annotating your frame --------------------- @@ -23,16 +23,16 @@ To select which columns should be visible, right click the header or click the | .. note:: - Note that when timing drawcalls the duration column will automatically be added to display the data. + Note that when timing actions the duration column will automatically be added to display the data. -Timing drawcalls ----------------- +Timing actions +-------------- .. |time| image:: ../imgs/icons/time.png -To time the GPU duration of each drawcall, click the timer button |time|. +To time the GPU duration of each action, click the timer button |time|. -This will automatically run a process to get the time of each drawcall and display it in the duration column, which will be added if necessary. +This will automatically run a process to get the time of each action and display it in the duration column, which will be added if necessary. You can configure which time unit is used for the duration column on the fly in the :doc:`settings_window`. @@ -51,7 +51,7 @@ The currently selected event is highlighted and indicated with a green flag |fla Current Event: The Event browser showing several sections and the current event. -The EID column indicates the event ID of the drawcall listed. Event IDs are assigned starting from 1 and increase every time an API call is made - for this reason drawcall EIDs are not necessarily contiguous. +The EID column indicates the event ID of the action listed. Event IDs are assigned starting from 1 and increase every time an API call is made - for this reason action EIDs are not necessarily contiguous. Simply clicking on a different event will select it as current, and selecting a parent node with some child events will act as if the final child is selected - in other words selecting a node with several children will show the results of all children having happened. @@ -85,7 +85,7 @@ There are two other controls available in the Event Browser to aid in navigating .. |find| image:: ../imgs/icons/find.png -Pressing :kbd:`Ctrl-F` will open the find-event toolbar |find|. This toolbar allows you to type in a partial text filter that will be matched against both labels and drawcall events. The find will be executed when you press enter, although you can then adjust the text and re-search if you wish. +Pressing :kbd:`Ctrl-F` will open the find-event toolbar |find|. This toolbar allows you to type in a partial text filter that will be matched against both labels and action events. The find will be executed when you press enter, although you can then adjust the text and re-search if you wish. If the event found lies inside an unexpanded section, the sections will be expanded until the matching event is visible. @@ -105,7 +105,7 @@ You can also jump up and down between find results with the previous |arrow_left Highlighted Results: The results of a find are highlighted with an icon. -Pressing :kbd:`Ctrl-G` will open the jump to EID toolbar. This allows you to type in an EID and jump straight there, expanding nodes as necessary. If the EID typed doesn't exist in the list of drawcalls, the closest matching EID will be jumped to. +Pressing :kbd:`Ctrl-G` will open the jump to EID toolbar. This allows you to type in an EID and jump straight there, expanding nodes as necessary. If the EID typed doesn't exist in the list of actions, the closest matching EID will be jumped to. When you hit enter to jump to an EID, the toolbar closes and if you wish to jump again you must press :kbd:`Ctrl-G` again diff --git a/docs/window/performance_counter_viewer.rst b/docs/window/performance_counter_viewer.rst index d629b3e74..e9cfed2f1 100644 --- a/docs/window/performance_counter_viewer.rst +++ b/docs/window/performance_counter_viewer.rst @@ -29,7 +29,7 @@ When clicking :guilabel:`Sample Counters` in the counter selection dialog above, Performance Counter Viewer: Viewing the results of the counters. -By default the table is sorted by EID, but each column is sortable individually so that you can easily identify the drawcall with the highest or lowest value for any given counter. +By default the table is sorted by EID, but each column is sortable individually so that you can easily identify the action with the highest or lowest value for any given counter. .. |save| image:: ../imgs/icons/save.png diff --git a/docs/window/pipeline_state.rst b/docs/window/pipeline_state.rst index 6212c2b22..25e87ce67 100644 --- a/docs/window/pipeline_state.rst +++ b/docs/window/pipeline_state.rst @@ -10,7 +10,7 @@ At the top of the Pipeline Viewer is the pipeline flowchart - this shows the hig Each block is a separate page which contains the relevant state and contents for that piece of the graphics pipeline, with specific details varying by API and the type of data to be displayed. -The currently selected block is outlined with red, and the page in view reflects the contents of that section of the pipeline. Light gray parts of the pipeline are those which are currently active and participating in this drawcall. Dark gray parts of the pipeline are not enabled and can be considered pass-through/do-nothing. +The currently selected block is outlined with red, and the page in view reflects the contents of that section of the pipeline. Light gray parts of the pipeline are those which are currently active and participating in this action. Dark gray parts of the pipeline are not enabled and can be considered pass-through/do-nothing. .. figure:: ../imgs/Screenshots/PipelineBar.png @@ -23,7 +23,7 @@ The currently selected block is outlined with red, and the page in view reflects Pipeline Section Display ------------------------ -The pipeline state viewer always displays the state of the pipeline *after* the execution of the drawcall, as with the other viewers in RenderDoc. +The pipeline state viewer always displays the state of the pipeline *after* the execution of the action, as with the other viewers in RenderDoc. Any resources that are bound to the pipeline can be opened in more detailed viewers, such as vertex buffers, constant buffers and textures. More details of this process can be found in the page :doc:`../how/how_object_details`. diff --git a/docs/window/settings_window.rst b/docs/window/settings_window.rst index 2e74694bb..7dfdc29ca 100644 --- a/docs/window/settings_window.rst +++ b/docs/window/settings_window.rst @@ -243,7 +243,7 @@ Event Browser options | :guilabel:`Time unit used for event browser timings` Default: ``Microseconds`` -This option allows you to select the unit that will be shown in the duration column in the event browser when you time individual drawcalls. +This option allows you to select the unit that will be shown in the duration column in the event browser when you time individual actions. Seconds through to nanoseconds are supported. @@ -251,9 +251,9 @@ Seconds through to nanoseconds are supported. | :guilabel:`Add fake markers if none present` Default: ``Enable`` -If a capture is found to contain no markers whatsoever, RenderDoc will generate some default markers based on grouping drawcalls by the different output targets that they are drawing to. Roughly forming 'passes' of different types. +If a capture is found to contain no markers whatsoever, RenderDoc will generate some default markers based on grouping actions by the different output targets that they are drawing to. Roughly forming 'passes' of different types. -You can disable this option here if you want to view a pure list of drawcalls with no annotations. +You can disable this option here if you want to view a pure list of actions with no annotations. This option only applies itself the next time you load a capture. diff --git a/docs/window/shader_messages.rst b/docs/window/shader_messages.rst index de026a254..1257dd95f 100644 --- a/docs/window/shader_messages.rst +++ b/docs/window/shader_messages.rst @@ -1,9 +1,9 @@ Shader Messages =============== -The Shader Messages window shows messages obtained from shader prints in a given drawcall. +The Shader Messages window shows messages obtained from shader prints in a given action. -When selecting a draw you have the option to open the list of messages, which can be viewed in this window and filtered/processed. +When selecting an action you have the option to open the list of messages, which can be viewed in this window and filtered/processed. .. note:: @@ -19,7 +19,7 @@ For Vulkan the SPIR-V extension ``NonSemantic.DebugPrintf`` is used to list prin Fetching shader messages ------------------------ -Shader messages are not fetched for the whole capture at once, they are fetched on a per-draw basis when that drawcall is selected. If any messages appear they will be shown in the event browser next to the draw, with a link that opens the shader message viewer for those messages. The messages can also be found linked from the pipeline state under each shader stage, which will pre-filter for only messages from that stage. +Shader messages are not fetched for the whole capture at once, they are fetched on a per-action basis when that action is selected. If any messages appear they will be shown in the event browser next to the action, with a link that opens the shader message viewer for those messages. The messages can also be found linked from the pipeline state under each shader stage, which will pre-filter for only messages from that stage. Shader Messages --------------- @@ -44,6 +44,6 @@ Double clicking on any row will take you to the corresponding event ID in the ev Shader Edits ------------ -Since prints come from shaders, the expectation is that they are fixed for a given drawcall and so they are cached and not re-fetched each time the drawcall is selected. +Since prints come from shaders, the expectation is that they are fixed for a given action and so they are cached and not re-fetched each time the action is selected. -However this doesn't hold if the shader is edited, since the print could change or the control flow and inputs could change. When this happens any previous shader messages windows will show up as 'stale' until the drawcall is selected where they will refresh themselves with the latest messages. If the drawcall is already selected then the messages will update immediately. +However this doesn't hold if the shader is edited, since the print could change or the control flow and inputs could change. When this happens any previous shader messages windows will show up as 'stale' until the action is selected where they will refresh themselves with the latest messages. If the action is already selected then the messages will update immediately. diff --git a/docs/window/texture_viewer.rst b/docs/window/texture_viewer.rst index 1fc39f907..0c3ae9bcf 100644 --- a/docs/window/texture_viewer.rst +++ b/docs/window/texture_viewer.rst @@ -53,7 +53,7 @@ There are several thumbnail strip panels available, by default they are docked i These strips display thumbnails of the resources bound to their respective parts of the pipeline, to give some context and allow quick preview without having to switch the main display between these textures. -The texture that the following tab is currently displaying is highlighted in red, and each thumbnail shows both the slot number and the name of the texture bound at that point. To follow a given slot simply left click on it. If the currently followed texture slot is empty (i.e. it was following a texture and then that slot became unbound in a different drawcall) it will show up simply named "Unbound" and with no name or slot number. +The texture that the following tab is currently displaying is highlighted in red, and each thumbnail shows both the slot number and the name of the texture bound at that point. To follow a given slot simply left click on it. If the currently followed texture slot is empty (i.e. it was following a texture and then that slot became unbound in a different action) it will show up simply named "Unbound" and with no name or slot number. Each thumbnail has a context menu available via right click. This menu allows you to open a locked tab (:doc:`../how/how_view_texture`), jump to the :doc:`resource inspector <../window/resource_inspector>`, as well as containing a list of all the uses of this texture - as read-only resource and writable output. This is similar to the resource display strip on the :doc:`timeline_bar`. Clicking on any of these entries will jump to the first of the events in the event range listed. @@ -76,7 +76,7 @@ You can adjust the selected pixel with the arrow keys on your keyboard after pic Pixel context: Pixel context displaying the surrounds of the picked pixel. -From here, once you have selected a pixel, you can also launch the :doc:`pixel debugger <../how/how_debug_shader>` if you have the drawcall that you want to debug selected. You can also launch the :ref:`pixel-history` view which shows all modifications that have happened to the texture since the start of the frame to the currently selected event. +From here, once you have selected a pixel, you can also launch the :doc:`pixel debugger <../how/how_debug_shader>` if you have the draw that you want to debug selected. You can also launch the :ref:`pixel-history` view which shows all modifications that have happened to the texture since the start of the frame to the currently selected event. Visible Range Control --------------------- @@ -316,6 +316,8 @@ Render Overlay This is a powerful tool for quickly diagnosing issues and can be very useful for locating what you're looking for. Several overlays are available that can be rendered over any texture, although most of them are only meaningful for currently bound render targets. +These overlays are only relevant when the currently selected action is a rasterization draw, for other actions the overlays will be empty. + * ``Highlight Drawcall`` will do show the area covered by the drawcall. It darkens everything except the current drawcall which is highlighted in a flat color. This makes whatever is being drawn stand out and can be useful for seeing where the current object is on screen, especially if rapidly browsing through the frame. * ``Wireframe Mesh`` will render a wireframe mesh of the current drawcall over the top of the image. diff --git a/docs/window/timeline_bar.rst b/docs/window/timeline_bar.rst index 5bf56aab8..e2815b804 100644 --- a/docs/window/timeline_bar.rst +++ b/docs/window/timeline_bar.rst @@ -21,7 +21,7 @@ Timeline Display By default the timeline bar views the whole frame, but with the mouse wheel you can zoom in and out. When zoomed in, you can scroll through the frame with the horizontal scroll bar. -Underneath expanded sections, a blue pip is rendered for each drawcall-type event. The currently selected event is shown as a green pip, as well as there being a light gray vertical line to indicate the current position, such that this is visible even when the relevant section is not expanded. +Underneath expanded sections, a blue pip is rendered for each action. The currently selected event is shown as a green pip, as well as there being a light gray vertical line to indicate the current position, such that this is visible even when the relevant section is not expanded. Clicking on any section will toggle it between expanded and unexpanded, and any sections underneath a section which is collapsed will remain in their previous state but will not be visible. diff --git a/qrenderdoc/Code/CaptureContext.cpp b/qrenderdoc/Code/CaptureContext.cpp index 936360dc1..ec35655db 100644 --- a/qrenderdoc/Code/CaptureContext.cpp +++ b/qrenderdoc/Code/CaptureContext.cpp @@ -83,7 +83,7 @@ CaptureContext::CaptureContext(PersistantConfig &cfg) : m_Config(cfg) m_CurVulkanPipelineState = NULL; m_CurPipelineState = &m_DummyPipelineState; - m_Drawcalls = &m_EmptyDraws; + m_Actions = &m_EmptyActions; m_StructuredFile = &m_DummySDFile; @@ -782,10 +782,10 @@ void CaptureContext::LoadCapture(const rdcstr &captureFile, const ReplayOptions rdcarray viewers(m_CaptureViewers); // make sure we're on a consistent event before invoking viewer forms - if(m_LastDrawcall) - SetEventID(viewers, m_LastDrawcall->eventId, m_LastDrawcall->eventId, true); - else if(!m_Drawcalls->empty()) - SetEventID(viewers, m_Drawcalls->back().eventId, m_Drawcalls->back().eventId, true); + if(m_LastAction) + SetEventID(viewers, m_LastAction->eventId, m_LastAction->eventId, true); + else if(!m_Actions->empty()) + SetEventID(viewers, m_Actions->back().eventId, m_Actions->back().eventId, true); GUIInvoke::blockcall(m_MainWindow, [&viewers]() { // notify all the registers viewers that a capture has been loaded @@ -857,9 +857,9 @@ void CaptureContext::LoadCaptureThreaded(const QString &captureFile, const Repla m_EventID = 0; - m_FirstDrawcall = m_LastDrawcall = NULL; + m_FirstAction = m_LastAction = NULL; - // fetch initial data like drawcalls, textures and buffers + // fetch initial data like actions, textures and buffers m_Replay.BlockInvoke([this](IReplayController *r) { if(Config().EventBrowser_AddFake) r->AddFakeMarkers(); @@ -873,15 +873,15 @@ void CaptureContext::LoadCaptureThreaded(const QString &captureFile, const Repla m_PostloadProgress = 0.2f; - m_Drawcalls = &r->GetDrawcalls(); + m_Actions = &r->GetRootActions(); - m_FirstDrawcall = &m_Drawcalls->at(0); - while(!m_FirstDrawcall->children.empty()) - m_FirstDrawcall = &m_FirstDrawcall->children[0]; + m_FirstAction = &m_Actions->at(0); + while(!m_FirstAction->children.empty()) + m_FirstAction = &m_FirstAction->children[0]; - m_LastDrawcall = &m_Drawcalls->back(); - while(!m_LastDrawcall->children.empty()) - m_LastDrawcall = &m_LastDrawcall->children.back(); + m_LastAction = &m_Actions->back(); + while(!m_LastAction->children.empty()) + m_LastAction = &m_LastAction->children.back(); m_PostloadProgress = 0.4f; @@ -1316,8 +1316,8 @@ void CaptureContext::CloseCapture() m_Bookmarks.clear(); m_Notes.clear(); - m_Drawcalls = &m_EmptyDraws; - m_FirstDrawcall = m_LastDrawcall = NULL; + m_Actions = &m_EmptyActions; + m_FirstAction = m_LastAction = NULL; m_CurD3D11PipelineState = NULL; m_CurD3D12PipelineState = NULL; @@ -1487,7 +1487,7 @@ void CaptureContext::SetEventID(const rdcarray &exclude, uint3 if(!IsCaptureLoaded()) return; - if(eventId > m_LastDrawcall->eventId) + if(eventId > m_LastAction->eventId) { qCritical() << "Invalid EID being selected " << eventId; return; diff --git a/qrenderdoc/Code/CaptureContext.h b/qrenderdoc/Code/CaptureContext.h index e1b08411b..6aa79b2c5 100644 --- a/qrenderdoc/Code/CaptureContext.h +++ b/qrenderdoc/Code/CaptureContext.h @@ -156,16 +156,13 @@ public: rdcarray TargetShaderEncodings() override { return m_TargetEncodings; } uint32_t CurSelectedEvent() override { return m_SelectedEventID; } uint32_t CurEvent() override { return m_EventID; } - const DrawcallDescription *CurSelectedDrawcall() override - { - return GetDrawcall(CurSelectedEvent()); - } - const DrawcallDescription *CurDrawcall() override { return GetDrawcall(CurEvent()); } - const DrawcallDescription *GetFirstDrawcall() override { return m_FirstDrawcall; }; - const DrawcallDescription *GetLastDrawcall() override { return m_LastDrawcall; }; + const ActionDescription *CurSelectedAction() override { return GetAction(CurSelectedEvent()); } + const ActionDescription *CurAction() override { return GetAction(CurEvent()); } + const ActionDescription *GetFirstAction() override { return m_FirstAction; }; + const ActionDescription *GetLastAction() override { return m_LastAction; }; bool OpenRGPProfile(const rdcstr &filename) override; IRGPInterop *GetRGPInterop() override { return m_RGP; } - const rdcarray &CurDrawcalls() override { return *m_Drawcalls; } + const rdcarray &CurRootActions() override { return *m_Actions; } ResourceDescription *GetResource(ResourceId id) override { return m_Resources[id]; } const rdcarray &GetResources() override { return m_ResourceList; } rdcstr GetResourceName(ResourceId id) override; @@ -178,9 +175,9 @@ public: const rdcarray &GetTextures() override { return m_TextureList; } BufferDescription *GetBuffer(ResourceId id) override { return m_Buffers[id]; } const rdcarray &GetBuffers() override { return m_BufferList; } - const DrawcallDescription *GetDrawcall(uint32_t eventId) override + const ActionDescription *GetAction(uint32_t eventId) override { - return GetDrawcall(*m_Drawcalls, eventId); + return GetAction(*m_Actions, eventId); } const SDFile &GetStructuredFile() override { return *m_StructuredFile; } WindowingSystem CurWindowingSystem() override { return m_CurWinSystem; } @@ -340,33 +337,33 @@ private: uint32_t m_SelectedEventID = 0; uint32_t m_EventID = 0; - const DrawcallDescription *GetDrawcall(const rdcarray &draws, uint32_t eventId) + const ActionDescription *GetAction(const rdcarray &actions, uint32_t eventId) { - for(const DrawcallDescription &d : draws) + for(const ActionDescription &a : actions) { - if(!d.children.empty()) + if(!a.children.empty()) { - const DrawcallDescription *draw = GetDrawcall(d.children, eventId); - if(draw != NULL) - return draw; + const ActionDescription *action = GetAction(a.children, eventId); + if(action != NULL) + return action; } - if(d.eventId == eventId) - return &d; + if(a.eventId == eventId) + return &a; } return NULL; } void setupDockWindow(QWidget *shad); - const rdcarray *m_Drawcalls; - rdcarray m_EmptyDraws; + const rdcarray *m_Actions; + rdcarray m_EmptyActions; rdcarray m_CustomEncodings, m_TargetEncodings; APIProperties m_APIProps; FrameDescription m_FrameInfo; - const DrawcallDescription *m_FirstDrawcall = NULL; - const DrawcallDescription *m_LastDrawcall = NULL; + const ActionDescription *m_FirstAction = NULL; + const ActionDescription *m_LastAction = NULL; IRGPInterop *m_RGP = NULL; diff --git a/qrenderdoc/Code/Interface/Analytics.cpp b/qrenderdoc/Code/Interface/Analytics.cpp index 0115b9088..fed41603f 100644 --- a/qrenderdoc/Code/Interface/Analytics.cpp +++ b/qrenderdoc/Code/Interface/Analytics.cpp @@ -258,7 +258,7 @@ static struct AnalyticsDocumentation DOCUMENT_ANALYTIC(ShaderEditing, "Did the user edit a shader (any API)?"); DOCUMENT_ANALYTIC(CallstackResolve, "Did the user capture and resolve CPU callstacks?"); DOCUMENT_ANALYTIC(PixelHistory, "Did the user run a pixel history?"); - DOCUMENT_ANALYTIC(DrawcallTimes, "Did the user fetch drawcall timings/durations?"); + DOCUMENT_ANALYTIC(DrawcallTimes, "Did the user fetch action timings/durations?"); DOCUMENT_ANALYTIC(PerformanceCounters, "Did the user fetch advanced performance counters?"); DOCUMENT_ANALYTIC(PythonInterop, "Did the user run any python scripts or commands?"); DOCUMENT_ANALYTIC(CustomTextureVisualise, @@ -273,7 +273,7 @@ static struct AnalyticsDocumentation struct { - DOCUMENT_ANALYTIC(EventBrowser, "Did the user ever export drawcalls from the event browser?"); + DOCUMENT_ANALYTIC(EventBrowser, "Did the user ever export actions from the event browser?"); DOCUMENT_ANALYTIC(PipelineState, "Did the user ever export the pipeline state (any API)?"); DOCUMENT_ANALYTIC(MeshOutput, "Did the user ever export mesh data (inputs or outputs)?"); DOCUMENT_ANALYTIC(RawBuffer, "Did the user ever export raw buffer data?"); diff --git a/qrenderdoc/Code/Interface/PersistantConfig.h b/qrenderdoc/Code/Interface/PersistantConfig.h index 2849c90f2..29fdaad8d 100644 --- a/qrenderdoc/Code/Interface/PersistantConfig.h +++ b/qrenderdoc/Code/Interface/PersistantConfig.h @@ -417,8 +417,8 @@ DECLARE_REFLECTION_STRUCT(BugReport); CONFIG_SETTING_VAL(public, int, TimeUnit, EventBrowser_TimeUnit, TimeUnit::Microseconds) \ \ DOCUMENT( \ - "``True`` if fake drawcall marker regions should be added to captures that don't have any " \ - "markers, for easier browsing. The regions are identified by grouping drawcalls that write " \ + "``True`` if fake action marker regions should be added to captures that don't have any " \ + "markers, for easier browsing. The regions are identified by grouping actions that write " \ "to the same targets together.\n" \ "\n" \ "Defaults to ``True``."); \ diff --git a/qrenderdoc/Code/Interface/QRDInterface.cpp b/qrenderdoc/Code/Interface/QRDInterface.cpp index 41236ca5c..bbc224c7f 100644 --- a/qrenderdoc/Code/Interface/QRDInterface.cpp +++ b/qrenderdoc/Code/Interface/QRDInterface.cpp @@ -99,7 +99,7 @@ CaptureSettings::operator QVariant() const opts[lit("allowFullscreen")] = options.allowFullscreen; opts[lit("apiValidation")] = options.apiValidation; opts[lit("captureCallstacks")] = options.captureCallstacks; - opts[lit("captureCallstacksOnlyDraws")] = options.captureCallstacksOnlyDraws; + opts[lit("captureCallstacksOnlyDraws")] = options.captureCallstacksOnlyActions; opts[lit("delayForDebugger")] = options.delayForDebugger; opts[lit("verifyBufferAccess")] = options.verifyBufferAccess; opts[lit("hookIntoChildren")] = options.hookIntoChildren; @@ -138,7 +138,7 @@ CaptureSettings::CaptureSettings(const QVariant &v) options.allowFullscreen = opts[lit("allowFullscreen")].toBool(); options.apiValidation = opts[lit("apiValidation")].toBool(); options.captureCallstacks = opts[lit("captureCallstacks")].toBool(); - options.captureCallstacksOnlyDraws = opts[lit("captureCallstacksOnlyDraws")].toBool(); + options.captureCallstacksOnlyActions = opts[lit("captureCallstacksOnlyDraws")].toBool(); options.delayForDebugger = opts[lit("delayForDebugger")].toUInt(); // old name for verifyBufferAccess was verifyMapWrites, so use that as a fallback if(opts.contains(lit("verifyBufferAccess"))) diff --git a/qrenderdoc/Code/Interface/QRDInterface.h b/qrenderdoc/Code/Interface/QRDInterface.h index feca7c0fa..dbaab7427 100644 --- a/qrenderdoc/Code/Interface/QRDInterface.h +++ b/qrenderdoc/Code/Interface/QRDInterface.h @@ -196,7 +196,7 @@ DECLARE_REFLECTION_STRUCT(IMainWindow); DOCUMENT(R"(The event browser window. -.. function:: EventFilterCallback(context, filter, params, eventId, chunk, draw, name) +.. function:: EventFilterCallback(context, filter, params, eventId, chunk, action, name) Not a member function - the signature for any ``EventFilterCallback`` callbacks. @@ -209,8 +209,8 @@ DOCUMENT(R"(The event browser window. :param str params: The parameters to the filter function. :param int eventId: The event's :data:`eventId `. :param renderdoc.SDChunk chunk: The structured data chunk for this event. - :param renderdoc.DrawcallDescription draw: The drawcall that contains this event. If the event is - the draw itself then the event ID will be equal. + :param renderdoc.ActionDescription action: The action that contains this event. If the event is + the action itself then the event ID will be equal. :param str name: The name of the event as shown in the event browser, for string-based filtering. :return: Whether or not this event matches the filter :rtype: bool @@ -252,7 +252,7 @@ DOCUMENT(R"(The event browser window. struct IEventBrowser { typedef std::function + const SDChunk *, const ActionDescription *, const rdcstr &)> EventFilterCallback; typedef std::function FilterParseCallback; @@ -285,17 +285,17 @@ returned. virtual APIEvent GetAPIEventForEID(uint32_t eventId) = 0; DOCUMENT(R"(Uses the existing caching in the event browser to return a -:class:`~renderdoc.DrawcallDescription` for a specified EID. This draw may not be the exact EID -specified, but it will be the draw that the EID is associated with. I.e. if you specify the EID for -a state setting event the next draw will be returned. +:class:`~renderdoc.ActionDescription` for a specified EID. This action may not be the exact EID +specified, but it will be the action that the EID is associated with. I.e. if you specify the EID for +a state setting event the next action will be returned. If no capture is loaded or the EID doesn't correspond to a known event, ``None`` will be returned. :param int eventId: The EID to look up. -:return: The drawcall containing the EID, or ``None`` if no such EID exists. -:rtype: renderdoc.DrawcallDescription +:return: The action containing the EID, or ``None`` if no such EID exists. +:rtype: renderdoc.ActionDescription )"); - virtual const DrawcallDescription *GetDrawcallForEID(uint32_t eventId) = 0; + virtual const ActionDescription *GetActionForEID(uint32_t eventId) = 0; DOCUMENT(R"(Determines if a given EID is visible with the current filters applied to the event browser. @@ -359,20 +359,20 @@ the scratch filter. The filter is applied immediately. )"); virtual rdcstr GetCurrentFilterText() = 0; - DOCUMENT(R"(Sets whether or not custom drawcall names are used. Certain drawcalls such as indirect -draws it is useful to show a custom drawcall name which contains the actual indirect parameters + DOCUMENT(R"(Sets whether or not custom action names are used. Certain actions such as indirect +actions it is useful to show a custom action name which contains the actual indirect parameters instead of the 'raw' parameters. -:param bool use: Whether or not custom drawcall names will be used. +:param bool use: Whether or not custom action names will be used. )"); - virtual void SetUseCustomDrawNames(bool use) = 0; + virtual void SetUseCustomActionNames(bool use) = 0; DOCUMENT(R"(Sets whether or not parameter names are shown in the events. If disabled, only the value is shown and the parameter is implicit. .. note:: - If custom draw names are used this will not have an effect for any such draws. See - :meth:`SetUseCustomDrawNames`. + If custom action names are used this will not have an effect for any such actions. See + :meth:`SetUseCustomActionNames`. :param bool show: Whether or not parameter names will be shown. )"); @@ -382,14 +382,14 @@ value is shown and the parameter is implicit. the most significant parameters are shown. .. note:: - If custom draw names are used this will not have an effect for any such draws. See - :meth:`SetUseCustomDrawNames`. + If custom action names are used this will not have an effect for any such actions. See + :meth:`SetUseCustomActionNames`. :param bool show: Whether or not parameter names will be shown. )"); virtual void SetShowAllParameters(bool show) = 0; - DOCUMENT(R"(Sets whether or not marker regions which have no draws . + DOCUMENT(R"(Sets whether or not marker regions which have no visible actions. :param bool show: Whether or not empty regions after filtering will be shown. )"); @@ -1909,43 +1909,43 @@ information for how this differs. )"); virtual uint32_t CurEvent() = 0; - DOCUMENT(R"(Retrieve the currently selected drawcall. + DOCUMENT(R"(Retrieve the currently selected action. -In most cases, prefer using :meth:`CurDrawcall`. See :meth:`CaptureViewer.OnSelectedEventChanged` for +In most cases, prefer using :meth:`CurAction`. See :meth:`CaptureViewer.OnSelectedEventChanged` for more information for how this differs. -:return: The currently selected drawcall. -:rtype: renderdoc.DrawcallDescription +:return: The currently selected action. +:rtype: renderdoc.ActionDescription )"); - virtual const DrawcallDescription *CurSelectedDrawcall() = 0; + virtual const ActionDescription *CurSelectedAction() = 0; - DOCUMENT(R"(Retrieve the current drawcall. + DOCUMENT(R"(Retrieve the current action. -:return: The current drawcall, or ``None`` if no drawcall is selected. -:rtype: renderdoc.DrawcallDescription +:return: The current action, or ``None`` if no action is selected. +:rtype: renderdoc.ActionDescription )"); - virtual const DrawcallDescription *CurDrawcall() = 0; + virtual const ActionDescription *CurAction() = 0; - DOCUMENT(R"(Retrieve the first drawcall in the capture. + DOCUMENT(R"(Retrieve the first action in the capture. -:return: The first drawcall. -:rtype: renderdoc.DrawcallDescription +:return: The first action. +:rtype: renderdoc.ActionDescription )"); - virtual const DrawcallDescription *GetFirstDrawcall() = 0; + virtual const ActionDescription *GetFirstAction() = 0; - DOCUMENT(R"(Retrieve the last drawcall in the capture. + DOCUMENT(R"(Retrieve the last action in the capture. -:return: The last drawcall. -:rtype: renderdoc.DrawcallDescription +:return: The last action. +:rtype: renderdoc.ActionDescription )"); - virtual const DrawcallDescription *GetLastDrawcall() = 0; + virtual const ActionDescription *GetLastAction() = 0; - DOCUMENT(R"(Retrieve the root list of drawcalls in the current capture. + DOCUMENT(R"(Retrieve the root list of actions in the current capture. -:return: The root drawcalls. -:rtype: List[renderdoc.DrawcallDescription] +:return: The root actions. +:rtype: List[renderdoc.ActionDescription] )"); - virtual const rdcarray &CurDrawcalls() = 0; + virtual const rdcarray &CurRootActions() = 0; DOCUMENT(R"(Retrieve the information about a particular resource. @@ -2067,15 +2067,15 @@ considered out of date )"); virtual const rdcarray &GetBuffers() = 0; - DOCUMENT(R"(Retrieve the information about a drawcall at a given + DOCUMENT(R"(Retrieve the information about an action at a given :data:`eventId `. :param int eventId: The :data:`eventId ` to query for. -:return: The information about the drawcall, or ``None`` if the - :data:`eventId ` doesn't correspond to a drawcall. -:rtype: renderdoc.DrawcallDescription +:return: The information about the action, or ``None`` if the + :data:`eventId ` doesn't correspond to an action. +:rtype: renderdoc.ActionDescription )"); - virtual const DrawcallDescription *GetDrawcall(uint32_t eventId) = 0; + virtual const ActionDescription *GetAction(uint32_t eventId) = 0; DOCUMENT(R"(Sets the path to the RGP profile to use with :meth:`GetRGPInterop`, launches RGP and opens an interop connection. This function will block (with a progress dialog) until either an diff --git a/qrenderdoc/Code/QRDUtils.cpp b/qrenderdoc/Code/QRDUtils.cpp index 17e2e7be1..9c392a213 100644 --- a/qrenderdoc/Code/QRDUtils.cpp +++ b/qrenderdoc/Code/QRDUtils.cpp @@ -1602,27 +1602,27 @@ void CombineUsageEvents(ICaptureContext &ctx, const rdcarray &usage, if(u.usage == us && u.eventId == end) continue; - const DrawcallDescription *draw = ctx.GetDrawcall(u.eventId); + const ActionDescription *action = ctx.GetAction(u.eventId); bool distinct = false; // if the usage is different from the last, add a new entry, - // or if the previous draw link is broken. - if(u.usage != us || draw == NULL || draw->previous == 0) + // or if the previous action link is broken. + if(u.usage != us || action == NULL || action->previous == 0) { distinct = true; } else { - // otherwise search back through real draws, to see if the + // otherwise search back through real actions, to see if the // last event was where we were - otherwise it's a new - // distinct set of drawcalls and should have a separate + // distinct set of actions and should have a separate // entry in the context menu - const DrawcallDescription *prev = draw->previous; + const ActionDescription *prev = action->previous; while(prev != NULL && prev->eventId > end) { - if(!(prev->flags & (DrawFlags::Dispatch | DrawFlags::Drawcall | DrawFlags::CmdList))) + if(!(prev->flags & (ActionFlags::Dispatch | ActionFlags::Drawcall | ActionFlags::CmdList))) { prev = prev->previous; } diff --git a/qrenderdoc/Code/RGPInterop.cpp b/qrenderdoc/Code/RGPInterop.cpp index cd717069c..d297d6adb 100644 --- a/qrenderdoc/Code/RGPInterop.cpp +++ b/qrenderdoc/Code/RGPInterop.cpp @@ -213,11 +213,11 @@ void RGPInterop::EventSelected(RGPInteropEvent event) return; } - const DrawcallDescription *draw = m_Ctx.GetDrawcall(eventId); + const ActionDescription *action = m_Ctx.GetAction(eventId); - if(draw && QString(draw->name) != event.eventname) - qWarning() << "Drawcall name mismatch. Expected " << event.eventname << " but got " - << QString(draw->name); + if(action && QString(action->name) != event.eventname) + qWarning() << "Action name mismatch. Expected " << event.eventname << " but got " + << QString(action->name); m_Ctx.SetEventID({}, eventId, eventId); @@ -248,13 +248,13 @@ void RGPInterop::ConnectionEstablished() }); } -void RGPInterop::CreateMapping(const rdcarray &drawcalls) +void RGPInterop::CreateMapping(const rdcarray &actions) { const SDFile &file = m_Ctx.GetStructuredFile(); - for(const DrawcallDescription &draw : drawcalls) + for(const ActionDescription &action : actions) { - for(const APIEvent &ev : draw.events) + for(const APIEvent &ev : action.events) { if(ev.chunkIndex == 0 || ev.chunkIndex == APIEvent::NoChunk || ev.chunkIndex >= file.chunks.size()) @@ -265,8 +265,8 @@ void RGPInterop::CreateMapping(const rdcarray &drawcalls) if(m_EventNames.contains(chunk->name, Qt::CaseSensitive)) { m_Event2RGP[ev.eventId].interoplinearid = (uint32_t)m_RGP2Event.size(); - if(ev.eventId == draw.eventId) - m_Event2RGP[ev.eventId].eventname = draw.name; + if(ev.eventId == action.eventId) + m_Event2RGP[ev.eventId].eventname = action.name; else m_Event2RGP[ev.eventId].eventname = chunk->name; @@ -275,8 +275,8 @@ void RGPInterop::CreateMapping(const rdcarray &drawcalls) } // if we have children, step into them first before going to our next sibling - if(!draw.children.empty()) - CreateMapping(draw.children); + if(!action.children.empty()) + CreateMapping(action.children); } } @@ -308,13 +308,13 @@ void RGPInterop::CreateMapping(uint32_t version) if(m_EventNames.isEmpty()) return; - m_Event2RGP.resize(m_Ctx.GetLastDrawcall()->eventId + 1); + m_Event2RGP.resize(m_Ctx.GetLastAction()->eventId + 1); // linearId 0 is invalid, so map to eventId 0. // the first real event will be linearId 1 m_RGP2Event.push_back(0); - CreateMapping(m_Ctx.CurDrawcalls()); + CreateMapping(m_Ctx.CurRootActions()); } QString RGPInterop::EncodeCommand(RGPCommand command, QVariantList params) diff --git a/qrenderdoc/Code/RGPInterop.h b/qrenderdoc/Code/RGPInterop.h index c6efa8c5b..a645d45b9 100644 --- a/qrenderdoc/Code/RGPInterop.h +++ b/qrenderdoc/Code/RGPInterop.h @@ -122,7 +122,7 @@ private: void InitializeRGP(); void ConnectionEstablished(); - void CreateMapping(const rdcarray &drawcalls); + void CreateMapping(const rdcarray &actions); void CreateMapping(uint32_t version); void EventSelected(RGPInteropEvent event); diff --git a/qrenderdoc/Code/pyrenderdoc/cosmetics.i b/qrenderdoc/Code/pyrenderdoc/cosmetics.i index c93621711..fb6f3b820 100644 --- a/qrenderdoc/Code/pyrenderdoc/cosmetics.i +++ b/qrenderdoc/Code/pyrenderdoc/cosmetics.i @@ -150,7 +150,7 @@ fail: %enddef // %define DEFINE_SAFE_COMPARISONS -DEFINE_SAFE_EQUALITY(DrawcallDescription) +DEFINE_SAFE_EQUALITY(ActionDescription) DEFINE_SAFE_EQUALITY(CounterResult) DEFINE_SAFE_EQUALITY(APIEvent) DEFINE_SAFE_EQUALITY(Bindpoint) diff --git a/qrenderdoc/Code/pyrenderdoc/renderdoc.i b/qrenderdoc/Code/pyrenderdoc/renderdoc.i index 2e4e03035..5d4077eb0 100644 --- a/qrenderdoc/Code/pyrenderdoc/renderdoc.i +++ b/qrenderdoc/Code/pyrenderdoc/renderdoc.i @@ -350,7 +350,7 @@ TEMPLATE_ARRAY_INSTANTIATE(rdcarray, uint32_t) TEMPLATE_ARRAY_INSTANTIATE(rdcarray, uint64_t) TEMPLATE_ARRAY_INSTANTIATE(rdcarray, rdcstr) TEMPLATE_ARRAY_INSTANTIATE(rdcarray, WindowingSystem) -TEMPLATE_ARRAY_INSTANTIATE(rdcarray, DrawcallDescription) +TEMPLATE_ARRAY_INSTANTIATE(rdcarray, ActionDescription) TEMPLATE_ARRAY_INSTANTIATE(rdcarray, GPUCounter) TEMPLATE_ARRAY_INSTANTIATE(rdcarray, CounterResult) TEMPLATE_ARRAY_INSTANTIATE(rdcarray, APIEvent) diff --git a/qrenderdoc/Widgets/MarkerBreadcrumbs.cpp b/qrenderdoc/Widgets/MarkerBreadcrumbs.cpp index c82460abb..388ba864b 100644 --- a/qrenderdoc/Widgets/MarkerBreadcrumbs.cpp +++ b/qrenderdoc/Widgets/MarkerBreadcrumbs.cpp @@ -232,9 +232,9 @@ MarkerBreadcrumbs::~MarkerBreadcrumbs() void MarkerBreadcrumbs::OnEventChanged(uint32_t eventId) { - const DrawcallDescription *parent = m_Ctx.GetEventBrowser()->GetDrawcallForEID(m_Ctx.CurEvent()); + const ActionDescription *parent = m_Ctx.GetEventBrowser()->GetActionForEID(m_Ctx.CurEvent()); - if(parent != NULL && !(parent->flags & DrawFlags::PushMarker)) + if(parent != NULL && !(parent->flags & ActionFlags::PushMarker)) parent = parent->parent; if(m_CurParent == parent && m_Layout->count() != 0) @@ -243,7 +243,7 @@ void MarkerBreadcrumbs::OnEventChanged(uint32_t eventId) m_CurParent = parent; m_Layout->clear(); - QVector path; + QVector path; while(parent) { @@ -268,27 +268,27 @@ void MarkerBreadcrumbs::ForceRefresh() OnEventChanged(m_Ctx.CurEvent()); } -void MarkerBreadcrumbs::ConfigurePathMenu(QMenu *menu, const DrawcallDescription *draw) +void MarkerBreadcrumbs::ConfigurePathMenu(QMenu *menu, const ActionDescription *action) { - const rdcarray &draws = draw ? draw->children : m_Ctx.CurDrawcalls(); + const rdcarray &actions = action ? action->children : m_Ctx.CurRootActions(); menu->clear(); - for(const DrawcallDescription &child : draws) + for(const ActionDescription &child : actions) { - if((child.flags & DrawFlags::PushMarker) && + if((child.flags & ActionFlags::PushMarker) && m_Ctx.GetEventBrowser()->IsAPIEventVisible(child.eventId)) { - QAction *action = new QAction(child.name, menu); + QAction *menuAction = new QAction(child.name, menu); uint32_t eid = child.eventId; if(child.IsFakeMarker()) eid = child.children[0].eventId; - QObject::connect(action, &QAction::triggered, + QObject::connect(menuAction, &QAction::triggered, [this, eid]() { m_Ctx.SetEventID({}, eid, eid); }); - menu->addAction(action); + menu->addAction(menuAction); } } } @@ -315,11 +315,11 @@ void MarkerBreadcrumbs::elidedItemsClicked() m_ElidedMenu->show(); } -void MarkerBreadcrumbs::AddPathButton(const DrawcallDescription *draw) +void MarkerBreadcrumbs::AddPathButton(const ActionDescription *action) { RDToolButton *b = new RDToolButton(); - b->setText(draw ? QString(draw->name) : QString()); - if(!draw) + b->setText(action ? QString(action->name) : QString()); + if(!action) { b->setIcon(Icons::house()); b->setToolButtonStyle(Qt::ToolButtonIconOnly); @@ -328,9 +328,9 @@ void MarkerBreadcrumbs::AddPathButton(const DrawcallDescription *draw) bool hasChildMarkers = false; - for(const DrawcallDescription &child : draw ? draw->children : m_Ctx.CurDrawcalls()) + for(const ActionDescription &child : action ? action->children : m_Ctx.CurRootActions()) { - if((child.flags & DrawFlags::PushMarker) && + if((child.flags & ActionFlags::PushMarker) && m_Ctx.GetEventBrowser()->IsAPIEventVisible(child.eventId)) { hasChildMarkers = true; @@ -346,13 +346,13 @@ void MarkerBreadcrumbs::AddPathButton(const DrawcallDescription *draw) b->setMenu(menu); QObject::connect(menu, &QMenu::aboutToShow, - [this, menu, draw]() { ConfigurePathMenu(menu, draw); }); + [this, menu, action]() { ConfigurePathMenu(menu, action); }); } - uint32_t eid = draw ? draw->eventId : 0; + uint32_t eid = action ? action->eventId : 0; - if(draw && draw->IsFakeMarker()) - eid = draw->children[0].eventId; + if(action && action->IsFakeMarker()) + eid = action->children[0].eventId; b->setAutoRaise(true); QObject::connect(b, &RDToolButton::clicked, [this, eid]() { m_Ctx.SetEventID({}, eid, eid); }); diff --git a/qrenderdoc/Widgets/MarkerBreadcrumbs.h b/qrenderdoc/Widgets/MarkerBreadcrumbs.h index b1572d03a..0420f1fd0 100644 --- a/qrenderdoc/Widgets/MarkerBreadcrumbs.h +++ b/qrenderdoc/Widgets/MarkerBreadcrumbs.h @@ -31,7 +31,7 @@ struct ICaptureContext; class RDToolButton; class RDLabel; -struct DrawcallDescription; +struct ActionDescription; class QMenu; @@ -76,14 +76,14 @@ private slots: void elidedItemsClicked(); private: - void AddPathButton(const DrawcallDescription *); - void ConfigurePathMenu(QMenu *, const DrawcallDescription *); + void AddPathButton(const ActionDescription *); + void ConfigurePathMenu(QMenu *, const ActionDescription *); ICaptureContext &m_Ctx; - QVector m_Path; + QVector m_Path; - const DrawcallDescription *m_CurParent = NULL; + const ActionDescription *m_CurParent = NULL; BreadcrumbsLayout *m_Layout; RDToolButton *m_ElidedItems; diff --git a/qrenderdoc/Windows/APIInspector.cpp b/qrenderdoc/Windows/APIInspector.cpp index 89a5bf241..cb4e593d9 100644 --- a/qrenderdoc/Windows/APIInspector.cpp +++ b/qrenderdoc/Windows/APIInspector.cpp @@ -206,22 +206,22 @@ void APIInspector::fillAPIView() m_Chunks.clear(); - const DrawcallDescription *draw = m_Ctx.CurSelectedDrawcall(); + const ActionDescription *action = m_Ctx.CurSelectedAction(); - if(draw != NULL && !draw->events.isEmpty()) + if(action != NULL && !action->events.isEmpty()) { - if(draw->IsFakeMarker()) + if(action->IsFakeMarker()) { - RDTreeWidgetItem *root = new RDTreeWidgetItem({lit("---"), QString(draw->name)}); + RDTreeWidgetItem *root = new RDTreeWidgetItem({lit("---"), QString(action->name)}); root->setBold(true); ui->apiEvents->addTopLevelItem(root); ui->apiEvents->setSelectedItem(root); } else { - for(const APIEvent &ev : draw->events) + for(const APIEvent &ev : action->events) { - addEvent(ev, ev.eventId == draw->eventId); + addEvent(ev, ev.eventId == action->eventId); } } } diff --git a/qrenderdoc/Windows/BufferViewer.cpp b/qrenderdoc/Windows/BufferViewer.cpp index b7a20852f..7fabb3bf5 100644 --- a/qrenderdoc/Windows/BufferViewer.cpp +++ b/qrenderdoc/Windows/BufferViewer.cpp @@ -1506,7 +1506,7 @@ static void ConfigureColumnsForShader(ICaptureContext &ctx, const ShaderReflecti static void ConfigureMeshColumns(ICaptureContext &ctx, PopulateBufferData *bufdata) { - const DrawcallDescription *draw = ctx.CurDrawcall(); + const ActionDescription *action = ctx.CurAction(); rdcarray vinputs = ctx.CurPipelineState().GetVertexInputs(); @@ -1553,16 +1553,16 @@ static void ConfigureMeshColumns(ICaptureContext &ctx, PopulateBufferData *bufda bufdata->vsinConfig.noVertices = false; bufdata->vsinConfig.noInstances = false; - if(draw) + if(action) { - bufdata->vsinConfig.numRows = draw->numIndices; + bufdata->vsinConfig.numRows = action->numIndices; bufdata->vsinConfig.unclampedNumRows = 0; // calculate an upper bound on the valid number of rows just in case it's an invalid value (e.g. // 0xdeadbeef) and we want to clamp. uint32_t numRowsUpperBound = 0; - if(draw->flags & DrawFlags::Indexed) + if(action->flags & ActionFlags::Indexed) { // In an indexed draw we clamp to however many indices are available in the index buffer @@ -1575,7 +1575,7 @@ static void ConfigureMeshColumns(ICaptureContext &ctx, PopulateBufferData *bufda BufferDescription *buf = ctx.GetBuffer(ib.resourceId); if(buf) { - uint64_t offset = ib.byteOffset + draw->indexOffset * ib.byteStride; + uint64_t offset = ib.byteOffset + action->indexOffset * ib.byteStride; if(offset > buf->length) bytesAvailable = 0; else @@ -1634,10 +1634,10 @@ static void ConfigureMeshColumns(ICaptureContext &ctx, PopulateBufferData *bufda bufdata->vsinConfig.numRows = numRowsUpperBound + 100; } - if((draw->flags & DrawFlags::Drawcall) && draw->numIndices == 0) + if((action->flags & ActionFlags::Drawcall) && action->numIndices == 0) bufdata->vsinConfig.noVertices = true; - if((draw->flags & DrawFlags::Instanced) && draw->numInstances == 0) + if((action->flags & ActionFlags::Instanced) && action->numInstances == 0) { bufdata->vsinConfig.noInstances = true; bufdata->vsinConfig.numRows = bufdata->vsinConfig.unclampedNumRows = 0; @@ -1649,7 +1649,7 @@ static void ConfigureMeshColumns(ICaptureContext &ctx, PopulateBufferData *bufda bufdata->gsoutConfig.columns.clear(); bufdata->gsoutConfig.props.clear(); - if(draw) + if(action) { const ShaderReflection *vs = ctx.CurPipelineState().GetShaderReflection(ShaderStage::Vertex); const ShaderReflection *last = ctx.CurPipelineState().GetShaderReflection(ShaderStage::Geometry); @@ -1663,19 +1663,19 @@ static void ConfigureMeshColumns(ICaptureContext &ctx, PopulateBufferData *bufda static void RT_FetchMeshData(IReplayController *r, ICaptureContext &ctx, PopulateBufferData *data) { - const DrawcallDescription *draw = ctx.CurDrawcall(); + const ActionDescription *action = ctx.CurAction(); BoundVBuffer ib = ctx.CurPipelineState().GetIBuffer(); rdcarray vbs = ctx.CurPipelineState().GetVBuffers(); - uint32_t numIndices = draw ? draw->numIndices : 0; + uint32_t numIndices = action ? action->numIndices : 0; bytebuf idata; - if(ib.resourceId != ResourceId() && draw && (draw->flags & DrawFlags::Indexed)) + if(ib.resourceId != ResourceId() && action && (action->flags & ActionFlags::Indexed)) { uint64_t readBytes = numIndices * ib.byteStride; - uint32_t offset = draw->indexOffset * ib.byteStride; + uint32_t offset = action->indexOffset * ib.byteStride; if(ib.byteSize > offset) readBytes = qMin(ib.byteSize - offset, readBytes); @@ -1691,20 +1691,20 @@ static void RT_FetchMeshData(IReplayController *r, ICaptureContext &ctx, Populat data->vsinConfig.indices = new BufferData(); - if(draw && ib.byteStride != 0 && !idata.isEmpty()) + if(action && ib.byteStride != 0 && !idata.isEmpty()) data->vsinConfig.indices->storage.resize( sizeof(uint32_t) * qMin(numIndices, (((uint32_t)idata.size() + ib.byteStride - 1) / ib.byteStride))); - else if(draw && (draw->flags & DrawFlags::Indexed)) + else if(action && (action->flags & ActionFlags::Indexed)) data->vsinConfig.indices->storage.resize(sizeof(uint32_t)); uint32_t *indices = (uint32_t *)data->vsinConfig.indices->data(); uint32_t maxIndex = 0; - if(draw) + if(action) maxIndex = qMax(1U, numIndices) - 1; - if(draw && !idata.isEmpty()) + if(action && !idata.isEmpty()) { maxIndex = 0; if(ib.byteStride == 1) @@ -1782,20 +1782,20 @@ static void RT_FetchMeshData(IReplayController *r, ICaptureContext &ctx, Populat uint32_t maxIdx = 0; uint32_t offset = 0; - if(used && draw) + if(used && action) { if(pi) { - maxIdx = qMax(1U, draw->numInstances) - 1; - offset = draw->instanceOffset; + maxIdx = qMax(1U, action->numInstances) - 1; + offset = action->instanceOffset; } if(pv) { maxIdx = qMax(maxIndex, maxIdx); - offset = draw->vertexOffset; + offset = action->vertexOffset; - if(draw->baseVertex > 0) - maxIdx = qMax(maxIdx, maxIdx + (uint32_t)draw->baseVertex); + if(action->baseVertex > 0) + maxIdx = qMax(maxIdx, maxIdx + (uint32_t)action->baseVertex); } if(pi && pv) @@ -1844,7 +1844,7 @@ static void RT_FetchMeshData(IReplayController *r, ICaptureContext &ctx, Populat data->vsoutConfig.baseVertex = data->postVS.baseVertex; data->vsoutConfig.displayBaseVertex = data->vsinConfig.baseVertex; - if(draw && data->postVS.indexResourceId != ResourceId() && (draw->flags & DrawFlags::Indexed)) + if(action && data->postVS.indexResourceId != ResourceId() && (action->flags & ActionFlags::Indexed)) idata = r->GetBufferData(data->postVS.indexResourceId, data->postVS.indexByteOffset, numIndices * data->postVS.indexByteStride); @@ -1860,7 +1860,7 @@ static void RT_FetchMeshData(IReplayController *r, ICaptureContext &ctx, Populat data->vsoutConfig.displayIndices->ref(); data->vsoutConfig.indices = new BufferData(); - if(draw && ib.byteStride != 0 && !idata.isEmpty()) + if(action && ib.byteStride != 0 && !idata.isEmpty()) { data->vsoutConfig.indices->storage.resize(sizeof(uint32_t) * numIndices); indices = (uint32_t *)data->vsoutConfig.indices->data(); @@ -2384,7 +2384,7 @@ void BufferViewer::stageRowMenu(MeshDataStage stage, QMenu *menu, const QPoint & { m_DebugVert->setToolTip(tr("This API does not support shader debugging")); } - else if(!m_Ctx.CurDrawcall() || !(m_Ctx.CurDrawcall()->flags & DrawFlags::Drawcall)) + else if(!m_Ctx.CurAction() || !(m_Ctx.CurAction()->flags & ActionFlags::Drawcall)) { m_DebugVert->setToolTip(tr("No draw call selected")); } @@ -2532,7 +2532,7 @@ void BufferViewer::OnEventChanged(uint32_t eventId) updateWindowTitle(); - const DrawcallDescription *draw = m_Ctx.CurDrawcall(); + const ActionDescription *action = m_Ctx.CurAction(); configureDrawRange(); @@ -2546,7 +2546,7 @@ void BufferViewer::OnEventChanged(uint32_t eventId) const PipeState &pipe = m_Ctx.CurPipelineState(); - if(pipe.IsStripRestartEnabled() && draw && (draw->flags & DrawFlags::Indexed) && + if(pipe.IsStripRestartEnabled() && action && (action->flags & ActionFlags::Indexed) && SupportsRestart(pipe.GetPrimitiveTopology())) { bufdata->vsinConfig.primRestart = pipe.GetStripRestartIndex(); @@ -2593,18 +2593,18 @@ void BufferViewer::OnEventChanged(uint32_t eventId) m_ModelVSOut->beginReset(); m_ModelGSOut->beginReset(); - bufdata->vsinConfig.baseVertex = draw ? draw->baseVertex : 0; + bufdata->vsinConfig.baseVertex = action ? action->baseVertex : 0; - ui->instance->setEnabled(draw && (draw->flags & DrawFlags::Instanced)); + ui->instance->setEnabled(action && (action->flags & ActionFlags::Instanced)); if(!ui->instance->isEnabled()) ui->instance->setValue(0); - if(draw) - ui->instance->setMaximum(qMax(0, int(draw->numInstances) - 1)); + if(action) + ui->instance->setMaximum(qMax(0, int(action->numInstances) - 1)); uint32_t numViews = m_Ctx.CurPipelineState().MultiviewBroadcastCount(); - if(draw && numViews > 1) + if(action && numViews > 1) { ui->viewIndex->setEnabled(true); ui->viewIndex->setMaximum(qMax(0, int(numViews) - 1)); @@ -2813,11 +2813,11 @@ void BufferViewer::OnEventChanged(uint32_t eventId) void BufferViewer::populateBBox(PopulateBufferData *bufdata) { - const DrawcallDescription *draw = m_Ctx.CurDrawcall(); + const ActionDescription *action = m_Ctx.CurAction(); - if(draw && m_MeshView) + if(action && m_MeshView) { - uint32_t eventId = draw->eventId; + uint32_t eventId = action->eventId; bool calcNeeded = false; { @@ -3092,15 +3092,15 @@ void BufferViewer::UI_CalculateMeshFormats() const PipeState &pipe = m_Ctx.CurPipelineState(); rdcarray vbs = pipe.GetVBuffers(); - const DrawcallDescription *draw = m_Ctx.CurDrawcall(); + const ActionDescription *action = m_Ctx.CurAction(); - if(draw) + if(action) { m_VSInPosition = MeshFormat(); m_VSInSecondary = MeshFormat(); m_VSInPosition.allowRestart = pipe.IsStripRestartEnabled() && - (draw->flags & DrawFlags::Indexed) && + (action->flags & ActionFlags::Indexed) && SupportsRestart(pipe.GetPrimitiveTopology()); m_VSInPosition.restartIndex = pipe.GetStripRestartIndex(); @@ -3115,20 +3115,20 @@ void BufferViewer::UI_CalculateMeshFormats() if(vsinConfig.unclampedNumRows > 0) m_VSInPosition.numIndices = vsinConfig.numRows; else - m_VSInPosition.numIndices = draw->numIndices; + m_VSInPosition.numIndices = action->numIndices; - if((draw->flags & DrawFlags::Instanced) && draw->numInstances == 0) + if((action->flags & ActionFlags::Instanced) && action->numInstances == 0) m_VSInPosition.numIndices = 0; BoundVBuffer ib = pipe.GetIBuffer(); m_VSInPosition.topology = pipe.GetPrimitiveTopology(); m_VSInPosition.indexByteStride = ib.byteStride; - m_VSInPosition.baseVertex = draw->baseVertex; + m_VSInPosition.baseVertex = action->baseVertex; m_VSInPosition.indexResourceId = ib.resourceId; - m_VSInPosition.indexByteOffset = ib.byteOffset + draw->indexOffset * ib.byteStride; + m_VSInPosition.indexByteOffset = ib.byteOffset + action->indexOffset * ib.byteStride; m_VSInPosition.indexByteSize = ib.byteSize; - if((draw->flags & DrawFlags::Indexed) && m_VSInPosition.indexByteStride == 0) + if((action->flags & ActionFlags::Indexed) && m_VSInPosition.indexByteStride == 0) m_VSInPosition.indexByteStride = 4U; { @@ -3143,7 +3143,7 @@ void BufferViewer::UI_CalculateMeshFormats() m_VSInPosition.vertexResourceId = vbs[prop.buffer].resourceId; m_VSInPosition.vertexByteStride = vbs[prop.buffer].byteStride; m_VSInPosition.vertexByteOffset = vbs[prop.buffer].byteOffset + el.byteOffset + - draw->vertexOffset * m_VSInPosition.vertexByteStride; + action->vertexOffset * m_VSInPosition.vertexByteStride; m_VSInPosition.vertexByteSize = vbs[prop.buffer].byteSize; } else @@ -3171,7 +3171,7 @@ void BufferViewer::UI_CalculateMeshFormats() m_VSInSecondary.vertexResourceId = vbs[prop.buffer].resourceId; m_VSInSecondary.vertexByteStride = vbs[prop.buffer].byteStride; m_VSInSecondary.vertexByteOffset = vbs[prop.buffer].byteOffset + el.byteOffset + - draw->vertexOffset * m_VSInSecondary.vertexByteStride; + action->vertexOffset * m_VSInSecondary.vertexByteStride; m_VSInSecondary.vertexByteSize = vbs[prop.buffer].byteSize; } else @@ -3256,7 +3256,7 @@ void BufferViewer::UI_CalculateMeshFormats() m_PostGSPosition.indexByteStride = 0; - if(!(draw->flags & DrawFlags::Indexed)) + if(!(action->flags & ActionFlags::Indexed)) m_PostVSPosition.indexByteStride = m_VSInPosition.indexByteStride = 0; } else @@ -3274,7 +3274,7 @@ void BufferViewer::UI_CalculateMeshFormats() void BufferViewer::configureDrawRange() { - const DrawcallDescription *draw = m_Ctx.CurDrawcall(); + const ActionDescription *action = m_Ctx.CurAction(); int curIndex = ui->drawRange->currentIndex(); @@ -3282,7 +3282,7 @@ void BufferViewer::configureDrawRange() // don't check the flags, check if there are actually multiple instances if(m_Ctx.IsCaptureLoaded()) - instanced = draw && draw->numInstances > 1; + instanced = action && action->numInstances > 1; ui->drawRange->blockSignals(true); ui->drawRange->clear(); @@ -4015,7 +4015,7 @@ void BufferViewer::exportData(const BufferExport ¶ms) if(!m_Ctx.IsCaptureLoaded()) return; - if(!m_Ctx.CurDrawcall()) + if(!m_Ctx.CurAction()) return; if(!m_CurView) @@ -4266,7 +4266,7 @@ void BufferViewer::debugVertex() if(!m_Ctx.IsCaptureLoaded()) return; - if(!m_Ctx.CurDrawcall()) + if(!m_Ctx.CurAction()) return; if(!m_CurView) @@ -4307,7 +4307,7 @@ void BufferViewer::debugVertex() QString debugContext = tr("Vertex %1").arg(vertid); - if(m_Ctx.CurDrawcall()->numInstances > 1) + if(m_Ctx.CurAction()->numInstances > 1) debugContext += tr(", Instance %1").arg(m_Config.curInstance); // wait a short while before displaying the progress dialog (which won't show if we're already diff --git a/qrenderdoc/Windows/Dialogs/CaptureDialog.cpp b/qrenderdoc/Windows/Dialogs/CaptureDialog.cpp index 02de19ad5..c965844b9 100644 --- a/qrenderdoc/Windows/Dialogs/CaptureDialog.cpp +++ b/qrenderdoc/Windows/Dialogs/CaptureDialog.cpp @@ -275,12 +275,12 @@ void CaptureDialog::on_CaptureCallstacks_toggled(bool checked) { if(ui->CaptureCallstacks->isChecked()) { - ui->CaptureCallstacksOnlyDraws->setEnabled(true); + ui->CaptureCallstacksOnlyActions->setEnabled(true); } else { - ui->CaptureCallstacksOnlyDraws->setChecked(false); - ui->CaptureCallstacksOnlyDraws->setEnabled(false); + ui->CaptureCallstacksOnlyActions->setChecked(false); + ui->CaptureCallstacksOnlyActions->setEnabled(false); } } @@ -986,7 +986,7 @@ void CaptureDialog::SetSettings(CaptureSettings settings) ui->AllowVSync->setChecked(settings.options.allowVSync); ui->HookIntoChildren->setChecked(settings.options.hookIntoChildren); ui->CaptureCallstacks->setChecked(settings.options.captureCallstacks); - ui->CaptureCallstacksOnlyDraws->setChecked(settings.options.captureCallstacksOnlyDraws); + ui->CaptureCallstacksOnlyActions->setChecked(settings.options.captureCallstacksOnlyActions); ui->APIValidation->setChecked(settings.options.apiValidation); ui->RefAllResources->setChecked(settings.options.refAllResources); ui->CaptureAllCmdLists->setChecked(settings.options.captureAllCmdLists); @@ -1034,7 +1034,7 @@ CaptureSettings CaptureDialog::Settings() ret.options.allowVSync = ui->AllowVSync->isChecked(); ret.options.hookIntoChildren = ui->HookIntoChildren->isChecked(); ret.options.captureCallstacks = ui->CaptureCallstacks->isChecked(); - ret.options.captureCallstacksOnlyDraws = ui->CaptureCallstacksOnlyDraws->isChecked(); + ret.options.captureCallstacksOnlyActions = ui->CaptureCallstacksOnlyActions->isChecked(); ret.options.apiValidation = ui->APIValidation->isChecked(); ret.options.refAllResources = ui->RefAllResources->isChecked(); ret.options.captureAllCmdLists = ui->CaptureAllCmdLists->isChecked(); diff --git a/qrenderdoc/Windows/Dialogs/CaptureDialog.ui b/qrenderdoc/Windows/Dialogs/CaptureDialog.ui index cca107bf9..d12cc184c 100644 --- a/qrenderdoc/Windows/Dialogs/CaptureDialog.ui +++ b/qrenderdoc/Windows/Dialogs/CaptureDialog.ui @@ -470,12 +470,12 @@ - + - Only collect callstacks on 'drawcall' level api calls + Only collect callstacks on actions (draws, dispatches, clears, copies, etc) - Only Drawcall stacks + Only Action stacks diff --git a/qrenderdoc/Windows/Dialogs/SettingsDialog.ui b/qrenderdoc/Windows/Dialogs/SettingsDialog.ui index 41b7ff3b9..6f86139f6 100644 --- a/qrenderdoc/Windows/Dialogs/SettingsDialog.ui +++ b/qrenderdoc/Windows/Dialogs/SettingsDialog.ui @@ -1036,7 +1036,7 @@ After interop is enabled you will need to reload any capture. The time unit to use when displaying the duration column in the event browser - Time unit used for drawcall durations + Time unit used for action durations diff --git a/qrenderdoc/Windows/Dialogs/TipsDialog.cpp b/qrenderdoc/Windows/Dialogs/TipsDialog.cpp index 2832ff65d..bc9fa8336 100644 --- a/qrenderdoc/Windows/Dialogs/TipsDialog.cpp +++ b/qrenderdoc/Windows/Dialogs/TipsDialog.cpp @@ -188,7 +188,7 @@ void TipsDialog::initialize() "to view the history of in the texture viewer, and click the 'history' button underneath " "the zoomed-in pixel context.\n\nEach event will show up red or green depending on " "whether it affected or didn't affect the pixel. By expanding the event, you can see the " - "possibly several primitives within the draw that overdrew the pixel.\n"))); + "possibly several primitives within the action that overdrew the pixel.\n"))); // Tip 18 m_tips.push_back( @@ -209,7 +209,7 @@ void TipsDialog::initialize() // Tip 20 m_tips.push_back( Tip(tr("Gathering of per-event callstacks"), - tr("RenderDoc is able to gather callstacks either per-drawcall or per-API event. You can " + tr("RenderDoc is able to gather callstacks either per-action or per-API event. You can " "do this by enabling the option before launching an application capture.\n\nWhen " "loading the log, initially the callstacks will not be available until symbols are " "resolved. Go to tools -> resolve symbols to load up the pdbs matching the modules " @@ -219,7 +219,7 @@ void TipsDialog::initialize() m_tips.push_back(Tip( tr("Texture debugging overlays"), tr("In the texture viewer, you can select from several helpful debugging overlays over the " - "current view. This can show wireframe or solid coloour overlays of the current drawcall, " + "current view. This can show wireframe or solid coloour overlays of the current action, " "as well as showing depth pass/fail or even representing quad overdraw as a heatmap.\n"))); // Tip 22 @@ -268,7 +268,7 @@ void TipsDialog::initialize() m_tips.push_back( Tip(tr("Event browser keyboard shortcuts"), tr("In the event browser Ctrl-F opens up the find bar, to locate an event by its name. " - "Ctrl-G opens the jump-to-event to jump to the closest drawcall to a numbered event. " + "Ctrl-G opens the jump-to-event to jump to the closest action to a numbered event. " "Ctrl-B will toggle a bookmark at the current event.\n"))); // Tip 28 diff --git a/qrenderdoc/Windows/EventBrowser.cpp b/qrenderdoc/Windows/EventBrowser.cpp index 9e833061a..ce01d7231 100644 --- a/qrenderdoc/Windows/EventBrowser.cpp +++ b/qrenderdoc/Windows/EventBrowser.cpp @@ -83,7 +83,7 @@ struct EventBrowserPersistentStorage : public CustomPersistentStorage } else { - CurrentFilter = lit("$draw()"); + CurrentFilter = lit("$action()"); } QVariant saved = settings[lit("filters")]; @@ -106,9 +106,9 @@ struct EventBrowserPersistentStorage : public CustomPersistentStorage } else { - SavedFilters.push_back(qMakePair(lit("Default"), lit("$draw()"))); - SavedFilters.push_back(qMakePair(lit("Draws and Barriers"), lit("$draw() Barrier"))); - SavedFilters.push_back(qMakePair(lit("Hide Copies & Clears"), lit("$draw() -Copy -Clear"))); + SavedFilters.push_back(qMakePair(lit("Default"), lit("$action()"))); + SavedFilters.push_back(qMakePair(lit("Actions and Barriers"), lit("$action() Barrier"))); + SavedFilters.push_back(qMakePair(lit("Hide Copies & Clears"), lit("$action() -Copy -Clear"))); } } @@ -122,7 +122,7 @@ enum { COL_NAME, COL_EID, - COL_DRAW, + COL_ACTION, COL_DURATION, COL_COUNT, }; @@ -131,8 +131,8 @@ enum { ROLE_SELECTED_EID = Qt::UserRole, ROLE_EFFECTIVE_EID, - ROLE_GROUPED_DRAWCALL, - ROLE_EXACT_DRAWCALL, + ROLE_GROUPED_ACTION, + ROLE_EXACT_ACTION, ROLE_CHUNK, }; @@ -186,11 +186,11 @@ struct EventItemModel : public QAbstractItemModel m_Nodes.clear(); m_RowInParentCache.clear(); m_EIDNameCache.clear(); - m_Draws.clear(); + m_Actions.clear(); m_Chunks.clear(); - if(!m_Ctx.CurDrawcalls().empty()) - m_Nodes[0] = CreateDrawNode(NULL); + if(!m_Ctx.CurRootActions().empty()) + m_Nodes[0] = CreateActionNode(NULL); m_CurrentEID = createIndex(0, 0, TagCaptureStart); @@ -295,12 +295,12 @@ struct EventItemModel : public QAbstractItemModel } } - bool UseCustomDrawNames() { return m_UseCustomDrawNames; } - void SetUseCustomDrawNames(bool use) + bool UseCustomActionNames() { return m_UseCustomActionNames; } + void SetUseCustomActionNames(bool use) { - if(m_UseCustomDrawNames != use) + if(m_UseCustomActionNames != use) { - m_UseCustomDrawNames = use; + m_UseCustomActionNames = use; m_EIDNameCache.clear(); m_View->viewport()->update(); @@ -338,7 +338,7 @@ struct EventItemModel : public QAbstractItemModel uint32_t eid = text.toUInt(&eidOK); // include EID in results first if the text parses as an integer - if(eidOK && eid > 0 && eid < m_Draws.size()) + if(eidOK && eid > 0 && eid < m_Actions.size()) { // if the text doesn't exactly match the EID after converting back, don't treat this as an // EID-only search @@ -427,8 +427,8 @@ struct EventItemModel : public QAbstractItemModel if(eid == 0) return createIndex(0, 0, TagCaptureStart); - const DrawcallDescription *draw = m_Draws[eid]; - if(draw) + const ActionDescription *action = m_Actions[eid]; + if(action) { // this function is not called regularly (anywhere to do with painting) but only occasionally // to find an index by EID, so we do an 'expensive' search for the row in the parent. The @@ -447,41 +447,41 @@ struct EventItemModel : public QAbstractItemModel m_RowInParentCache.pop_back(); // account for the Capture Start row we'll add at the top level - int rowInParent = draw->parent ? 0 : 1; + int rowInParent = action->parent ? 0 : 1; - const rdcarray &draws = - draw->parent ? draw->parent->children : m_Ctx.CurDrawcalls(); + const rdcarray &actions = + action->parent ? action->parent->children : m_Ctx.CurRootActions(); - for(const DrawcallDescription &d : draws) + for(const ActionDescription &a : actions) { - // the first draw with an EID greater than the one we're searching for should contain it. - if(d.eventId >= eid) + // the first action with an EID greater than the one we're searching for should contain it. + if(a.eventId >= eid) { - // except if the draw is a fake marker. In this case its own event ID is invalid, so we + // except if the action is a fake marker. In this case its own event ID is invalid, so we // check the range of its children (knowing it only has one layer of children) - if(d.IsFakeMarker()) + if(a.IsFakeMarker()) { - if(d.eventId == eid) + if(a.eventId == eid) break; - if(d.children[0].eventId < eid) + if(a.children[0].eventId < eid) { rowInParent++; continue; } } - // keep counting until we get to the row within this draw - for(size_t i = 0; i < d.events.size(); i++) + // keep counting until we get to the row within this action + for(size_t i = 0; i < a.events.size(); i++) { - if(d.events[i].eventId < eid) + if(a.events[i].eventId < eid) { rowInParent++; continue; } - if(d.events[i].eventId != eid) - qCritical() << "Couldn't find event" << eid << "within draw" << draw->eventId; + if(a.events[i].eventId != eid) + qCritical() << "Couldn't find event" << eid << "within action" << action->eventId; // stop, we should be at the event now break; @@ -490,7 +490,7 @@ struct EventItemModel : public QAbstractItemModel break; } - rowInParent += d.events.count(); + rowInParent += a.events.count(); } // insert the new element on the front of the cache @@ -500,16 +500,16 @@ struct EventItemModel : public QAbstractItemModel } else { - qCritical() << "Couldn't find draw for event" << eid; + qCritical() << "Couldn't find action for event" << eid; } return QModelIndex(); } - const DrawcallDescription *GetDrawcallForEID(uint32_t eid) + const ActionDescription *GetActionForEID(uint32_t eid) { - if(eid < m_Draws.size()) - return m_Draws[eid]; + if(eid < m_Actions.size()) + return m_Actions[eid]; return NULL; } @@ -519,8 +519,8 @@ struct EventItemModel : public QAbstractItemModel rdcarray ret; for(auto it = m_Nodes.begin(); it != m_Nodes.end(); ++it) - if(it.value().draw && (it.value().draw->flags & DrawFlags::PushMarker)) - ret.push_back(it.value().draw->name); + if(it.value().action && (it.value().action->flags & ActionFlags::PushMarker)) + ret.push_back(it.value().action->name); return ret; } @@ -545,8 +545,8 @@ struct EventItemModel : public QAbstractItemModel if(row == 0) return createIndex(row, column, TagCaptureStart); - // the rest are in the root draw node - return GetIndexForDrawChildRow(m_Nodes[0], row, column); + // the rest are in the root action node + return GetIndexForActionChildRow(m_Nodes[0], row, column); } else if(parent.internalId() == TagCaptureStart) { @@ -555,10 +555,10 @@ struct EventItemModel : public QAbstractItemModel } else { - // otherwise the parent is a real draw + // otherwise the parent is a real action auto it = m_Nodes.find(parent.internalId()); if(it != m_Nodes.end()) - return GetIndexForDrawChildRow(*it, row, column); + return GetIndexForActionChildRow(*it, row, column); } return QModelIndex(); @@ -573,19 +573,20 @@ struct EventItemModel : public QAbstractItemModel if(index.internalId() == TagCaptureStart) return createIndex(0, 0, TagRoot); - if(index.internalId() >= m_Draws.size()) + if(index.internalId() >= m_Actions.size()) return QModelIndex(); - // otherwise it's a draw - const DrawcallDescription *draw = m_Draws[index.internalId()]; + // otherwise it's an action + const ActionDescription *action = m_Actions[index.internalId()]; - // if it has no parent draw, the parent is the root - if(draw->parent == NULL) + // if it has no parent action, the parent is the root + if(action->parent == NULL) return createIndex(0, 0, TagRoot); - // the parent must be a node since it has at least one child (this draw), so we'll have a cached + // the parent must be a node since it has at least one child (this action), so we'll have a + // cached // index - return m_Nodes[draw->parent->eventId].index; + return m_Nodes[action->parent->eventId].index; } int rowCount(const QModelIndex &parent = QModelIndex()) const override @@ -628,7 +629,7 @@ struct EventItemModel : public QAbstractItemModel { case COL_NAME: return tr("Name"); case COL_EID: return lit("EID"); - case COL_DRAW: return lit("Draw #"); + case COL_ACTION: return lit("Action #"); case COL_DURATION: return tr("Duration (%1)").arg(UnitSuffix(m_TimeUnit)); default: break; } @@ -681,7 +682,7 @@ struct EventItemModel : public QAbstractItemModel { case COL_NAME: return tr("Capture Start"); case COL_EID: return lit("0"); - case COL_DRAW: return lit("0"); + case COL_ACTION: return lit("0"); default: break; } } @@ -696,19 +697,19 @@ struct EventItemModel : public QAbstractItemModel { uint32_t eid = index.internalId(); - if(eid >= m_Draws.size()) + if(eid >= m_Actions.size()) return QVariant(); if(role == ROLE_SELECTED_EID) return eid; - if(role == ROLE_GROUPED_DRAWCALL) - return QVariant::fromValue(qulonglong(m_Draws[eid])); + if(role == ROLE_GROUPED_ACTION) + return QVariant::fromValue(qulonglong(m_Actions[eid])); - if(role == ROLE_EXACT_DRAWCALL) + if(role == ROLE_EXACT_ACTION) { - const DrawcallDescription *draw = m_Draws[eid]; - return draw->eventId == eid ? QVariant::fromValue(qulonglong(m_Draws[eid])) : QVariant(); + const ActionDescription *action = m_Actions[eid]; + return action->eventId == eid ? QVariant::fromValue(qulonglong(m_Actions[eid])) : QVariant(); } if(role == ROLE_CHUNK) @@ -727,22 +728,22 @@ struct EventItemModel : public QAbstractItemModel if(role == Qt::DisplayRole) { - const DrawcallDescription *draw = m_Draws[eid]; + const ActionDescription *action = m_Actions[eid]; switch(index.column()) { case COL_NAME: return GetCachedEIDName(eid); case COL_EID: - case COL_DRAW: - if(draw->eventId == eid && !draw->children.empty()) + case COL_ACTION: + if(action->eventId == eid && !action->children.empty()) { uint32_t effectiveEID = eid; auto it = m_Nodes.find(eid); if(it != m_Nodes.end()) effectiveEID = it->effectiveEID; - if(draw->IsFakeMarker()) - eid = draw->children[0].events[0].eventId; + if(action->IsFakeMarker()) + eid = action->children[0].events[0].eventId; if(index.column() == COL_EID) { @@ -752,25 +753,25 @@ struct EventItemModel : public QAbstractItemModel } else { - uint32_t drawId = draw->drawcallId; - uint32_t endDrawId = m_Draws[effectiveEID]->drawcallId; + uint32_t actionId = action->actionId; + uint32_t endActionId = m_Actions[effectiveEID]->actionId; - if(draw->IsFakeMarker()) - drawId = draw->children[0].drawcallId; + if(action->IsFakeMarker()) + actionId = action->children[0].actionId; - return drawId == endDrawId + return actionId == endActionId ? QVariant() - : QVariant(QFormatStr("%1-%2").arg(drawId).arg(endDrawId)); + : QVariant(QFormatStr("%1-%2").arg(actionId).arg(endActionId)); } } if(index.column() == COL_EID) return eid; else - return draw->eventId == eid && - !(draw->flags & - (DrawFlags::SetMarker | DrawFlags::PushMarker | DrawFlags::PopMarker)) - ? QVariant(draw->drawcallId) + return action->eventId == eid && + !(action->flags & (ActionFlags::SetMarker | ActionFlags::PushMarker | + ActionFlags::PopMarker)) + ? QVariant(action->actionId) : QVariant(); default: break; } @@ -783,19 +784,19 @@ struct EventItemModel : public QAbstractItemModel if(!m_Ctx.Config().EventBrowser_ColorEventRow && role != RDTreeView::TreeLineColorRole) return QVariant(); - const DrawcallDescription *draw = m_Draws[eid]; + const ActionDescription *action = m_Actions[eid]; - // skip events that aren't the actual draw - if(draw->eventId != eid) + // skip events that aren't the actual action + if(action->eventId != eid) return QVariant(); // if alpha isn't 0, assume the colour is valid - if((draw->flags & (DrawFlags::PushMarker | DrawFlags::SetMarker)) && - draw->markerColor.w > 0.0f) + if((action->flags & (ActionFlags::PushMarker | ActionFlags::SetMarker)) && + action->markerColor.w > 0.0f) { QColor col = - QColor::fromRgb(qRgb(draw->markerColor.x * 255.0f, draw->markerColor.y * 255.0f, - draw->markerColor.z * 255.0f)); + QColor::fromRgb(qRgb(action->markerColor.x * 255.0f, action->markerColor.y * 255.0f, + action->markerColor.z * 255.0f)); if(role == Qt::BackgroundRole || role == RDTreeView::TreeLineColorRole) return QBrush(col); @@ -835,41 +836,41 @@ private: // an upper bound. We store only 1 pointer per event which gives us reasonable memory usage (i.e. // 8MB for that 1-million case on 64-bit) and still lets us look up what we need in O(1) and avoid // more expensive lookups when we need the properties for an event. - // This gives us a pointer for every event ID pointing to the draw that contains it. - rdcarray m_Draws; + // This gives us a pointer for every event ID pointing to the action that contains it. + rdcarray m_Actions; rdcarray m_Chunks; - // we can have a bigger structure for every nested node (i.e. draw with children). + // we can have a bigger structure for every nested node (i.e. action with children). // This drastically limits how many we need to worry about - some hierarchies have more nodes than // others but even in hierarchies with lots of nodes the number is small, compared to - // draws/events. - // we cache this with a depth-first search at init time while populating m_Draws - struct DrawTreeNode + // actions/events. + // we cache this with a depth-first search at init time while populating m_Actions + struct ActionTreeNode { - const DrawcallDescription *draw; + const ActionDescription *action; uint32_t effectiveEID; // cache the index for this node to make parent() significantly faster QModelIndex index; - // this is the number of child events, meaning all the draws and all of their events, but *not* + // this is the number of child events, meaning all the action and all of their events, but *not* // the events in any of their children. uint32_t rowCount; - // this is a cache of row index to draw. Rather than being present for every row, this is + // this is a cache of row index to action. Rather than being present for every row, this is // spaced out such that there are roughly Row2EIDFactor entries at most. This means that the // O(n) lookup to find the EID for a given row has to process that many times less entries since // it can jump to somewhere nearby. // - // The key is the row, the value is the index in the list of children of the draw - QMap row2draw; - static const int Row2DrawFactor = 100; + // The key is the row, the value is the index in the list of children of the action + QMap row2action; + static const int Row2ActionFactor = 100; }; - QMap m_Nodes; + QMap m_Nodes; bool m_ShowParameterNames = false; bool m_ShowAllParameters = false; - bool m_UseCustomDrawNames = true; + bool m_UseCustomActionNames = true; // a cache of EID -> row in parent for looking up indices for arbitrary EIDs. rdcarray> m_RowInParentCache; @@ -920,74 +921,75 @@ private: return Formatter::Format(secs); } - void CalculateTotalDuration(DrawTreeNode &node) + void CalculateTotalDuration(ActionTreeNode &node) { - const rdcarray &drawChildren = - node.draw ? node.draw->children : m_Ctx.CurDrawcalls(); + const rdcarray &actionChildren = + node.action ? node.action->children : m_Ctx.CurRootActions(); double duration = 0.0; - for(const DrawcallDescription &d : drawChildren) + for(const ActionDescription &a : actionChildren) { // ignore out of bounds EIDs - should not happen - if(d.eventId >= m_Times.size()) + if(a.eventId >= m_Times.size()) continue; // add the time for this event, if it's non-negative. Because we fill out nodes in reverse // order, any children that are nodes themselves should be populated by now - duration += qMax(0.0, m_Times[d.eventId]); + duration += qMax(0.0, m_Times[a.eventId]); } - m_Times[node.draw ? node.draw->eventId : 0] = duration; + m_Times[node.action ? node.action->eventId : 0] = duration; } - DrawTreeNode CreateDrawNode(const DrawcallDescription *draw) + ActionTreeNode CreateActionNode(const ActionDescription *action) { - const rdcarray &drawRange = draw ? draw->children : m_Ctx.CurDrawcalls(); + const rdcarray &actionRange = + action ? action->children : m_Ctx.CurRootActions(); // account for the Capture Start row we'll add at the top level - int row = draw ? 0 : 1; + int row = action ? 0 : 1; - DrawTreeNode ret; + ActionTreeNode ret; - ret.draw = draw; - ret.effectiveEID = drawRange.back().eventId; + ret.action = action; + ret.effectiveEID = actionRange.back().eventId; - ret.row2draw[0] = 0; + ret.row2action[0] = 0; - uint32_t row2eidStride = (drawRange.count() / DrawTreeNode::Row2DrawFactor) + 1; + uint32_t row2eidStride = (actionRange.count() / ActionTreeNode::Row2ActionFactor) + 1; const SDFile &sdfile = m_Ctx.GetStructuredFile(); - for(int i = 0; i < drawRange.count(); i++) + for(int i = 0; i < actionRange.count(); i++) { - const DrawcallDescription &d = drawRange[i]; + const ActionDescription &a = actionRange[i]; if((i % row2eidStride) == 0) - ret.row2draw[row] = i; + ret.row2action[row] = i; - for(const APIEvent &e : d.events) + for(const APIEvent &e : a.events) { - m_Draws.resize_for_index(e.eventId); + m_Actions.resize_for_index(e.eventId); m_Chunks.resize_for_index(e.eventId); - m_Draws[e.eventId] = &d; + m_Actions[e.eventId] = &a; if(e.chunkIndex != APIEvent::NoChunk && e.chunkIndex < sdfile.chunks.size()) m_Chunks[e.eventId] = sdfile.chunks[e.chunkIndex]; } - row += d.events.count(); + row += a.events.count(); - if(d.children.empty()) + if(a.children.empty()) continue; - DrawTreeNode node = CreateDrawNode(&d); + ActionTreeNode node = CreateActionNode(&a); - node.index = createIndex(row - 1, 0, d.eventId); + node.index = createIndex(row - 1, 0, a.eventId); - if(d.eventId == ret.effectiveEID) + if(a.eventId == ret.effectiveEID) ret.effectiveEID = node.effectiveEID; - m_Nodes[d.eventId] = node; + m_Nodes[a.eventId] = node; } ret.rowCount = row; @@ -995,70 +997,70 @@ private: return ret; } - QModelIndex GetIndexForDrawChildRow(const DrawTreeNode &node, int row, int column) const + QModelIndex GetIndexForActionChildRow(const ActionTreeNode &node, int row, int column) const { // if the row is out of bounds, bail if(row < 0 || (uint32_t)row >= node.rowCount) return QModelIndex(); - // we do the linear 'counting' within the draws list to find the event at the given row. It's - // still essentially O(n) however we keep a limited cached of skip entries at each draw node + // we do the linear 'counting' within the actions list to find the event at the given row. It's + // still essentially O(n) however we keep a limited cached of skip entries at each action node // which helps lower the cost significantly (by a factor of the roughly number of skip entries // we store). - const rdcarray &draws = - node.draw ? node.draw->children : m_Ctx.CurDrawcalls(); + const rdcarray &actions = + node.action ? node.action->children : m_Ctx.CurRootActions(); int curRow = 0; - size_t curDraw = 0; + size_t curAction = 0; // lowerBound doesn't do exactly what we want, we want the first row that is less-equal. So // instead we use upperBound and go back one step if we don't get returned the first entry - auto it = node.row2draw.upperBound(row); - if(it != node.row2draw.begin()) + auto it = node.row2action.upperBound(row); + if(it != node.row2action.begin()) --it; // start at the first skip before the desired row curRow = it.key(); - curDraw = it.value(); + curAction = it.value(); if(curRow > row) { // we should always have a skip, even if it's only the first child - qCritical() << "Couldn't find skip for" << row << "in draw node" - << (node.draw ? node.draw->eventId : 0); + qCritical() << "Couldn't find skip for" << row << "in action node" + << (node.action ? node.action->eventId : 0); // start at the first child row instead curRow = 0; - curDraw = 0; + curAction = 0; } - // if this draw doesn't contain the desired row, advance - while(curDraw < draws.size() && curRow + draws[curDraw].events.count() <= row) + // if this action doesn't contain the desired row, advance + while(curAction < actions.size() && curRow + actions[curAction].events.count() <= row) { - curRow += draws[curDraw].events.count(); - curDraw++; + curRow += actions[curAction].events.count(); + curAction++; } - // we've iterated all the draws and didn't come up with this row - but we checked above that + // we've iterated all the actions and didn't come up with this row - but we checked above that // we're in bounds of rowCount so something went wrong - if(curDraw >= draws.size()) + if(curAction >= actions.size()) { - qCritical() << "Couldn't find draw containing row" << row << "in draw node" - << (node.draw ? node.draw->eventId : 0); + qCritical() << "Couldn't find action containing row" << row << "in action node" + << (node.action ? node.action->eventId : 0); return QModelIndex(); } - // now curDraw contains the row at the idx'th event + // now curAction contains the row at the idx'th event int idx = row - curRow; - if(idx < 0 || idx >= draws[curDraw].events.count()) + if(idx < 0 || idx >= actions[curAction].events.count()) { - qCritical() << "Got invalid relative index for row" << row << "in draw node" - << (node.draw ? node.draw->eventId : 0); + qCritical() << "Got invalid relative index for row" << row << "in action node" + << (node.action ? node.action->eventId : 0); return QModelIndex(); } - return createIndex(row, column, draws[curDraw].events[idx].eventId); + return createIndex(row, column, actions[curAction].events[idx].eventId); } QVariant GetCachedEIDName(uint32_t eid) const @@ -1067,31 +1069,31 @@ private: if(it != m_EIDNameCache.end()) return it.value(); - const DrawcallDescription *draw = m_Draws[eid]; + const ActionDescription *action = m_Actions[eid]; QString name; - // markers always use the draw name no matter what (fake markers must because we don't have a - // chunk to use to name them). This doesn't apply to 'marker' regions that are multidraws or + // markers always use the action name no matter what (fake markers must because we don't have a + // chunk to use to name them). This doesn't apply to 'marker' regions that are multiactions or // command buffer boundaries. - if(draw->eventId == eid) + if(action->eventId == eid) { - if(m_UseCustomDrawNames) + if(m_UseCustomActionNames) { - name = draw->name; + name = action->name; } else { - if((draw->flags & (DrawFlags::SetMarker | DrawFlags::PushMarker)) && - !(draw->flags & (DrawFlags::CommandBufferBoundary | DrawFlags::PassBoundary | - DrawFlags::CmdList | DrawFlags::MultiDraw))) - name = draw->name; + if((action->flags & (ActionFlags::SetMarker | ActionFlags::PushMarker)) && + !(action->flags & (ActionFlags::CommandBufferBoundary | ActionFlags::PassBoundary | + ActionFlags::CmdList | ActionFlags::MultiAction))) + name = action->name; } } if(name.isEmpty()) { - for(const APIEvent &e : draw->events) + for(const APIEvent &e : action->events) { if(e.eventId == eid) { @@ -1178,33 +1180,33 @@ struct EventFilter MatchType type; }; -static QMap DrawFlagsLookup; -static QStringList DrawFlagsList; +static QMap ActionFlagsLookup; +static QStringList ActionFlagsList; -void CacheDrawFlagsLookup() +void CacheActionFlagsLookup() { - if(DrawFlagsLookup.empty()) + if(ActionFlagsLookup.empty()) { for(uint32_t i = 0; i <= 31; i++) { - DrawFlags flag = DrawFlags(1U << i); + ActionFlags flag = ActionFlags(1U << i); // bit of a hack, see if it's a valid flag by stringising and seeing if it contains - // DrawFlags( + // ActionFlags( QString str = ToQStr(flag); - if(str.contains(lit("DrawFlags("))) + if(str.contains(lit("ActionFlags("))) continue; - DrawFlagsList.push_back(str); - DrawFlagsLookup[str.toLower()] = flag; + ActionFlagsList.push_back(str); + ActionFlagsLookup[str.toLower()] = flag; } - DrawFlagsList.sort(); + ActionFlagsList.sort(); } } bool EvaluateFilterSet(ICaptureContext &ctx, const rdcarray &filters, bool all, - uint32_t eid, const SDChunk *chunk, const DrawcallDescription *draw, + uint32_t eid, const SDChunk *chunk, const ActionDescription *action, QString name) { if(filters.empty()) @@ -1235,7 +1237,7 @@ bool EvaluateFilterSet(ICaptureContext &ctx, const rdcarray &filter if(accept && !all && filter.type == MatchType::Normal) continue; - bool match = filter.callback(&ctx, rdcstr(), rdcstr(), eid, chunk, draw, name); + bool match = filter.callback(&ctx, rdcstr(), rdcstr(), eid, chunk, action, name); // in normal mode, if it matches it should be included (unless a subsequent filter excludes // it) @@ -1346,7 +1348,7 @@ public: MAKE_BUILTIN_FILTER(regex); MAKE_BUILTIN_FILTER(param); // MAKE_BUILTIN_FILTER(event); - MAKE_BUILTIN_FILTER(draw); + MAKE_BUILTIN_FILTER(action); MAKE_BUILTIN_FILTER(dispatch); MAKE_BUILTIN_FILTER(childOf); MAKE_BUILTIN_FILTER(parent); @@ -1357,9 +1359,9 @@ public: return filterCompleter_event(ctx, name, parameters); }; */ - m_BuiltinFilters[lit("draw")].completer = [this](ICaptureContext *ctx, QString name, - QString parameters) { - return filterCompleter_draw(ctx, name, parameters); + m_BuiltinFilters[lit("action")].completer = [this](ICaptureContext *ctx, QString name, + QString parameters) { + return filterCompleter_action(ctx, name, parameters); }; m_BuiltinFilters[lit("dispatch")].completer = [this](ICaptureContext *ctx, QString name, QString parameters) { @@ -1488,9 +1490,8 @@ protected: const SDChunk *chunk = (const SDChunk *)(sourceModel()->data(source_idx, ROLE_CHUNK).toULongLong()); - const DrawcallDescription *draw = - (const DrawcallDescription - *)(sourceModel()->data(source_idx, ROLE_GROUPED_DRAWCALL).toULongLong()); + const ActionDescription *action = + (const ActionDescription *)(sourceModel()->data(source_idx, ROLE_GROUPED_ACTION).toULongLong()); QString name = source_idx.data(Qt::DisplayRole).toString(); int off = name.indexOf(QLatin1Char('<')); @@ -1505,7 +1506,7 @@ protected: off = name.indexOf(QLatin1Char('<'), off + 1); } - m_VisibleCache[eid] = EvaluateFilterSet(m_Ctx, m_Filters, false, eid, chunk, draw, name); + m_VisibleCache[eid] = EvaluateFilterSet(m_Ctx, m_Filters, false, eid, chunk, action, name); return m_VisibleCache[eid] > 0; } @@ -1526,7 +1527,7 @@ private: { QString matchString = string.toLower(); return [matchString](ICaptureContext *, const rdcstr &, const rdcstr &, uint32_t, - const SDChunk *, const DrawcallDescription *, const rdcstr &name) { + const SDChunk *, const ActionDescription *, const rdcstr &name) { return QString(name).toLower().contains(matchString); }; } @@ -1654,7 +1655,7 @@ after the trailing /: } return [regex](ICaptureContext *, const rdcstr &, const rdcstr &, uint32_t, const SDChunk *, - const DrawcallDescription *, const rdcstr &name) { + const ActionDescription *, const rdcstr &name) { QRegularExpressionMatch match = regex.match(QString(name)); return match.isValid() && match.hasMatch(); }; @@ -1706,35 +1707,34 @@ searched for as a case-insensitive substring. return NULL; } - return - [paramName, paramValue](ICaptureContext *ctx, const rdcstr &, const rdcstr &, uint32_t, - const SDChunk *chunk, const DrawcallDescription *, const rdcstr &) { - if(!chunk) - return false; + return [paramName, paramValue](ICaptureContext *ctx, const rdcstr &, const rdcstr &, uint32_t, + const SDChunk *chunk, const ActionDescription *, const rdcstr &) { + if(!chunk) + return false; - const SDObject *o = FindChildRecursively(chunk, paramName); + const SDObject *o = FindChildRecursively(chunk, paramName); - if(!o) - return false; + if(!o) + return false; - if(o->IsArray()) - { - for(const SDObject *c : *o) - { - if(RichResourceTextFormat(*ctx, SDObject2Variant(c, false)) - .contains(paramValue, Qt::CaseInsensitive)) - return true; - } + if(o->IsArray()) + { + for(const SDObject *c : *o) + { + if(RichResourceTextFormat(*ctx, SDObject2Variant(c, false)) + .contains(paramValue, Qt::CaseInsensitive)) + return true; + } - return false; - } - else - { - return RichResourceTextFormat(*ctx, SDObject2Variant(o, false)) - .contains(paramValue, Qt::CaseInsensitive); - } + return false; + } + else + { + return RichResourceTextFormat(*ctx, SDObject2Variant(o, false)) + .contains(paramValue, Qt::CaseInsensitive); + } - }; + }; } QString filterDescription_event() const @@ -1826,83 +1826,83 @@ Available numeric properties. Compare with $event(prop > 100) or eid; }; case 4: return [eid](ICaptureContext *, const rdcstr &, const rdcstr &, uint32_t eventId, - const SDChunk *, const DrawcallDescription *draw, + const SDChunk *, const ActionDescription *action, const rdcstr &) { return eventId <= eid; }; case 5: return [eid](ICaptureContext *, const rdcstr &, const rdcstr &, uint32_t eventId, - const SDChunk *, const DrawcallDescription *draw, + const SDChunk *, const ActionDescription *action, const rdcstr &) { return eventId >= eid; }; default: trace.setError(tr("Internal error", "EventFilterModel")); return NULL; } } - QString filterDescription_draw() const + QString filterDescription_action() const { return tr(R"EOD( -

    $draw

    +

    $action


    - - + +
    $draw()- passes if an event is a drawcall.
    $draw(condition)- passes if an event is a drawcall and matches a condition.
    $action()- passes if an event is an action.
    $action(condition)- passes if an event is an action and matches a condition.

    -If no condition is specified then the event is just included if it's a draw-type event - meaning any -event such as drawcalls, dispatches, copies, clears and others that do work and modify resources.
    -Otherwise the event is included if it's a draw AND if the condition is true. +If no condition is specified then the event is just included if it's an action - meaning any event +such as draws, dispatches, copies, clears and others that do work and modify resources.
    +Otherwise the event is included if it's an action AND if the condition is true.

    -

    Available numeric properties. Compare with $draw(prop > 100) or $draw(prop <= 200)

    +

    Available numeric properties. Compare with $action(prop > 100) or $action(prop <= 200)

    - - - - - - - + + + + + + + - +
    EID: The draw's EID.
    drawId: The draw ID, starting from 1 and numbering each draw.
    numIndices: The number of vertices or indices in a draw.
    baseVertex: The base vertex value for an indexed draw.
    indexOffset: The index offset for an indexed draw.
    vertexOffset: The vertex offset for a non-indexed draw.
    instanceOffset: The instance offset for an instanced draw.
    EID: The action's EID.
    actionId: The action ID, starting from 1 and numbering each action.
    numIndices: The number of vertices or indices in an action.
    baseVertex: The base vertex value for an indexed action.
    indexOffset: The index offset for an indexed action.
    vertexOffset: The vertex offset for a non-indexed action.
    instanceOffset: The instance offset for an instanced action.
    dispatchX: The number of groups in the X dimension of a dispatch.
    dispatchY: The number of groups in the Y dimension of a dispatch.
    dispatchZ: The number of groups in the Z dimension of a dispatch.
    dispatchSize: The total number of groups (X * Y * Z) of a dispatch.
    duration: The listed duration of a drawcall (only available with durations).
    duration: The listed duration of an action (only available with durations).

    -Also available is the flags property. Drawcalls have different flags and properties -and these can be queried with a filter such as $draw(flags & Clear|ClearDepthStencil) +Also available is the flags property. Actions have different flags and properties +and these can be queried with a filter such as $action(flags & Clear|ClearDepthStencil)

    The flags available are:

    - + - + - + @@ -1921,13 +1921,14 @@ and these can be queried with a filter such as $draw(flags & Clear|ClearDe "EventFilterModel"); } - rdcarray filterCompleter_draw(ICaptureContext *ctx, const rdcstr &name, const rdcstr ¶ms) + rdcarray filterCompleter_action(ICaptureContext *ctx, const rdcstr &name, + const rdcstr ¶ms) { QList tokens = tokenise(params); if(tokens.size() <= 1) return { - "EID", "drawId", "numIndices", + "EID", "actionId", "numIndices", // most aliases we don't autocomplete but this one we leave "numVertices", "numInstances", "baseVertex", "indexOffset", "vertexOffset", "instanceOffset", "dispatchX", "dispatchY", "dispatchZ", "dispatchSize", "duration", @@ -1936,11 +1937,11 @@ and these can be queried with a filter such as $draw(flags & Clear|ClearDe if(tokens[0].text == lit("flags") && tokens.size() >= 2) { - CacheDrawFlagsLookup(); + CacheActionFlagsLookup(); rdcarray flags; - for(QString s : DrawFlagsList) + for(QString s : ActionFlagsList) flags.push_back(s); return flags; @@ -1949,25 +1950,26 @@ and these can be queried with a filter such as $draw(flags & Clear|ClearDe return {}; } - IEventBrowser::EventFilterCallback filterFunction_draw(QString name, QString parameters, - ParseTrace &trace) + IEventBrowser::EventFilterCallback filterFunction_action(QString name, QString parameters, + ParseTrace &trace) { - // $draw(...) => returns true only for draws, optionally with a particular property filter - // PopMarker draws are draws so they can contain the other non-draw events that might trail - // in a group, but we don't count them as real draws for any of this filtering except for flags - // filtering, where they can be manually included + // action(...) => returns true only for actions, optionally with a particular property filter + // PopMarker actions are actions so they can contain the other non-action events that might + // trail in a group, but we don't count them as real actions for any of this filtering except + // for + // flags filtering, where they can be manually included QList tokens = tokenise(parameters); - // no parameters, just return if it's a draw + // no parameters, just return if it's an action if(tokens.isEmpty()) return [](ICaptureContext *, const rdcstr &, const rdcstr &, uint32_t eventId, - const SDChunk *, const DrawcallDescription *draw, const rdcstr &) { - return draw->eventId == eventId && !(draw->flags & DrawFlags::PopMarker); + const SDChunk *, const ActionDescription *action, const rdcstr &) { + return action->eventId == eventId && !(action->flags & ActionFlags::PopMarker); }; // we upcast to int64_t so we can compare both unsigned and signed values without losing any // precision (we don't have any uint64_ts to compare) - using PropGetter = int64_t (*)(const DrawcallDescription *); + using PropGetter = int64_t (*)(const ActionDescription *); struct NamedProp { @@ -1977,24 +1979,25 @@ and these can be queried with a filter such as $draw(flags & Clear|ClearDe #define NAMED_PROP(name, access) \ { \ - name, [](const DrawcallDescription *draw) -> int64_t { return access; } \ + name, [](const ActionDescription *action) -> int64_t { return access; } \ } static const NamedProp namedProps[] = { - NAMED_PROP("eventid", draw->eventId), NAMED_PROP("eid", draw->eventId), - NAMED_PROP("drawcallid", draw->drawcallId), NAMED_PROP("drawid", draw->drawcallId), - NAMED_PROP("numindices", draw->numIndices), NAMED_PROP("numindexes", draw->numIndices), - NAMED_PROP("numvertices", draw->numIndices), NAMED_PROP("numvertexes", draw->numIndices), - NAMED_PROP("indexcount", draw->numIndices), NAMED_PROP("vertexcount", draw->numIndices), - NAMED_PROP("numinstances", draw->numInstances), - NAMED_PROP("instancecount", draw->numInstances), NAMED_PROP("basevertex", draw->baseVertex), - NAMED_PROP("indexoffset", draw->indexOffset), NAMED_PROP("vertexoffset", draw->vertexOffset), - NAMED_PROP("instanceoffset", draw->instanceOffset), - NAMED_PROP("dispatchx", draw->dispatchDimension[0]), - NAMED_PROP("dispatchy", draw->dispatchDimension[1]), - NAMED_PROP("dispatchz", draw->dispatchDimension[2]), - NAMED_PROP("dispatchsize", draw->dispatchDimension[0] * draw->dispatchDimension[1] * - draw->dispatchDimension[2]), + NAMED_PROP("eventid", action->eventId), NAMED_PROP("eid", action->eventId), + NAMED_PROP("actionid", action->actionId), NAMED_PROP("numindices", action->numIndices), + NAMED_PROP("numindexes", action->numIndices), NAMED_PROP("numvertices", action->numIndices), + NAMED_PROP("numvertexes", action->numIndices), NAMED_PROP("indexcount", action->numIndices), + NAMED_PROP("vertexcount", action->numIndices), + NAMED_PROP("numinstances", action->numInstances), + NAMED_PROP("instancecount", action->numInstances), + NAMED_PROP("basevertex", action->baseVertex), NAMED_PROP("indexoffset", action->indexOffset), + NAMED_PROP("vertexoffset", action->vertexOffset), + NAMED_PROP("instanceoffset", action->instanceOffset), + NAMED_PROP("dispatchx", action->dispatchDimension[0]), + NAMED_PROP("dispatchy", action->dispatchDimension[1]), + NAMED_PROP("dispatchz", action->dispatchDimension[2]), + NAMED_PROP("dispatchsize", action->dispatchDimension[0] * action->dispatchDimension[1] * + action->dispatchDimension[2]), }; QByteArray prop = tokens[0].text.toLower().toLatin1(); @@ -2044,44 +2047,44 @@ and these can be queried with a filter such as $draw(flags & Clear|ClearDe case 0: return [propGetter, value](ICaptureContext *, const rdcstr &, const rdcstr &, uint32_t eventId, const SDChunk *, - const DrawcallDescription *draw, const rdcstr &) { - return draw->eventId == eventId && !(draw->flags & DrawFlags::PopMarker) && - propGetter(draw) == value; + const ActionDescription *action, const rdcstr &) { + return action->eventId == eventId && !(action->flags & ActionFlags::PopMarker) && + propGetter(action) == value; }; case 1: return [propGetter, value](ICaptureContext *, const rdcstr &, const rdcstr &, uint32_t eventId, const SDChunk *, - const DrawcallDescription *draw, const rdcstr &) { - return draw->eventId == eventId && !(draw->flags & DrawFlags::PopMarker) && - propGetter(draw) != value; + const ActionDescription *action, const rdcstr &) { + return action->eventId == eventId && !(action->flags & ActionFlags::PopMarker) && + propGetter(action) != value; }; case 2: return [propGetter, value](ICaptureContext *, const rdcstr &, const rdcstr &, uint32_t eventId, const SDChunk *, - const DrawcallDescription *draw, const rdcstr &) { - return draw->eventId == eventId && !(draw->flags & DrawFlags::PopMarker) && - propGetter(draw) < value; + const ActionDescription *action, const rdcstr &) { + return action->eventId == eventId && !(action->flags & ActionFlags::PopMarker) && + propGetter(action) < value; }; case 3: return [propGetter, value](ICaptureContext *, const rdcstr &, const rdcstr &, uint32_t eventId, const SDChunk *, - const DrawcallDescription *draw, const rdcstr &) { - return draw->eventId == eventId && !(draw->flags & DrawFlags::PopMarker) && - propGetter(draw) > value; + const ActionDescription *action, const rdcstr &) { + return action->eventId == eventId && !(action->flags & ActionFlags::PopMarker) && + propGetter(action) > value; }; case 4: return [propGetter, value](ICaptureContext *, const rdcstr &, const rdcstr &, uint32_t eventId, const SDChunk *, - const DrawcallDescription *draw, const rdcstr &) { - return draw->eventId == eventId && !(draw->flags & DrawFlags::PopMarker) && - propGetter(draw) <= value; + const ActionDescription *action, const rdcstr &) { + return action->eventId == eventId && !(action->flags & ActionFlags::PopMarker) && + propGetter(action) <= value; }; case 5: return [propGetter, value](ICaptureContext *, const rdcstr &, const rdcstr &, uint32_t eventId, const SDChunk *, - const DrawcallDescription *draw, const rdcstr &) { - return draw->eventId == eventId && !(draw->flags & DrawFlags::PopMarker) && - propGetter(draw) >= value; + const ActionDescription *action, const rdcstr &) { + return action->eventId == eventId && !(action->flags & ActionFlags::PopMarker) && + propGetter(action) >= value; }; default: trace.setError(tr("Internal error", "EventFilterModel")); return NULL; } @@ -2162,28 +2165,28 @@ and these can be queried with a filter such as $draw(flags & Clear|ClearDe case 0: return [this, nanoValue](ICaptureContext *, const rdcstr &, const rdcstr &, uint32_t eventId, - const SDChunk *, const DrawcallDescription *draw, const rdcstr &) { + const SDChunk *, const ActionDescription *, const rdcstr &) { double dur = m_Model->GetSecondsDurationForEID(eventId); return dur >= 0.0 && int64_t(dur * 1000000000.0) < nanoValue; }; case 1: return [this, nanoValue](ICaptureContext *, const rdcstr &, const rdcstr &, uint32_t eventId, - const SDChunk *, const DrawcallDescription *draw, const rdcstr &) { + const SDChunk *, const ActionDescription *, const rdcstr &) { double dur = m_Model->GetSecondsDurationForEID(eventId); return dur >= 0.0 && int64_t(dur * 1000000000.0) > nanoValue; }; case 2: return [this, nanoValue](ICaptureContext *, const rdcstr &, const rdcstr &, uint32_t eventId, - const SDChunk *, const DrawcallDescription *draw, const rdcstr &) { + const SDChunk *, const ActionDescription *, const rdcstr &) { double dur = m_Model->GetSecondsDurationForEID(eventId); return dur >= 0.0 && int64_t(dur * 1000000000.0) <= nanoValue; }; case 3: return [this, nanoValue](ICaptureContext *, const rdcstr &, const rdcstr &, uint32_t eventId, - const SDChunk *, const DrawcallDescription *draw, const rdcstr &) { + const SDChunk *, const ActionDescription *, const rdcstr &) { double dur = m_Model->GetSecondsDurationForEID(eventId); return dur >= 0.0 && int64_t(dur * 1000000000.0) >= nanoValue; }; @@ -2196,7 +2199,7 @@ and these can be queried with a filter such as $draw(flags & Clear|ClearDe { trace.position = tokens[0].position; trace.length = (tokens[1].position + tokens[1].length) - trace.position + 1; - trace.setError(tr("Expected $draw(flags & ...)", "EventFilterModel")); + trace.setError(tr("Expected $action(flags & ...)", "EventFilterModel")); return NULL; } @@ -2211,21 +2214,21 @@ and these can be queried with a filter such as $draw(flags & Clear|ClearDe { trace.position = tokens[2].position; trace.length = (tokens.back().position + tokens.back().length) - trace.position + 1; - trace.setError(tr("Invalid draw flags expression", "EventFilterModel")); + trace.setError(tr("Invalid action flags expression", "EventFilterModel")); return NULL; } - CacheDrawFlagsLookup(); + CacheActionFlagsLookup(); - DrawFlags flags = DrawFlags::NoFlags; + ActionFlags flags = ActionFlags::NoFlags; for(const QString &flagString : flagStrings) { - auto it = DrawFlagsLookup.find(flagString.toLower()); - if(it == DrawFlagsLookup.end()) + auto it = ActionFlagsLookup.find(flagString.toLower()); + if(it == ActionFlagsLookup.end()) { trace.position = tokens[2].position; trace.length = (tokens.back().position + tokens.back().length) - trace.position + 1; - trace.setError(tr("Unrecognised draw flag '%1'", "EventFilterModel").arg(flagString)); + trace.setError(tr("Unrecognised action flag '%1'", "EventFilterModel").arg(flagString)); return NULL; } @@ -2233,8 +2236,9 @@ and these can be queried with a filter such as $draw(flags & Clear|ClearDe } return [flags](ICaptureContext *, const rdcstr &, const rdcstr &, uint32_t eventId, - const SDChunk *, const DrawcallDescription *draw, - const rdcstr &) { return draw->eventId == eventId && (draw->flags & flags); }; + const SDChunk *, const ActionDescription *action, const rdcstr &) { + return action->eventId == eventId && (action->flags & flags); + }; } else { @@ -2264,7 +2268,7 @@ Otherwise the event is included if it's a dispatch AND if the condition is true.
    Clear: This is a clear call, clearing all or a subset of a resource.
    Drawcall: This is a graphics pipeline drawcall, rasterizing polygons.
    Drawcall: This is a graphics pipeline action, rasterizing polygons.
    Dispatch: This is a compute dispatch.
    CmdList: This is part of the book-keeping for a command list, secondary command buffer or bundle.
    SetMarker: This is an individual string debug marker, with no children.
    PushMarker: This is a push of a debug marker region, with some child drawcalls
    PushMarker: This is a push of a debug marker region, with some child actions
    PopMarker: This is the pop of a debug marker region.
    Present: This is a graphics present to a window.
    MultiDraw: This is part of a multi-draw drawcall.
    MultiAction: This is part of a multi-action, like a MultiDraw or ExecuteIndirect.
    Copy: This is a copy call, copying between one resource and another.
    Resolve: This is a resolve or non-identical blit, as opposed to a copy.
    GenMips: This call is generating mip-maps for a texture
    - + @@ -2282,7 +2286,7 @@ Otherwise the event is included if it's a dispatch AND if the condition is true. if(tokens.size() <= 1) return { - "EID", "drawcallId", "drawId", "x", "y", "z", "size", "duration", + "EID", "actionId", "x", "y", "z", "size", "duration", }; return {}; @@ -2295,16 +2299,16 @@ Otherwise the event is included if it's a dispatch AND if the condition is true. // filter QList tokens = tokenise(parameters); - // no parameters, just return if it's a draw + // no parameters, just return if it's a dispatch if(tokens.isEmpty()) return [](ICaptureContext *, const rdcstr &, const rdcstr &, uint32_t eventId, - const SDChunk *, const DrawcallDescription *draw, const rdcstr &) { - return draw->eventId == eventId && (draw->flags & DrawFlags::Dispatch); + const SDChunk *, const ActionDescription *action, const rdcstr &) { + return action->eventId == eventId && (action->flags & ActionFlags::Dispatch); }; // we upcast to int64_t so we can compare both unsigned and signed values without losing any // precision (we don't have any uint64_ts to compare) - using PropGetter = int64_t (*)(const DrawcallDescription *); + using PropGetter = int64_t (*)(const ActionDescription *); struct NamedProp { @@ -2313,17 +2317,17 @@ Otherwise the event is included if it's a dispatch AND if the condition is true. }; static const NamedProp namedProps[] = { - NAMED_PROP("eventid", draw->eventId), NAMED_PROP("eid", draw->eventId), - NAMED_PROP("drawcallid", draw->drawcallId), NAMED_PROP("drawid", draw->drawcallId), - NAMED_PROP("dispatchx", draw->dispatchDimension[0]), - NAMED_PROP("dispatchy", draw->dispatchDimension[1]), - NAMED_PROP("dispatchz", draw->dispatchDimension[2]), - NAMED_PROP("x", draw->dispatchDimension[0]), NAMED_PROP("y", draw->dispatchDimension[1]), - NAMED_PROP("z", draw->dispatchDimension[2]), - NAMED_PROP("dispatchsize", draw->dispatchDimension[0] * draw->dispatchDimension[1] * - draw->dispatchDimension[2]), - NAMED_PROP("size", draw->dispatchDimension[0] * draw->dispatchDimension[1] * - draw->dispatchDimension[2]), + NAMED_PROP("eventid", action->eventId), NAMED_PROP("eid", action->eventId), + NAMED_PROP("actionid", action->actionId), + NAMED_PROP("dispatchx", action->dispatchDimension[0]), + NAMED_PROP("dispatchy", action->dispatchDimension[1]), + NAMED_PROP("dispatchz", action->dispatchDimension[2]), + NAMED_PROP("x", action->dispatchDimension[0]), + NAMED_PROP("y", action->dispatchDimension[1]), NAMED_PROP("z", action->dispatchDimension[2]), + NAMED_PROP("dispatchsize", action->dispatchDimension[0] * action->dispatchDimension[1] * + action->dispatchDimension[2]), + NAMED_PROP("size", action->dispatchDimension[0] * action->dispatchDimension[1] * + action->dispatchDimension[2]), }; QByteArray prop = tokens[0].text.toLower().toLatin1(); @@ -2373,44 +2377,44 @@ Otherwise the event is included if it's a dispatch AND if the condition is true. case 0: return [propGetter, value](ICaptureContext *, const rdcstr &, const rdcstr &, uint32_t eventId, const SDChunk *, - const DrawcallDescription *draw, const rdcstr &) { - return draw->eventId == eventId && (draw->flags & DrawFlags::Dispatch) && - propGetter(draw) == value; + const ActionDescription *action, const rdcstr &) { + return action->eventId == eventId && (action->flags & ActionFlags::Dispatch) && + propGetter(action) == value; }; case 1: return [propGetter, value](ICaptureContext *, const rdcstr &, const rdcstr &, uint32_t eventId, const SDChunk *, - const DrawcallDescription *draw, const rdcstr &) { - return draw->eventId == eventId && (draw->flags & DrawFlags::Dispatch) && - propGetter(draw) != value; + const ActionDescription *action, const rdcstr &) { + return action->eventId == eventId && (action->flags & ActionFlags::Dispatch) && + propGetter(action) != value; }; case 2: return [propGetter, value](ICaptureContext *, const rdcstr &, const rdcstr &, uint32_t eventId, const SDChunk *, - const DrawcallDescription *draw, const rdcstr &) { - return draw->eventId == eventId && (draw->flags & DrawFlags::Dispatch) && - propGetter(draw) < value; + const ActionDescription *action, const rdcstr &) { + return action->eventId == eventId && (action->flags & ActionFlags::Dispatch) && + propGetter(action) < value; }; case 3: return [propGetter, value](ICaptureContext *, const rdcstr &, const rdcstr &, uint32_t eventId, const SDChunk *, - const DrawcallDescription *draw, const rdcstr &) { - return draw->eventId == eventId && (draw->flags & DrawFlags::Dispatch) && - propGetter(draw) > value; + const ActionDescription *action, const rdcstr &) { + return action->eventId == eventId && (action->flags & ActionFlags::Dispatch) && + propGetter(action) > value; }; case 4: return [propGetter, value](ICaptureContext *, const rdcstr &, const rdcstr &, uint32_t eventId, const SDChunk *, - const DrawcallDescription *draw, const rdcstr &) { - return draw->eventId == eventId && (draw->flags & DrawFlags::Dispatch) && - propGetter(draw) <= value; + const ActionDescription *action, const rdcstr &) { + return action->eventId == eventId && (action->flags & ActionFlags::Dispatch) && + propGetter(action) <= value; }; case 5: return [propGetter, value](ICaptureContext *, const rdcstr &, const rdcstr &, uint32_t eventId, const SDChunk *, - const DrawcallDescription *draw, const rdcstr &) { - return draw->eventId == eventId && (draw->flags & DrawFlags::Dispatch) && - propGetter(draw) >= value; + const ActionDescription *action, const rdcstr &) { + return action->eventId == eventId && (action->flags & ActionFlags::Dispatch) && + propGetter(action) >= value; }; default: trace.setError(tr("Internal error", "EventFilterModel")); return NULL; } @@ -2491,33 +2495,33 @@ Otherwise the event is included if it's a dispatch AND if the condition is true. case 0: return [this, nanoValue](ICaptureContext *, const rdcstr &, const rdcstr &, uint32_t eventId, - const SDChunk *, const DrawcallDescription *draw, const rdcstr &) { + const SDChunk *, const ActionDescription *action, const rdcstr &) { double dur = m_Model->GetSecondsDurationForEID(eventId); - return draw->eventId == eventId && (draw->flags & DrawFlags::Dispatch) && + return action->eventId == eventId && (action->flags & ActionFlags::Dispatch) && dur >= 0.0 && int64_t(dur * 1000000000.0) < nanoValue; }; case 1: return [this, nanoValue](ICaptureContext *, const rdcstr &, const rdcstr &, uint32_t eventId, - const SDChunk *, const DrawcallDescription *draw, const rdcstr &) { + const SDChunk *, const ActionDescription *action, const rdcstr &) { double dur = m_Model->GetSecondsDurationForEID(eventId); - return draw->eventId == eventId && (draw->flags & DrawFlags::Dispatch) && + return action->eventId == eventId && (action->flags & ActionFlags::Dispatch) && dur >= 0.0 && int64_t(dur * 1000000000.0) > nanoValue; }; case 2: return [this, nanoValue](ICaptureContext *, const rdcstr &, const rdcstr &, uint32_t eventId, - const SDChunk *, const DrawcallDescription *draw, const rdcstr &) { + const SDChunk *, const ActionDescription *action, const rdcstr &) { double dur = m_Model->GetSecondsDurationForEID(eventId); - return draw->eventId == eventId && (draw->flags & DrawFlags::Dispatch) && + return action->eventId == eventId && (action->flags & ActionFlags::Dispatch) && dur >= 0.0 && int64_t(dur * 1000000000.0) <= nanoValue; }; case 3: return [this, nanoValue](ICaptureContext *, const rdcstr &, const rdcstr &, uint32_t eventId, - const SDChunk *, const DrawcallDescription *draw, const rdcstr &) { + const SDChunk *, const ActionDescription *action, const rdcstr &) { double dur = m_Model->GetSecondsDurationForEID(eventId); - return draw->eventId == eventId && (draw->flags & DrawFlags::Dispatch) && + return action->eventId == eventId && (action->flags & ActionFlags::Dispatch) && dur >= 0.0 && int64_t(dur * 1000000000.0) >= nanoValue; }; default: trace.setError(tr("Internal error", "EventFilterModel")); return NULL; @@ -2557,13 +2561,13 @@ nesting level. QString markerName = parameters.trimmed(); return [markerName](ICaptureContext *, const rdcstr &, const rdcstr &, uint32_t eventId, - const SDChunk *, const DrawcallDescription *draw, const rdcstr &) { - while(draw->parent) + const SDChunk *, const ActionDescription *action, const rdcstr &) { + while(action->parent) { - if(QString(draw->parent->name).contains(markerName, Qt::CaseInsensitive)) + if(QString(action->parent->name).contains(markerName, Qt::CaseInsensitive)) return true; - draw = draw->parent; + action = action->parent; } return false; @@ -2605,9 +2609,9 @@ nesting level. } return [n, p, innerFilter](ICaptureContext *ctx, const rdcstr &, const rdcstr &, uint32_t eid, - const SDChunk *chunk, const DrawcallDescription *draw, + const SDChunk *chunk, const ActionDescription *action, const rdcstr &name) { - return innerFilter(ctx, n, p, eid, chunk, draw, name); + return innerFilter(ctx, n, p, eid, chunk, action, name); }; } @@ -2886,8 +2890,8 @@ ParseTrace EventFilterModel::ParseExpressionToFilters(QString expr, rdcarrayevents->header()->setSectionResizeMode(COL_NAME, QHeaderView::Interactive); ui->events->header()->setSectionResizeMode(COL_EID, QHeaderView::Interactive); - ui->events->header()->setSectionResizeMode(COL_DRAW, QHeaderView::Interactive); + ui->events->header()->setSectionResizeMode(COL_ACTION, QHeaderView::Interactive); ui->events->header()->setSectionResizeMode(COL_DURATION, QHeaderView::Interactive); ui->events->header()->setMinimumSectionSize(40); @@ -3316,11 +3320,11 @@ EventBrowser::EventBrowser(ICaptureContext &ctx, QWidget *parent) // set up default section layout. This will be overridden in restoreState() ui->events->header()->resizeSection(COL_EID, 80); - ui->events->header()->resizeSection(COL_DRAW, 60); + ui->events->header()->resizeSection(COL_ACTION, 60); ui->events->header()->resizeSection(COL_NAME, 200); ui->events->header()->resizeSection(COL_DURATION, 80); - ui->events->header()->hideSection(COL_DRAW); + ui->events->header()->hideSection(COL_ACTION); ui->events->header()->hideSection(COL_DURATION); ui->events->header()->moveSection(COL_NAME, 2); @@ -3530,9 +3534,9 @@ void EventBrowser::OnCaptureLoaded() m_Breadcrumbs->ForceRefresh(); ui->find->setEnabled(true); - ui->timeDraws->setEnabled(true); + ui->timeActions->setEnabled(true); ui->bookmark->setEnabled(true); - ui->exportDraws->setEnabled(true); + ui->exportActions->setEnabled(true); ui->stepPrev->setEnabled(true); ui->stepNext->setEnabled(true); } @@ -3553,9 +3557,9 @@ void EventBrowser::OnCaptureClosed() setPersistData(p); ui->find->setEnabled(false); - ui->timeDraws->setEnabled(false); + ui->timeActions->setEnabled(false); ui->bookmark->setEnabled(false); - ui->exportDraws->setEnabled(false); + ui->exportActions->setEnabled(false); ui->stepPrev->setEnabled(false); ui->stepNext->setEnabled(false); } @@ -3593,7 +3597,7 @@ void EventBrowser::on_bookmark_clicked() } } -void EventBrowser::on_timeDraws_clicked() +void EventBrowser::on_timeActions_clicked() { ANALYTIC_SET(UIFeatures.DrawcallTimes, true); @@ -3622,20 +3626,20 @@ void EventBrowser::events_currentChanged(const QModelIndex ¤t, const QMode m_Model->RefreshCache(); m_Breadcrumbs->OnEventChanged(effectiveEID); - const DrawcallDescription *draw = m_Ctx.GetDrawcall(selectedEID); + const ActionDescription *action = m_Ctx.GetAction(selectedEID); - if(draw && draw->IsFakeMarker()) - draw = &draw->children.back(); + if(action && action->IsFakeMarker()) + action = &action->children.back(); - ui->stepPrev->setEnabled(draw && draw->previous); - ui->stepNext->setEnabled(draw && draw->next); + ui->stepPrev->setEnabled(action && action->previous); + ui->stepNext->setEnabled(action && action->next); - // special case for the first draw in the frame + // special case for the first action in the frame if(selectedEID == 0) ui->stepNext->setEnabled(true); - // special case for the first 'virtual' draw at EID 0 - if(m_Ctx.GetFirstDrawcall() && selectedEID == m_Ctx.GetFirstDrawcall()->eventId) + // special case for the first 'virtual' action at EID 0 + if(m_Ctx.GetFirstAction() && selectedEID == m_Ctx.GetFirstAction()->eventId) ui->stepPrev->setEnabled(true); highlightBookmarks(); @@ -3709,14 +3713,14 @@ void EventBrowser::CreateFilterDialog() QObject::connect(m_FilterSettings.ShowAll, &QCheckBox::toggled, [this](bool on) { m_Model->SetShowAllParameters(on); }); - m_FilterSettings.UseCustom->setText(tr("Show custom draw names")); + m_FilterSettings.UseCustom->setText(tr("Show custom action names")); m_FilterSettings.UseCustom->setToolTip( - tr("Show custom draw names for e.g. indirect draws where the values are not as directly " - "useful.")); + tr("Show custom action names for e.g. indirect draws where the explicit parameters are not " + "as directly useful.")); m_FilterSettings.UseCustom->setCheckable(true); QObject::connect(m_FilterSettings.UseCustom, &QCheckBox::toggled, - [this](bool on) { m_Model->SetUseCustomDrawNames(on); }); + [this](bool on) { m_Model->SetUseCustomActionNames(on); }); settingsLayout->addWidget(m_FilterSettings.ShowParams); settingsLayout->addWidget(m_FilterSettings.ShowAll); @@ -4069,11 +4073,11 @@ Finally you can use filter functions for more advanced matching than just strings. These are documented on the left here, but for example

    -
      $draw(numIndices > 1000) Indexed
    +
      $action(numIndices > 1000) Indexed

    -will include any drawcall that matches "Indexed" as a plain string match, OR -renders more than 1000 indices. +will include any action that matches "Indexed" as a plain string match, OR +is an action which renders more than 1000 indices.

    )EOD").trimmed()); } @@ -4291,7 +4295,7 @@ void EventBrowser::filterSettings_clicked() // update the global parameter checkboxes m_FilterSettings.ShowParams->setChecked(m_Model->ShowParameterNames()); m_FilterSettings.ShowAll->setChecked(m_Model->ShowAllParameters()); - m_FilterSettings.UseCustom->setChecked(m_Model->UseCustomDrawNames()); + m_FilterSettings.UseCustom->setChecked(m_Model->UseCustomActionNames()); // fill out the list of filter functions with the current list m_FilterSettings.FuncList->clear(); @@ -4731,24 +4735,24 @@ void EventBrowser::on_stepNext_clicked() if(!m_Ctx.IsCaptureLoaded() || !ui->stepNext->isEnabled()) return; - const DrawcallDescription *draw = m_Ctx.CurDrawcall(); + const ActionDescription *action = m_Ctx.CurAction(); - if(draw) - draw = draw->next; + if(action) + action = action->next; - // special case for the first 'virtual' draw at EID 0 + // special case for the first 'virtual' action at EID 0 if(m_Ctx.CurEvent() == 0) - draw = m_Ctx.GetFirstDrawcall(); + action = m_Ctx.GetFirstAction(); - while(draw) + while(action) { // try to select the next event. If successful, stop - if(SelectEvent(draw->eventId)) + if(SelectEvent(action->eventId)) return; - // if it failed, possibly the next draw is filtered out. Step along the list until we find one + // if it failed, possibly the next action is filtered out. Step along the list until we find one // which isn't - draw = draw->next; + action = action->next; } } @@ -4757,27 +4761,27 @@ void EventBrowser::on_stepPrev_clicked() if(!m_Ctx.IsCaptureLoaded() || !ui->stepPrev->isEnabled()) return; - const DrawcallDescription *draw = m_Ctx.CurDrawcall(); + const ActionDescription *action = m_Ctx.CurAction(); - if(draw) - draw = draw->previous; + if(action) + action = action->previous; - while(draw) + while(action) { // try to select the previous event. If successful, stop - if(SelectEvent(draw->eventId)) + if(SelectEvent(action->eventId)) return; - // if it failed, possibly the previous draw is filtered out. Step along the list until we find + // if it failed, possibly the previous action is filtered out. Step along the list until we find // one which isn't - draw = draw->previous; + action = action->previous; } - // special case for the first 'virtual' draw at EID 0 + // special case for the first 'virtual' action at EID 0 SelectEvent(0); } -void EventBrowser::on_exportDraws_clicked() +void EventBrowser::on_exportActions_clicked() { QString filename = RDDialog::getSaveFileName(this, tr("Save Event List"), QString(), tr("Text files (*.txt)")); @@ -4806,7 +4810,7 @@ void EventBrowser::on_exportDraws_clicked() for(int i = 1, rowCount = ui->events->model()->rowCount(root); i < rowCount; i++) GetMaxNameLength(maxNameLength, 0, false, ui->events->model()->index(i, COL_NAME, root)); - QString line = QFormatStr(" EID | %1 | Draw #").arg(lit("Event"), -maxNameLength); + QString line = QFormatStr(" EID | %1 | Action #").arg(lit("Event"), -maxNameLength); if(m_Model->HasTimes()) { @@ -4830,8 +4834,8 @@ void EventBrowser::on_exportDraws_clicked() stream << line << "\n"; for(int i = 1, rowCount = ui->events->model()->rowCount(root); i < rowCount; i++) - ExportDrawcall(stream, maxNameLength, 0, false, - ui->events->model()->index(i, COL_NAME, root)); + ExportAction(stream, maxNameLength, 0, false, + ui->events->model()->index(i, COL_NAME, root)); } else { @@ -4884,18 +4888,18 @@ void EventBrowser::GetMaxNameLength(int &maxNameLength, int indent, bool firstch } } -void EventBrowser::ExportDrawcall(QTextStream &writer, int maxNameLength, int indent, - bool firstchild, const QModelIndex &idx) +void EventBrowser::ExportAction(QTextStream &writer, int maxNameLength, int indent, bool firstchild, + const QModelIndex &idx) { QString nameString = GetExportString(indent, firstchild, idx); QModelIndex eidIdx = idx.model()->sibling(idx.row(), COL_EID, idx); - QModelIndex drawIdx = idx.model()->sibling(idx.row(), COL_DRAW, idx); + QModelIndex actionIdx = idx.model()->sibling(idx.row(), COL_ACTION, idx); QString line = QFormatStr("%1 | %2 | %3") .arg(eidIdx.data(Qt::DisplayRole).toString(), -5) .arg(nameString, -maxNameLength) - .arg(drawIdx.data(Qt::DisplayRole).toString(), -6); + .arg(actionIdx.data(Qt::DisplayRole).toString(), -6); if(m_Model->HasTimes()) { @@ -4917,7 +4921,7 @@ void EventBrowser::ExportDrawcall(QTextStream &writer, int maxNameLength, int in for(int i = 0, rowCount = idx.model()->rowCount(idx); i < rowCount; i++) { - ExportDrawcall(writer, maxNameLength, indent + 1, firstchild, idx.child(i, COL_NAME)); + ExportAction(writer, maxNameLength, indent + 1, firstchild, idx.child(i, COL_NAME)); firstchild = false; } } @@ -5011,7 +5015,7 @@ void EventBrowser::events_keyPress(QKeyEvent *event) } else if(event->key() == Qt::Key_T) { - on_timeDraws_clicked(); + on_timeActions_clicked(); event->accept(); } } @@ -5211,11 +5215,11 @@ void EventBrowser::UpdateDurationColumn() APIEvent EventBrowser::GetAPIEventForEID(uint32_t eid) { - const DrawcallDescription *draw = GetDrawcallForEID(eid); + const ActionDescription *action = GetActionForEID(eid); - if(draw) + if(action) { - for(const APIEvent &ev : draw->events) + for(const APIEvent &ev : action->events) { if(ev.eventId == eid) return ev; @@ -5225,9 +5229,9 @@ APIEvent EventBrowser::GetAPIEventForEID(uint32_t eid) return APIEvent(); } -const DrawcallDescription *EventBrowser::GetDrawcallForEID(uint32_t eid) +const ActionDescription *EventBrowser::GetActionForEID(uint32_t eid) { - return m_Model->GetDrawcallForEID(eid); + return m_Model->GetActionForEID(eid); } bool EventBrowser::IsAPIEventVisible(uint32_t eid) @@ -5268,9 +5272,9 @@ void EventBrowser::SetShowAllParameters(bool show) m_Model->SetShowAllParameters(show); } -void EventBrowser::SetUseCustomDrawNames(bool use) +void EventBrowser::SetUseCustomActionNames(bool use) { - m_Model->SetUseCustomDrawNames(use); + m_Model->SetUseCustomActionNames(use); } void EventBrowser::SetEmptyRegionsVisible(bool show) diff --git a/qrenderdoc/Windows/EventBrowser.h b/qrenderdoc/Windows/EventBrowser.h index 8436dfe25..935bdeb0d 100644 --- a/qrenderdoc/Windows/EventBrowser.h +++ b/qrenderdoc/Windows/EventBrowser.h @@ -123,7 +123,7 @@ public: QWidget *Widget() override { return this; } void UpdateDurationColumn() override; APIEvent GetAPIEventForEID(uint32_t eid) override; - const DrawcallDescription *GetDrawcallForEID(uint32_t eid) override; + const ActionDescription *GetActionForEID(uint32_t eid) override; bool IsAPIEventVisible(uint32_t eid) override; bool RegisterEventFilterFunction(const rdcstr &name, const rdcstr &description, EventFilterCallback filter, FilterParseCallback parser, @@ -132,7 +132,7 @@ public: void SetCurrentFilterText(const rdcstr &text) override; rdcstr GetCurrentFilterText() override; - void SetUseCustomDrawNames(bool use) override; + void SetUseCustomActionNames(bool use) override; void SetShowParameterNames(bool show) override; void SetShowAllParameters(bool show) override; void SetEmptyRegionsVisible(bool show) override; @@ -149,7 +149,7 @@ public: private slots: // automatic slots void on_find_toggled(bool checked); - void on_timeDraws_clicked(); + void on_timeActions_clicked(); void on_bookmark_clicked(); void on_HideFind(); void on_findEvent_returnPressed(); @@ -164,7 +164,7 @@ private slots: void on_findPrev_clicked(); void on_stepNext_clicked(); void on_stepPrev_clicked(); - void on_exportDraws_clicked(); + void on_exportActions_clicked(); void on_colSelect_clicked(); // manual slots @@ -204,8 +204,8 @@ private: QString GetExportString(int indent, bool firstchild, const QModelIndex &idx); void GetMaxNameLength(int &maxNameLength, int indent, bool firstchild, const QModelIndex &idx); - void ExportDrawcall(QTextStream &writer, int maxNameLength, int indent, bool firstchild, - const QModelIndex &idx); + void ExportAction(QTextStream &writer, int maxNameLength, int indent, bool firstchild, + const QModelIndex &idx); QPalette m_redPalette; diff --git a/qrenderdoc/Windows/EventBrowser.ui b/qrenderdoc/Windows/EventBrowser.ui index a1c78b358..321f65eb1 100644 --- a/qrenderdoc/Windows/EventBrowser.ui +++ b/qrenderdoc/Windows/EventBrowser.ui @@ -66,7 +66,7 @@ - Go to Previous Drawcall + Go to Previous Action @@ -80,7 +80,7 @@ - Go to Next Drawcall + Go to Next Action @@ -119,9 +119,9 @@ - + - Time durations for the drawcalls + Time durations for the actions @@ -167,9 +167,9 @@ - + - Export the list of drawcalls to disk + Export the list of events to disk diff --git a/qrenderdoc/Windows/MainWindow.cpp b/qrenderdoc/Windows/MainWindow.cpp index 595193e25..674ca1065 100644 --- a/qrenderdoc/Windows/MainWindow.cpp +++ b/qrenderdoc/Windows/MainWindow.cpp @@ -2589,11 +2589,11 @@ void MainWindow::on_action_Start_Replay_Loop_triggered() const TextureDescription *displayTex = NULL; - const DrawcallDescription *lastDraw = m_Ctx.GetLastDrawcall(); + const ActionDescription *lastAction = m_Ctx.GetLastAction(); - displayTex = m_Ctx.GetTexture(lastDraw->copyDestination); + displayTex = m_Ctx.GetTexture(lastAction->copyDestination); if(!displayTex) - displayTex = m_Ctx.GetTexture(lastDraw->outputs[0]); + displayTex = m_Ctx.GetTexture(lastAction->outputs[0]); if(!displayTex) { diff --git a/qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.cpp b/qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.cpp index 0d4052240..2860314ea 100644 --- a/qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.cpp +++ b/qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.cpp @@ -1254,7 +1254,7 @@ void D3D11PipelineStateViewer::setState() } const D3D11Pipe::State &state = *m_Ctx.CurD3D11PipelineState(); - const DrawcallDescription *draw = m_Ctx.CurDrawcall(); + const ActionDescription *action = m_Ctx.CurAction(); const QPixmap &tick = Pixmaps::tick(this); const QPixmap &cross = Pixmaps::cross(this); @@ -1444,7 +1444,7 @@ void D3D11PipelineStateViewer::setState() m_Common.setTopologyDiagram(ui->topologyDiagram, state.inputAssembly.topology); - bool ibufferUsed = draw && (draw->flags & DrawFlags::Indexed); + bool ibufferUsed = action && (action->flags & ActionFlags::Indexed); m_VBNodes.clear(); m_EmptyNodes.clear(); @@ -1484,7 +1484,7 @@ void D3D11PipelineStateViewer::setState() node->setTag(QVariant::fromValue(D3D11VBIBTag( state.inputAssembly.indexBuffer.resourceId, state.inputAssembly.indexBuffer.byteOffset + - (draw ? draw->indexOffset * state.inputAssembly.indexBuffer.byteStride : 0), + (action ? action->indexOffset * state.inputAssembly.indexBuffer.byteStride : 0), iformat))); if(!ibufferUsed) @@ -1521,7 +1521,7 @@ void D3D11PipelineStateViewer::setState() node->setTag(QVariant::fromValue(D3D11VBIBTag( state.inputAssembly.indexBuffer.resourceId, state.inputAssembly.indexBuffer.byteOffset + - (draw ? draw->indexOffset * state.inputAssembly.indexBuffer.byteStride : 0), + (action ? action->indexOffset * state.inputAssembly.indexBuffer.byteStride : 0), iformat))); setEmptyRow(node); @@ -1940,8 +1940,8 @@ void D3D11PipelineStateViewer::setState() // set up thread debugging inputs if(m_Ctx.APIProps().shaderDebugging && state.computeShader.reflection && - state.computeShader.reflection->debugInfo.debuggable && draw && - (draw->flags & DrawFlags::Dispatch)) + state.computeShader.reflection->debugInfo.debuggable && action && + (action->flags & ActionFlags::Dispatch)) { ui->groupX->setEnabled(true); ui->groupY->setEnabled(true); @@ -1954,11 +1954,11 @@ void D3D11PipelineStateViewer::setState() ui->debugThread->setEnabled(true); // set maximums for CS debugging - ui->groupX->setMaximum((int)draw->dispatchDimension[0] - 1); - ui->groupY->setMaximum((int)draw->dispatchDimension[1] - 1); - ui->groupZ->setMaximum((int)draw->dispatchDimension[2] - 1); + ui->groupX->setMaximum((int)action->dispatchDimension[0] - 1); + ui->groupY->setMaximum((int)action->dispatchDimension[1] - 1); + ui->groupZ->setMaximum((int)action->dispatchDimension[2] - 1); - if(draw->dispatchThreadsDimension[0] == 0) + if(action->dispatchThreadsDimension[0] == 0) { ui->threadX->setMaximum((int)state.computeShader.reflection->dispatchThreadsDimension[0] - 1); ui->threadY->setMaximum((int)state.computeShader.reflection->dispatchThreadsDimension[1] - 1); @@ -1966,9 +1966,9 @@ void D3D11PipelineStateViewer::setState() } else { - ui->threadX->setMaximum((int)draw->dispatchThreadsDimension[0] - 1); - ui->threadY->setMaximum((int)draw->dispatchThreadsDimension[1] - 1); - ui->threadZ->setMaximum((int)draw->dispatchThreadsDimension[2] - 1); + ui->threadX->setMaximum((int)action->dispatchThreadsDimension[0] - 1); + ui->threadY->setMaximum((int)action->dispatchThreadsDimension[1] - 1); + ui->threadZ->setMaximum((int)action->dispatchThreadsDimension[2] - 1); } ui->debugThread->setToolTip(QString()); @@ -1987,7 +1987,7 @@ void D3D11PipelineStateViewer::setState() if(!m_Ctx.APIProps().shaderDebugging) ui->debugThread->setToolTip(tr("This API does not support shader debugging")); - else if(!draw || !(draw->flags & DrawFlags::Dispatch)) + else if(!action || !(action->flags & ActionFlags::Dispatch)) ui->debugThread->setToolTip(tr("No dispatch selected")); else if(!state.computeShader.reflection) ui->debugThread->setToolTip(tr("No compute shader bound")); @@ -1997,11 +1997,11 @@ void D3D11PipelineStateViewer::setState() } // highlight the appropriate stages in the flowchart - if(draw == NULL) + if(action == NULL) { ui->pipeFlow->setStagesEnabled({true, true, true, true, true, true, true, true, true}); } - else if(draw->flags & DrawFlags::Dispatch) + else if(action->flags & ActionFlags::Dispatch) { ui->pipeFlow->setStagesEnabled({false, false, false, false, false, false, false, false, true}); } @@ -2544,7 +2544,7 @@ QVariantList D3D11PipelineStateViewer::exportViewHTML(const D3D11Pipe::View &vie void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe::InputAssembly &ia) { - const DrawcallDescription *draw = m_Ctx.CurDrawcall(); + const ActionDescription *action = m_Ctx.CurAction(); { xml.writeStartElement(lit("h3")); @@ -3205,9 +3205,9 @@ void D3D11PipelineStateViewer::on_debugThread_clicked() if(!m_Ctx.IsCaptureLoaded()) return; - const DrawcallDescription *draw = m_Ctx.CurDrawcall(); + const ActionDescription *action = m_Ctx.CurAction(); - if(!draw) + if(!action) return; ShaderReflection *shaderDetails = m_Ctx.CurD3D11PipelineState()->computeShader.reflection; @@ -3220,11 +3220,11 @@ void D3D11PipelineStateViewer::on_debugThread_clicked() uint32_t groupdim[3] = {}; for(int i = 0; i < 3; i++) - groupdim[i] = draw->dispatchDimension[i]; + groupdim[i] = action->dispatchDimension[i]; uint32_t threadsdim[3] = {}; for(int i = 0; i < 3; i++) - threadsdim[i] = draw->dispatchThreadsDimension[i]; + threadsdim[i] = action->dispatchThreadsDimension[i]; if(threadsdim[0] == 0) { diff --git a/qrenderdoc/Windows/PipelineState/D3D12PipelineStateViewer.cpp b/qrenderdoc/Windows/PipelineState/D3D12PipelineStateViewer.cpp index bc060f2b7..a3f765826 100644 --- a/qrenderdoc/Windows/PipelineState/D3D12PipelineStateViewer.cpp +++ b/qrenderdoc/Windows/PipelineState/D3D12PipelineStateViewer.cpp @@ -1444,7 +1444,7 @@ void D3D12PipelineStateViewer::setState() } const D3D12Pipe::State &state = *m_Ctx.CurD3D12PipelineState(); - const DrawcallDescription *draw = m_Ctx.CurDrawcall(); + const ActionDescription *action = m_Ctx.CurAction(); const QPixmap &tick = Pixmaps::tick(this); const QPixmap &cross = Pixmaps::cross(this); @@ -1531,7 +1531,7 @@ void D3D12PipelineStateViewer::setState() m_Common.setTopologyDiagram(ui->topologyDiagram, state.inputAssembly.topology); - bool ibufferUsed = draw && (draw->flags & DrawFlags::Indexed); + bool ibufferUsed = action && (action->flags & ActionFlags::Indexed); m_VBNodes.clear(); m_EmptyNodes.clear(); @@ -1566,7 +1566,7 @@ void D3D12PipelineStateViewer::setState() lit(" indices[%1]").arg(RENDERDOC_NumVerticesPerPrimitive(state.inputAssembly.topology)); uint32_t drawOffset = - (draw ? draw->indexOffset * state.inputAssembly.indexBuffer.byteStride : 0); + (action ? action->indexOffset * state.inputAssembly.indexBuffer.byteStride : 0); node->setTag(QVariant::fromValue( D3D12VBIBTag(state.inputAssembly.indexBuffer.resourceId, @@ -1617,7 +1617,7 @@ void D3D12PipelineStateViewer::setState() lit(" indices[%1]").arg(RENDERDOC_NumVerticesPerPrimitive(state.inputAssembly.topology)); uint32_t drawOffset = - (draw ? draw->indexOffset * state.inputAssembly.indexBuffer.byteStride : 0); + (action ? action->indexOffset * state.inputAssembly.indexBuffer.byteStride : 0); node->setTag(QVariant::fromValue( D3D12VBIBTag(state.inputAssembly.indexBuffer.resourceId, @@ -2003,8 +2003,8 @@ void D3D12PipelineStateViewer::setState() // set up thread debugging inputs if(m_Ctx.APIProps().shaderDebugging && state.computeShader.reflection && - state.computeShader.reflection->debugInfo.debuggable && draw && - (draw->flags & DrawFlags::Dispatch)) + state.computeShader.reflection->debugInfo.debuggable && action && + (action->flags & ActionFlags::Dispatch)) { ui->groupX->setEnabled(true); ui->groupY->setEnabled(true); @@ -2017,11 +2017,11 @@ void D3D12PipelineStateViewer::setState() ui->debugThread->setEnabled(true); // set maximums for CS debugging - ui->groupX->setMaximum((int)draw->dispatchDimension[0] - 1); - ui->groupY->setMaximum((int)draw->dispatchDimension[1] - 1); - ui->groupZ->setMaximum((int)draw->dispatchDimension[2] - 1); + ui->groupX->setMaximum((int)action->dispatchDimension[0] - 1); + ui->groupY->setMaximum((int)action->dispatchDimension[1] - 1); + ui->groupZ->setMaximum((int)action->dispatchDimension[2] - 1); - if(draw->dispatchThreadsDimension[0] == 0) + if(action->dispatchThreadsDimension[0] == 0) { ui->threadX->setMaximum((int)state.computeShader.reflection->dispatchThreadsDimension[0] - 1); ui->threadY->setMaximum((int)state.computeShader.reflection->dispatchThreadsDimension[1] - 1); @@ -2029,9 +2029,9 @@ void D3D12PipelineStateViewer::setState() } else { - ui->threadX->setMaximum((int)draw->dispatchThreadsDimension[0] - 1); - ui->threadY->setMaximum((int)draw->dispatchThreadsDimension[1] - 1); - ui->threadZ->setMaximum((int)draw->dispatchThreadsDimension[2] - 1); + ui->threadX->setMaximum((int)action->dispatchThreadsDimension[0] - 1); + ui->threadY->setMaximum((int)action->dispatchThreadsDimension[1] - 1); + ui->threadZ->setMaximum((int)action->dispatchThreadsDimension[2] - 1); } ui->debugThread->setToolTip(QString()); @@ -2050,7 +2050,7 @@ void D3D12PipelineStateViewer::setState() if(!m_Ctx.APIProps().shaderDebugging) ui->debugThread->setToolTip(tr("This API does not support shader debugging")); - else if(!draw || !(draw->flags & DrawFlags::Dispatch)) + else if(!action || !(action->flags & ActionFlags::Dispatch)) ui->debugThread->setToolTip(tr("No dispatch selected")); else if(!state.computeShader.reflection) ui->debugThread->setToolTip(tr("No compute shader bound")); @@ -2060,11 +2060,11 @@ void D3D12PipelineStateViewer::setState() } // highlight the appropriate stages in the flowchart - if(draw == NULL) + if(action == NULL) { ui->pipeFlow->setStagesEnabled({true, true, true, true, true, true, true, true, true}); } - else if(draw->flags & DrawFlags::Dispatch) + else if(action->flags & ActionFlags::Dispatch) { ui->pipeFlow->setStagesEnabled({false, false, false, false, false, false, false, false, true}); } @@ -2552,7 +2552,7 @@ QVariantList D3D12PipelineStateViewer::exportViewHTML(const D3D12Pipe::View &vie void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe::InputAssembly &ia) { - const DrawcallDescription *draw = m_Ctx.CurDrawcall(); + const ActionDescription *action = m_Ctx.CurAction(); { xml.writeStartElement(lit("h3")); @@ -3370,9 +3370,9 @@ void D3D12PipelineStateViewer::on_debugThread_clicked() if(!m_Ctx.IsCaptureLoaded()) return; - const DrawcallDescription *draw = m_Ctx.CurDrawcall(); + const ActionDescription *action = m_Ctx.CurAction(); - if(!draw) + if(!action) return; ShaderReflection *shaderDetails = m_Ctx.CurD3D12PipelineState()->computeShader.reflection; @@ -3385,11 +3385,11 @@ void D3D12PipelineStateViewer::on_debugThread_clicked() uint32_t groupdim[3] = {}; for(int i = 0; i < 3; i++) - groupdim[i] = draw->dispatchDimension[i]; + groupdim[i] = action->dispatchDimension[i]; uint32_t threadsdim[3] = {}; for(int i = 0; i < 3; i++) - threadsdim[i] = draw->dispatchThreadsDimension[i]; + threadsdim[i] = action->dispatchThreadsDimension[i]; if(threadsdim[0] == 0) { diff --git a/qrenderdoc/Windows/PipelineState/GLPipelineStateViewer.cpp b/qrenderdoc/Windows/PipelineState/GLPipelineStateViewer.cpp index 0e0aa2a49..571c7f3f9 100644 --- a/qrenderdoc/Windows/PipelineState/GLPipelineStateViewer.cpp +++ b/qrenderdoc/Windows/PipelineState/GLPipelineStateViewer.cpp @@ -1321,7 +1321,7 @@ void GLPipelineStateViewer::setState() } const GLPipe::State &state = *m_Ctx.CurGLPipelineState(); - const DrawcallDescription *draw = m_Ctx.CurDrawcall(); + const ActionDescription *action = m_Ctx.CurAction(); bool showUnused = ui->showUnused->isChecked(); bool showEmpty = ui->showEmpty->isChecked(); @@ -1409,7 +1409,7 @@ void GLPipelineStateViewer::setState() m_Common.setTopologyDiagram(ui->topologyDiagram, state.vertexInput.topology); - bool ibufferUsed = draw && (draw->flags & DrawFlags::Indexed); + bool ibufferUsed = action && (action->flags & ActionFlags::Indexed); if(ibufferUsed) { @@ -1453,7 +1453,7 @@ void GLPipelineStateViewer::setState() (qulonglong)length, QString()}); QString iformat; - if(draw) + if(action) { if(state.vertexInput.indexByteStride == 1) iformat = lit("ubyte"); @@ -1466,9 +1466,9 @@ void GLPipelineStateViewer::setState() lit(" indices[%1]").arg(RENDERDOC_NumVerticesPerPrimitive(state.vertexInput.topology)); } - node->setTag(QVariant::fromValue( - GLVBIBTag(state.vertexInput.indexBuffer, - draw ? draw->indexOffset * state.vertexInput.indexByteStride : 0, iformat))); + node->setTag(QVariant::fromValue(GLVBIBTag( + state.vertexInput.indexBuffer, + action ? action->indexOffset * state.vertexInput.indexByteStride : 0, iformat))); if(!ibufferUsed) setInactiveRow(node); @@ -1490,7 +1490,7 @@ void GLPipelineStateViewer::setState() {tr("Element"), tr("No Buffer Set"), lit("-"), lit("-"), lit("-"), lit("-"), QString()}); QString iformat; - if(draw) + if(action) { if(state.vertexInput.indexByteStride == 1) iformat = lit("ubyte"); @@ -1503,9 +1503,9 @@ void GLPipelineStateViewer::setState() lit(" indices[%1]").arg(RENDERDOC_NumVerticesPerPrimitive(state.vertexInput.topology)); } - node->setTag(QVariant::fromValue( - GLVBIBTag(state.vertexInput.indexBuffer, - draw ? draw->indexOffset * state.vertexInput.indexByteStride : 0, iformat))); + node->setTag(QVariant::fromValue(GLVBIBTag( + state.vertexInput.indexBuffer, + action ? action->indexOffset * state.vertexInput.indexByteStride : 0, iformat))); setEmptyRow(node); m_EmptyNodes.push_back(node); @@ -2230,11 +2230,11 @@ void GLPipelineStateViewer::setState() ui->stencils->endUpdate(); // highlight the appropriate stages in the flowchart - if(draw == NULL) + if(action == NULL) { ui->pipeFlow->setStagesEnabled({true, true, true, true, true, true, true, true, true}); } - else if(draw->flags & DrawFlags::Dispatch) + else if(action->flags & ActionFlags::Dispatch) { ui->pipeFlow->setStagesEnabled({false, false, false, false, false, false, false, false, true}); } @@ -2519,7 +2519,7 @@ void GLPipelineStateViewer::shaderSave_clicked() void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::VertexInput &vtx) { - const DrawcallDescription *draw = m_Ctx.CurDrawcall(); + const ActionDescription *action = m_Ctx.CurAction(); const GLPipe::State &pipe = *m_Ctx.CurGLPipelineState(); { @@ -2599,7 +2599,7 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Vert } QString ifmt = lit("UNKNOWN"); - if(draw) + if(action) { if(vtx.indexByteStride == 1) ifmt = lit("UNSIGNED_BYTE"); @@ -2617,7 +2617,7 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Vert xml.writeEndElement(); m_Common.exportHTMLTable(xml, {tr("Primitive Topology")}, - {ToQStr(draw ? vtx.topology : Topology::Unknown)}); + {ToQStr(action ? vtx.topology : Topology::Unknown)}); { xml.writeStartElement(tr("h3")); diff --git a/qrenderdoc/Windows/PipelineState/PipelineStateViewer.cpp b/qrenderdoc/Windows/PipelineState/PipelineStateViewer.cpp index dfdf56b0b..f45c61965 100644 --- a/qrenderdoc/Windows/PipelineState/PipelineStateViewer.cpp +++ b/qrenderdoc/Windows/PipelineState/PipelineStateViewer.cpp @@ -489,23 +489,23 @@ div.stage table tr td { border-right: 1px solid #AAAAAA; background-color: #EEEE QString context = frameNumber == ~0U ? tr("Capture") : tr("Frame %1").arg(frameNumber); - const DrawcallDescription *draw = m_Ctx.CurDrawcall(); + const ActionDescription *action = m_Ctx.CurAction(); - QList drawstack; - const DrawcallDescription *parent = draw ? draw->parent : NULL; + QList actionstack; + const ActionDescription *parent = action ? action->parent : NULL; while(parent) { - drawstack.push_front(parent); + actionstack.push_front(parent); parent = parent->parent; } - for(const DrawcallDescription *d : drawstack) + for(const ActionDescription *d : actionstack) { context += QFormatStr(" > %1").arg(d->name); } - if(draw) - context += QFormatStr(" => %1").arg(draw->name); + if(action) + context += QFormatStr(" => %1").arg(action->name); else context += tr(" => Capture Start"); diff --git a/qrenderdoc/Windows/PipelineState/VulkanPipelineStateViewer.cpp b/qrenderdoc/Windows/PipelineState/VulkanPipelineStateViewer.cpp index 4c2b88360..8e699888c 100644 --- a/qrenderdoc/Windows/PipelineState/VulkanPipelineStateViewer.cpp +++ b/qrenderdoc/Windows/PipelineState/VulkanPipelineStateViewer.cpp @@ -1979,7 +1979,7 @@ void VulkanPipelineStateViewer::setState() m_CombinedImageSamplers.clear(); const VKPipe::State &state = *m_Ctx.CurVulkanPipelineState(); - const DrawcallDescription *draw = m_Ctx.CurDrawcall(); + const ActionDescription *action = m_Ctx.CurAction(); bool showUnused = ui->showUnused->isChecked(); bool showEmpty = ui->showEmpty->isChecked(); @@ -2062,7 +2062,7 @@ void VulkanPipelineStateViewer::setState() ui->viBuffers->beginUpdate(); ui->viBuffers->clear(); - bool ibufferUsed = draw != NULL && (draw->flags & DrawFlags::Indexed); + bool ibufferUsed = action != NULL && (action->flags & ActionFlags::Indexed); if(state.inputAssembly.indexBuffer.resourceId != ResourceId()) { @@ -2098,7 +2098,7 @@ void VulkanPipelineStateViewer::setState() node->setTag(QVariant::fromValue(VulkanVBIBTag( state.inputAssembly.indexBuffer.resourceId, state.inputAssembly.indexBuffer.byteOffset + - (draw ? draw->indexOffset * state.inputAssembly.indexBuffer.byteStride : 0), + (action ? action->indexOffset * state.inputAssembly.indexBuffer.byteStride : 0), iformat))); if(!ibufferUsed) @@ -2135,7 +2135,7 @@ void VulkanPipelineStateViewer::setState() node->setTag(QVariant::fromValue(VulkanVBIBTag( state.inputAssembly.indexBuffer.resourceId, state.inputAssembly.indexBuffer.byteOffset + - (draw ? draw->indexOffset * state.inputAssembly.indexBuffer.byteStride : 0), + (action ? action->indexOffset * state.inputAssembly.indexBuffer.byteStride : 0), iformat))); setEmptyRow(node); @@ -2771,8 +2771,8 @@ void VulkanPipelineStateViewer::setState() // set up thread debugging inputs if(m_Ctx.APIProps().shaderDebugging && state.computeShader.reflection && - state.computeShader.reflection->debugInfo.debuggable && draw && - (draw->flags & DrawFlags::Dispatch)) + state.computeShader.reflection->debugInfo.debuggable && action && + (action->flags & ActionFlags::Dispatch)) { ui->groupX->setEnabled(true); ui->groupY->setEnabled(true); @@ -2785,11 +2785,11 @@ void VulkanPipelineStateViewer::setState() ui->debugThread->setEnabled(true); // set maximums for CS debugging - ui->groupX->setMaximum((int)draw->dispatchDimension[0] - 1); - ui->groupY->setMaximum((int)draw->dispatchDimension[1] - 1); - ui->groupZ->setMaximum((int)draw->dispatchDimension[2] - 1); + ui->groupX->setMaximum((int)action->dispatchDimension[0] - 1); + ui->groupY->setMaximum((int)action->dispatchDimension[1] - 1); + ui->groupZ->setMaximum((int)action->dispatchDimension[2] - 1); - if(draw->dispatchThreadsDimension[0] == 0) + if(action->dispatchThreadsDimension[0] == 0) { ui->threadX->setMaximum((int)state.computeShader.reflection->dispatchThreadsDimension[0] - 1); ui->threadY->setMaximum((int)state.computeShader.reflection->dispatchThreadsDimension[1] - 1); @@ -2797,9 +2797,9 @@ void VulkanPipelineStateViewer::setState() } else { - ui->threadX->setMaximum((int)draw->dispatchThreadsDimension[0] - 1); - ui->threadY->setMaximum((int)draw->dispatchThreadsDimension[1] - 1); - ui->threadZ->setMaximum((int)draw->dispatchThreadsDimension[2] - 1); + ui->threadX->setMaximum((int)action->dispatchThreadsDimension[0] - 1); + ui->threadY->setMaximum((int)action->dispatchThreadsDimension[1] - 1); + ui->threadZ->setMaximum((int)action->dispatchThreadsDimension[2] - 1); } ui->debugThread->setToolTip(QString()); @@ -2818,7 +2818,7 @@ void VulkanPipelineStateViewer::setState() if(!m_Ctx.APIProps().shaderDebugging) ui->debugThread->setToolTip(tr("This API does not support shader debugging")); - else if(!draw || !(draw->flags & DrawFlags::Dispatch)) + else if(!action || !(action->flags & ActionFlags::Dispatch)) ui->debugThread->setToolTip(tr("No dispatch selected")); else if(!state.computeShader.reflection) ui->debugThread->setToolTip(tr("No compute shader bound")); @@ -2828,11 +2828,11 @@ void VulkanPipelineStateViewer::setState() } // highlight the appropriate stages in the flowchart - if(draw == NULL) + if(action == NULL) { ui->pipeFlow->setStagesEnabled({true, true, true, true, true, true, true, true, true}); } - else if(draw->flags & DrawFlags::Dispatch) + else if(action->flags & ActionFlags::Dispatch) { ui->pipeFlow->setStagesEnabled({false, false, false, false, false, false, false, false, true}); } @@ -3259,7 +3259,7 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe::InputAssembly &ia) { - const DrawcallDescription *draw = m_Ctx.CurDrawcall(); + const ActionDescription *action = m_Ctx.CurAction(); { xml.writeStartElement(lit("h3")); @@ -4121,9 +4121,9 @@ void VulkanPipelineStateViewer::on_debugThread_clicked() if(!m_Ctx.IsCaptureLoaded()) return; - const DrawcallDescription *draw = m_Ctx.CurDrawcall(); + const ActionDescription *action = m_Ctx.CurAction(); - if(!draw || !(draw->flags & DrawFlags::Dispatch)) + if(!action || !(action->flags & ActionFlags::Dispatch)) return; ShaderReflection *shaderDetails = m_Ctx.CurVulkanPipelineState()->computeShader.reflection; @@ -4136,11 +4136,11 @@ void VulkanPipelineStateViewer::on_debugThread_clicked() uint32_t groupdim[3] = {}; for(int i = 0; i < 3; i++) - groupdim[i] = draw->dispatchDimension[i]; + groupdim[i] = action->dispatchDimension[i]; uint32_t threadsdim[3] = {}; for(int i = 0; i < 3; i++) - threadsdim[i] = draw->dispatchThreadsDimension[i]; + threadsdim[i] = action->dispatchThreadsDimension[i]; if(threadsdim[0] == 0) { diff --git a/qrenderdoc/Windows/PixelHistoryView.cpp b/qrenderdoc/Windows/PixelHistoryView.cpp index 1a7f3b8f6..b0e8a8ea9 100644 --- a/qrenderdoc/Windows/PixelHistoryView.cpp +++ b/qrenderdoc/Windows/PixelHistoryView.cpp @@ -134,9 +134,9 @@ public: if(isEvent(parent)) { const QList &mods = getMods(parent); - const DrawcallDescription *draw = m_Ctx.GetDrawcall(mods.front().eventId); + const ActionDescription *action = m_Ctx.GetAction(mods.front().eventId); - if(draw && draw->flags & (DrawFlags::Clear | DrawFlags::PassBoundary)) + if(action && action->flags & (ActionFlags::Clear | ActionFlags::PassBoundary)) return 0; return mods.count(); @@ -194,32 +194,32 @@ public: if(isEvent(index)) { const QList &mods = getMods(index); - const DrawcallDescription *drawcall = m_Ctx.GetDrawcall(mods.front().eventId); - if(!drawcall) + const ActionDescription *action = m_Ctx.GetAction(mods.front().eventId); + if(!action) return QVariant(); QString ret; - QList drawstack; - const DrawcallDescription *parent = drawcall->parent; + QList actionstack; + const ActionDescription *parent = action->parent; while(parent) { - drawstack.push_back(parent); + actionstack.push_back(parent); parent = parent->parent; } - if(!drawstack.isEmpty()) + if(!actionstack.isEmpty()) { - ret += lit("> ") + drawstack.back()->name; + ret += lit("> ") + actionstack.back()->name; - if(drawstack.count() > 3) + if(actionstack.count() > 3) ret += lit(" ..."); ret += lit("\n"); - if(drawstack.count() > 2) - ret += lit("> ") + drawstack[1]->name + lit("\n"); - if(drawstack.count() > 1) - ret += lit("> ") + drawstack[0]->name + lit("\n"); + if(actionstack.count() > 2) + ret += lit("> ") + actionstack[1]->name + lit("\n"); + if(actionstack.count() > 1) + ret += lit("> ") + actionstack[0]->name + lit("\n"); ret += lit("\n"); } @@ -231,7 +231,7 @@ public: { ret += tr("EID %1\n%2\nBound as UAV or copy - potential modification") .arg(mods.front().eventId) - .arg(drawcall->name); + .arg(action->name); if(mods[0].preMod.col.uintValue == mods[0].postMod.col.uintValue) { @@ -249,7 +249,7 @@ public: ret += tr("EID %1\n%2%3\n%4 Fragments touching pixel\n") .arg(mods.front().eventId) - .arg(drawcall->name) + .arg(action->name) .arg(failure) .arg(mods.count()); } @@ -795,9 +795,9 @@ void PixelHistoryView::jumpToPrimitive(EventTag tag) IBufferViewer *viewer = m_Ctx.GetMeshPreview(); - const DrawcallDescription *draw = m_Ctx.CurDrawcall(); + const ActionDescription *action = m_Ctx.CurAction(); - if(draw) + if(action) { uint32_t vertIdx = RENDERDOC_VertexOffset(m_Ctx.CurPipelineState().GetPrimitiveTopology(), tag.primitive); diff --git a/qrenderdoc/Windows/PythonShell.cpp b/qrenderdoc/Windows/PythonShell.cpp index 44151e8d6..3478d0276 100644 --- a/qrenderdoc/Windows/PythonShell.cpp +++ b/qrenderdoc/Windows/PythonShell.cpp @@ -431,19 +431,16 @@ struct CaptureContextInvoker : ObjectForwarder } virtual uint32_t CurSelectedEvent() override { return m_Obj.CurSelectedEvent(); } virtual uint32_t CurEvent() override { return m_Obj.CurEvent(); } - virtual const DrawcallDescription *CurSelectedDrawcall() override + virtual const ActionDescription *CurSelectedAction() override { - return m_Obj.CurSelectedDrawcall(); + return m_Obj.CurSelectedAction(); } - virtual const DrawcallDescription *CurDrawcall() override { return m_Obj.CurDrawcall(); } - virtual const DrawcallDescription *GetFirstDrawcall() override + virtual const ActionDescription *CurAction() override { return m_Obj.CurAction(); } + virtual const ActionDescription *GetFirstAction() override { return m_Obj.GetFirstAction(); } + virtual const ActionDescription *GetLastAction() override { return m_Obj.GetLastAction(); } + virtual const rdcarray &CurRootActions() override { - return m_Obj.GetFirstDrawcall(); - } - virtual const DrawcallDescription *GetLastDrawcall() override { return m_Obj.GetLastDrawcall(); } - virtual const rdcarray &CurDrawcalls() override - { - return m_Obj.CurDrawcalls(); + return m_Obj.CurRootActions(); } virtual ResourceDescription *GetResource(ResourceId id) override { return m_Obj.GetResource(id); } virtual const rdcarray &GetResources() override @@ -465,9 +462,9 @@ struct CaptureContextInvoker : ObjectForwarder virtual const rdcarray &GetTextures() override { return m_Obj.GetTextures(); } virtual BufferDescription *GetBuffer(ResourceId id) override { return m_Obj.GetBuffer(id); } virtual const rdcarray &GetBuffers() override { return m_Obj.GetBuffers(); } - virtual const DrawcallDescription *GetDrawcall(uint32_t eventId) override + virtual const ActionDescription *GetAction(uint32_t eventId) override { - return m_Obj.GetDrawcall(eventId); + return m_Obj.GetAction(eventId); } virtual bool OpenRGPProfile(const rdcstr &filename) override { diff --git a/qrenderdoc/Windows/ShaderMessageViewer.cpp b/qrenderdoc/Windows/ShaderMessageViewer.cpp index 39cdd0631..60557ec2d 100644 --- a/qrenderdoc/Windows/ShaderMessageViewer.cpp +++ b/qrenderdoc/Windows/ShaderMessageViewer.cpp @@ -153,7 +153,7 @@ ShaderMessageViewer::ShaderMessageViewer(ICaptureContext &ctx, ShaderStageMask s ui->pixel->setText(ToQStr(ShaderStage::Pixel, m_API)); m_EID = m_Ctx.CurEvent(); - m_Drawcall = m_Ctx.GetDrawcall(m_EID); + m_Action = m_Ctx.GetAction(m_EID); const PipeState &pipe = m_Ctx.CurPipelineState(); @@ -187,7 +187,7 @@ ShaderMessageViewer::ShaderMessageViewer(ICaptureContext &ctx, ShaderStageMask s m_debugDelegate = new ButtonDelegate(Icons::wrench(), this); - if(m_Drawcall && (m_Drawcall->flags & DrawFlags::Dispatch)) + if(m_Action && (m_Action->flags & ActionFlags::Dispatch)) { ui->stageFilters->hide(); @@ -418,7 +418,7 @@ ShaderMessageViewer::ShaderMessageViewer(ICaptureContext &ctx, ShaderStageMask s ui->label->setText(tr("Shader messages from @%1 - %2") .arg(m_EID) - .arg(m_Drawcall ? m_Drawcall->name : rdcstr("Unknown draw"))); + .arg(m_Action ? m_Action->name : rdcstr("Unknown action"))); setWindowTitle(tr("Shader messages at @%1").arg(m_EID)); @@ -516,7 +516,7 @@ void ShaderMessageViewer::refreshMessages() { ShaderStageMask mask = ShaderStageMask::Compute; - if(!m_Drawcall || !(m_Drawcall->flags & DrawFlags::Dispatch)) + if(!m_Action || !(m_Action->flags & ActionFlags::Dispatch)) { mask = ShaderStageMask::Unknown; @@ -565,12 +565,12 @@ void ShaderMessageViewer::refreshMessages() } // only show the instance if the draw is actually instanced - if(m_Drawcall && (m_Drawcall->flags & DrawFlags::Instanced) && m_Drawcall->numInstances > 1) + if(m_Action && (m_Action->flags & ActionFlags::Instanced) && m_Action->numInstances > 1) { location += lit("Inst %1, ").arg(msg.location.vertex.instance); } - if(m_Drawcall && (m_Drawcall->flags & DrawFlags::Indexed)) + if(m_Action && (m_Action->flags & ActionFlags::Indexed)) { location += lit("Idx %1").arg(msg.location.vertex.vertexIndex); } diff --git a/qrenderdoc/Windows/ShaderMessageViewer.h b/qrenderdoc/Windows/ShaderMessageViewer.h index 73041e8f5..defd64cd1 100644 --- a/qrenderdoc/Windows/ShaderMessageViewer.h +++ b/qrenderdoc/Windows/ShaderMessageViewer.h @@ -86,7 +86,7 @@ private: GraphicsAPI m_API; uint32_t m_EID; - const DrawcallDescription *m_Drawcall; + const ActionDescription *m_Action; rdcarray m_Messages; ResourceId m_OrigShaders[6]; diff --git a/qrenderdoc/Windows/StatisticsViewer.cpp b/qrenderdoc/Windows/StatisticsViewer.cpp index 859c3e980..1f0443875 100644 --- a/qrenderdoc/Windows/StatisticsViewer.cpp +++ b/qrenderdoc/Windows/StatisticsViewer.cpp @@ -623,23 +623,23 @@ void StatisticsViewer::AppendDetailedInformation() AppendOutputStatistics(); } -void StatisticsViewer::CountContributingEvents(const DrawcallDescription &draw, uint32_t &drawCount, +void StatisticsViewer::CountContributingEvents(const ActionDescription &action, uint32_t &drawCount, uint32_t &dispatchCount, uint32_t &diagnosticCount) { - const DrawFlags diagnosticMask = - DrawFlags::SetMarker | DrawFlags::PushMarker | DrawFlags::PopMarker; - DrawFlags diagnosticMasked = draw.flags & diagnosticMask; + const ActionFlags diagnosticMask = + ActionFlags::SetMarker | ActionFlags::PushMarker | ActionFlags::PopMarker; + ActionFlags diagnosticMasked = action.flags & diagnosticMask; - if(diagnosticMasked != DrawFlags::NoFlags) + if(diagnosticMasked != ActionFlags::NoFlags) diagnosticCount += 1; - if(draw.flags & DrawFlags::Drawcall) + if(action.flags & ActionFlags::Drawcall) drawCount += 1; - if(draw.flags & DrawFlags::Dispatch) + if(action.flags & ActionFlags::Dispatch) dispatchCount += 1; - for(const DrawcallDescription &c : draw.children) + for(const ActionDescription &c : action.children) CountContributingEvents(c, drawCount, dispatchCount, diagnosticCount); } @@ -685,16 +685,16 @@ void StatisticsViewer::AppendAPICallSummary() void StatisticsViewer::GenerateReport() { - const rdcarray &curDraws = m_Ctx.CurDrawcalls(); + const rdcarray &curActions = m_Ctx.CurRootActions(); uint32_t drawCount = 0; uint32_t dispatchCount = 0; uint32_t diagnosticCount = 0; - for(const DrawcallDescription &d : curDraws) - CountContributingEvents(d, drawCount, dispatchCount, diagnosticCount); + for(const ActionDescription &action : curActions) + CountContributingEvents(action, drawCount, dispatchCount, diagnosticCount); uint32_t numAPIcalls = - m_Ctx.GetLastDrawcall()->eventId - (drawCount + dispatchCount + diagnosticCount); + m_Ctx.GetLastAction()->eventId - (drawCount + dispatchCount + diagnosticCount); int numTextures = m_Ctx.GetTextures().count(); int numBuffers = m_Ctx.GetBuffers().count(); diff --git a/qrenderdoc/Windows/StatisticsViewer.h b/qrenderdoc/Windows/StatisticsViewer.h index 6e777f999..81bf645b1 100644 --- a/qrenderdoc/Windows/StatisticsViewer.h +++ b/qrenderdoc/Windows/StatisticsViewer.h @@ -66,7 +66,7 @@ private: void AppendRasterizationStatistics(); void AppendOutputStatistics(); void AppendDetailedInformation(); - void CountContributingEvents(const DrawcallDescription &draw, uint32_t &drawCount, + void CountContributingEvents(const ActionDescription &action, uint32_t &drawCount, uint32_t &dispatchCount, uint32_t &diagnosticCount); void AppendAPICallSummary(); void GenerateReport(); diff --git a/qrenderdoc/Windows/TextureViewer.cpp b/qrenderdoc/Windows/TextureViewer.cpp index 3f013aa3a..ca9b1d5bb 100644 --- a/qrenderdoc/Windows/TextureViewer.cpp +++ b/qrenderdoc/Windows/TextureViewer.cpp @@ -110,13 +110,13 @@ bool Following::operator==(const Following &o) return Type == o.Type && Stage == o.Stage && index == o.index && arrayEl == o.arrayEl; } -void Following::GetDrawContext(ICaptureContext &ctx, bool ©, bool &clear, bool &compute) +void Following::GetActionContext(ICaptureContext &ctx, bool ©, bool &clear, bool &compute) { - const DrawcallDescription *curDraw = ctx.CurDrawcall(); - copy = curDraw != NULL && - (curDraw->flags & (DrawFlags::Copy | DrawFlags::Resolve | DrawFlags::Present)); - clear = curDraw != NULL && (curDraw->flags & DrawFlags::Clear); - compute = curDraw != NULL && (curDraw->flags & DrawFlags::Dispatch) && + const ActionDescription *curAction = ctx.CurAction(); + copy = curAction != NULL && + (curAction->flags & (ActionFlags::Copy | ActionFlags::Resolve | ActionFlags::Present)); + clear = curAction != NULL && (curAction->flags & ActionFlags::Clear); + compute = curAction != NULL && (curAction->flags & ActionFlags::Dispatch) && ctx.CurPipelineState().GetShader(ShaderStage::Compute) != ResourceId(); } @@ -201,13 +201,13 @@ BoundResource Following::GetBoundResource(ICaptureContext &ctx, int arrayIdx) rdcarray Following::GetOutputTargets(ICaptureContext &ctx) { - const DrawcallDescription *curDraw = ctx.CurDrawcall(); + const ActionDescription *curAction = ctx.CurAction(); bool copy = false, clear = false, compute = false; - GetDrawContext(ctx, copy, clear, compute); + GetActionContext(ctx, copy, clear, compute); if(copy || clear) { - return {BoundResource(curDraw->copyDestination, curDraw->copyDestinationSubresource)}; + return {BoundResource(curAction->copyDestination, curAction->copyDestinationSubresource)}; } else if(compute) { @@ -217,10 +217,10 @@ rdcarray Following::GetOutputTargets(ICaptureContext &ctx) { rdcarray ret = ctx.CurPipelineState().GetOutputTargets(); - if(ret.isEmpty() && curDraw != NULL && (curDraw->flags & DrawFlags::Present)) + if(ret.isEmpty() && curAction != NULL && (curAction->flags & ActionFlags::Present)) { - if(curDraw->copyDestination != ResourceId()) - return {BoundResource(curDraw->copyDestination, curDraw->copyDestinationSubresource)}; + if(curAction->copyDestination != ResourceId()) + return {BoundResource(curAction->copyDestination, curAction->copyDestinationSubresource)}; for(const TextureDescription &tex : ctx.GetTextures()) { @@ -236,7 +236,7 @@ rdcarray Following::GetOutputTargets(ICaptureContext &ctx) BoundResource Following::GetDepthTarget(ICaptureContext &ctx) { bool copy = false, clear = false, compute = false; - GetDrawContext(ctx, copy, clear, compute); + GetActionContext(ctx, copy, clear, compute); if(copy || clear || compute) return BoundResource(ResourceId()); @@ -248,7 +248,7 @@ rdcarray Following::GetReadWriteResources(ICaptureContext &c ShaderStage stage, bool onlyUsed) { bool copy = false, clear = false, compute = false; - GetDrawContext(ctx, copy, clear, compute); + GetActionContext(ctx, copy, clear, compute); if(copy || clear) { @@ -271,9 +271,9 @@ rdcarray Following::GetReadWriteResources(ICaptureContext &c rdcarray Following::GetReadOnlyResources(ICaptureContext &ctx, ShaderStage stage, bool onlyUsed) { - const DrawcallDescription *curDraw = ctx.CurDrawcall(); + const ActionDescription *curAction = ctx.CurAction(); bool copy = false, clear = false, compute = false; - GetDrawContext(ctx, copy, clear, compute); + GetActionContext(ctx, copy, clear, compute); if(copy || clear) { @@ -282,7 +282,7 @@ rdcarray Following::GetReadOnlyResources(ICaptureContext &ct // only return copy source for one stage if(copy && stage == ShaderStage::Pixel) ret.push_back(BoundResourceArray( - Bindpoint(0, 0), {BoundResource(curDraw->copySource, curDraw->copySourceSubresource)})); + Bindpoint(0, 0), {BoundResource(curAction->copySource, curAction->copySourceSubresource)})); return ret; } @@ -303,7 +303,7 @@ rdcarray Following::GetReadOnlyResources(ICaptureContext &ct const ShaderReflection *Following::GetReflection(ICaptureContext &ctx, ShaderStage stage) { bool copy = false, clear = false, compute = false; - GetDrawContext(ctx, copy, clear, compute); + GetActionContext(ctx, copy, clear, compute); if(copy || clear) return NULL; @@ -321,7 +321,7 @@ const ShaderReflection *Following::GetReflection(ICaptureContext &ctx) const ShaderBindpointMapping &Following::GetMapping(ICaptureContext &ctx, ShaderStage stage) { bool copy = false, clear = false, compute = false; - GetDrawContext(ctx, copy, clear, compute); + GetActionContext(ctx, copy, clear, compute); if(copy || clear) { @@ -393,7 +393,7 @@ void TextureViewer::UI_UpdateCachedTexture() const ShaderReflection *shaderDetails = m_Ctx.CurPipelineState().GetShaderReflection(ShaderStage::Pixel); - if(!m_Ctx.CurDrawcall() || !(m_Ctx.CurDrawcall()->flags & DrawFlags::Drawcall)) + if(!m_Ctx.CurAction() || !(m_Ctx.CurAction()->flags & ActionFlags::Drawcall)) { ui->debugPixelContext->setEnabled(false); ui->debugPixelContext->setToolTip(tr("No draw call selected")); @@ -1242,7 +1242,7 @@ void TextureViewer::UI_UpdateTextureDetails() ui->texStatusFormat->setText(status); } -void TextureViewer::UI_OnTextureSelectionChanged(bool newdraw) +void TextureViewer::UI_OnTextureSelectionChanged(bool newAction) { TextureDescription *texptr = GetCurrentTexture(); @@ -1423,8 +1423,8 @@ void TextureViewer::UI_OnTextureSelectionChanged(bool newdraw) { int highestMip = -1; - // only switch to the selected mip for outputs, and when changing drawcall - if(!currentTextureIsLocked() && m_Following.Type != FollowType::ReadOnly && (newdraw || newtex)) + // only switch to the selected mip for outputs, and when changing action + if(!currentTextureIsLocked() && m_Following.Type != FollowType::ReadOnly && (newAction || newtex)) highestMip = m_Following.GetHighestMip(m_Ctx); // assuming we get a valid mip for the highest mip, only switch to it @@ -1447,8 +1447,8 @@ void TextureViewer::UI_OnTextureSelectionChanged(bool newdraw) { int firstArraySlice = -1; - // only switch to the selected mip for outputs, and when changing drawcall - if(!currentTextureIsLocked() && m_Following.Type != FollowType::ReadOnly && (newdraw || newtex)) + // only switch to the selected mip for outputs, and when changing action + if(!currentTextureIsLocked() && m_Following.Type != FollowType::ReadOnly && (newAction || newtex)) firstArraySlice = m_Following.GetFirstArraySlice(m_Ctx); // see above with highestMip and prevHighestMip for the logic behind this @@ -3101,7 +3101,7 @@ void TextureViewer::OnCaptureClosed() void TextureViewer::OnEventChanged(uint32_t eventId) { bool copy = false, clear = false, compute = false; - Following::GetDrawContext(m_Ctx, copy, clear, compute); + Following::GetActionContext(m_Ctx, copy, clear, compute); ShaderStage stages[] = {ShaderStage::Vertex, ShaderStage::Hull, ShaderStage::Domain, ShaderStage::Geometry, ShaderStage::Pixel}; diff --git a/qrenderdoc/Windows/TextureViewer.h b/qrenderdoc/Windows/TextureViewer.h index e4e8bf21f..ec6ba85f9 100644 --- a/qrenderdoc/Windows/TextureViewer.h +++ b/qrenderdoc/Windows/TextureViewer.h @@ -60,7 +60,7 @@ struct Following bool operator==(const Following &o); bool operator!=(const Following &o); - static void GetDrawContext(ICaptureContext &ctx, bool ©, bool &clear, bool &compute); + static void GetActionContext(ICaptureContext &ctx, bool ©, bool &clear, bool &compute); int GetHighestMip(ICaptureContext &ctx); int GetFirstArraySlice(ICaptureContext &ctx); @@ -248,7 +248,7 @@ private: void UI_UpdateStatusText(); void UI_UpdateTextureDetails(); - void UI_OnTextureSelectionChanged(bool newdraw); + void UI_OnTextureSelectionChanged(bool newAction); void UI_SetHistogramRange(const TextureDescription *tex, CompType typeCast); diff --git a/qrenderdoc/Windows/TimelineBar.cpp b/qrenderdoc/Windows/TimelineBar.cpp index 61f986020..f61ec62ea 100644 --- a/qrenderdoc/Windows/TimelineBar.cpp +++ b/qrenderdoc/Windows/TimelineBar.cpp @@ -180,8 +180,8 @@ void TimelineBar::OnCaptureClosed() m_HistoryEvents.clear(); m_UsageEvents.clear(); - m_Draws.clear(); - m_RootDraws.clear(); + m_Actions.clear(); + m_RootActions.clear(); m_RootMarkers.clear(); layout(); @@ -196,7 +196,7 @@ void TimelineBar::OnCaptureLoaded() else setWindowTitle(tr("Timeline - Capture")); - processDraws(m_RootMarkers, m_RootDraws, m_Ctx.CurDrawcalls()); + processActions(m_RootMarkers, m_RootActions, m_Ctx.CurRootActions()); m_zoom = 1.0; m_pan = 0.0; @@ -251,7 +251,7 @@ void TimelineBar::layout() m_markerRect.setBottom(m_highlightingRect.top()); - uint32_t maxEID = m_Draws.isEmpty() ? 0 : m_Draws.back(); + uint32_t maxEID = m_Actions.isEmpty() ? 0 : m_Actions.back(); int stepSize = 1; int stepMagnitude = 1; @@ -360,18 +360,18 @@ void TimelineBar::mousePressEvent(QMouseEvent *e) return; } - if(!m_Draws.isEmpty() && m_dataArea.contains(m_lastPos)) + if(!m_Actions.isEmpty() && m_dataArea.contains(m_lastPos)) { uint32_t eid = eventAt(x); - auto it = std::find_if(m_Draws.begin(), m_Draws.end(), [eid](uint32_t d) { + auto it = std::find_if(m_Actions.begin(), m_Actions.end(), [eid](uint32_t d) { if(d >= eid) return true; return false; }); - if(it == m_Draws.end()) - m_Ctx.SetEventID({}, m_Draws.back(), m_Draws.back()); + if(it == m_Actions.end()) + m_Ctx.SetEventID({}, m_Actions.back(), m_Actions.back()); else m_Ctx.SetEventID({}, *it, *it); } @@ -397,18 +397,18 @@ void TimelineBar::mouseMoveEvent(QMouseEvent *e) layout(); } - else if(!m_Draws.isEmpty() && m_dataArea.contains(e->localPos()) && + else if(!m_Actions.isEmpty() && m_dataArea.contains(e->localPos()) && !m_highlightingRect.contains(e->localPos())) { uint32_t eid = eventAt(x); - auto it = std::find_if(m_Draws.begin(), m_Draws.end(), [eid](uint32_t d) { + auto it = std::find_if(m_Actions.begin(), m_Actions.end(), [eid](uint32_t d) { if(d >= eid) return true; return false; }); - if(it != m_Draws.end()) + if(it != m_Actions.end()) m_Ctx.SetEventID({}, *it, *it); } } @@ -510,12 +510,12 @@ void TimelineBar::paintEvent(QPaintEvent *e) drawLine(p, m_highlightingRect.topLeft(), m_highlightingRect.topRight()); - if(m_Draws.isEmpty()) + if(m_Actions.isEmpty()) return; eidAxisRect.setLeft(m_eidAxisRect.left() + m_pan); - uint32_t maxEID = m_Draws.isEmpty() ? 0 : m_Draws.back(); + uint32_t maxEID = m_Actions.isEmpty() ? 0 : m_Actions.back(); to.setAlignment(Qt::AlignCenter | Qt::AlignVCenter); @@ -601,7 +601,7 @@ void TimelineBar::paintEvent(QPaintEvent *e) { QPen pen = p.pen(); - paintMarkers(p, m_RootMarkers, m_RootDraws, m_markerRect); + paintMarkers(p, m_RootMarkers, m_RootActions, m_markerRect); p.setPen(pen); } @@ -916,9 +916,9 @@ void TimelineBar::drawLine(QStylePainter &p, QPointF start, QPointF end) } void TimelineBar::paintMarkers(QPainter &p, const QVector &markers, - const QVector &draws, QRectF markerRect) + const QVector &actions, QRectF markerRect) { - if(markers.isEmpty() && draws.isEmpty()) + if(markers.isEmpty() && actions.isEmpty()) return; QTextOption to; @@ -983,24 +983,24 @@ void TimelineBar::paintMarkers(QPainter &p, const QVector &markers, childRect.setTop(r.bottom() + borderWidth * 2); childRect.setBottom(markerRect.bottom()); - paintMarkers(p, m.children, m.draws, childRect); + paintMarkers(p, m.children, m.actions, childRect); } } p.setRenderHint(QPainter::Antialiasing); - for(uint32_t d : draws) + for(uint32_t a : actions) { QRectF r = markerRect; - r.setLeft(qMax(m_dataArea.left() + borderWidth * 3, offsetOf(d))); - r.setRight(qMin(m_dataArea.right() - borderWidth, offsetOf(d + 1))); + r.setLeft(qMax(m_dataArea.left() + borderWidth * 3, offsetOf(a))); + r.setRight(qMin(m_dataArea.right() - borderWidth, offsetOf(a + 1))); r.setHeight(fm.height() + borderWidth * 2); QPainterPath path; path.addRoundedRect(r, 5, 5); p.setPen(QPen(palette().brush(QPalette::Text), 1.0)); - p.fillPath(path, d == m_Ctx.CurEvent() ? Qt::green : Qt::blue); + p.fillPath(path, a == m_Ctx.CurEvent() ? Qt::green : Qt::blue); p.drawPath(path); } @@ -1009,7 +1009,7 @@ void TimelineBar::paintMarkers(QPainter &p, const QVector &markers, uint32_t TimelineBar::eventAt(qreal x) { - if(m_Draws.isEmpty()) + if(m_Actions.isEmpty()) return 0; // clamp to the visible viewport @@ -1022,7 +1022,7 @@ uint32_t TimelineBar::eventAt(qreal x) qreal steps = x / m_eidAxisLabelWidth; // finally convert to EID and clamp - uint32_t maxEID = m_Draws.back(); + uint32_t maxEID = m_Actions.back(); return qMin(maxEID, uint32_t(steps * m_eidAxisLabelStep)); } @@ -1036,28 +1036,28 @@ qreal TimelineBar::offsetOf(uint32_t eid) fractionalPart * m_eidAxisLabelWidth; } -uint32_t TimelineBar::processDraws(QVector &markers, QVector &draws, - const rdcarray &curDraws) +uint32_t TimelineBar::processActions(QVector &markers, QVector &actions, + const rdcarray &curActions) { uint32_t maxEID = 0; - for(const DrawcallDescription &d : curDraws) + for(const ActionDescription &a : curActions) { - if(!d.children.isEmpty()) + if(!a.children.isEmpty()) { markers.push_back(Marker()); Marker &m = markers.back(); - m.name = d.name; - m.eidStart = d.eventId; - m.eidEnd = processDraws(m.children, m.draws, d.children); + m.name = a.name; + m.eidStart = a.eventId; + m.eidEnd = processActions(m.children, m.actions, a.children); maxEID = qMax(maxEID, m.eidEnd); - if(d.markerColor.w > 0.0f) + if(a.markerColor.w > 0.0f) { m.color = QColor::fromRgb( - qRgb(d.markerColor.x * 255.0f, d.markerColor.y * 255.0f, d.markerColor.z * 255.0f)); + qRgb(a.markerColor.x * 255.0f, a.markerColor.y * 255.0f, a.markerColor.z * 255.0f)); } else { @@ -1066,14 +1066,14 @@ uint32_t TimelineBar::processDraws(QVector &markers, QVector & } else { - if(!(d.flags & DrawFlags::SetMarker)) + if(!(a.flags & ActionFlags::SetMarker)) { - m_Draws.push_back(d.eventId); - draws.push_back(d.eventId); + m_Actions.push_back(a.eventId); + actions.push_back(a.eventId); } } - maxEID = qMax(maxEID, d.eventId); + maxEID = qMax(maxEID, a.eventId); } return maxEID; diff --git a/qrenderdoc/Windows/TimelineBar.h b/qrenderdoc/Windows/TimelineBar.h index 0d5a72172..cfc8538d4 100644 --- a/qrenderdoc/Windows/TimelineBar.h +++ b/qrenderdoc/Windows/TimelineBar.h @@ -69,12 +69,12 @@ private: bool expanded = false; QVector children; - QVector draws; + QVector actions; }; QVector m_RootMarkers; - QVector m_RootDraws; - QVector m_Draws; + QVector m_RootActions; + QVector m_Actions; ResourceId m_ID; QString m_HistoryTarget; @@ -109,10 +109,10 @@ private: uint32_t eventAt(qreal x); qreal offsetOf(uint32_t eid); - uint32_t processDraws(QVector &markers, QVector &draws, - const rdcarray &curDraws); + uint32_t processActions(QVector &markers, QVector &actions, + const rdcarray &curActions); void drawLine(QStylePainter &p, QPointF start, QPointF end); - void paintMarkers(QPainter &p, const QVector &markers, const QVector &draws, + void paintMarkers(QPainter &p, const QVector &markers, const QVector &actions, QRectF markerRect); Marker *findMarker(QVector &markers, QRectF markerRect, QPointF pos); }; diff --git a/renderdoc/api/app/renderdoc_app.h b/renderdoc/api/app/renderdoc_app.h index 4e1fec210..ca5a79b54 100644 --- a/renderdoc/api/app/renderdoc_app.h +++ b/renderdoc/api/app/renderdoc_app.h @@ -107,15 +107,16 @@ typedef enum RENDERDOC_CaptureOption { // 0 - no callstacks are captured eRENDERDOC_Option_CaptureCallstacks = 3, - // When capturing CPU callstacks, only capture them from drawcalls. + // When capturing CPU callstacks, only capture them from actions. // This option does nothing without the above option being enabled // // Default - disabled // - // 1 - Only captures callstacks for drawcall type API events. + // 1 - Only captures callstacks for actions. // Ignored if CaptureCallstacks is disabled // 0 - Callstacks, if enabled, are captured for every event. eRENDERDOC_Option_CaptureCallstacksOnlyDraws = 4, + eRENDERDOC_Option_CaptureCallstacksOnlyActions = 4, // Specify a delay in seconds to wait for a debugger to attach, after // creating or injecting into a process, before continuing to allow it to run. @@ -548,6 +549,7 @@ typedef enum RENDERDOC_Version { eRENDERDOC_API_Version_1_3_0 = 10300, // RENDERDOC_API_1_3_0 = 1 03 00 eRENDERDOC_API_Version_1_4_0 = 10400, // RENDERDOC_API_1_4_0 = 1 04 00 eRENDERDOC_API_Version_1_4_1 = 10401, // RENDERDOC_API_1_4_1 = 1 04 01 + eRENDERDOC_API_Version_1_4_2 = 10402, // RENDERDOC_API_1_4_2 = 1 04 02 } RENDERDOC_Version; // API version changelog: @@ -574,6 +576,7 @@ typedef enum RENDERDOC_Version { // 1.4.0 - Added feature: DiscardFrameCapture() to discard a frame capture in progress and stop // capturing without saving anything to disk. // 1.4.1 - Refactor: Renamed Shutdown to RemoveHooks to better clarify what is happening +// 1.4.2 - Refactor: Renamed 'draws' to 'actions' in callstack capture option. typedef struct RENDERDOC_API_1_4_1 { @@ -647,17 +650,18 @@ typedef struct RENDERDOC_API_1_4_1 // new function in 1.4.0 pRENDERDOC_DiscardFrameCapture DiscardFrameCapture; -} RENDERDOC_API_1_4_1; +} RENDERDOC_API_1_4_2; -typedef RENDERDOC_API_1_4_1 RENDERDOC_API_1_0_0; -typedef RENDERDOC_API_1_4_1 RENDERDOC_API_1_0_1; -typedef RENDERDOC_API_1_4_1 RENDERDOC_API_1_0_2; -typedef RENDERDOC_API_1_4_1 RENDERDOC_API_1_1_0; -typedef RENDERDOC_API_1_4_1 RENDERDOC_API_1_1_1; -typedef RENDERDOC_API_1_4_1 RENDERDOC_API_1_1_2; -typedef RENDERDOC_API_1_4_1 RENDERDOC_API_1_2_0; -typedef RENDERDOC_API_1_4_1 RENDERDOC_API_1_3_0; -typedef RENDERDOC_API_1_4_1 RENDERDOC_API_1_4_0; +typedef RENDERDOC_API_1_4_2 RENDERDOC_API_1_0_0; +typedef RENDERDOC_API_1_4_2 RENDERDOC_API_1_0_1; +typedef RENDERDOC_API_1_4_2 RENDERDOC_API_1_0_2; +typedef RENDERDOC_API_1_4_2 RENDERDOC_API_1_1_0; +typedef RENDERDOC_API_1_4_2 RENDERDOC_API_1_1_1; +typedef RENDERDOC_API_1_4_2 RENDERDOC_API_1_1_2; +typedef RENDERDOC_API_1_4_2 RENDERDOC_API_1_2_0; +typedef RENDERDOC_API_1_4_2 RENDERDOC_API_1_3_0; +typedef RENDERDOC_API_1_4_2 RENDERDOC_API_1_4_0; +typedef RENDERDOC_API_1_4_2 RENDERDOC_API_1_4_0; ////////////////////////////////////////////////////////////////////////////////////////////////// // RenderDoc API entry point diff --git a/renderdoc/api/replay/capture_options.h b/renderdoc/api/replay/capture_options.h index 30dee4fc8..b81289d35 100644 --- a/renderdoc/api/replay/capture_options.h +++ b/renderdoc/api/replay/capture_options.h @@ -121,16 +121,16 @@ Default - disabled )"); bool captureCallstacks; - DOCUMENT(R"(When capturing CPU callstacks, only capture them from drawcalls. + DOCUMENT(R"(When capturing CPU callstacks, only capture them from actions. This option does nothing if :data:`captureCallstacks` is not enabled. Default - disabled -``True`` - Only captures callstacks for drawcall type API events. +``True`` - Only captures callstacks for actions. ``False`` - Callstacks, if enabled, are captured for every event. )"); - bool captureCallstacksOnlyDraws; + bool captureCallstacksOnlyActions; DOCUMENT(R"(Specify a delay in seconds to wait for a debugger to attach, after creating or injecting into a process, before continuing to allow it to run. diff --git a/renderdoc/api/replay/data_types.h b/renderdoc/api/replay/data_types.h index 12ffc1077..1370f6706 100644 --- a/renderdoc/api/replay/data_types.h +++ b/renderdoc/api/replay/data_types.h @@ -722,13 +722,13 @@ This is a 1-based count of API events in the capture. The eventId is used as a r many places in the API to represent where in the capture the 'current state' is, and to perform analysis in reference to the state at a particular point in the frame. -eventIds are always increasing and positive, but they may not be contiguous - in some circumstances -there may be gaps if some events are consumed entirely internally, such as debug marker pops which -only modify the internal drawcall tree structures. +eventIds are generally increasing, positive, and contiguous, with a few exceptions. These are when +fake markers are added to a capture with :meth:`ReplayController.AddFakeMarkers`. Thus if strong +eventId guarantees are desired, this function should be avoided. Also eventIds may not correspond directly to an actual function call - sometimes a function such as -a multi draw indirect will be one function call that expands to multiple events to allow inspection -of results part way through the multi draw. +a multi action indirect will be one function call that expands to multiple events to allow inspection +of results part way through the multi action. )"); uint32_t eventId = 0; @@ -1541,21 +1541,27 @@ an array slice. DECLARE_REFLECTION_STRUCT(Subresource); -DOCUMENT("Describes the properties of a drawcall, dispatch, debug marker, or similar event."); -struct DrawcallDescription +DOCUMENT(R"(Describes the properties of an action. + +An action is a call such as a draw, a compute dispatch, clears, copies, resolves, etc. Any GPU event +which may have deliberate visible side-effects to application-visible memory, typically resources +such as textures and buffers. It also includes markers, which provide a user-generated annotation of +events and actions. +)"); +struct ActionDescription { DOCUMENT(""); - DrawcallDescription() = default; - DrawcallDescription(const DrawcallDescription &) = default; - DrawcallDescription &operator=(const DrawcallDescription &) = default; + ActionDescription() = default; + ActionDescription(const ActionDescription &) = default; + ActionDescription &operator=(const ActionDescription &) = default; - DOCUMENT(R"(Returns whether or not this drawcall corresponds to a fake marker added by + DOCUMENT(R"(Returns whether or not this action corresponds to a fake marker added by :meth:`ReplayController.AddFakeMarkers`. -Such draws may break expectations of event IDs and drawcall IDs, so it is recommended to avoid +Such actions may break expectations of event IDs and action IDs, so it is recommended to avoid processing them wherever possible. -:return: Returns whether or not this drawcall is a fake marker. +:return: Returns whether or not this action is a fake marker. :rtype: bool )"); bool IsFakeMarker() const @@ -1564,22 +1570,24 @@ processing them wherever possible. } DOCUMENT(""); - bool operator==(const DrawcallDescription &o) const { return eventId == o.eventId; } - bool operator<(const DrawcallDescription &o) const { return eventId < o.eventId; } - DOCUMENT("The :data:`eventId ` that actually produced the drawcall."); + bool operator==(const ActionDescription &o) const { return eventId == o.eventId; } + bool operator<(const ActionDescription &o) const { return eventId < o.eventId; } + DOCUMENT("The :data:`eventId ` that actually produced the action."); uint32_t eventId = 0; - DOCUMENT("A 1-based index of this drawcall relative to other drawcalls."); - uint32_t drawcallId = 0; + DOCUMENT("A 1-based index of this action relative to other actions."); + uint32_t actionId = 0; - DOCUMENT(R"(The name of this drawcall. Typically a summarised/concise list of parameters. + DOCUMENT(R"(The name of this action. Typically a summarised/concise list of parameters. -.. note:: For drawcalls, the convention is to list primary parameters (vertex/index count, instance - count) and omit secondary parameters (vertex offset, instance offset). +.. note:: For markers this will be a user-provided string. In most other cases this name will be + empty, and the name can be generated using structured data. Some actions will have a custom + name generated for e.g. reading back and directly displaying indirect parameters or render pass + parameters. )"); rdcstr name; - DOCUMENT("A set of :class:`DrawFlags` properties describing what kind of drawcall this is."); - DrawFlags flags = DrawFlags::NoFlags; + DOCUMENT("A set of :class:`ActionFlags` properties describing what kind of action this is."); + ActionFlags flags = ActionFlags::NoFlags; DOCUMENT(R"(A RGBA color specified by a debug marker call. @@ -1587,10 +1595,10 @@ processing them wherever possible. )"); FloatVector markerColor; - DOCUMENT("The number of indices or vertices as appropriate for the drawcall. 0 if not used."); + DOCUMENT("The number of indices or vertices as appropriate for a draw action. 0 if not used."); uint32_t numIndices = 0; - DOCUMENT("The number of instances for the drawcall. 0 if not used."); + DOCUMENT("The number of instances for a draw action. 0 if not used."); uint32_t numInstances = 0; DOCUMENT("For indexed drawcalls, the offset added to each index after fetching."); @@ -1606,9 +1614,9 @@ processing them wherever possible. "For instanced drawcalls, the offset applied before looking up instanced vertex inputs."); uint32_t instanceOffset = 0; - DOCUMENT(R"(The index of this draw in an call with multiple draws, e.g. an indirect draw. + DOCUMENT(R"(The index of this action in an call with multiple draws, e.g. an indirect action. -0 if not part of a multi-draw. +0 if not part of a multi-action. )"); uint32_t drawIndex = 0; @@ -1652,26 +1660,26 @@ operation. )"); Subresource copyDestinationSubresource; - DOCUMENT(R"(The parent of this drawcall, or ``None`` if there is no parent for this drawcall. + DOCUMENT(R"(The parent of this action, or ``None`` if there is no parent for this action. -:type: DrawcallDescription +:type: ActionDescription )"); - const DrawcallDescription *parent = NULL; + const ActionDescription *parent = NULL; - DOCUMENT(R"(The previous drawcall in the frame, or ``None`` if this is the first drawcall in the + DOCUMENT(R"(The previous action in the frame, or ``None`` if this is the first action in the frame. -:type: DrawcallDescription +:type: ActionDescription )"); - const DrawcallDescription *previous = NULL; - DOCUMENT(R"(The next drawcall in the frame, or ``None`` if this is the last drawcall in the frame. + const ActionDescription *previous = NULL; + DOCUMENT(R"(The next action in the frame, or ``None`` if this is the last action in the frame. -:type: DrawcallDescription +:type: ActionDescription )"); - const DrawcallDescription *next = NULL; + const ActionDescription *next = NULL; DOCUMENT(R"(An 8-tuple of the :class:`ResourceId` ids for the color outputs, which can be used -for very coarse bucketing of drawcalls into similar passes by their outputs. +for very coarse bucketing of actions into similar passes by their outputs. :type: Tuple[ResourceId,...] )"); @@ -1679,20 +1687,20 @@ for very coarse bucketing of drawcalls into similar passes by their outputs. DOCUMENT("The resource used for depth output - see :data:`outputs`."); ResourceId depthOut; - DOCUMENT(R"(The events that happened since the previous drawcall. + DOCUMENT(R"(The events that happened since the previous action. :type: List[APIEvent] )"); rdcarray events; - DOCUMENT(R"(The child drawcalls below this one, if it's a marker region or multidraw type draw. + DOCUMENT(R"(The child actions below this one, if it's a marker region or multi-action. -:type: List[DrawcallDescription] +:type: List[ActionDescription] )"); - rdcarray children; + rdcarray children; }; -DECLARE_REFLECTION_STRUCT(DrawcallDescription); +DECLARE_REFLECTION_STRUCT(ActionDescription); DOCUMENT("Gives some API-specific information about the capture."); struct APIProperties @@ -2081,7 +2089,7 @@ struct PixelModification bool unboundPS; DOCUMENT(R"(A 0-based index of which fragment this modification corresponds to, in the case that -multiple fragments from a single draw wrote to a pixel. +multiple fragments from a single action wrote to a pixel. )"); uint32_t fragIndex; diff --git a/renderdoc/api/replay/gl_pipestate.h b/renderdoc/api/replay/gl_pipestate.h index d8bb4b1a9..2a4663e97 100644 --- a/renderdoc/api/replay/gl_pipestate.h +++ b/renderdoc/api/replay/gl_pipestate.h @@ -164,15 +164,15 @@ struct VertexInput non-indexed draws. .. note:: - This does not correspond to a real GL state since the index type is specified per-draw in the call - itself. This is an implicit state derived from the last (or current) drawcall at any given event. + This does not correspond to a real GL state since the index type is specified per-action in the call + itself. This is an implicit state derived from the last (or current) action at any given event. )"); uint32_t indexByteStride = 0; DOCUMENT(R"(The byte width of the index buffer - typically 1, 2 or 4 bytes. .. note:: - This does not correspond to a real GL state since the topology is specified per-draw in the call - itself. This is an implicit state derived from the last (or current) drawcall at any given event. + This does not correspond to a real GL state since the topology is specified per-action in the call + itself. This is an implicit state derived from the last (or current) action at any given event. )"); Topology topology = Topology::Unknown; DOCUMENT("``True`` if primitive restart is enabled for strip primitives."); diff --git a/renderdoc/api/replay/pipestate.h b/renderdoc/api/replay/pipestate.h index a0a23bac0..92f752e5c 100644 --- a/renderdoc/api/replay/pipestate.h +++ b/renderdoc/api/replay/pipestate.h @@ -262,9 +262,9 @@ For some APIs that don't distinguish by entry point, this may be empty. DOCUMENT(R"(Returns the current primitive topology. .. note:: - On OpenGL the primitive topology is not part of any state, but is specified in each drawcall. - In this case the current topology is whichever was last specified to a drawcall, as if there was - implicit state set by a draw. + On OpenGL the primitive topology is not part of any state, but is specified in each action. + In this case the current topology is whichever was last specified to a action, as if there was + implicit state set by a action. :return: The current primitive topology. :rtype: Topology @@ -274,9 +274,9 @@ For some APIs that don't distinguish by entry point, this may be empty. DOCUMENT(R"(Retrieves the current index buffer binding. .. note:: - On OpenGL the index stride/width is not part of any state, but is specified in each drawcall. - In this case the current stride is whichever was last specified to a drawcall, as if there was - implicit state set by a draw. + On OpenGL the index stride/width is not part of any state, but is specified in each action. + In this case the current stride is whichever was last specified to a action, as if there was + implicit state set by a action. :return: A :class:`BoundVBuffer` with the index buffer details :rtype: BoundVBuffer @@ -385,9 +385,9 @@ For some APIs that don't distinguish by entry point, this may be empty. )"); bool IsIndependentBlendingEnabled() const; - DOCUMENT(R"(Retrieves the shader messages obtained for the current draw. + DOCUMENT(R"(Retrieves the shader messages obtained for the current action. -:return: The shader messages obtained for the current draw. +:return: The shader messages obtained for the current action. :rtype: List[ShaderMessage] )"); const rdcarray &GetShaderMessages() const; diff --git a/renderdoc/api/replay/renderdoc_replay.h b/renderdoc/api/replay/renderdoc_replay.h index 883e5944e..917815141 100644 --- a/renderdoc/api/replay/renderdoc_replay.h +++ b/renderdoc/api/replay/renderdoc_replay.h @@ -679,7 +679,7 @@ See :meth:`BuildTargetShader`. )"); virtual const SDFile &GetStructuredFile() = 0; - DOCUMENT(R"(Add fake marker regions to the list of drawcalls in the capture, based on which + DOCUMENT(R"(Add fake marker regions to the list of actions in the capture, based on which textures are bound as outputs. Will not do anything if the capture already contains user marker regions. @@ -688,7 +688,7 @@ regions. corruption. No other functions should be called between load and this one. .. note:: - The event IDs for fake marker pushes and pops will not be contiguous with the surrounding draws + The event IDs for fake marker pushes and pops will not be contiguous with the surrounding actions and will be set to values above the last real event in the capture. This also means they break the typical rules that event IDs always increase. It's recommended that these events are not referenced directly in other calls such as SetFrameEvent, and fake markers should be used @@ -696,12 +696,12 @@ regions. )"); virtual void AddFakeMarkers() = 0; - DOCUMENT(R"(Retrieve the list of root-level drawcalls in the capture. + DOCUMENT(R"(Retrieve the list of root-level actions in the capture. -:return: The list of root-level drawcalls in the capture. -:rtype: List[DrawcallDescription] +:return: The list of root-level actions in the capture. +:rtype: List[ActionDescription] )"); - virtual const rdcarray &GetDrawcalls() = 0; + virtual const rdcarray &GetRootActions() = 0; DOCUMENT(R"(Retrieve the values of a specified set of counters. diff --git a/renderdoc/api/replay/renderdoc_tostr.inl b/renderdoc/api/replay/renderdoc_tostr.inl index 37737eb24..c03dc589a 100644 --- a/renderdoc/api/replay/renderdoc_tostr.inl +++ b/renderdoc/api/replay/renderdoc_tostr.inl @@ -1147,9 +1147,9 @@ rdcstr DoStringise(const BufferCategory &el) } template <> -rdcstr DoStringise(const DrawFlags &el) +rdcstr DoStringise(const ActionFlags &el) { - BEGIN_BITFIELD_STRINGISE(DrawFlags); + BEGIN_BITFIELD_STRINGISE(ActionFlags); { STRINGISE_BITFIELD_CLASS_VALUE_NAMED(NoFlags, "None"); @@ -1161,7 +1161,7 @@ rdcstr DoStringise(const DrawFlags &el) STRINGISE_BITFIELD_CLASS_BIT(PushMarker); STRINGISE_BITFIELD_CLASS_BIT(PopMarker); STRINGISE_BITFIELD_CLASS_BIT(Present); - STRINGISE_BITFIELD_CLASS_BIT(MultiDraw); + STRINGISE_BITFIELD_CLASS_BIT(MultiAction); STRINGISE_BITFIELD_CLASS_BIT(Copy); STRINGISE_BITFIELD_CLASS_BIT(Resolve); STRINGISE_BITFIELD_CLASS_BIT(GenMips); diff --git a/renderdoc/api/replay/replay_enums.h b/renderdoc/api/replay/replay_enums.h index 88c28823d..68fb33d57 100644 --- a/renderdoc/api/replay/replay_enums.h +++ b/renderdoc/api/replay/replay_enums.h @@ -4044,7 +4044,7 @@ DOCUMENT(R"(A set of flags describing how this buffer may be used .. data:: Indirect - The buffer will be used to provide indirect parameters for launching GPU-based drawcalls. + The buffer will be used to provide indirect parameters for launching GPU-based actions. )"); enum class BufferCategory : uint32_t { @@ -4226,104 +4226,109 @@ enum class ShaderEvents : uint32_t BITMASK_OPERATORS(ShaderEvents); DECLARE_REFLECTION_ENUM(ShaderEvents); -DOCUMENT(R"(A set of flags describing the properties of a particular drawcall. +DOCUMENT(R"(A set of flags describing the properties of a particular action. An action is a call +such as a draw, a compute dispatch, clears, copies, resolves, etc. Any GPU event which may have +deliberate visible side-effects to application-visible memory, typically resources such as textures +and buffers. It also includes markers, which provide a user-generated annotation of events and +actions. .. data:: NoFlags - The drawcall has no special properties. + The action has no special properties. .. data:: Clear - The drawcall is a clear call. See :data:`ClearColor` and :data:`ClearDepthStencil`. + The action is a clear call. See :data:`ClearColor` and :data:`ClearDepthStencil`. .. data:: Drawcall - The drawcall renders primitives using the graphics pipeline. + The action renders primitives using the graphics pipeline. .. data:: Dispatch - The drawcall issues a number of compute workgroups. + The action issues a number of compute workgroups. .. data:: CmdList - The drawcall calls into a previously recorded child command list. + The action calls into a previously recorded child command list. .. data:: SetMarker - The drawcall inserts a single debugging marker. + The action inserts a single debugging marker. .. data:: PushMarker - The drawcall begins a debugging marker region that has children. + The action begins a debugging marker region that has children. .. data:: PopMarker - The drawcall ends a debugging marker region. + The action ends a debugging marker region. .. data:: Present - The drawcall is a presentation call that hands a swapchain image to the presentation engine. + The action is a presentation call that hands a swapchain image to the presentation engine. -.. data:: MultiDraw +.. data:: MultiAction - The drawcall is a multi-draw that contains several specified child draws. + The action is a multi-action that contains several specified child actions. Typically a MultiDraw + or ExecuteIndirect on D3D12. .. data:: Copy - The drawcall performs a resource copy operation. + The action performs a resource copy operation. .. data:: Resolve - The drawcall performs a resource resolve or blit operation. + The action performs a resource resolve or blit operation. .. data:: GenMips - The drawcall performs a resource mip-generation operation. + The action performs a resource mip-generation operation. .. data:: PassBoundary - The drawcall marks the beginning or end of a render pass. See :data:`BeginPass` and + The action marks the beginning or end of a render pass. See :data:`BeginPass` and :data:`EndPass`. .. data:: Indexed - The drawcall uses an index buffer. + The action uses an index buffer. .. data:: Instanced - The drawcall uses instancing. This does not mean it renders more than one instanced, simply that + The action uses instancing. This does not mean it renders more than one instanced, simply that it uses the instancing feature. .. data:: Auto - The drawcall interacts with stream-out to render all vertices previously written. This is a + The action interacts with stream-out to render all vertices previously written. This is a Direct3D 11 specific feature. .. data:: Indirect - The drawcall uses a buffer on the GPU to source some or all of its parameters in an indirect way. + The action uses a buffer on the GPU to source some or all of its parameters in an indirect way. .. data:: ClearColor - The drawcall clears a color target. + The action clears a color target. .. data:: ClearDepthStencil - The drawcall clears a depth-stencil target. + The action clears a depth-stencil target. .. data:: BeginPass - The drawcall marks the beginning of a render pass. + The action marks the beginning of a render pass. .. data:: EndPass - The drawcall marks the end of a render pass. + The action marks the end of a render pass. .. data:: CommandBufferBoundary - The drawcall is a virtual marker added to show command buffer boundaries. + The action is a virtual marker added to show command buffer boundaries. )"); -enum class DrawFlags : uint32_t +enum class ActionFlags : uint32_t { NoFlags = 0x0000, @@ -4336,7 +4341,7 @@ enum class DrawFlags : uint32_t PushMarker = 0x0020, PopMarker = 0x0040, // this is only for internal tracking use Present = 0x0080, - MultiDraw = 0x0100, + MultiAction = 0x0100, Copy = 0x0200, Resolve = 0x0400, GenMips = 0x0800, @@ -4354,8 +4359,8 @@ enum class DrawFlags : uint32_t CommandBufferBoundary = 0x1000000, }; -BITMASK_OPERATORS(DrawFlags); -DECLARE_REFLECTION_ENUM(DrawFlags); +BITMASK_OPERATORS(ActionFlags); +DECLARE_REFLECTION_ENUM(ActionFlags); DOCUMENT(R"(INTERNAL: A set of flags giving details of the current status of vulkan layer registration. diff --git a/renderdoc/api/replay/vk_pipestate.h b/renderdoc/api/replay/vk_pipestate.h index 4eb667abd..7cfd69e76 100644 --- a/renderdoc/api/replay/vk_pipestate.h +++ b/renderdoc/api/replay/vk_pipestate.h @@ -1297,7 +1297,7 @@ struct State )"); rdcarray images; - DOCUMENT(R"(The shader messages retrieved for this draw. + DOCUMENT(R"(The shader messages retrieved for this action. :type: List[ShaderMessage] )"); diff --git a/renderdoc/core/core.cpp b/renderdoc/core/core.cpp index 5a036d1be..1861efad9 100644 --- a/renderdoc/core/core.cpp +++ b/renderdoc/core/core.cpp @@ -188,9 +188,9 @@ rdcstr DoStringise(const ReplayLogType &el) { BEGIN_ENUM_STRINGISE(ReplayLogType); { - STRINGISE_ENUM_NAMED(eReplay_Full, "Full replay including draw"); - STRINGISE_ENUM_NAMED(eReplay_WithoutDraw, "Replay without draw"); - STRINGISE_ENUM_NAMED(eReplay_OnlyDraw, "Replay only draw"); + STRINGISE_ENUM_NAMED(eReplay_Full, "Full replay including action"); + STRINGISE_ENUM_NAMED(eReplay_WithoutDraw, "Replay without action"); + STRINGISE_ENUM_NAMED(eReplay_OnlyDraw, "Replay only action"); } END_ENUM_STRINGISE(); } diff --git a/renderdoc/core/core.h b/renderdoc/core/core.h index 513af572f..68a362886 100644 --- a/renderdoc/core/core.h +++ b/renderdoc/core/core.h @@ -85,7 +85,7 @@ enum class CaptureState { // This is the state while the initial load of a capture is happening and the replay is // initialising available resources. This is where any heavy one-off analysis can happen like - // noting down the details of a drawcall, tracking statistics about resource use and drawcall + // noting down the details of a action, tracking statistics about resource use and action // types, and creating resources that will be needed later in ActiveReplaying. // // After leaving this state, the capture enters ActiveReplaying and remains there until the diff --git a/renderdoc/core/image_viewer.cpp b/renderdoc/core/image_viewer.cpp index c6376104f..750292602 100644 --- a/renderdoc/core/image_viewer.cpp +++ b/renderdoc/core/image_viewer.cpp @@ -46,16 +46,16 @@ public: m_FrameRecord.frameInfo.frameNumber = 1; RDCEraseEl(m_FrameRecord.frameInfo.stats); - m_FrameRecord.drawcallList.resize(1); - DrawcallDescription &d = m_FrameRecord.drawcallList[0]; - d.drawcallId = 1; - d.eventId = 1; - d.name = get_basename(filename); + m_FrameRecord.actionList.resize(1); + ActionDescription &action = m_FrameRecord.actionList[0]; + action.actionId = 1; + action.eventId = 1; + action.name = get_basename(filename); APIEvent ev; ev.eventId = 1; - d.events.push_back(ev); + action.events.push_back(ev); - SDChunk *chunk = new SDChunk(d.name); + SDChunk *chunk = new SDChunk(action.name); chunk->AddAndOwnChild(makeSDString("path"_lit, filename)); m_File.chunks.push_back(chunk); diff --git a/renderdoc/core/replay_proxy.cpp b/renderdoc/core/replay_proxy.cpp index 2da820ece..92cd10648 100644 --- a/renderdoc/core/replay_proxy.cpp +++ b/renderdoc/core/replay_proxy.cpp @@ -627,8 +627,8 @@ FrameRecord ReplayProxy::Proxied_GetFrameRecord(ParamSerialiser ¶mser, Retur if(paramser.IsWriting()) { - // re-configure the drawcall pointers, since they will be invalid - SetupDrawcallPointers(m_Drawcalls, ret.drawcallList); + // re-configure the action pointers, since they will be invalid + SetupActionPointers(m_Actions, ret.actionList); } return ret; @@ -2443,20 +2443,20 @@ void ReplayProxy::EnsureBufCached(ResourceId bufid) } } -const DrawcallDescription *ReplayProxy::FindDraw(const rdcarray &drawcallList, +const ActionDescription *ReplayProxy::FindAction(const rdcarray &actionList, uint32_t eventId) { - for(const DrawcallDescription &d : drawcallList) + for(const ActionDescription &a : actionList) { - if(!d.children.empty()) + if(!a.children.empty()) { - const DrawcallDescription *draw = FindDraw(d.children, eventId); - if(draw != NULL) - return draw; + const ActionDescription *action = FindAction(a.children, eventId); + if(action != NULL) + return action; } - if(d.eventId == eventId) - return &d; + if(a.eventId == eventId) + return &a; } return NULL; @@ -2485,7 +2485,7 @@ void ReplayProxy::InitPreviewWindow() } } - if(m_FrameRecord.drawcallList.empty()) + if(m_FrameRecord.actionList.empty()) m_FrameRecord = m_Replay->GetFrameRecord(); } } @@ -2518,7 +2518,7 @@ void ReplayProxy::RefreshPreviewWindow() m_Replay->RenderCheckerboard(RenderDoc::Inst().DarkCheckerboardColor(), RenderDoc::Inst().LightCheckerboardColor()); - const DrawcallDescription *curDraw = FindDraw(m_FrameRecord.drawcallList, m_EventID); + const ActionDescription *curDraw = FindAction(m_FrameRecord.actionList, m_EventID); if(curDraw) { diff --git a/renderdoc/core/replay_proxy.h b/renderdoc/core/replay_proxy.h index a5bd464b4..fe49975b0 100644 --- a/renderdoc/core/replay_proxy.h +++ b/renderdoc/core/replay_proxy.h @@ -590,7 +590,7 @@ private: void EnsureBufCached(ResourceId bufid); IMPLEMENT_FUNCTION_PROXIED(bool, NeedRemapForFetch, const ResourceFormat &format); - const DrawcallDescription *FindDraw(const rdcarray &drawcallList, + const ActionDescription *FindAction(const rdcarray &actionList, uint32_t eventId); bool CheckError(ReplayProxyPacket receivedPacket, ReplayProxyPacket expectedPacket); @@ -720,7 +720,7 @@ private: APIProperties m_APIProps; std::map m_TextureInfo; - rdcarray m_Drawcalls; + rdcarray m_Actions; SDFile m_StructuredFile; diff --git a/renderdoc/driver/d3d11/d3d11_context.cpp b/renderdoc/driver/d3d11/d3d11_context.cpp index 011431c30..3c520f7f1 100644 --- a/renderdoc/driver/d3d11/d3d11_context.cpp +++ b/renderdoc/driver/d3d11/d3d11_context.cpp @@ -168,10 +168,10 @@ WrappedID3D11DeviceContext::WrappedID3D11DeviceContext(WrappedID3D11Device *real m_FailureReason = CaptureSucceeded; m_EmptyCommandList = true; - m_DrawcallStack.push_back(&m_ParentDrawcall); + m_ActionStack.push_back(&m_ParentAction); m_CurEventID = 0; - m_CurDrawcallID = 1; + m_CurActionID = 1; m_MarkerIndentLevel = 0; @@ -542,7 +542,7 @@ void WrappedID3D11DeviceContext::FinishCapture() void WrappedID3D11DeviceContext::EndCaptureFrame() { WriteSerialiser &ser = m_ScratchSerialiser; - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(SystemChunk::CaptureEnd); SERIALISE_ELEMENT(m_ResourceID).Named("Context"_lit).TypedAs("ID3D11DeviceContext *"_lit); @@ -564,14 +564,14 @@ bool WrappedID3D11DeviceContext::Serialise_Present(SerialiserType &ser, UINT Syn { AddEvent(); - DrawcallDescription draw; + ActionDescription action; - draw.copyDestination = m_pDevice->GetBackbufferResourceID(); + action.copyDestination = m_pDevice->GetBackbufferResourceID(); - draw.name = StringFormat::Fmt("Present(%s)", ToStr(draw.copyDestination).c_str()); - draw.flags |= DrawFlags::Present; + action.name = StringFormat::Fmt("Present(%s)", ToStr(action.copyDestination).c_str()); + action.flags |= ActionFlags::Present; - AddDrawcall(draw); + AddAction(action); } return true; @@ -584,7 +584,7 @@ void WrappedID3D11DeviceContext::Present(UINT SyncInterval, UINT Flags) if(IsActiveCapturing(m_State)) { USE_SCRATCH_SERIALISER(); - GET_SERIALISER.SetDrawChunk(); + GET_SERIALISER.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D11Chunk::SwapchainPresent); SERIALISE_ELEMENT(m_ResourceID).Named("Context"_lit).TypedAs("ID3D11DeviceContext *"_lit); Serialise_Present(ser, SyncInterval, Flags); @@ -677,7 +677,7 @@ bool WrappedID3D11DeviceContext::ProcessChunk(ReadSerialiser &ser, D3D11Chunk ch SERIALISE_CHECK_READ_ERRORS(); - m_AddedDrawcall = false; + m_AddedAction = false; bool ret = false; @@ -944,13 +944,13 @@ bool WrappedID3D11DeviceContext::ProcessChunk(ReadSerialiser &ser, D3D11Chunk ch { AddEvent(); - DrawcallDescription draw; - draw.name = "End of Capture"; - draw.flags |= DrawFlags::Present; + ActionDescription action; + action.name = "End of Capture"; + action.flags |= ActionFlags::Present; - draw.copyDestination = m_pDevice->GetBackbufferResourceID(); + action.copyDestination = m_pDevice->GetBackbufferResourceID(); - AddDrawcall(draw); + AddAction(action); } ret = true; @@ -970,40 +970,40 @@ bool WrappedID3D11DeviceContext::ProcessChunk(ReadSerialiser &ser, D3D11Chunk ch } else if(chunk == D3D11Chunk::PushMarker) { - // push down the drawcallstack to the latest drawcall - m_DrawcallStack.push_back(&m_DrawcallStack.back()->children.back()); + // push down the action stack to the latest action + m_ActionStack.push_back(&m_ActionStack.back()->children.back()); } else if(chunk == D3D11Chunk::PopMarker) { - // refuse to pop off further than the root drawcall (mismatched begin/end events e.g.) - if(m_DrawcallStack.size() > 1) - m_DrawcallStack.pop_back(); + // refuse to pop off further than the root action (mismatched begin/end events e.g.) + if(m_ActionStack.size() > 1) + m_ActionStack.pop_back(); } - if(!m_AddedDrawcall) + if(!m_AddedAction) AddEvent(); } - m_AddedDrawcall = false; + m_AddedAction = false; return ret; } -void WrappedID3D11DeviceContext::AddUsage(const DrawcallDescription &d) +void WrappedID3D11DeviceContext::AddUsage(const ActionDescription &a) { const D3D11RenderState *pipe = m_CurrentPipelineState; - uint32_t e = d.eventId; + uint32_t e = a.eventId; - DrawFlags DrawMask = DrawFlags::Drawcall | DrawFlags::Dispatch | DrawFlags::CmdList; - if(!(d.flags & DrawMask)) + ActionFlags ActionMask = ActionFlags::Drawcall | ActionFlags::Dispatch | ActionFlags::CmdList; + if(!(a.flags & ActionMask)) return; - const bool isDispatch = bool(d.flags & DrawFlags::Dispatch); + const bool isDispatch = bool(a.flags & ActionFlags::Dispatch); ////////////////////////////// // IA - if(d.flags & DrawFlags::Indexed && pipe->IA.IndexBuffer != NULL) + if(a.flags & ActionFlags::Indexed && pipe->IA.IndexBuffer != NULL) m_ResourceUses[GetIDForDeviceChild(pipe->IA.IndexBuffer)].push_back( EventUsage(e, ResourceUsage::IndexBuffer)); @@ -1105,49 +1105,49 @@ void WrappedID3D11DeviceContext::AddUsage(const DrawcallDescription &d) } } -void WrappedID3D11DeviceContext::AddDrawcall(const DrawcallDescription &d) +void WrappedID3D11DeviceContext::AddAction(const ActionDescription &a) { if(m_CurEventID == 0) return; - DrawcallDescription draw = d; + ActionDescription action = a; - m_AddedDrawcall = true; + m_AddedAction = true; - draw.eventId = m_CurEventID; - draw.drawcallId = m_CurDrawcallID; + action.eventId = m_CurEventID; + action.actionId = m_CurActionID; for(int i = 0; i < D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT; i++) { - draw.outputs[i] = ResourceId(); + action.outputs[i] = ResourceId(); if(m_CurrentPipelineState->OM.RenderTargets[i]) - draw.outputs[i] = m_pDevice->GetResourceManager()->GetOriginalID( + action.outputs[i] = m_pDevice->GetResourceManager()->GetOriginalID( ((WrappedID3D11RenderTargetView1 *)m_CurrentPipelineState->OM.RenderTargets[i]) ->GetResourceResID()); } { - draw.depthOut = ResourceId(); + action.depthOut = ResourceId(); if(m_CurrentPipelineState->OM.DepthView) - draw.depthOut = m_pDevice->GetResourceManager()->GetOriginalID( + action.depthOut = m_pDevice->GetResourceManager()->GetOriginalID( ((WrappedID3D11DepthStencilView *)m_CurrentPipelineState->OM.DepthView)->GetResourceResID()); } - // markers don't increment drawcall ID - DrawFlags MarkerMask = DrawFlags::SetMarker | DrawFlags::PushMarker | DrawFlags::PopMarker; - if(!(draw.flags & MarkerMask)) - m_CurDrawcallID++; + // markers don't increment action ID + ActionFlags MarkerMask = ActionFlags::SetMarker | ActionFlags::PushMarker | ActionFlags::PopMarker; + if(!(action.flags & MarkerMask)) + m_CurActionID++; - draw.events.swap(m_CurEvents); + action.events.swap(m_CurEvents); - AddUsage(draw); + AddUsage(action); - // should have at least the root drawcall here, push this drawcall + // should have at least the root action here, push this action // onto the back's children list. - if(!m_DrawcallStack.empty()) - m_DrawcallStack.back()->children.push_back(draw); + if(!m_ActionStack.empty()) + m_ActionStack.back()->children.push_back(action); else - RDCERR("Somehow lost drawcall stack!"); + RDCERR("Somehow lost action stack!"); } void WrappedID3D11DeviceContext::AddEvent() @@ -1302,7 +1302,7 @@ ReplayStatus WrappedID3D11DeviceContext::ReplayLog(CaptureState readType, uint32 if(IsLoading(m_State)) { - m_pDevice->GetReplay()->WriteFrameRecord().drawcallList = m_ParentDrawcall.children; + m_pDevice->GetReplay()->WriteFrameRecord().actionList = m_ParentAction.children; m_pDevice->GetReplay()->WriteFrameRecord().frameInfo.debugMessages = m_pDevice->GetDebugMessages(); @@ -1321,7 +1321,7 @@ ReplayStatus WrappedID3D11DeviceContext::ReplayLog(CaptureState readType, uint32 m_ResourceUses[it->first]; // it's easier to remove duplicate usages here than check it as we go. - // this means if textures are bound in multiple places in the same draw + // this means if textures are bound in multiple places in the same action // we don't have duplicate uses for(auto it = m_ResourceUses.begin(); it != m_ResourceUses.end(); ++it) { diff --git a/renderdoc/driver/d3d11/d3d11_context.h b/renderdoc/driver/d3d11/d3d11_context.h index 12ec3be6e..c7a330c7c 100644 --- a/renderdoc/driver/d3d11/d3d11_context.h +++ b/renderdoc/driver/d3d11/d3d11_context.h @@ -186,7 +186,7 @@ private: D3D11RenderState *m_DeferredSavedState; rdcarray m_CurEvents, m_Events; - bool m_AddedDrawcall; + bool m_AddedAction; WrappedID3DUserDefinedAnnotation m_UserAnnotation; int32_t m_MarkerIndentLevel; @@ -211,15 +211,15 @@ private: uint64_t m_CurChunkOffset; SDChunkMetaData m_ChunkMetadata; - uint32_t m_CurEventID, m_CurDrawcallID; + uint32_t m_CurEventID, m_CurActionID; D3D11Chunk m_LastChunk; ReplayStatus m_FailedReplayStatus = ReplayStatus::APIReplayFailed; - DrawcallDescription m_ParentDrawcall; - std::map m_CmdLists; + ActionDescription m_ParentAction; + std::map m_CmdLists; - rdcarray m_DrawcallStack; + rdcarray m_ActionStack; D3D11ResourceManager *GetResourceManager(); static rdcstr GetChunkName(uint32_t idx); @@ -229,10 +229,10 @@ private: void DrainAnnotationQueue(); - void AddUsage(const DrawcallDescription &d); + void AddUsage(const ActionDescription &a); void AddEvent(); - void AddDrawcall(const DrawcallDescription &d); + void AddAction(const ActionDescription &a); void RecordIndexBindStats(ID3D11Buffer *Buffer); void RecordVertexBindStats(UINT NumBuffers, ID3D11Buffer *const Buffers[]); @@ -321,7 +321,7 @@ public: uint32_t GetEventID() { return m_CurEventID; } const APIEvent &GetEvent(uint32_t eventId) const; - const DrawcallDescription &GetRootDraw() { return m_ParentDrawcall; } + const ActionDescription &GetRootDraw() { return m_ParentAction; } void ThreadSafe_SetMarker(uint32_t col, const wchar_t *name); int ThreadSafe_BeginEvent(uint32_t col, const wchar_t *name); int ThreadSafe_EndEvent(); diff --git a/renderdoc/driver/d3d11/d3d11_context1_wrap.cpp b/renderdoc/driver/d3d11/d3d11_context1_wrap.cpp index f985205c4..db2661e47 100644 --- a/renderdoc/driver/d3d11/d3d11_context1_wrap.cpp +++ b/renderdoc/driver/d3d11/d3d11_context1_wrap.cpp @@ -454,17 +454,17 @@ bool WrappedID3D11DeviceContext::Serialise_CopySubresourceRegion1( AddEvent(); - DrawcallDescription draw; - draw.flags |= DrawFlags::Copy; + ActionDescription action; + action.flags |= ActionFlags::Copy; if(pDstResource && pSrcResource) { - draw.copySource = srcOrigID; - draw.copySourceSubresource = + action.copySource = srcOrigID; + action.copySourceSubresource = Subresource(GetMipForSubresource(pSrcResource, SrcSubresource), GetSliceForSubresource(pSrcResource, SrcSubresource)); - draw.copyDestination = dstOrigID; - draw.copyDestinationSubresource = + action.copyDestination = dstOrigID; + action.copyDestinationSubresource = Subresource(GetMipForSubresource(pDstResource, DstSubresource), GetSliceForSubresource(pDstResource, DstSubresource)); @@ -482,7 +482,7 @@ bool WrappedID3D11DeviceContext::Serialise_CopySubresourceRegion1( } } - AddDrawcall(draw); + AddAction(action); } } @@ -561,9 +561,9 @@ bool WrappedID3D11DeviceContext::Serialise_ClearView(SerialiserType &ser, ID3D11 // add this event AddEvent(); - DrawcallDescription draw; + ActionDescription action; - draw.flags |= DrawFlags::Clear; + action.flags |= ActionFlags::Clear; ResourceId resid = GetViewResourceResID(pView); @@ -571,14 +571,14 @@ bool WrappedID3D11DeviceContext::Serialise_ClearView(SerialiserType &ser, ID3D11 { m_ResourceUses[resid].push_back( EventUsage(m_CurEventID, ResourceUsage::Clear, GetIDForDeviceChild(pView))); - draw.copyDestination = GetResourceManager()->GetOriginalID(resid); - draw.copyDestinationSubresource = Subresource(); + action.copyDestination = GetResourceManager()->GetOriginalID(resid); + action.copyDestinationSubresource = Subresource(); const ResourceRange &range = GetResourceRange(pView); - draw.copyDestinationSubresource = Subresource(range.GetMinMip(), range.GetMinSlice()); + action.copyDestinationSubresource = Subresource(range.GetMinMip(), range.GetMinSlice()); } - AddDrawcall(draw); + AddAction(action); } } @@ -636,7 +636,7 @@ void WrappedID3D11DeviceContext::ClearView(ID3D11View *pView, const FLOAT Color[ if(IsActiveCapturing(m_State)) { USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D11Chunk::ClearView); SERIALISE_ELEMENT(m_ResourceID).Named("Context"_lit).TypedAs("ID3D11DeviceContext *"_lit); Serialise_ClearView(ser, pView, Color, pRect, NumRects); @@ -1738,14 +1738,14 @@ bool WrappedID3D11DeviceContext::Serialise_DiscardResource(SerialiserType &ser, AddEvent(); - DrawcallDescription draw; + ActionDescription action; - draw.name = StringFormat::Fmt("DiscardResource(%s)", ToStr(dstOrigID).c_str()); - draw.flags |= DrawFlags::Clear; - draw.copyDestination = dstOrigID; - draw.copyDestinationSubresource = Subresource(); + action.name = StringFormat::Fmt("DiscardResource(%s)", ToStr(dstOrigID).c_str()); + action.flags |= ActionFlags::Clear; + action.copyDestination = dstOrigID; + action.copyDestinationSubresource = Subresource(); - AddDrawcall(draw); + AddAction(action); if(pResource) m_ResourceUses[dstLiveID].push_back(EventUsage(m_CurEventID, ResourceUsage::Discard)); @@ -1780,7 +1780,7 @@ void WrappedID3D11DeviceContext::DiscardResource(ID3D11Resource *pResource) if(IsActiveCapturing(m_State)) { USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D11Chunk::DiscardResource); SERIALISE_ELEMENT(m_ResourceID).Named("Context"_lit).TypedAs("ID3D11DeviceContext *"_lit); Serialise_DiscardResource(ser, pResource); @@ -1825,23 +1825,23 @@ bool WrappedID3D11DeviceContext::Serialise_DiscardView(SerialiserType &ser, ID3D { AddEvent(); - DrawcallDescription draw; + ActionDescription action; - draw.flags |= DrawFlags::Clear; - draw.copyDestinationSubresource = Subresource(); + action.flags |= ActionFlags::Clear; + action.copyDestinationSubresource = Subresource(); if(pResourceView) { const ResourceRange &range = GetResourceRange(pResourceView); ResourceId resid = GetViewResourceResID(pResourceView); - draw.copyDestination = m_pDevice->GetResourceManager()->GetOriginalID(resid); - draw.copyDestinationSubresource = Subresource(range.GetMinMip(), range.GetMinSlice()); + action.copyDestination = m_pDevice->GetResourceManager()->GetOriginalID(resid); + action.copyDestinationSubresource = Subresource(range.GetMinMip(), range.GetMinSlice()); m_ResourceUses[resid].push_back( EventUsage(m_CurEventID, ResourceUsage::Discard, GetIDForDeviceChild(pResourceView))); } - draw.name = StringFormat::Fmt("DiscardView(%s)", ToStr(draw.copyDestination).c_str()); + action.name = StringFormat::Fmt("DiscardView(%s)", ToStr(action.copyDestination).c_str()); - AddDrawcall(draw); + AddAction(action); } } @@ -1898,7 +1898,7 @@ void WrappedID3D11DeviceContext::DiscardView(ID3D11View *pResourceView) if(IsActiveCapturing(m_State)) { USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D11Chunk::DiscardView); SERIALISE_ELEMENT(m_ResourceID).Named("Context"_lit).TypedAs("ID3D11DeviceContext *"_lit); Serialise_DiscardView(ser, pResourceView); @@ -1962,23 +1962,23 @@ bool WrappedID3D11DeviceContext::Serialise_DiscardView1(SerialiserType &ser, { AddEvent(); - DrawcallDescription draw; + ActionDescription action; - draw.flags |= DrawFlags::Clear; + action.flags |= ActionFlags::Clear; if(pResourceView) { const ResourceRange &range = GetResourceRange(pResourceView); ResourceId resid = GetViewResourceResID(pResourceView); - draw.copyDestination = m_pDevice->GetResourceManager()->GetOriginalID(resid); - draw.copyDestinationSubresource = Subresource(range.GetMinMip(), range.GetMinSlice()); + action.copyDestination = m_pDevice->GetResourceManager()->GetOriginalID(resid); + action.copyDestinationSubresource = Subresource(range.GetMinMip(), range.GetMinSlice()); m_ResourceUses[resid].push_back( EventUsage(m_CurEventID, ResourceUsage::Discard, GetIDForDeviceChild(pResourceView))); } - draw.name = StringFormat::Fmt("DiscardView1(%s)", ToStr(draw.copyDestination).c_str()); + action.name = StringFormat::Fmt("DiscardView1(%s)", ToStr(action.copyDestination).c_str()); - AddDrawcall(draw); + AddAction(action); } } @@ -2036,7 +2036,7 @@ void WrappedID3D11DeviceContext::DiscardView1(ID3D11View *pResourceView, const D if(IsActiveCapturing(m_State)) { USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D11Chunk::DiscardView1); SERIALISE_ELEMENT(m_ResourceID).Named("Context"_lit).TypedAs("ID3D11DeviceContext *"_lit); Serialise_DiscardView1(ser, pResourceView, pRects, NumRects); diff --git a/renderdoc/driver/d3d11/d3d11_context_wrap.cpp b/renderdoc/driver/d3d11/d3d11_context_wrap.cpp index b6620cfbd..17c679413 100644 --- a/renderdoc/driver/d3d11/d3d11_context_wrap.cpp +++ b/renderdoc/driver/d3d11/d3d11_context_wrap.cpp @@ -55,22 +55,22 @@ bool WrappedID3D11DeviceContext::Serialise_SetMarker(SerialiserType &ser, uint32 if(IsLoading(m_State)) { - DrawcallDescription draw; - draw.name = MarkerName; - draw.flags |= DrawFlags::SetMarker; + ActionDescription action; + action.name = MarkerName; + action.flags |= ActionFlags::SetMarker; byte alpha = (Color >> 24) & 0xff; byte red = (Color >> 16) & 0xff; byte green = (Color >> 8) & 0xff; byte blue = (Color >> 0) & 0xff; - draw.markerColor.x = float(red) / 255.0f; - draw.markerColor.y = float(green) / 255.0f; - draw.markerColor.z = float(blue) / 255.0f; - draw.markerColor.w = float(alpha) / 255.0f; + action.markerColor.x = float(red) / 255.0f; + action.markerColor.y = float(green) / 255.0f; + action.markerColor.z = float(blue) / 255.0f; + action.markerColor.w = float(alpha) / 255.0f; AddEvent(); - AddDrawcall(draw); + AddAction(action); } } @@ -93,22 +93,22 @@ bool WrappedID3D11DeviceContext::Serialise_PushMarker(SerialiserType &ser, uint3 if(IsLoading(m_State)) { - DrawcallDescription draw; - draw.name = MarkerName; - draw.flags |= DrawFlags::PushMarker; + ActionDescription action; + action.name = MarkerName; + action.flags |= ActionFlags::PushMarker; byte alpha = (Color >> 24) & 0xff; byte red = (Color >> 16) & 0xff; byte green = (Color >> 8) & 0xff; byte blue = (Color >> 0) & 0xff; - draw.markerColor.x = float(red) / 255.0f; - draw.markerColor.y = float(green) / 255.0f; - draw.markerColor.z = float(blue) / 255.0f; - draw.markerColor.w = float(alpha) / 255.0f; + action.markerColor.x = float(red) / 255.0f; + action.markerColor.y = float(green) / 255.0f; + action.markerColor.z = float(blue) / 255.0f; + action.markerColor.w = float(alpha) / 255.0f; AddEvent(); - AddDrawcall(draw); + AddAction(action); } } @@ -125,11 +125,11 @@ bool WrappedID3D11DeviceContext::Serialise_PopMarker(SerialiserType &ser) if(IsLoading(m_State)) { - DrawcallDescription draw; - draw.flags |= DrawFlags::PopMarker; + ActionDescription action; + action.flags |= ActionFlags::PopMarker; AddEvent(); - AddDrawcall(draw); + AddAction(action); } } @@ -143,7 +143,7 @@ void WrappedID3D11DeviceContext::SetMarker(uint32_t Color, const wchar_t *Marker if(IsActiveCapturing(m_State)) { USE_SCRATCH_SERIALISER(); - GET_SERIALISER.SetDrawChunk(); + GET_SERIALISER.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D11Chunk::SetMarker); SERIALISE_ELEMENT(m_ResourceID).Named("Context"_lit).TypedAs("ID3D11DeviceContext *"_lit); Serialise_SetMarker(GET_SERIALISER, Color, MarkerName); @@ -159,7 +159,7 @@ int WrappedID3D11DeviceContext::PushMarker(uint32_t Color, const wchar_t *Marker if(IsActiveCapturing(m_State)) { USE_SCRATCH_SERIALISER(); - GET_SERIALISER.SetDrawChunk(); + GET_SERIALISER.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D11Chunk::PushMarker); SERIALISE_ELEMENT(m_ResourceID).Named("Context"_lit).TypedAs("ID3D11DeviceContext *"_lit); Serialise_PushMarker(GET_SERIALISER, Color, MarkerName); @@ -177,7 +177,7 @@ int WrappedID3D11DeviceContext::PopMarker() if(IsActiveCapturing(m_State)) { USE_SCRATCH_SERIALISER(); - GET_SERIALISER.SetDrawChunk(); + GET_SERIALISER.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D11Chunk::PopMarker); SERIALISE_ELEMENT(m_ResourceID).Named("Context"_lit).TypedAs("ID3D11DeviceContext *"_lit); Serialise_PopMarker(GET_SERIALISER); @@ -3826,16 +3826,16 @@ bool WrappedID3D11DeviceContext::Serialise_DrawIndexedInstanced( AddEvent(); - DrawcallDescription draw; - draw.numIndices = IndexCountPerInstance; - draw.numInstances = InstanceCount; - draw.indexOffset = StartIndexLocation; - draw.baseVertex = BaseVertexLocation; - draw.instanceOffset = StartInstanceLocation; + ActionDescription action; + action.numIndices = IndexCountPerInstance; + action.numInstances = InstanceCount; + action.indexOffset = StartIndexLocation; + action.baseVertex = BaseVertexLocation; + action.instanceOffset = StartInstanceLocation; - draw.flags |= DrawFlags::Drawcall | DrawFlags::Instanced | DrawFlags::Indexed; + action.flags |= ActionFlags::Drawcall | ActionFlags::Instanced | ActionFlags::Indexed; - AddDrawcall(draw); + AddAction(action); } } @@ -3861,7 +3861,7 @@ void WrappedID3D11DeviceContext::DrawIndexedInstanced(UINT IndexCountPerInstance if(IsActiveCapturing(m_State)) { USE_SCRATCH_SERIALISER(); - GET_SERIALISER.SetDrawChunk(); + GET_SERIALISER.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D11Chunk::DrawIndexedInstanced); SERIALISE_ELEMENT(m_ResourceID).Named("Context"_lit).TypedAs("ID3D11DeviceContext *"_lit); Serialise_DrawIndexedInstanced(GET_SERIALISER, IndexCountPerInstance, InstanceCount, @@ -3899,15 +3899,15 @@ bool WrappedID3D11DeviceContext::Serialise_DrawInstanced(SerialiserType &ser, AddEvent(); - DrawcallDescription draw; - draw.numIndices = VertexCountPerInstance; - draw.numInstances = InstanceCount; - draw.vertexOffset = StartVertexLocation; - draw.instanceOffset = StartInstanceLocation; + ActionDescription action; + action.numIndices = VertexCountPerInstance; + action.numInstances = InstanceCount; + action.vertexOffset = StartVertexLocation; + action.instanceOffset = StartInstanceLocation; - draw.flags |= DrawFlags::Drawcall | DrawFlags::Instanced; + action.flags |= ActionFlags::Drawcall | ActionFlags::Instanced; - AddDrawcall(draw); + AddAction(action); } } @@ -3931,7 +3931,7 @@ void WrappedID3D11DeviceContext::DrawInstanced(UINT VertexCountPerInstance, UINT if(IsActiveCapturing(m_State)) { USE_SCRATCH_SERIALISER(); - GET_SERIALISER.SetDrawChunk(); + GET_SERIALISER.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D11Chunk::DrawInstanced); SERIALISE_ELEMENT(m_ResourceID).Named("Context"_lit).TypedAs("ID3D11DeviceContext *"_lit); Serialise_DrawInstanced(GET_SERIALISER, VertexCountPerInstance, InstanceCount, @@ -3966,14 +3966,14 @@ bool WrappedID3D11DeviceContext::Serialise_DrawIndexed(SerialiserType &ser, UINT AddEvent(); - DrawcallDescription draw; - draw.numIndices = IndexCount; - draw.baseVertex = BaseVertexLocation; - draw.indexOffset = StartIndexLocation; + ActionDescription action; + action.numIndices = IndexCount; + action.baseVertex = BaseVertexLocation; + action.indexOffset = StartIndexLocation; - draw.flags |= DrawFlags::Drawcall | DrawFlags::Indexed; + action.flags |= ActionFlags::Drawcall | ActionFlags::Indexed; - AddDrawcall(draw); + AddAction(action); } } @@ -3996,7 +3996,7 @@ void WrappedID3D11DeviceContext::DrawIndexed(UINT IndexCount, UINT StartIndexLoc if(IsActiveCapturing(m_State)) { USE_SCRATCH_SERIALISER(); - GET_SERIALISER.SetDrawChunk(); + GET_SERIALISER.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D11Chunk::DrawIndexed); SERIALISE_ELEMENT(m_ResourceID).Named("Context"_lit).TypedAs("ID3D11DeviceContext *"_lit); Serialise_DrawIndexed(GET_SERIALISER, IndexCount, StartIndexLocation, BaseVertexLocation); @@ -4028,13 +4028,13 @@ bool WrappedID3D11DeviceContext::Serialise_Draw(SerialiserType &ser, UINT Vertex AddEvent(); - DrawcallDescription draw; - draw.numIndices = VertexCount; - draw.vertexOffset = StartVertexLocation; + ActionDescription action; + action.numIndices = VertexCount; + action.vertexOffset = StartVertexLocation; - draw.flags |= DrawFlags::Drawcall; + action.flags |= ActionFlags::Drawcall; - AddDrawcall(draw); + AddAction(action); } } @@ -4056,7 +4056,7 @@ void WrappedID3D11DeviceContext::Draw(UINT VertexCount, UINT StartVertexLocation if(IsActiveCapturing(m_State)) { USE_SCRATCH_SERIALISER(); - GET_SERIALISER.SetDrawChunk(); + GET_SERIALISER.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D11Chunk::Draw); SERIALISE_ELEMENT(m_ResourceID).Named("Context"_lit).TypedAs("ID3D11DeviceContext *"_lit); Serialise_Draw(GET_SERIALISER, VertexCount, StartVertexLocation); @@ -4138,16 +4138,16 @@ bool WrappedID3D11DeviceContext::Serialise_DrawAuto(SerialiserType &ser) AddEvent(); - DrawcallDescription draw; - draw.name = StringFormat::Fmt("DrawAuto(<%u>)", numVerts); - draw.flags |= DrawFlags::Drawcall | DrawFlags::Auto; - draw.numIndices = (uint32_t)numVerts; - draw.vertexOffset = 0; - draw.indexOffset = 0; - draw.instanceOffset = 0; - draw.numInstances = 1; + ActionDescription action; + action.name = StringFormat::Fmt("DrawAuto(<%u>)", numVerts); + action.flags |= ActionFlags::Drawcall | ActionFlags::Auto; + action.numIndices = (uint32_t)numVerts; + action.vertexOffset = 0; + action.indexOffset = 0; + action.instanceOffset = 0; + action.numInstances = 1; - AddDrawcall(draw); + AddAction(action); } } @@ -4169,7 +4169,7 @@ void WrappedID3D11DeviceContext::DrawAuto() if(IsActiveCapturing(m_State)) { USE_SCRATCH_SERIALISER(); - GET_SERIALISER.SetDrawChunk(); + GET_SERIALISER.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D11Chunk::DrawAuto); SERIALISE_ELEMENT(m_ResourceID).Named("Context"_lit).TypedAs("ID3D11DeviceContext *"_lit); Serialise_DrawAuto(GET_SERIALISER); @@ -4204,7 +4204,7 @@ bool WrappedID3D11DeviceContext::Serialise_DrawIndexedInstancedIndirect(Serialis { AddEvent(); - DrawcallDescription draw; + ActionDescription action; rdcstr name; @@ -4227,16 +4227,16 @@ bool WrappedID3D11DeviceContext::Serialise_DrawIndexedInstancedIndirect(Serialis { DrawArgs *args = (DrawArgs *)&argarray[0]; - draw.numIndices = args->IndexCountPerInstance; - draw.numInstances = args->InstanceCount; - draw.indexOffset = args->StartIndexLocation; - draw.baseVertex = args->BaseVertexLocation; - draw.instanceOffset = args->StartInstanceLocation; + action.numIndices = args->IndexCountPerInstance; + action.numInstances = args->InstanceCount; + action.indexOffset = args->StartIndexLocation; + action.baseVertex = args->BaseVertexLocation; + action.instanceOffset = args->StartInstanceLocation; - RecordDrawStats(true, true, draw.numInstances); + RecordDrawStats(true, true, action.numInstances); - name = StringFormat::Fmt("DrawIndexedInstancedIndirect(<%u, %u>)", draw.numIndices, - draw.numInstances); + name = StringFormat::Fmt("DrawIndexedInstancedIndirect(<%u, %u>)", action.numIndices, + action.numInstances); } else { @@ -4268,12 +4268,12 @@ bool WrappedID3D11DeviceContext::Serialise_DrawIndexedInstancedIndirect(Serialis EventUsage(m_CurEventID, ResourceUsage::Indirect)); } - draw.name = name; + action.name = name; - draw.flags |= - DrawFlags::Drawcall | DrawFlags::Instanced | DrawFlags::Indexed | DrawFlags::Indirect; + action.flags |= ActionFlags::Drawcall | ActionFlags::Instanced | ActionFlags::Indexed | + ActionFlags::Indirect; - AddDrawcall(draw); + AddAction(action); } } @@ -4297,7 +4297,7 @@ void WrappedID3D11DeviceContext::DrawIndexedInstancedIndirect(ID3D11Buffer *pBuf if(IsActiveCapturing(m_State)) { USE_SCRATCH_SERIALISER(); - GET_SERIALISER.SetDrawChunk(); + GET_SERIALISER.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D11Chunk::DrawIndexedInstancedIndirect); SERIALISE_ELEMENT(m_ResourceID).Named("Context"_lit).TypedAs("ID3D11DeviceContext *"_lit); Serialise_DrawIndexedInstancedIndirect(GET_SERIALISER, pBufferForArgs, AlignedByteOffsetForArgs); @@ -4335,7 +4335,7 @@ bool WrappedID3D11DeviceContext::Serialise_DrawInstancedIndirect(SerialiserType { AddEvent(); - DrawcallDescription draw; + ActionDescription action; rdcstr name; @@ -4357,15 +4357,15 @@ bool WrappedID3D11DeviceContext::Serialise_DrawInstancedIndirect(SerialiserType { DrawArgs *args = (DrawArgs *)&argarray[0]; - draw.numIndices = args->VertexCountPerInstance; - draw.numInstances = args->InstanceCount; - draw.vertexOffset = args->StartVertexLocation; - draw.instanceOffset = args->StartInstanceLocation; + action.numIndices = args->VertexCountPerInstance; + action.numInstances = args->InstanceCount; + action.vertexOffset = args->StartVertexLocation; + action.instanceOffset = args->StartInstanceLocation; - RecordDrawStats(true, true, draw.numInstances); + RecordDrawStats(true, true, action.numInstances); - name = StringFormat::Fmt("DrawInstancedIndirect(<%u, %u>)", draw.numIndices, - draw.numInstances); + name = StringFormat::Fmt("DrawInstancedIndirect(<%u, %u>)", action.numIndices, + action.numInstances); } else { @@ -4397,11 +4397,11 @@ bool WrappedID3D11DeviceContext::Serialise_DrawInstancedIndirect(SerialiserType EventUsage(m_CurEventID, ResourceUsage::Indirect)); } - draw.name = name; + action.name = name; - draw.flags |= DrawFlags::Drawcall | DrawFlags::Instanced | DrawFlags::Indirect; + action.flags |= ActionFlags::Drawcall | ActionFlags::Instanced | ActionFlags::Indirect; - AddDrawcall(draw); + AddAction(action); } } @@ -4425,7 +4425,7 @@ void WrappedID3D11DeviceContext::DrawInstancedIndirect(ID3D11Buffer *pBufferForA if(IsActiveCapturing(m_State)) { USE_SCRATCH_SERIALISER(); - GET_SERIALISER.SetDrawChunk(); + GET_SERIALISER.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D11Chunk::DrawInstancedIndirect); SERIALISE_ELEMENT(m_ResourceID).Named("Context"_lit).TypedAs("ID3D11DeviceContext *"_lit); Serialise_DrawInstancedIndirect(GET_SERIALISER, pBufferForArgs, AlignedByteOffsetForArgs); @@ -4961,12 +4961,12 @@ bool WrappedID3D11DeviceContext::Serialise_Dispatch(SerialiserType &ser, UINT Th AddEvent(); - DrawcallDescription draw; - draw.flags |= DrawFlags::Dispatch; + ActionDescription action; + action.flags |= ActionFlags::Dispatch; - draw.dispatchDimension[0] = ThreadGroupCountX; - draw.dispatchDimension[1] = ThreadGroupCountY; - draw.dispatchDimension[2] = ThreadGroupCountZ; + action.dispatchDimension[0] = ThreadGroupCountX; + action.dispatchDimension[1] = ThreadGroupCountY; + action.dispatchDimension[2] = ThreadGroupCountZ; if(ThreadGroupCountX == 0) m_pDevice->AddDebugMessage( @@ -4984,7 +4984,7 @@ bool WrappedID3D11DeviceContext::Serialise_Dispatch(SerialiserType &ser, UINT Th "Dispatch call has ThreadGroup count Z=0. This will do nothing, " "which is unusual for a non-indirect Dispatch. Did you mean Z=1?"); - AddDrawcall(draw); + AddAction(action); } } @@ -5008,7 +5008,7 @@ void WrappedID3D11DeviceContext::Dispatch(UINT ThreadGroupCountX, UINT ThreadGro if(IsActiveCapturing(m_State)) { USE_SCRATCH_SERIALISER(); - GET_SERIALISER.SetDrawChunk(); + GET_SERIALISER.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D11Chunk::Dispatch); SERIALISE_ELEMENT(m_ResourceID).Named("Context"_lit).TypedAs("ID3D11DeviceContext *"_lit); Serialise_Dispatch(GET_SERIALISER, ThreadGroupCountX, ThreadGroupCountY, ThreadGroupCountZ); @@ -5045,7 +5045,7 @@ bool WrappedID3D11DeviceContext::Serialise_DispatchIndirect(SerialiserType &ser, AddEvent(); - DrawcallDescription draw; + ActionDescription action; rdcstr name; if(pBufferForArgs) @@ -5065,9 +5065,9 @@ bool WrappedID3D11DeviceContext::Serialise_DispatchIndirect(SerialiserType &ser, { DispatchArgs *args = (DispatchArgs *)&argarray[0]; - draw.dispatchDimension[0] = args->ThreadGroupCountX; - draw.dispatchDimension[1] = args->ThreadGroupCountY; - draw.dispatchDimension[2] = args->ThreadGroupCountZ; + action.dispatchDimension[0] = args->ThreadGroupCountX; + action.dispatchDimension[1] = args->ThreadGroupCountY; + action.dispatchDimension[2] = args->ThreadGroupCountZ; name = StringFormat::Fmt("DispatchIndirect(<%u, %u, %u>)", args->ThreadGroupCountX, args->ThreadGroupCountY, args->ThreadGroupCountZ); @@ -5102,10 +5102,10 @@ bool WrappedID3D11DeviceContext::Serialise_DispatchIndirect(SerialiserType &ser, EventUsage(m_CurEventID, ResourceUsage::Indirect)); } - draw.name = name; - draw.flags |= DrawFlags::Dispatch | DrawFlags::Indirect; + action.name = name; + action.flags |= ActionFlags::Dispatch | ActionFlags::Indirect; - AddDrawcall(draw); + AddAction(action); } } @@ -5129,7 +5129,7 @@ void WrappedID3D11DeviceContext::DispatchIndirect(ID3D11Buffer *pBufferForArgs, if(IsActiveCapturing(m_State)) { USE_SCRATCH_SERIALISER(); - GET_SERIALISER.SetDrawChunk(); + GET_SERIALISER.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D11Chunk::DispatchIndirect); SERIALISE_ELEMENT(m_ResourceID).Named("Context"_lit).TypedAs("ID3D11DeviceContext *"_lit); Serialise_DispatchIndirect(GET_SERIALISER, pBufferForArgs, AlignedByteOffsetForArgs); @@ -5181,10 +5181,10 @@ bool WrappedID3D11DeviceContext::Serialise_ExecuteCommandList(SerialiserType &se { AddEvent(); - DrawcallDescription draw; - draw.flags |= DrawFlags::CmdList; + ActionDescription action; + action.flags |= ActionFlags::CmdList; - AddDrawcall(draw); + AddAction(action); } } @@ -5244,7 +5244,7 @@ void WrappedID3D11DeviceContext::ExecuteCommandList(ID3D11CommandList *pCommandL { { USE_SCRATCH_SERIALISER(); - GET_SERIALISER.SetDrawChunk(); + GET_SERIALISER.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D11Chunk::ExecuteCommandList); SERIALISE_ELEMENT(m_ResourceID).Named("Context"_lit).TypedAs("ID3D11DeviceContext *"_lit); Serialise_ExecuteCommandList(GET_SERIALISER, pCommandList, RestoreContextState); @@ -5317,10 +5317,10 @@ bool WrappedID3D11DeviceContext::Serialise_FinishCommandList(SerialiserType &ser { AddEvent(); - DrawcallDescription draw; - draw.flags |= DrawFlags::CmdList; + ActionDescription action; + action.flags |= ActionFlags::CmdList; - AddDrawcall(draw); + AddAction(action); m_pDevice->AddResource(pCommandList, ResourceType::CommandBuffer, "Command List"); @@ -5413,7 +5413,7 @@ HRESULT WrappedID3D11DeviceContext::FinishCommandList(BOOL RestoreDeferredContex // serialise the finish marker { USE_SCRATCH_SERIALISER(); - GET_SERIALISER.SetDrawChunk(); + GET_SERIALISER.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D11Chunk::FinishCommandList); SERIALISE_ELEMENT(m_ResourceID).Named("Context"_lit).TypedAs("ID3D11DeviceContext *"_lit); Serialise_FinishCommandList(GET_SERIALISER, RestoreDeferredContextState, &w); @@ -5588,18 +5588,18 @@ bool WrappedID3D11DeviceContext::Serialise_CopySubresourceRegion( AddEvent(); - DrawcallDescription draw; - draw.flags |= DrawFlags::Copy; + ActionDescription action; + action.flags |= ActionFlags::Copy; if(pDstResource && pSrcResource) { - draw.copySource = srcOrigID; - draw.copySourceSubresource = + action.copySource = srcOrigID; + action.copySourceSubresource = Subresource(GetMipForSubresource(pSrcResource, SrcSubresource), GetSliceForSubresource(pSrcResource, SrcSubresource)); - draw.copyDestination = dstOrigID; - draw.copyDestinationSubresource = + action.copyDestination = dstOrigID; + action.copyDestinationSubresource = Subresource(GetMipForSubresource(pDstResource, DstSubresource), GetSliceForSubresource(pDstResource, DstSubresource)); @@ -5617,7 +5617,7 @@ bool WrappedID3D11DeviceContext::Serialise_CopySubresourceRegion( } } - AddDrawcall(draw); + AddAction(action); } } @@ -5642,7 +5642,7 @@ void WrappedID3D11DeviceContext::CopySubresourceRegion(ID3D11Resource *pDstResou if(IsActiveCapturing(m_State)) { USE_SCRATCH_SERIALISER(); - GET_SERIALISER.SetDrawChunk(); + GET_SERIALISER.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D11Chunk::CopySubresourceRegion); SERIALISE_ELEMENT(m_ResourceID).Named("Context"_lit).TypedAs("ID3D11DeviceContext *"_lit); Serialise_CopySubresourceRegion(GET_SERIALISER, pDstResource, DstSubresource, DstX, DstY, DstZ, @@ -5745,15 +5745,15 @@ bool WrappedID3D11DeviceContext::Serialise_CopyResource(SerialiserType &ser, AddEvent(); - DrawcallDescription draw; - draw.flags |= DrawFlags::Copy; + ActionDescription action; + action.flags |= ActionFlags::Copy; if(pDstResource && pSrcResource) { - draw.copySource = srcOrigID; - draw.copySourceSubresource = Subresource(); - draw.copyDestination = dstOrigID; - draw.copyDestinationSubresource = Subresource(); + action.copySource = srcOrigID; + action.copySourceSubresource = Subresource(); + action.copyDestination = dstOrigID; + action.copyDestinationSubresource = Subresource(); if(m_CurEventID) { @@ -5769,7 +5769,7 @@ bool WrappedID3D11DeviceContext::Serialise_CopyResource(SerialiserType &ser, } } - AddDrawcall(draw); + AddAction(action); } } @@ -5791,7 +5791,7 @@ void WrappedID3D11DeviceContext::CopyResource(ID3D11Resource *pDstResource, if(IsActiveCapturing(m_State)) { USE_SCRATCH_SERIALISER(); - GET_SERIALISER.SetDrawChunk(); + GET_SERIALISER.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D11Chunk::CopyResource); SERIALISE_ELEMENT(m_ResourceID).Named("Context"_lit).TypedAs("ID3D11DeviceContext *"_lit); Serialise_CopyResource(GET_SERIALISER, pDstResource, pSrcResource); @@ -6185,12 +6185,12 @@ bool WrappedID3D11DeviceContext::Serialise_CopyStructureCount(SerialiserType &se AddEvent(); - DrawcallDescription draw; - draw.flags |= DrawFlags::Copy; - draw.copySource = srcOrigID; - draw.copySourceSubresource = Subresource(); - draw.copyDestination = dstOrigID; - draw.copyDestinationSubresource = Subresource(); + ActionDescription action; + action.flags |= ActionFlags::Copy; + action.copySource = srcOrigID; + action.copySourceSubresource = Subresource(); + action.copyDestination = dstOrigID; + action.copyDestinationSubresource = Subresource(); if(m_CurEventID) { @@ -6205,7 +6205,7 @@ bool WrappedID3D11DeviceContext::Serialise_CopyStructureCount(SerialiserType &se } } - AddDrawcall(draw); + AddAction(action); } } @@ -6229,7 +6229,7 @@ void WrappedID3D11DeviceContext::CopyStructureCount(ID3D11Buffer *pDstBuffer, if(IsActiveCapturing(m_State)) { USE_SCRATCH_SERIALISER(); - GET_SERIALISER.SetDrawChunk(); + GET_SERIALISER.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D11Chunk::CopyStructureCount); SERIALISE_ELEMENT(m_ResourceID).Named("Context"_lit).TypedAs("ID3D11DeviceContext *"_lit); Serialise_CopyStructureCount(GET_SERIALISER, pDstBuffer, DstAlignedByteOffset, pSrcView); @@ -6295,17 +6295,17 @@ bool WrappedID3D11DeviceContext::Serialise_ResolveSubresource(SerialiserType &se AddEvent(); - DrawcallDescription draw; - draw.flags |= DrawFlags::Resolve; + ActionDescription action; + action.flags |= ActionFlags::Resolve; if(pDstResource && pSrcResource) { - draw.copySource = srcOrigID; - draw.copySourceSubresource = + action.copySource = srcOrigID; + action.copySourceSubresource = Subresource(GetMipForSubresource(pSrcResource, SrcSubresource), GetSliceForSubresource(pSrcResource, SrcSubresource)); - draw.copyDestination = dstOrigID; - draw.copyDestinationSubresource = + action.copyDestination = dstOrigID; + action.copyDestinationSubresource = Subresource(GetMipForSubresource(pDstResource, DstSubresource), GetSliceForSubresource(pDstResource, DstSubresource)); @@ -6323,7 +6323,7 @@ bool WrappedID3D11DeviceContext::Serialise_ResolveSubresource(SerialiserType &se } } - AddDrawcall(draw); + AddAction(action); } } @@ -6347,7 +6347,7 @@ void WrappedID3D11DeviceContext::ResolveSubresource(ID3D11Resource *pDstResource if(IsActiveCapturing(m_State)) { USE_SCRATCH_SERIALISER(); - GET_SERIALISER.SetDrawChunk(); + GET_SERIALISER.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D11Chunk::ResolveSubresource); SERIALISE_ELEMENT(m_ResourceID).Named("Context"_lit).TypedAs("ID3D11DeviceContext *"_lit); Serialise_ResolveSubresource(GET_SERIALISER, pDstResource, DstSubresource, pSrcResource, @@ -6396,13 +6396,13 @@ bool WrappedID3D11DeviceContext::Serialise_GenerateMips(SerialiserType &ser, AddEvent(); - DrawcallDescription draw; - draw.name = + ActionDescription action; + action.name = "GenerateMips(" + ToStr(GetResourceManager()->GetOriginalID(GetIDForDeviceChild(pShaderResourceView))) + ")"; - draw.flags |= DrawFlags::GenMips; + action.flags |= ActionFlags::GenMips; - AddDrawcall(draw); + AddAction(action); } } @@ -6426,7 +6426,7 @@ void WrappedID3D11DeviceContext::GenerateMips(ID3D11ShaderResourceView *pShaderR if(IsActiveCapturing(m_State)) { USE_SCRATCH_SERIALISER(); - GET_SERIALISER.SetDrawChunk(); + GET_SERIALISER.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D11Chunk::GenerateMips); SERIALISE_ELEMENT(m_ResourceID).Named("Context"_lit).TypedAs("ID3D11DeviceContext *"_lit); Serialise_GenerateMips(GET_SERIALISER, pShaderResourceView); @@ -6492,7 +6492,7 @@ void WrappedID3D11DeviceContext::ClearState() if(IsActiveCapturing(m_State)) { USE_SCRATCH_SERIALISER(); - GET_SERIALISER.SetDrawChunk(); + GET_SERIALISER.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D11Chunk::ClearState); SERIALISE_ELEMENT(m_ResourceID).Named("Context"_lit).TypedAs("ID3D11DeviceContext *"_lit); Serialise_ClearState(GET_SERIALISER); @@ -6546,22 +6546,22 @@ bool WrappedID3D11DeviceContext::Serialise_ClearRenderTargetView( WrappedID3D11RenderTargetView1 *view = (WrappedID3D11RenderTargetView1 *)pRenderTargetView; - DrawcallDescription draw; - draw.flags |= DrawFlags::Clear | DrawFlags::ClearColor; + ActionDescription action; + action.flags |= ActionFlags::Clear | ActionFlags::ClearColor; if(view) { m_ResourceUses[view->GetResourceResID()].push_back( EventUsage(m_CurEventID, ResourceUsage::Clear, view->GetResourceID())); - draw.copyDestination = + action.copyDestination = m_pDevice->GetResourceManager()->GetOriginalID(view->GetResourceResID()); D3D11_RENDER_TARGET_VIEW_DESC viewDesc; view->GetDesc(&viewDesc); - draw.copyDestinationSubresource = + action.copyDestinationSubresource = Subresource(GetMipForRtv(viewDesc), GetSliceForRtv(viewDesc)); } - AddDrawcall(draw); + AddAction(action); } } @@ -6586,7 +6586,7 @@ void WrappedID3D11DeviceContext::ClearRenderTargetView(ID3D11RenderTargetView *p if(IsActiveCapturing(m_State)) { USE_SCRATCH_SERIALISER(); - GET_SERIALISER.SetDrawChunk(); + GET_SERIALISER.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D11Chunk::ClearRenderTargetView); SERIALISE_ELEMENT(m_ResourceID).Named("Context"_lit).TypedAs("ID3D11DeviceContext *"_lit); Serialise_ClearRenderTargetView(GET_SERIALISER, pRenderTargetView, ColorRGBA); @@ -6629,19 +6629,19 @@ bool WrappedID3D11DeviceContext::Serialise_ClearUnorderedAccessViewUint( WrappedID3D11UnorderedAccessView1 *view = (WrappedID3D11UnorderedAccessView1 *)pUnorderedAccessView; - DrawcallDescription draw; - draw.flags |= DrawFlags::Clear; + ActionDescription action; + action.flags |= ActionFlags::Clear; if(view) { m_ResourceUses[view->GetResourceResID()].push_back( EventUsage(m_CurEventID, ResourceUsage::Clear, view->GetResourceID())); - draw.copyDestination = + action.copyDestination = m_pDevice->GetResourceManager()->GetOriginalID(view->GetResourceResID()); - draw.copyDestinationSubresource = Subresource(); + action.copyDestinationSubresource = Subresource(); } - AddDrawcall(draw); + AddAction(action); } } @@ -6661,7 +6661,7 @@ void WrappedID3D11DeviceContext::ClearUnorderedAccessViewUint( if(IsActiveCapturing(m_State)) { USE_SCRATCH_SERIALISER(); - GET_SERIALISER.SetDrawChunk(); + GET_SERIALISER.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D11Chunk::ClearUnorderedAccessViewUint); SERIALISE_ELEMENT(m_ResourceID).Named("Context"_lit).TypedAs("ID3D11DeviceContext *"_lit); Serialise_ClearUnorderedAccessViewUint(GET_SERIALISER, pUnorderedAccessView, Values); @@ -6708,19 +6708,19 @@ bool WrappedID3D11DeviceContext::Serialise_ClearUnorderedAccessViewFloat( WrappedID3D11UnorderedAccessView1 *view = (WrappedID3D11UnorderedAccessView1 *)pUnorderedAccessView; - DrawcallDescription draw; - draw.flags |= DrawFlags::Clear; + ActionDescription action; + action.flags |= ActionFlags::Clear; if(view) { m_ResourceUses[view->GetResourceResID()].push_back( EventUsage(m_CurEventID, ResourceUsage::Clear, view->GetResourceID())); - draw.copyDestination = + action.copyDestination = m_pDevice->GetResourceManager()->GetOriginalID(view->GetResourceResID()); - draw.copyDestinationSubresource = Subresource(); + action.copyDestinationSubresource = Subresource(); } - AddDrawcall(draw); + AddAction(action); } } @@ -6740,7 +6740,7 @@ void WrappedID3D11DeviceContext::ClearUnorderedAccessViewFloat( if(IsActiveCapturing(m_State)) { USE_SCRATCH_SERIALISER(); - GET_SERIALISER.SetDrawChunk(); + GET_SERIALISER.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D11Chunk::ClearUnorderedAccessViewFloat); SERIALISE_ELEMENT(m_ResourceID).Named("Context"_lit).TypedAs("ID3D11DeviceContext *"_lit); Serialise_ClearUnorderedAccessViewFloat(GET_SERIALISER, pUnorderedAccessView, Values); @@ -6793,22 +6793,22 @@ bool WrappedID3D11DeviceContext::Serialise_ClearDepthStencilView( WrappedID3D11DepthStencilView *view = (WrappedID3D11DepthStencilView *)pDepthStencilView; - DrawcallDescription draw; - draw.flags |= DrawFlags::Clear | DrawFlags::ClearDepthStencil; + ActionDescription action; + action.flags |= ActionFlags::Clear | ActionFlags::ClearDepthStencil; if(view) { m_ResourceUses[view->GetResourceResID()].push_back( EventUsage(m_CurEventID, ResourceUsage::Clear, view->GetResourceID())); - draw.copyDestination = + action.copyDestination = m_pDevice->GetResourceManager()->GetOriginalID(view->GetResourceResID()); D3D11_DEPTH_STENCIL_VIEW_DESC viewDesc; view->GetDesc(&viewDesc); - draw.copyDestinationSubresource = + action.copyDestinationSubresource = Subresource(GetMipForDsv(viewDesc), GetSliceForDsv(viewDesc)); } - AddDrawcall(draw); + AddAction(action); } } @@ -6833,7 +6833,7 @@ void WrappedID3D11DeviceContext::ClearDepthStencilView(ID3D11DepthStencilView *p if(IsActiveCapturing(m_State)) { USE_SCRATCH_SERIALISER(); - GET_SERIALISER.SetDrawChunk(); + GET_SERIALISER.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D11Chunk::ClearDepthStencilView); SERIALISE_ELEMENT(m_ResourceID).Named("Context"_lit).TypedAs("ID3D11DeviceContext *"_lit); Serialise_ClearDepthStencilView(GET_SERIALISER, pDepthStencilView, ClearFlags, Depth, Stencil); diff --git a/renderdoc/driver/d3d11/d3d11_counters.cpp b/renderdoc/driver/d3d11/d3d11_counters.cpp index 757f3b92f..46aa9cfec 100644 --- a/renderdoc/driver/d3d11/d3d11_counters.cpp +++ b/renderdoc/driver/d3d11/d3d11_counters.cpp @@ -232,21 +232,21 @@ struct D3D11CounterContext rdcarray timers; }; -void D3D11Replay::FillTimers(D3D11CounterContext &ctx, const DrawcallDescription &drawnode) +void D3D11Replay::FillTimers(D3D11CounterContext &ctx, const ActionDescription &actionnode) { const D3D11_QUERY_DESC qtimedesc = {D3D11_QUERY_TIMESTAMP, 0}; const D3D11_QUERY_DESC qstatsdesc = {D3D11_QUERY_PIPELINE_STATISTICS, 0}; const D3D11_QUERY_DESC qoccldesc = {D3D11_QUERY_OCCLUSION, 0}; - if(drawnode.children.empty()) + if(actionnode.children.empty()) return; - for(size_t i = 0; i < drawnode.children.size(); i++) + for(size_t i = 0; i < actionnode.children.size(); i++) { - const DrawcallDescription &d = drawnode.children[i]; - FillTimers(ctx, drawnode.children[i]); + const ActionDescription &a = actionnode.children[i]; + FillTimers(ctx, actionnode.children[i]); - if(d.events.empty()) + if(a.events.empty()) continue; GPUTimer *timer = NULL; @@ -257,7 +257,7 @@ void D3D11Replay::FillTimers(D3D11CounterContext &ctx, const DrawcallDescription ctx.timers.push_back(GPUTimer()); timer = &ctx.timers.back(); - timer->eventId = d.eventId; + timer->eventId = a.eventId; timer->before = timer->after = timer->stats = timer->occlusion = NULL; hr = m_pDevice->GetReal()->CreateQuery(&qtimedesc, &timer->before); @@ -270,7 +270,7 @@ void D3D11Replay::FillTimers(D3D11CounterContext &ctx, const DrawcallDescription RDCASSERTEQUAL(hr, S_OK); } - m_pDevice->ReplayLog(ctx.eventStart, d.eventId, eReplay_WithoutDraw); + m_pDevice->ReplayLog(ctx.eventStart, a.eventId, eReplay_WithoutDraw); SerializeImmediateContext(); @@ -280,7 +280,7 @@ void D3D11Replay::FillTimers(D3D11CounterContext &ctx, const DrawcallDescription m_pImmediateContext->GetReal()->Begin(timer->occlusion); if(timer->before && timer->after) m_pImmediateContext->GetReal()->End(timer->before); - m_pDevice->ReplayLog(ctx.eventStart, d.eventId, eReplay_OnlyDraw); + m_pDevice->ReplayLog(ctx.eventStart, a.eventId, eReplay_OnlyDraw); if(timer->before && timer->after) m_pImmediateContext->GetReal()->End(timer->after); if(timer->occlusion) @@ -288,7 +288,7 @@ void D3D11Replay::FillTimers(D3D11CounterContext &ctx, const DrawcallDescription if(timer->stats) m_pImmediateContext->GetReal()->End(timer->stats); - ctx.eventStart = d.eventId + 1; + ctx.eventStart = a.eventId + 1; } } @@ -331,103 +331,103 @@ void D3D11Replay::SerializeImmediateContext() } void D3D11Replay::FillTimersAMD(uint32_t &eventStartID, uint32_t &sampleIndex, - rdcarray &eventIDs, const DrawcallDescription &drawnode) + rdcarray &eventIDs, const ActionDescription &actionnode) { - if(drawnode.children.empty()) + if(actionnode.children.empty()) return; - for(size_t i = 0; i < drawnode.children.size(); i++) + for(size_t i = 0; i < actionnode.children.size(); i++) { - const DrawcallDescription &d = drawnode.children[i]; + const ActionDescription &a = actionnode.children[i]; - FillTimersAMD(eventStartID, sampleIndex, eventIDs, drawnode.children[i]); + FillTimersAMD(eventStartID, sampleIndex, eventIDs, actionnode.children[i]); - if(d.events.empty()) + if(a.events.empty()) continue; - eventIDs.push_back(d.eventId); + eventIDs.push_back(a.eventId); - m_pDevice->ReplayLog(eventStartID, d.eventId, eReplay_WithoutDraw); + m_pDevice->ReplayLog(eventStartID, a.eventId, eReplay_WithoutDraw); SerializeImmediateContext(); m_pAMDCounters->BeginSample(sampleIndex); - m_pDevice->ReplayLog(eventStartID, d.eventId, eReplay_OnlyDraw); + m_pDevice->ReplayLog(eventStartID, a.eventId, eReplay_OnlyDraw); m_pAMDCounters->EndSample(); - eventStartID = d.eventId + 1; + eventStartID = a.eventId + 1; sampleIndex++; } } void D3D11Replay::FillTimersNV(uint32_t &eventStartID, uint32_t &sampleIndex, - rdcarray &eventIDs, const DrawcallDescription &drawnode) + rdcarray &eventIDs, const ActionDescription &actionnode) { - if(drawnode.children.empty()) + if(actionnode.children.empty()) return; - for(size_t i = 0; i < drawnode.children.size(); i++) + for(size_t i = 0; i < actionnode.children.size(); i++) { - const DrawcallDescription &d = drawnode.children[i]; + const ActionDescription &a = actionnode.children[i]; - FillTimersNV(eventStartID, sampleIndex, eventIDs, drawnode.children[i]); + FillTimersNV(eventStartID, sampleIndex, eventIDs, actionnode.children[i]); - if(d.events.empty() || (!(drawnode.children[i].flags & DrawFlags::Drawcall) && - !(drawnode.children[i].flags & DrawFlags::Dispatch))) + if(a.events.empty() || (!(actionnode.children[i].flags & ActionFlags::Drawcall) && + !(actionnode.children[i].flags & ActionFlags::Dispatch))) continue; - eventIDs.push_back(d.eventId); + eventIDs.push_back(a.eventId); - m_pDevice->ReplayLog(eventStartID, d.eventId, eReplay_WithoutDraw); + m_pDevice->ReplayLog(eventStartID, a.eventId, eReplay_WithoutDraw); SerializeImmediateContext(); m_pNVCounters->BeginSample(sampleIndex); - m_pDevice->ReplayLog(eventStartID, d.eventId, eReplay_OnlyDraw); + m_pDevice->ReplayLog(eventStartID, a.eventId, eReplay_OnlyDraw); SerializeImmediateContext(); m_pNVCounters->EndSample(sampleIndex); - eventStartID = d.eventId + 1; + eventStartID = a.eventId + 1; sampleIndex++; } } void D3D11Replay::FillTimersIntel(uint32_t &eventStartID, uint32_t &sampleIndex, - rdcarray &eventIDs, const DrawcallDescription &drawnode) + rdcarray &eventIDs, const ActionDescription &actionnode) { - if(drawnode.children.empty()) + if(actionnode.children.empty()) return; - for(size_t i = 0; i < drawnode.children.size(); i++) + for(size_t i = 0; i < actionnode.children.size(); i++) { - const DrawcallDescription &d = drawnode.children[i]; + const ActionDescription &a = actionnode.children[i]; - FillTimersIntel(eventStartID, sampleIndex, eventIDs, drawnode.children[i]); + FillTimersIntel(eventStartID, sampleIndex, eventIDs, actionnode.children[i]); - if(d.events.empty() || (!(drawnode.children[i].flags & DrawFlags::Drawcall) && - !(drawnode.children[i].flags & DrawFlags::Dispatch))) + if(a.events.empty() || (!(actionnode.children[i].flags & ActionFlags::Drawcall) && + !(actionnode.children[i].flags & ActionFlags::Dispatch))) continue; - eventIDs.push_back(d.eventId); + eventIDs.push_back(a.eventId); - m_pDevice->ReplayLog(eventStartID, d.eventId, eReplay_WithoutDraw); + m_pDevice->ReplayLog(eventStartID, a.eventId, eReplay_WithoutDraw); SerializeImmediateContext(); m_pIntelCounters->BeginSample(); - m_pDevice->ReplayLog(eventStartID, d.eventId, eReplay_OnlyDraw); + m_pDevice->ReplayLog(eventStartID, a.eventId, eReplay_OnlyDraw); SerializeImmediateContext(); m_pIntelCounters->EndSample(); - eventStartID = d.eventId + 1; + eventStartID = a.eventId + 1; sampleIndex++; } } diff --git a/renderdoc/driver/d3d11/d3d11_device.cpp b/renderdoc/driver/d3d11/d3d11_device.cpp index 358afa7eb..c8245c45e 100644 --- a/renderdoc/driver/d3d11/d3d11_device.cpp +++ b/renderdoc/driver/d3d11/d3d11_device.cpp @@ -1420,7 +1420,7 @@ ReplayStatus WrappedID3D11Device::ReadLogInitialisation(RDCFile *rdc, bool store if(!IsStructuredExporting(m_State)) { - SetupDrawcallPointers(m_Drawcalls, GetReplay()->WriteFrameRecord().drawcallList); + SetupActionPointers(m_Actions, GetReplay()->WriteFrameRecord().actionList); // propagate any UAV names onto counter buffers rdcarray counterBuffers; @@ -2886,12 +2886,12 @@ WrappedID3D11DeviceContext *WrappedID3D11Device::GetDeferredContext(size_t idx) return *it; } -const DrawcallDescription *WrappedID3D11Device::GetDrawcall(uint32_t eventId) +const ActionDescription *WrappedID3D11Device::GetAction(uint32_t eventId) { - if(eventId >= m_Drawcalls.size()) + if(eventId >= m_Actions.size()) return NULL; - return m_Drawcalls[eventId]; + return m_Actions[eventId]; } ResourceDescription &WrappedID3D11Device::GetResourceDesc(ResourceId id) diff --git a/renderdoc/driver/d3d11/d3d11_device.h b/renderdoc/driver/d3d11/d3d11_device.h index d1c18abb7..16af4ce28 100644 --- a/renderdoc/driver/d3d11/d3d11_device.h +++ b/renderdoc/driver/d3d11/d3d11_device.h @@ -603,7 +603,7 @@ private: rdcarray m_DebugMessages; rdcarray m_CapturedFrames; - rdcarray m_Drawcalls; + rdcarray m_Actions; public: ALLOCATE_WITH_WRAPPED_POOL(WrappedID3D11Device); @@ -648,7 +648,7 @@ public: WrappedID3D11DeviceContext *GetDeferredContext(size_t idx); ResourceId GetResourceID() { return m_ResourceID; } - const DrawcallDescription *GetDrawcall(uint32_t eventId); + const ActionDescription *GetAction(uint32_t eventId); ResourceDescription &GetResourceDesc(ResourceId id); FrameStatistics &GetFrameStats(); diff --git a/renderdoc/driver/d3d11/d3d11_overlay.cpp b/renderdoc/driver/d3d11/d3d11_overlay.cpp index 439403b42..e93704aa4 100644 --- a/renderdoc/driver/d3d11/d3d11_overlay.cpp +++ b/renderdoc/driver/d3d11/d3d11_overlay.cpp @@ -842,9 +842,9 @@ ResourceId D3D11Replay::RenderOverlay(ResourceId texid, FloatVector clearCol, De SAFE_RELEASE(ds); - const DrawcallDescription *draw = m_pDevice->GetDrawcall(events[i]); + const ActionDescription *action = m_pDevice->GetAction(events[i]); - for(uint32_t inst = 0; draw && inst < RDCMAX(1U, draw->numInstances); inst++) + for(uint32_t inst = 0; action && inst < RDCMAX(1U, action->numInstances); inst++) { MeshFormat fmt = GetPostVSBuffers(events[i], inst, 0, MeshDataStage::GSOut); if(fmt.vertexResourceId == ResourceId()) diff --git a/renderdoc/driver/d3d11/d3d11_pixelhistory.cpp b/renderdoc/driver/d3d11/d3d11_pixelhistory.cpp index 92a241ce6..e06ac2918 100644 --- a/renderdoc/driver/d3d11/d3d11_pixelhistory.cpp +++ b/renderdoc/driver/d3d11/d3d11_pixelhistory.cpp @@ -1329,7 +1329,7 @@ rdcarray D3D11Replay::PixelHistory(rdcarray event SAFE_RELEASE(curBS); SAFE_RELEASE(curDS); - // replay only draw to get immediately post-modification values + // replay only action to get immediately post-modification values m_pDevice->ReplayLog(events[ev].eventId, events[ev].eventId, eReplay_OnlyDraw); D3D11MarkerRegion::Set("Copying post-mod col/depth[1]"); @@ -1364,9 +1364,9 @@ rdcarray D3D11Replay::PixelHistory(rdcarray event ResourceRange resourceRange(targetres, mip, slice); - const DrawcallDescription *draw = m_pDevice->GetDrawcall(events[i].eventId); + const ActionDescription *action = m_pDevice->GetAction(events[i].eventId); - bool clear = bool(draw->flags & DrawFlags::Clear); + bool clear = bool(action->flags & ActionFlags::Clear); bool uavWrite = ((events[i].usage >= ResourceUsage::VS_RWResource && @@ -1437,7 +1437,7 @@ rdcarray D3D11Replay::PixelHistory(rdcarray event mod.preMod.col.uintValue[0] = (uint32_t)i; - if(!(draw->flags & DrawFlags::Clear) && !uavWrite) + if(!(action->flags & ActionFlags::Clear) && !uavWrite) { if(flags[i] & TestMustFail_DepthTesting) mod.depthTestFailed = true; @@ -1903,7 +1903,7 @@ rdcarray D3D11Replay::PixelHistory(rdcarray event byte *pixstoreData = (byte *)mapped.pData; //////////////////////////////////////////////////////////////////////////////////////// - // Third loop over each modification event to read back the pre-draw colour + depth data + // Third loop over each modification event to read back the pre-action colour + depth data // as well as the # fragments to use in the next step for(size_t h = 0; h < history.size(); h++) @@ -1998,17 +1998,17 @@ rdcarray D3D11Replay::PixelHistory(rdcarray event for(size_t h = 0; h < history.size(); h++) { - const DrawcallDescription *draw = m_pDevice->GetDrawcall(history[h].eventId); + const ActionDescription *action = m_pDevice->GetAction(history[h].eventId); - if(draw->flags & DrawFlags::Clear) + if(action->flags & ActionFlags::Clear) continue; - D3D11MarkerRegion historyData( - StringFormat::Fmt("Fetching history data for %u: %s", draw->eventId, draw->name.c_str())); + D3D11MarkerRegion historyData(StringFormat::Fmt("Fetching history data for %u: %s", + action->eventId, action->name.c_str())); if(prev != history[h].eventId) { - D3D11MarkerRegion predraw("fetching pre-draw"); + D3D11MarkerRegion predraw("fetching pre-action"); m_pDevice->ReplayLog(0, history[h].eventId, eReplay_WithoutDraw); prev = history[h].eventId; @@ -2142,7 +2142,7 @@ rdcarray D3D11Replay::PixelHistory(rdcarray event // if we're not the last modification in our event, need to fetch post fragment value if(h + 1 < history.size() && history[h].eventId == history[h + 1].eventId) { - D3D11MarkerRegion middraw("fetching mid-draw"); + D3D11MarkerRegion middraw("fetching mid-action"); m_pImmediateContext->OMSetRenderTargets(rtIndex + 1, RTVs, shaddepthOutputDSV); @@ -2254,9 +2254,9 @@ rdcarray D3D11Replay::PixelHistory(rdcarray event for(size_t h = 0; h < history.size(); h++) { - const DrawcallDescription *draw = m_pDevice->GetDrawcall(history[h].eventId); + const ActionDescription *action = m_pDevice->GetAction(history[h].eventId); - if(draw->flags & DrawFlags::Clear) + if(action->flags & ActionFlags::Clear) continue; // if we're not the last modification in our event, need to fetch post fragment value @@ -2402,22 +2402,22 @@ rdcarray D3D11Replay::PixelHistory(rdcarray event Topology topo = MakePrimitiveTopology(m_pImmediateContext->GetCurrentPipelineState()->IA.Topo); - // do draw - if(draw->flags & DrawFlags::Indexed) + // do action + if(action->flags & ActionFlags::Indexed) { // TODO once pixel history distinguishes between instances, draw only the instance for // this fragment m_pImmediateContext->DrawIndexedInstanced( - RENDERDOC_NumVerticesPerPrimitive(topo), RDCMAX(1U, draw->numInstances), - draw->indexOffset + RENDERDOC_VertexOffset(topo, history[h].primitiveID), - draw->baseVertex, draw->instanceOffset); + RENDERDOC_NumVerticesPerPrimitive(topo), RDCMAX(1U, action->numInstances), + action->indexOffset + RENDERDOC_VertexOffset(topo, history[h].primitiveID), + action->baseVertex, action->instanceOffset); } else { m_pImmediateContext->DrawInstanced( - RENDERDOC_NumVerticesPerPrimitive(topo), RDCMAX(1U, draw->numInstances), - draw->vertexOffset + RENDERDOC_VertexOffset(topo, history[h].primitiveID), - draw->instanceOffset); + RENDERDOC_NumVerticesPerPrimitive(topo), RDCMAX(1U, action->numInstances), + action->vertexOffset + RENDERDOC_VertexOffset(topo, history[h].primitiveID), + action->instanceOffset); } m_pImmediateContext->End(testQueries[0]); diff --git a/renderdoc/driver/d3d11/d3d11_postvs.cpp b/renderdoc/driver/d3d11/d3d11_postvs.cpp index fb6c8a408..3260cb671 100644 --- a/renderdoc/driver/d3d11/d3d11_postvs.cpp +++ b/renderdoc/driver/d3d11/d3d11_postvs.cpp @@ -212,10 +212,10 @@ void D3D11Replay::InitPostVSBuffers(uint32_t eventId) WrappedID3D11Shader *wrappedVS = (WrappedID3D11Shader *)vs; - const DrawcallDescription *drawcall = m_pDevice->GetDrawcall(eventId); + const ActionDescription *action = m_pDevice->GetAction(eventId); - if(drawcall->numIndices == 0 || - ((drawcall->flags & DrawFlags::Instanced) && drawcall->numInstances == 0)) + if(action->numIndices == 0 || + ((action->flags & ActionFlags::Instanced) && action->numInstances == 0)) return; DXBC::DXBCContainer *dxbcVS = wrappedVS->GetDXBC(); @@ -314,15 +314,15 @@ void D3D11Replay::InitPostVSBuffers(uint32_t eventId) ID3D11Buffer *origBuf = idxBuf; - if(!(drawcall->flags & DrawFlags::Indexed)) + if(!(action->flags & ActionFlags::Indexed)) { m_pImmediateContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_POINTLIST); SAFE_RELEASE(idxBuf); - uint64_t outputSize = stride * uint64_t(drawcall->numIndices); - if(drawcall->flags & DrawFlags::Instanced) - outputSize *= drawcall->numInstances; + uint64_t outputSize = stride * uint64_t(action->numIndices); + if(action->flags & ActionFlags::Instanced) + outputSize *= action->numInstances; if(m_SOBufferSize < outputSize) { @@ -339,11 +339,11 @@ void D3D11Replay::InitPostVSBuffers(uint32_t eventId) m_pImmediateContext->Begin(m_SOStatsQueries[0]); - if(drawcall->flags & DrawFlags::Instanced) - m_pImmediateContext->DrawInstanced(drawcall->numIndices, drawcall->numInstances, - drawcall->vertexOffset, drawcall->instanceOffset); + if(action->flags & ActionFlags::Instanced) + m_pImmediateContext->DrawInstanced(action->numIndices, action->numInstances, + action->vertexOffset, action->instanceOffset); else - m_pImmediateContext->Draw(drawcall->numIndices, drawcall->vertexOffset); + m_pImmediateContext->Draw(action->numIndices, action->vertexOffset); m_pImmediateContext->End(m_SOStatsQueries[0]); } @@ -353,8 +353,8 @@ void D3D11Replay::InitPostVSBuffers(uint32_t eventId) UINT bytesize = index16 ? 2 : 4; bytebuf idxdata; - GetDebugManager()->GetBufferData(idxBuf, idxOffs + drawcall->indexOffset * bytesize, - drawcall->numIndices * bytesize, idxdata); + GetDebugManager()->GetBufferData(idxBuf, idxOffs + action->indexOffset * bytesize, + action->numIndices * bytesize, idxdata); SAFE_RELEASE(idxBuf); @@ -365,7 +365,7 @@ void D3D11Replay::InitPostVSBuffers(uint32_t eventId) // only read as many indices as were available in the buffer uint32_t numIndices = - RDCMIN(uint32_t(index16 ? idxdata.size() / 2 : idxdata.size() / 4), drawcall->numIndices); + RDCMIN(uint32_t(index16 ? idxdata.size() / 2 : idxdata.size() / 4), action->numIndices); // grab all unique vertex indices referenced for(uint32_t i = 0; i < numIndices; i++) @@ -382,7 +382,7 @@ void D3D11Replay::InitPostVSBuffers(uint32_t eventId) // if we read out of bounds, we'll also have a 0 index being referenced // (as 0 is read). Don't insert 0 if we already have 0 though - if(numIndices < drawcall->numIndices && (indices.empty() || indices[0] != 0)) + if(numIndices < action->numIndices && (indices.empty() || indices[0] != 0)) indices.insert(0, 0); // An index buffer could be something like: 500, 501, 502, 501, 503, 502 @@ -423,8 +423,8 @@ void D3D11Replay::InitPostVSBuffers(uint32_t eventId) SAFE_RELEASE(idxBuf); uint64_t outputSize = stride * uint64_t(indices.size()); - if(drawcall->flags & DrawFlags::Instanced) - outputSize *= drawcall->numInstances; + if(action->flags & ActionFlags::Instanced) + outputSize *= action->numInstances; if(m_SOBufferSize < outputSize) { @@ -440,11 +440,11 @@ void D3D11Replay::InitPostVSBuffers(uint32_t eventId) m_pImmediateContext->Begin(m_SOStatsQueries[0]); - if(drawcall->flags & DrawFlags::Instanced) - m_pImmediateContext->DrawIndexedInstanced((UINT)indices.size(), drawcall->numInstances, 0, - drawcall->baseVertex, drawcall->instanceOffset); + if(action->flags & ActionFlags::Instanced) + m_pImmediateContext->DrawIndexedInstanced((UINT)indices.size(), action->numInstances, 0, + action->baseVertex, action->instanceOffset); else - m_pImmediateContext->DrawIndexed((UINT)indices.size(), 0, drawcall->baseVertex); + m_pImmediateContext->DrawIndexed((UINT)indices.size(), 0, action->baseVertex); m_pImmediateContext->End(m_SOStatsQueries[0]); @@ -602,13 +602,13 @@ void D3D11Replay::InitPostVSBuffers(uint32_t eventId) m_PostVSData[eventId].vsout.nearPlane = nearp; m_PostVSData[eventId].vsout.farPlane = farp; - m_PostVSData[eventId].vsout.useIndices = bool(drawcall->flags & DrawFlags::Indexed); - m_PostVSData[eventId].vsout.numVerts = drawcall->numIndices; + m_PostVSData[eventId].vsout.useIndices = bool(action->flags & ActionFlags::Indexed); + m_PostVSData[eventId].vsout.numVerts = action->numIndices; m_PostVSData[eventId].vsout.instStride = 0; - if(drawcall->flags & DrawFlags::Instanced) + if(action->flags & ActionFlags::Instanced) m_PostVSData[eventId].vsout.instStride = - bufferDesc.ByteWidth / RDCMAX(1U, drawcall->numInstances); + bufferDesc.ByteWidth / RDCMAX(1U, action->numInstances); m_PostVSData[eventId].vsout.idxBuf = NULL; if(m_PostVSData[eventId].vsout.useIndices && idxBuf) @@ -714,38 +714,38 @@ void D3D11Replay::InitPostVSBuffers(uint32_t eventId) m_pImmediateContext->SOSetTargets(1, &m_SOBuffer, &offset); - if(drawcall->flags & DrawFlags::Instanced) + if(action->flags & ActionFlags::Instanced) { - if(drawcall->flags & DrawFlags::Indexed) + if(action->flags & ActionFlags::Indexed) { - m_pImmediateContext->DrawIndexedInstanced(drawcall->numIndices, drawcall->numInstances, - drawcall->indexOffset, drawcall->baseVertex, - drawcall->instanceOffset); + m_pImmediateContext->DrawIndexedInstanced(action->numIndices, action->numInstances, + action->indexOffset, action->baseVertex, + action->instanceOffset); } else { - m_pImmediateContext->DrawInstanced(drawcall->numIndices, drawcall->numInstances, - drawcall->vertexOffset, drawcall->instanceOffset); + m_pImmediateContext->DrawInstanced(action->numIndices, action->numInstances, + action->vertexOffset, action->instanceOffset); } } else { // trying to stream out a stream-out-auto based drawcall would be bad! // instead just draw the number of verts we pre-calculated - if(drawcall->flags & DrawFlags::Auto) + if(action->flags & ActionFlags::Auto) { - m_pImmediateContext->Draw(drawcall->numIndices, 0); + m_pImmediateContext->Draw(action->numIndices, 0); } else { - if(drawcall->flags & DrawFlags::Indexed) + if(action->flags & ActionFlags::Indexed) { - m_pImmediateContext->DrawIndexed(drawcall->numIndices, drawcall->indexOffset, - drawcall->baseVertex); + m_pImmediateContext->DrawIndexed(action->numIndices, action->indexOffset, + action->baseVertex); } else { - m_pImmediateContext->Draw(drawcall->numIndices, drawcall->vertexOffset); + m_pImmediateContext->Draw(action->numIndices, action->vertexOffset); } } } @@ -775,11 +775,11 @@ void D3D11Replay::InitPostVSBuffers(uint32_t eventId) } // instanced draws must be replayed one at a time so we can record the number of primitives from - // each drawcall, as due to expansion this can vary per-instance. - if(drawcall->flags & DrawFlags::Instanced && drawcall->numInstances > 1) + // each action, as due to expansion this can vary per-instance. + if(action->flags & ActionFlags::Instanced && action->numInstances > 1) { // ensure we have enough queries - while(m_SOStatsQueries.size() < drawcall->numInstances) + while(m_SOStatsQueries.size() < action->numInstances) { D3D11_QUERY_DESC qdesc; qdesc.MiscFlags = 0; @@ -797,22 +797,22 @@ void D3D11Replay::InitPostVSBuffers(uint32_t eventId) // there's no way to replay only a single instance. We have to replay 1, 2, 3, ... N // instances and count the total number of verts each time, then we can see from the // difference how much each instance wrote. - for(uint32_t inst = 1; inst <= drawcall->numInstances; inst++) + for(uint32_t inst = 1; inst <= action->numInstances; inst++) { - if(drawcall->flags & DrawFlags::Indexed) + if(action->flags & ActionFlags::Indexed) { m_pImmediateContext->SOSetTargets(1, &m_SOBuffer, &offset); m_pImmediateContext->Begin(m_SOStatsQueries[inst - 1]); - m_pImmediateContext->DrawIndexedInstanced(drawcall->numIndices, inst, drawcall->indexOffset, - drawcall->baseVertex, drawcall->instanceOffset); + m_pImmediateContext->DrawIndexedInstanced(action->numIndices, inst, action->indexOffset, + action->baseVertex, action->instanceOffset); m_pImmediateContext->End(m_SOStatsQueries[inst - 1]); } else { m_pImmediateContext->SOSetTargets(1, &m_SOBuffer, &offset); m_pImmediateContext->Begin(m_SOStatsQueries[inst - 1]); - m_pImmediateContext->DrawInstanced(drawcall->numIndices, inst, drawcall->vertexOffset, - drawcall->instanceOffset); + m_pImmediateContext->DrawInstanced(action->numIndices, inst, action->vertexOffset, + action->instanceOffset); m_pImmediateContext->End(m_SOStatsQueries[inst - 1]); } @@ -828,11 +828,11 @@ void D3D11Replay::InitPostVSBuffers(uint32_t eventId) rdcarray instData; - if((drawcall->flags & DrawFlags::Instanced) && drawcall->numInstances > 1) + if((action->flags & ActionFlags::Instanced) && action->numInstances > 1) { uint64_t prevVertCount = 0; - for(uint32_t inst = 0; inst < drawcall->numInstances; inst++) + for(uint32_t inst = 0; inst < action->numInstances; inst++) { do { @@ -976,9 +976,9 @@ void D3D11Replay::InitPostVSBuffers(uint32_t eventId) m_PostVSData[eventId].gsout.buf = gsoutBuffer; m_PostVSData[eventId].gsout.instStride = 0; - if(drawcall->flags & DrawFlags::Instanced) + if(action->flags & ActionFlags::Instanced) m_PostVSData[eventId].gsout.instStride = - bufferDesc.ByteWidth / RDCMAX(1U, drawcall->numInstances); + bufferDesc.ByteWidth / RDCMAX(1U, action->numInstances); m_PostVSData[eventId].gsout.vertStride = stride; m_PostVSData[eventId].gsout.nearPlane = nearp; m_PostVSData[eventId].gsout.farPlane = farp; @@ -1016,8 +1016,8 @@ void D3D11Replay::InitPostVSBuffers(uint32_t eventId) break; } - if(drawcall->flags & DrawFlags::Instanced) - m_PostVSData[eventId].gsout.numVerts /= RDCMAX(1U, drawcall->numInstances); + if(action->flags & ActionFlags::Instanced) + m_PostVSData[eventId].gsout.numVerts /= RDCMAX(1U, action->numInstances); m_PostVSData[eventId].gsout.instData = instData; } @@ -1038,7 +1038,7 @@ void D3D11Replay::InitPostVSBuffers(const rdcarray &passEvents) prev = passEvents[i]; } - const DrawcallDescription *d = m_pDevice->GetDrawcall(passEvents[i]); + const ActionDescription *d = m_pDevice->GetAction(passEvents[i]); if(d) InitPostVSBuffers(passEvents[i]); diff --git a/renderdoc/driver/d3d11/d3d11_replay.cpp b/renderdoc/driver/d3d11/d3d11_replay.cpp index 73cfc6484..d055c2dc8 100644 --- a/renderdoc/driver/d3d11/d3d11_replay.cpp +++ b/renderdoc/driver/d3d11/d3d11_replay.cpp @@ -1582,12 +1582,12 @@ rdcarray D3D11Replay::GetPassEvents(uint32_t eventId) { rdcarray passEvents; - const DrawcallDescription *draw = m_pDevice->GetDrawcall(eventId); + const ActionDescription *action = m_pDevice->GetAction(eventId); - const DrawcallDescription *start = draw; - while(start && start->previous && !(start->previous->flags & DrawFlags::Clear)) + const ActionDescription *start = action; + while(start && start->previous && !(start->previous->flags & ActionFlags::Clear)) { - const DrawcallDescription *prev = start->previous; + const ActionDescription *prev = start->previous; if(start->outputs != prev->outputs || start->depthOut != prev->depthOut) break; @@ -1597,10 +1597,10 @@ rdcarray D3D11Replay::GetPassEvents(uint32_t eventId) while(start) { - if(start == draw) + if(start == action) break; - if(start->flags & DrawFlags::Drawcall) + if(start->flags & ActionFlags::Drawcall) passEvents.push_back(start->eventId); start = start->next; diff --git a/renderdoc/driver/d3d11/d3d11_replay.h b/renderdoc/driver/d3d11/d3d11_replay.h index a9a35fe32..b62d91dfb 100644 --- a/renderdoc/driver/d3d11/d3d11_replay.h +++ b/renderdoc/driver/d3d11/d3d11_replay.h @@ -277,13 +277,13 @@ private: rdcarray FetchCountersNV(const rdcarray &counters); rdcarray FetchCountersIntel(const rdcarray &counters); - void FillTimers(D3D11CounterContext &ctx, const DrawcallDescription &drawnode); + void FillTimers(D3D11CounterContext &ctx, const ActionDescription &actionnode); void FillTimersAMD(uint32_t &eventStartID, uint32_t &sampleIndex, rdcarray &eventIDs, - const DrawcallDescription &drawnode); + const ActionDescription &actionnode); void FillTimersNV(uint32_t &eventStartID, uint32_t &sampleIndex, rdcarray &eventIDs, - const DrawcallDescription &drawnode); + const ActionDescription &actionnode); void FillTimersIntel(uint32_t &eventStartID, uint32_t &sampleIndex, rdcarray &eventIDs, - const DrawcallDescription &drawnode); + const ActionDescription &actionnode); void SerializeImmediateContext(); diff --git a/renderdoc/driver/d3d11/d3d11_shaderdebug.cpp b/renderdoc/driver/d3d11/d3d11_shaderdebug.cpp index 88ce01350..3c1ec8c2d 100644 --- a/renderdoc/driver/d3d11/d3d11_shaderdebug.cpp +++ b/renderdoc/driver/d3d11/d3d11_shaderdebug.cpp @@ -100,12 +100,13 @@ D3D11DebugAPIWrapper::D3D11DebugAPIWrapper(WrappedID3D11Device *device, D3D11DebugAPIWrapper::~D3D11DebugAPIWrapper() { - // if we replayed to before the draw for fetching some UAVs, replay back to after the draw to keep + // if we replayed to before the action for fetching some UAVs, replay back to after the action to + // keep // the state consistent. if(m_DidReplay) { D3D11MarkerRegion region("ResetReplay"); - // replay the draw to get back to 'normal' state for this event, and mark that we need to + // replay the action to get back to 'normal' state for this event, and mark that we need to // replay back to pristine state next time we need to fetch data. m_pDevice->ReplayLog(0, m_EventID, eReplay_OnlyDraw); } @@ -193,7 +194,7 @@ void D3D11DebugAPIWrapper::FetchSRV(const DXBCDebug::BindingSlot &slot) void D3D11DebugAPIWrapper::FetchUAV(const DXBCDebug::BindingSlot &slot) { - // if the UAV might be dirty from side-effects from the draw, replay back to right + // if the UAV might be dirty from side-effects from the action, replay back to right // before it. if(!m_DidReplay) { @@ -1744,7 +1745,7 @@ ShaderDebugTrace *D3D11Replay::DebugVertex(uint32_t eventId, uint32_t vertid, ui D3D11MarkerRegion region( StringFormat::Fmt("DebugVertex @ %u of (%u,%u,%u)", eventId, vertid, instid, idx)); - const DrawcallDescription *draw = m_pDevice->GetDrawcall(eventId); + const ActionDescription *action = m_pDevice->GetAction(eventId); D3D11RenderStateTracker tracker(m_pImmediateContext); @@ -1779,7 +1780,7 @@ ShaderDebugTrace *D3D11Replay::DebugVertex(uint32_t eventId, uint32_t vertid, ui for(size_t i = 0; i < inputlayout.size(); i++) { if(inputlayout[i].InputSlotClass == D3D11_INPUT_PER_INSTANCE_DATA && - inputlayout[i].InstanceDataStepRate < draw->numInstances) + inputlayout[i].InstanceDataStepRate < action->numInstances) MaxStepRate = RDCMAX(inputlayout[i].InstanceDataStepRate, MaxStepRate); UINT slot = @@ -1811,20 +1812,20 @@ ShaderDebugTrace *D3D11Replay::DebugVertex(uint32_t eventId, uint32_t vertid, ui if(rs->IA.VBs[i]) { GetDebugManager()->GetBufferData( - rs->IA.VBs[i], rs->IA.Offsets[i] + rs->IA.Strides[i] * (draw->vertexOffset + idx), + rs->IA.VBs[i], rs->IA.Offsets[i] + rs->IA.Strides[i] * (action->vertexOffset + idx), rs->IA.Strides[i], vertData[i]); for(UINT isr = 1; isr <= MaxStepRate; isr++) { GetDebugManager()->GetBufferData( rs->IA.VBs[i], - rs->IA.Offsets[i] + rs->IA.Strides[i] * (draw->instanceOffset + (instid / isr)), + rs->IA.Offsets[i] + rs->IA.Strides[i] * (action->instanceOffset + (instid / isr)), rs->IA.Strides[i], instData[i * MaxStepRate + isr - 1]); } - GetDebugManager()->GetBufferData(rs->IA.VBs[i], - rs->IA.Offsets[i] + rs->IA.Strides[i] * draw->instanceOffset, - rs->IA.Strides[i], staticData[i]); + GetDebugManager()->GetBufferData( + rs->IA.VBs[i], rs->IA.Offsets[i] + rs->IA.Strides[i] * action->instanceOffset, + rs->IA.Strides[i], staticData[i]); } } @@ -1884,7 +1885,7 @@ ShaderDebugTrace *D3D11Replay::DebugVertex(uint32_t eventId, uint32_t vertid, ui } else { - if(el->InstanceDataStepRate == 0 || el->InstanceDataStepRate >= draw->numInstances) + if(el->InstanceDataStepRate == 0 || el->InstanceDataStepRate >= action->numInstances) { if(staticData[el->InputSlot].size() >= el->AlignedByteOffset) { @@ -2064,9 +2065,9 @@ ShaderDebugTrace *D3D11Replay::DebugVertex(uint32_t eventId, uint32_t vertid, ui { uint32_t sv_vertid = vertid; - if(draw->flags & DrawFlags::Indexed) + if(action->flags & ActionFlags::Indexed) { - sv_vertid = idx - draw->baseVertex; + sv_vertid = idx - action->baseVertex; } if(dxbc->GetReflection()->InputSig[i].varType == VarType::Float) diff --git a/renderdoc/driver/d3d12/d3d12_command_list1_wrap.cpp b/renderdoc/driver/d3d12/d3d12_command_list1_wrap.cpp index 5d419a763..842225518 100644 --- a/renderdoc/driver/d3d12/d3d12_command_list1_wrap.cpp +++ b/renderdoc/driver/d3d12/d3d12_command_list1_wrap.cpp @@ -85,30 +85,30 @@ bool WrappedID3D12GraphicsCommandList::Serialise_AtomicCopyBufferUINT( { m_Cmd->AddEvent(); - DrawcallDescription draw; - draw.copySource = GetResourceManager()->GetOriginalID(GetResID(pSrcBuffer)); - draw.copyDestination = GetResourceManager()->GetOriginalID(GetResID(pDstBuffer)); + ActionDescription action; + action.copySource = GetResourceManager()->GetOriginalID(GetResID(pSrcBuffer)); + action.copyDestination = GetResourceManager()->GetOriginalID(GetResID(pDstBuffer)); - draw.name = - StringFormat::Fmt("AtomicCopyBufferUINT(%s, %s)", ToStr(draw.copyDestination).c_str(), - ToStr(draw.copySource).c_str()); - draw.flags |= DrawFlags::Copy; + action.name = + StringFormat::Fmt("AtomicCopyBufferUINT(%s, %s)", ToStr(action.copyDestination).c_str(), + ToStr(action.copySource).c_str()); + action.flags |= ActionFlags::Copy; - m_Cmd->AddDrawcall(draw); + m_Cmd->AddAction(action); - D3D12DrawcallTreeNode &drawNode = m_Cmd->GetDrawcallStack().back()->children.back(); + D3D12ActionTreeNode &actionNode = m_Cmd->GetActionStack().back()->children.back(); if(pSrcBuffer == pDstBuffer) { - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(pSrcBuffer), EventUsage(drawNode.draw.eventId, ResourceUsage::Copy))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(pSrcBuffer), EventUsage(actionNode.action.eventId, ResourceUsage::Copy))); } else { - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(pSrcBuffer), EventUsage(drawNode.draw.eventId, ResourceUsage::CopySrc))); - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(pDstBuffer), EventUsage(drawNode.draw.eventId, ResourceUsage::CopyDst))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(pSrcBuffer), EventUsage(actionNode.action.eventId, ResourceUsage::CopySrc))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(pDstBuffer), EventUsage(actionNode.action.eventId, ResourceUsage::CopyDst))); } } } @@ -129,7 +129,7 @@ void WrappedID3D12GraphicsCommandList::AtomicCopyBufferUINT( if(IsCaptureMode(m_State)) { CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D12Chunk::List_AtomicCopyBufferUINT); Serialise_AtomicCopyBufferUINT(ser, pDstBuffer, DstOffset, pSrcBuffer, SrcOffset, Dependencies, ppDependentResources, pDependentSubresourceRanges); @@ -203,30 +203,30 @@ bool WrappedID3D12GraphicsCommandList::Serialise_AtomicCopyBufferUINT64( { m_Cmd->AddEvent(); - DrawcallDescription draw; - draw.copySource = GetResourceManager()->GetOriginalID(GetResID(pSrcBuffer)); - draw.copyDestination = GetResourceManager()->GetOriginalID(GetResID(pDstBuffer)); + ActionDescription action; + action.copySource = GetResourceManager()->GetOriginalID(GetResID(pSrcBuffer)); + action.copyDestination = GetResourceManager()->GetOriginalID(GetResID(pDstBuffer)); - draw.name = - StringFormat::Fmt("AtomicCopyBufferUINT64(%s, %s)", ToStr(draw.copyDestination).c_str(), - ToStr(draw.copySource).c_str()); - draw.flags |= DrawFlags::Copy; + action.name = StringFormat::Fmt("AtomicCopyBufferUINT64(%s, %s)", + ToStr(action.copyDestination).c_str(), + ToStr(action.copySource).c_str()); + action.flags |= ActionFlags::Copy; - m_Cmd->AddDrawcall(draw); + m_Cmd->AddAction(action); - D3D12DrawcallTreeNode &drawNode = m_Cmd->GetDrawcallStack().back()->children.back(); + D3D12ActionTreeNode &actionNode = m_Cmd->GetActionStack().back()->children.back(); if(pSrcBuffer == pDstBuffer) { - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(pSrcBuffer), EventUsage(drawNode.draw.eventId, ResourceUsage::Copy))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(pSrcBuffer), EventUsage(actionNode.action.eventId, ResourceUsage::Copy))); } else { - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(pSrcBuffer), EventUsage(drawNode.draw.eventId, ResourceUsage::CopySrc))); - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(pDstBuffer), EventUsage(drawNode.draw.eventId, ResourceUsage::CopyDst))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(pSrcBuffer), EventUsage(actionNode.action.eventId, ResourceUsage::CopySrc))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(pDstBuffer), EventUsage(actionNode.action.eventId, ResourceUsage::CopyDst))); } } } @@ -247,7 +247,7 @@ void WrappedID3D12GraphicsCommandList::AtomicCopyBufferUINT64( if(IsCaptureMode(m_State)) { CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D12Chunk::List_AtomicCopyBufferUINT64); Serialise_AtomicCopyBufferUINT64(ser, pDstBuffer, DstOffset, pSrcBuffer, SrcOffset, Dependencies, ppDependentResources, pDependentSubresourceRanges); @@ -481,30 +481,32 @@ bool WrappedID3D12GraphicsCommandList::Serialise_ResolveSubresourceRegion( { m_Cmd->AddEvent(); - DrawcallDescription draw; - draw.copySource = GetResourceManager()->GetOriginalID(GetResID(pSrcResource)); - draw.copyDestination = GetResourceManager()->GetOriginalID(GetResID(pDstResource)); + ActionDescription action; + action.copySource = GetResourceManager()->GetOriginalID(GetResID(pSrcResource)); + action.copyDestination = GetResourceManager()->GetOriginalID(GetResID(pDstResource)); - draw.name = - StringFormat::Fmt("ResolveSubresourceRegion(%s, %s)", - ToStr(draw.copyDestination).c_str(), ToStr(draw.copySource).c_str()); - draw.flags |= DrawFlags::Resolve; + action.name = StringFormat::Fmt("ResolveSubresourceRegion(%s, %s)", + ToStr(action.copyDestination).c_str(), + ToStr(action.copySource).c_str()); + action.flags |= ActionFlags::Resolve; - m_Cmd->AddDrawcall(draw); + m_Cmd->AddAction(action); - D3D12DrawcallTreeNode &drawNode = m_Cmd->GetDrawcallStack().back()->children.back(); + D3D12ActionTreeNode &actionNode = m_Cmd->GetActionStack().back()->children.back(); if(pSrcResource == pDstResource) { - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(pSrcResource), EventUsage(drawNode.draw.eventId, ResourceUsage::Resolve))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(pSrcResource), EventUsage(actionNode.action.eventId, ResourceUsage::Resolve))); } else { - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(pSrcResource), EventUsage(drawNode.draw.eventId, ResourceUsage::ResolveSrc))); - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(pDstResource), EventUsage(drawNode.draw.eventId, ResourceUsage::ResolveDst))); + actionNode.resourceUsage.push_back( + make_rdcpair(GetResID(pSrcResource), + EventUsage(actionNode.action.eventId, ResourceUsage::ResolveSrc))); + actionNode.resourceUsage.push_back( + make_rdcpair(GetResID(pDstResource), + EventUsage(actionNode.action.eventId, ResourceUsage::ResolveDst))); } } } @@ -525,7 +527,7 @@ void WrappedID3D12GraphicsCommandList::ResolveSubresourceRegion( if(IsCaptureMode(m_State)) { CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D12Chunk::List_ResolveSubresourceRegion); Serialise_ResolveSubresourceRegion(ser, pDstResource, DstSubresource, DstX, DstY, pSrcResource, SrcSubresource, pSrcRect, Format, ResolveMode); diff --git a/renderdoc/driver/d3d12/d3d12_command_list4_wrap.cpp b/renderdoc/driver/d3d12/d3d12_command_list4_wrap.cpp index 50c2ec070..26fa44139 100644 --- a/renderdoc/driver/d3d12/d3d12_command_list4_wrap.cpp +++ b/renderdoc/driver/d3d12/d3d12_command_list4_wrap.cpp @@ -357,13 +357,13 @@ bool WrappedID3D12GraphicsCommandList::Serialise_BeginRenderPass( m_Cmd->AddEvent(); - DrawcallDescription draw; - draw.name = StringFormat::Fmt( + ActionDescription action; + action.name = StringFormat::Fmt( "BeginRenderPass(%s)", MakeRenderPassOpString(false, NumRenderTargets, pRenderTargets, pDepthStencil, Flags).c_str()); - draw.flags |= DrawFlags::BeginPass | DrawFlags::PassBoundary; + action.flags |= ActionFlags::BeginPass | ActionFlags::PassBoundary; - m_Cmd->AddDrawcall(draw); + m_Cmd->AddAction(action); stateUpdate = true; } @@ -511,15 +511,15 @@ bool WrappedID3D12GraphicsCommandList::Serialise_EndRenderPass(SerialiserType &s D3D12RenderState &state = m_Cmd->m_BakedCmdListInfo[m_Cmd->m_LastCmdListID].state; - DrawcallDescription draw; - draw.name = StringFormat::Fmt( + ActionDescription action; + action.name = StringFormat::Fmt( "EndRenderPass(%s)", MakeRenderPassOpString(true, (UINT)state.rpRTs.size(), state.rpRTs.data(), state.rpDSV.cpuDescriptor.ptr ? &state.rpDSV : NULL, state.rpFlags) .c_str()); - draw.flags |= DrawFlags::EndPass | DrawFlags::PassBoundary; + action.flags |= ActionFlags::EndPass | ActionFlags::PassBoundary; - m_Cmd->AddDrawcall(draw); + m_Cmd->AddAction(action); stateUpdate = true; } diff --git a/renderdoc/driver/d3d12/d3d12_command_list_wrap.cpp b/renderdoc/driver/d3d12/d3d12_command_list_wrap.cpp index 4c6238a5c..08202692e 100644 --- a/renderdoc/driver/d3d12/d3d12_command_list_wrap.cpp +++ b/renderdoc/driver/d3d12/d3d12_command_list_wrap.cpp @@ -108,8 +108,8 @@ bool WrappedID3D12GraphicsCommandList::Serialise_Close(SerialiserType &ser) for(int i = 0; i < markerCount; i++) D3D12MarkerRegion::End(list); - if(m_Cmd->m_DrawcallCallback) - m_Cmd->m_DrawcallCallback->PreCloseCommandList(list); + if(m_Cmd->m_ActionCallback) + m_Cmd->m_ActionCallback->PreCloseCommandList(list); // if(m_Cmd->m_Partial[D3D12CommandData::Primary].renderPassActive) // list->EndRenderPass(); @@ -132,8 +132,8 @@ bool WrappedID3D12GraphicsCommandList::Serialise_Close(SerialiserType &ser) } { - if(m_Cmd->GetDrawcallStack().size() > 1) - m_Cmd->GetDrawcallStack().pop_back(); + if(m_Cmd->GetActionStack().size() > 1) + m_Cmd->GetActionStack().pop_back(); } BakedCmdListInfo &baked = m_Cmd->m_BakedCmdListInfo[BakedCommandList]; @@ -147,7 +147,7 @@ bool WrappedID3D12GraphicsCommandList::Serialise_Close(SerialiserType &ser) parent.curEventID = 0; parent.eventCount = 0; - parent.drawCount = 0; + parent.actionCount = 0; } } @@ -163,7 +163,7 @@ HRESULT WrappedID3D12GraphicsCommandList::Close() { { CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D12Chunk::List_Close); Serialise_Close(ser); @@ -340,8 +340,8 @@ bool WrappedID3D12GraphicsCommandList::Serialise_Reset(SerialiserType &ser, } { - D3D12DrawcallTreeNode *draw = new D3D12DrawcallTreeNode; - m_Cmd->m_BakedCmdListInfo[BakedCommandList].draw = draw; + D3D12ActionTreeNode *action = new D3D12ActionTreeNode; + m_Cmd->m_BakedCmdListInfo[BakedCommandList].action = action; { if(m_Cmd->m_CrackedAllocators[GetResID(pAllocator)] == NULL) @@ -371,13 +371,13 @@ bool WrappedID3D12GraphicsCommandList::Serialise_Reset(SerialiserType &ser, m_Cmd->m_BakedCmdListInfo[CommandList].allocator = m_Cmd->m_BakedCmdListInfo[BakedCommandList].allocator = GetResID(pAllocator); - // On list execute we increment all child events/drawcalls by + // On list execute we increment all child events/actions by // m_RootEventID and insert them into the tree. m_Cmd->m_BakedCmdListInfo[BakedCommandList].curEventID = 0; m_Cmd->m_BakedCmdListInfo[BakedCommandList].eventCount = 0; - m_Cmd->m_BakedCmdListInfo[BakedCommandList].drawCount = 0; + m_Cmd->m_BakedCmdListInfo[BakedCommandList].actionCount = 0; - m_Cmd->m_BakedCmdListInfo[BakedCommandList].drawStack.push_back(draw); + m_Cmd->m_BakedCmdListInfo[BakedCommandList].actionStack.push_back(action); m_Cmd->m_BakedCmdListInfo[BakedCommandList].beginChunk = uint32_t(m_Cmd->m_StructuredFile->chunks.size() - 1); @@ -2832,7 +2832,7 @@ void WrappedID3D12GraphicsCommandList::EndQuery(ID3D12QueryHeap *pQueryHeap, D3D if(IsCaptureMode(m_State)) { CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D12Chunk::List_EndQuery); Serialise_EndQuery(ser, pQueryHeap, Type, Index); @@ -2974,12 +2974,12 @@ bool WrappedID3D12GraphicsCommandList::Serialise_SetMarker(SerialiserType &ser, D3D12MarkerRegion::Set(pCommandList, MarkerText); D3D12MarkerRegion::Set(GetWrappedCrackedList(), MarkerText); - DrawcallDescription draw; - draw.name = MarkerText; - draw.flags |= DrawFlags::SetMarker; + ActionDescription action; + action.name = MarkerText; + action.flags |= ActionFlags::SetMarker; m_Cmd->AddEvent(); - m_Cmd->AddDrawcall(draw); + m_Cmd->AddAction(action); } } @@ -2996,7 +2996,7 @@ void WrappedID3D12GraphicsCommandList::SetMarker(UINT Metadata, const void *pDat if(IsCaptureMode(m_State)) { CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D12Chunk::SetMarker); Serialise_SetMarker(ser, Metadata, pData, Size); @@ -3039,12 +3039,12 @@ bool WrappedID3D12GraphicsCommandList::Serialise_BeginEvent(SerialiserType &ser, D3D12MarkerRegion::Begin(pCommandList, MarkerText); D3D12MarkerRegion::Begin(GetWrappedCrackedList(), MarkerText); - DrawcallDescription draw; - draw.name = MarkerText; - draw.flags |= DrawFlags::PushMarker; + ActionDescription action; + action.name = MarkerText; + action.flags |= ActionFlags::PushMarker; m_Cmd->AddEvent(); - m_Cmd->AddDrawcall(draw); + m_Cmd->AddAction(action); } } @@ -3061,7 +3061,7 @@ void WrappedID3D12GraphicsCommandList::BeginEvent(UINT Metadata, const void *pDa if(IsCaptureMode(m_State)) { CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D12Chunk::PushMarker); Serialise_BeginEvent(ser, Metadata, pData, Size); @@ -3098,11 +3098,11 @@ bool WrappedID3D12GraphicsCommandList::Serialise_EndEvent(SerialiserType &ser) D3D12MarkerRegion::End(pCommandList); D3D12MarkerRegion::End(GetWrappedCrackedList()); - DrawcallDescription draw; - draw.flags = DrawFlags::PopMarker; + ActionDescription action; + action.flags = ActionFlags::PopMarker; m_Cmd->AddEvent(); - m_Cmd->AddDrawcall(draw); + m_Cmd->AddAction(action); } } @@ -3119,7 +3119,7 @@ void WrappedID3D12GraphicsCommandList::EndEvent() if(IsCaptureMode(m_State)) { CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D12Chunk::PopMarker); Serialise_EndEvent(ser); @@ -3162,11 +3162,11 @@ bool WrappedID3D12GraphicsCommandList::Serialise_DrawInstanced(SerialiserType &s Unwrap(list)->DrawInstanced(VertexCountPerInstance, InstanceCount, StartVertexLocation, StartInstanceLocation); - if(eventId && m_Cmd->m_DrawcallCallback->PostDraw(eventId, list)) + if(eventId && m_Cmd->m_ActionCallback->PostDraw(eventId, list)) { Unwrap(list)->DrawInstanced(VertexCountPerInstance, InstanceCount, StartVertexLocation, StartInstanceLocation); - m_Cmd->m_DrawcallCallback->PostRedraw(eventId, list); + m_Cmd->m_ActionCallback->PostRedraw(eventId, list); } } } @@ -3180,16 +3180,16 @@ bool WrappedID3D12GraphicsCommandList::Serialise_DrawInstanced(SerialiserType &s m_Cmd->AddEvent(); - DrawcallDescription draw; - draw.numIndices = VertexCountPerInstance; - draw.numInstances = InstanceCount; - draw.indexOffset = 0; - draw.vertexOffset = StartVertexLocation; - draw.instanceOffset = StartInstanceLocation; + ActionDescription action; + action.numIndices = VertexCountPerInstance; + action.numInstances = InstanceCount; + action.indexOffset = 0; + action.vertexOffset = StartVertexLocation; + action.instanceOffset = StartInstanceLocation; - draw.flags |= DrawFlags::Drawcall | DrawFlags::Instanced; + action.flags |= ActionFlags::Drawcall | ActionFlags::Instanced; - m_Cmd->AddDrawcall(draw); + m_Cmd->AddAction(action); } } @@ -3206,7 +3206,7 @@ void WrappedID3D12GraphicsCommandList::DrawInstanced(UINT VertexCountPerInstance if(IsCaptureMode(m_State)) { CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D12Chunk::List_DrawInstanced); Serialise_DrawInstanced(ser, VertexCountPerInstance, InstanceCount, StartVertexLocation, StartInstanceLocation); @@ -3245,11 +3245,11 @@ bool WrappedID3D12GraphicsCommandList::Serialise_DrawIndexedInstanced( Unwrap(list)->DrawIndexedInstanced(IndexCountPerInstance, InstanceCount, StartIndexLocation, BaseVertexLocation, StartInstanceLocation); - if(eventId && m_Cmd->m_DrawcallCallback->PostDraw(eventId, list)) + if(eventId && m_Cmd->m_ActionCallback->PostDraw(eventId, list)) { Unwrap(list)->DrawIndexedInstanced(IndexCountPerInstance, InstanceCount, StartIndexLocation, BaseVertexLocation, StartInstanceLocation); - m_Cmd->m_DrawcallCallback->PostRedraw(eventId, list); + m_Cmd->m_ActionCallback->PostRedraw(eventId, list); } } } @@ -3263,16 +3263,16 @@ bool WrappedID3D12GraphicsCommandList::Serialise_DrawIndexedInstanced( m_Cmd->AddEvent(); - DrawcallDescription draw; - draw.numIndices = IndexCountPerInstance; - draw.numInstances = InstanceCount; - draw.indexOffset = StartIndexLocation; - draw.baseVertex = BaseVertexLocation; - draw.instanceOffset = StartInstanceLocation; + ActionDescription action; + action.numIndices = IndexCountPerInstance; + action.numInstances = InstanceCount; + action.indexOffset = StartIndexLocation; + action.baseVertex = BaseVertexLocation; + action.instanceOffset = StartInstanceLocation; - draw.flags |= DrawFlags::Drawcall | DrawFlags::Instanced | DrawFlags::Indexed; + action.flags |= ActionFlags::Drawcall | ActionFlags::Instanced | ActionFlags::Indexed; - m_Cmd->AddDrawcall(draw); + m_Cmd->AddAction(action); } } @@ -3292,7 +3292,7 @@ void WrappedID3D12GraphicsCommandList::DrawIndexedInstanced(UINT IndexCountPerIn if(IsCaptureMode(m_State)) { CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D12Chunk::List_DrawIndexedInstanced); Serialise_DrawIndexedInstanced(ser, IndexCountPerInstance, InstanceCount, StartIndexLocation, BaseVertexLocation, StartInstanceLocation); @@ -3328,10 +3328,10 @@ bool WrappedID3D12GraphicsCommandList::Serialise_Dispatch(SerialiserType &ser, U Unwrap(list)->Dispatch(ThreadGroupCountX, ThreadGroupCountY, ThreadGroupCountZ); - if(eventId && m_Cmd->m_DrawcallCallback->PostDraw(eventId, list)) + if(eventId && m_Cmd->m_ActionCallback->PostDraw(eventId, list)) { Unwrap(list)->Dispatch(ThreadGroupCountX, ThreadGroupCountY, ThreadGroupCountZ); - m_Cmd->m_DrawcallCallback->PostRedraw(eventId, list); + m_Cmd->m_ActionCallback->PostRedraw(eventId, list); } } } @@ -3342,14 +3342,14 @@ bool WrappedID3D12GraphicsCommandList::Serialise_Dispatch(SerialiserType &ser, U m_Cmd->AddEvent(); - DrawcallDescription draw; - draw.dispatchDimension[0] = ThreadGroupCountX; - draw.dispatchDimension[1] = ThreadGroupCountY; - draw.dispatchDimension[2] = ThreadGroupCountZ; + ActionDescription action; + action.dispatchDimension[0] = ThreadGroupCountX; + action.dispatchDimension[1] = ThreadGroupCountY; + action.dispatchDimension[2] = ThreadGroupCountZ; - draw.flags |= DrawFlags::Dispatch; + action.flags |= ActionFlags::Dispatch; - m_Cmd->AddDrawcall(draw); + m_Cmd->AddAction(action); } } @@ -3364,7 +3364,7 @@ void WrappedID3D12GraphicsCommandList::Dispatch(UINT ThreadGroupCountX, UINT Thr if(IsCaptureMode(m_State)) { CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D12Chunk::List_Dispatch); Serialise_Dispatch(ser, ThreadGroupCountX, ThreadGroupCountY, ThreadGroupCountZ); @@ -3398,10 +3398,10 @@ bool WrappedID3D12GraphicsCommandList::Serialise_ExecuteBundle(SerialiserType &s Unwrap(list)->ExecuteBundle(Unwrap(pBundle)); - if(eventId && m_Cmd->m_DrawcallCallback->PostDraw(eventId, list)) + if(eventId && m_Cmd->m_ActionCallback->PostDraw(eventId, list)) { Unwrap(list)->ExecuteBundle(Unwrap(pBundle)); - m_Cmd->m_DrawcallCallback->PostRedraw(eventId, list); + m_Cmd->m_ActionCallback->PostRedraw(eventId, list); } } } @@ -3412,10 +3412,10 @@ bool WrappedID3D12GraphicsCommandList::Serialise_ExecuteBundle(SerialiserType &s m_Cmd->AddEvent(); - DrawcallDescription draw; - draw.flags |= DrawFlags::CmdList; + ActionDescription action; + action.flags |= ActionFlags::CmdList; - m_Cmd->AddDrawcall(draw); + m_Cmd->AddAction(action); } } @@ -3429,7 +3429,7 @@ void WrappedID3D12GraphicsCommandList::ExecuteBundle(ID3D12GraphicsCommandList * if(IsCaptureMode(m_State)) { CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D12Chunk::List_ExecuteBundle); Serialise_ExecuteBundle(ser, pCommandList); @@ -3454,8 +3454,8 @@ void WrappedID3D12GraphicsCommandList::ExecuteBundle(ID3D12GraphicsCommandList * * Then when we come to ExecuteCommandLists this list, we go step by step through the cracked lists, * executing the first, then syncing to the GPU and patching the argument buffer before continuing. * - * At loading time we reserve a maxCount number of drawcalls and events, and later on when patching - * the argument buffer we fill in the parameters/names and remove any excess draws that weren't + * At loading time we reserve a maxCount number of actions and events, and later on when patching + * the argument buffer we fill in the parameters/names and remove any excess actions that weren't * actually executed. * * During active replaying we read the patched argument buffer and execute any commands needed by @@ -3466,7 +3466,7 @@ void WrappedID3D12GraphicsCommandList::ReserveExecuteIndirect(ID3D12GraphicsComm WrappedID3D12CommandSignature *comSig, UINT maxCount) { - const bool multidraw = (maxCount > 1 || comSig->sig.numDraws > 1); + const bool multiaction = (maxCount > 1 || comSig->sig.numActions > 1); const uint32_t sigSize = (uint32_t)comSig->sig.arguments.size(); RDCASSERT(IsLoading(m_State)); @@ -3484,11 +3484,10 @@ void WrappedID3D12GraphicsCommandList::ReserveExecuteIndirect(ID3D12GraphicsComm case D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH: case D3D12_INDIRECT_ARGUMENT_TYPE_DRAW_INDEXED: case D3D12_INDIRECT_ARGUMENT_TYPE_DRAW: - // add dummy event and drawcall + // add dummy event and action m_Cmd->AddEvent(); - m_Cmd->AddDrawcall(DrawcallDescription()); - m_Cmd->GetDrawcallStack().back()->children.back().state = - new D3D12RenderState(cmdInfo.state); + m_Cmd->AddAction(ActionDescription()); + m_Cmd->GetActionStack().back()->children.back().state = new D3D12RenderState(cmdInfo.state); cmdInfo.curEventID++; break; case D3D12_INDIRECT_ARGUMENT_TYPE_VERTEX_BUFFER_VIEW: @@ -3506,13 +3505,13 @@ void WrappedID3D12GraphicsCommandList::ReserveExecuteIndirect(ID3D12GraphicsComm } } - if(multidraw) + if(multiaction) { m_Cmd->AddEvent(); - DrawcallDescription draw; - draw.name = "ID3D12GraphicsCommandList::ExecuteIndirect()"; - draw.flags = DrawFlags::PopMarker; - m_Cmd->AddDrawcall(draw); + ActionDescription action; + action.name = "ID3D12GraphicsCommandList::ExecuteIndirect()"; + action.flags = ActionFlags::PopMarker; + m_Cmd->AddAction(action); } else { @@ -3540,7 +3539,7 @@ void WrappedID3D12GraphicsCommandList::PatchExecuteIndirect(BakedCmdListInfo &in exec.realCount = count; - const bool multidraw = (count > 1 || comSig->sig.numDraws > 1); + const bool multiaction = (count > 1 || comSig->sig.numActions > 1); const uint32_t sigSize = (uint32_t)comSig->sig.arguments.size(); const bool gfx = comSig->sig.graphics; @@ -3551,26 +3550,27 @@ void WrappedID3D12GraphicsCommandList::PatchExecuteIndirect(BakedCmdListInfo &in byte *mapPtr = NULL; exec.argBuf->Map(0, &range, (void **)&mapPtr); - rdcarray &draws = info.draw->children; + rdcarray &actions = info.action->children; size_t idx = 0; uint32_t eid = exec.baseEvent; - // find the draw where our execute begins - for(; idx < draws.size(); idx++) - if(draws[idx].draw.eventId == eid) + // find the action where our execute begins + for(; idx < actions.size(); idx++) + if(actions[idx].action.eventId == eid) break; - RDCASSERTMSG("Couldn't find base event draw!", idx < draws.size(), idx, draws.size()); + RDCASSERTMSG("Couldn't find base event action!", idx < actions.size(), idx, actions.size()); - // patch the name for the base drawcall - draws[idx].draw.name = + // patch the name for the base action + actions[idx].action.name = StringFormat::Fmt("ExecuteIndirect(maxCount %u, count <%u>)", exec.maxCount, count); // if there's only one command running, remove its pushmarker flag - if(!multidraw) - draws[idx].draw.flags = (draws[idx].draw.flags & ~DrawFlags::PushMarker) | DrawFlags::SetMarker; + if(!multiaction) + actions[idx].action.flags = + (actions[idx].action.flags & ~ActionFlags::PushMarker) | ActionFlags::SetMarker; - // move to the first actual draw of the commands + // move to the first actual action of the commands idx++; eid++; @@ -3578,12 +3578,12 @@ void WrappedID3D12GraphicsCommandList::PatchExecuteIndirect(BakedCmdListInfo &in if(count > 0) { - RDCASSERT(draws[idx].state); + RDCASSERT(actions[idx].state); - state = *draws[idx].state; + state = *actions[idx].state; } - SDChunk *baseChunk = m_Cmd->m_StructuredFile->chunks[draws[idx].draw.events[0].chunkIndex]; + SDChunk *baseChunk = m_Cmd->m_StructuredFile->chunks[actions[idx].action.events[0].chunkIndex]; for(uint32_t i = 0; i < count; i++) { @@ -3594,11 +3594,11 @@ void WrappedID3D12GraphicsCommandList::PatchExecuteIndirect(BakedCmdListInfo &in { const D3D12_INDIRECT_ARGUMENT_DESC &arg = comSig->sig.arguments[a]; - DrawcallDescription &curDraw = draws[idx].draw; + ActionDescription &curAction = actions[idx].action; APIEvent *curEvent = NULL; - for(APIEvent &ev : curDraw.events) + for(APIEvent &ev : curAction.events) { if(ev.eventId == eid) { @@ -3610,7 +3610,7 @@ void WrappedID3D12GraphicsCommandList::PatchExecuteIndirect(BakedCmdListInfo &in APIEvent dummy; if(!curEvent) { - RDCWARN("Couldn't find EID %u in current draw while patching ExecuteIndirect", eid); + RDCWARN("Couldn't find EID %u in current action while patching ExecuteIndirect", eid); // assign a dummy so we don't have to NULL-check below curEvent = &dummy; } @@ -3634,25 +3634,25 @@ void WrappedID3D12GraphicsCommandList::PatchExecuteIndirect(BakedCmdListInfo &in D3D12_DRAW_ARGUMENTS *args = (D3D12_DRAW_ARGUMENTS *)data; data += sizeof(D3D12_DRAW_ARGUMENTS); - curDraw.drawIndex = a; - curDraw.numIndices = args->VertexCountPerInstance; - curDraw.numInstances = args->InstanceCount; - curDraw.vertexOffset = args->StartVertexLocation; - curDraw.instanceOffset = args->StartInstanceLocation; - curDraw.flags |= DrawFlags::Drawcall | DrawFlags::Instanced | DrawFlags::Indirect; - curDraw.name = StringFormat::Fmt("[%u] arg%u: IndirectDraw(<%u, %u>)", i, a, - curDraw.numIndices, curDraw.numInstances); + curAction.drawIndex = a; + curAction.numIndices = args->VertexCountPerInstance; + curAction.numInstances = args->InstanceCount; + curAction.vertexOffset = args->StartVertexLocation; + curAction.instanceOffset = args->StartInstanceLocation; + curAction.flags |= ActionFlags::Drawcall | ActionFlags::Instanced | ActionFlags::Indirect; + curAction.name = StringFormat::Fmt("[%u] arg%u: IndirectDraw(<%u, %u>)", i, a, + curAction.numIndices, curAction.numInstances); - fakeChunk->name = curDraw.name; + fakeChunk->name = curAction.name; structuriser.Serialise("ArgumentData"_lit, *args).Important(); - // if this is the first draw of the indirect, we could have picked up previous - // non-indirect events in this drawcall, so the EID will be higher than we expect. Just - // assign the draw's EID - eid = curDraw.eventId; + // if this is the first action of the indirect, we could have picked up previous + // non-indirect events in this action, so the EID will be higher than we expect. Just + // assign the action's EID + eid = curAction.eventId; - m_Cmd->AddUsage(state, draws[idx]); + m_Cmd->AddUsage(state, actions[idx]); // advance idx++; @@ -3665,27 +3665,27 @@ void WrappedID3D12GraphicsCommandList::PatchExecuteIndirect(BakedCmdListInfo &in D3D12_DRAW_INDEXED_ARGUMENTS *args = (D3D12_DRAW_INDEXED_ARGUMENTS *)data; data += sizeof(D3D12_DRAW_INDEXED_ARGUMENTS); - curDraw.drawIndex = a; - curDraw.numIndices = args->IndexCountPerInstance; - curDraw.numInstances = args->InstanceCount; - curDraw.baseVertex = args->BaseVertexLocation; - curDraw.indexOffset = args->StartIndexLocation; - curDraw.instanceOffset = args->StartInstanceLocation; - curDraw.flags |= DrawFlags::Drawcall | DrawFlags::Instanced | DrawFlags::Indexed | - DrawFlags::Indirect; - curDraw.name = StringFormat::Fmt("[%u] arg%u: IndirectDrawIndexed(<%u, %u>)", i, a, - curDraw.numIndices, curDraw.numInstances); + curAction.drawIndex = a; + curAction.numIndices = args->IndexCountPerInstance; + curAction.numInstances = args->InstanceCount; + curAction.baseVertex = args->BaseVertexLocation; + curAction.indexOffset = args->StartIndexLocation; + curAction.instanceOffset = args->StartInstanceLocation; + curAction.flags |= ActionFlags::Drawcall | ActionFlags::Instanced | + ActionFlags::Indexed | ActionFlags::Indirect; + curAction.name = StringFormat::Fmt("[%u] arg%u: IndirectDrawIndexed(<%u, %u>)", i, a, + curAction.numIndices, curAction.numInstances); - fakeChunk->name = curDraw.name; + fakeChunk->name = curAction.name; structuriser.Serialise("ArgumentData"_lit, *args).Important(); - // if this is the first draw of the indirect, we could have picked up previous - // non-indirect events in this drawcall, so the EID will be higher than we expect. Just - // assign the draw's EID - eid = curDraw.eventId; + // if this is the first action of the indirect, we could have picked up previous + // non-indirect events in this action, so the EID will be higher than we expect. Just + // assign the action's EID + eid = curAction.eventId; - m_Cmd->AddUsage(state, draws[idx]); + m_Cmd->AddUsage(state, actions[idx]); // advance idx++; @@ -3698,24 +3698,24 @@ void WrappedID3D12GraphicsCommandList::PatchExecuteIndirect(BakedCmdListInfo &in D3D12_DISPATCH_ARGUMENTS *args = (D3D12_DISPATCH_ARGUMENTS *)data; data += sizeof(D3D12_DISPATCH_ARGUMENTS); - curDraw.dispatchDimension[0] = args->ThreadGroupCountX; - curDraw.dispatchDimension[1] = args->ThreadGroupCountY; - curDraw.dispatchDimension[2] = args->ThreadGroupCountZ; - curDraw.flags |= DrawFlags::Dispatch | DrawFlags::Indirect; - curDraw.name = StringFormat::Fmt( - "[%u] arg%u: IndirectDispatch(<%u, %u, %u>)", i, a, curDraw.dispatchDimension[0], - curDraw.dispatchDimension[1], curDraw.dispatchDimension[2]); + curAction.dispatchDimension[0] = args->ThreadGroupCountX; + curAction.dispatchDimension[1] = args->ThreadGroupCountY; + curAction.dispatchDimension[2] = args->ThreadGroupCountZ; + curAction.flags |= ActionFlags::Dispatch | ActionFlags::Indirect; + curAction.name = StringFormat::Fmt( + "[%u] arg%u: IndirectDispatch(<%u, %u, %u>)", i, a, curAction.dispatchDimension[0], + curAction.dispatchDimension[1], curAction.dispatchDimension[2]); - fakeChunk->name = curDraw.name; + fakeChunk->name = curAction.name; structuriser.Serialise("ArgumentData"_lit, *args).Important(); - // if this is the first draw of the indirect, we could have picked up previous - // non-indirect events in this drawcall, so the EID will be higher than we expect. Just - // assign the draw's EID - eid = curDraw.eventId; + // if this is the first action of the indirect, we could have picked up previous + // non-indirect events in this action, so the EID will be higher than we expect. Just + // assign the action's EID + eid = curAction.eventId; - m_Cmd->AddUsage(state, draws[idx]); + m_Cmd->AddUsage(state, actions[idx]); // advance idx++; @@ -3741,7 +3741,7 @@ void WrappedID3D12GraphicsCommandList::PatchExecuteIndirect(BakedCmdListInfo &in state.compute.sigelems[arg.Constant.RootParameterIndex].constants.assign( data32, arg.Constant.Num32BitValuesToSet); - // advance only the EID, since we're still in the same draw + // advance only the EID, since we're still in the same action eid++; break; @@ -3772,7 +3772,7 @@ void WrappedID3D12GraphicsCommandList::PatchExecuteIndirect(BakedCmdListInfo &in structuriser.Serialise("ArgumentData"_lit, *vb).Important(); - // advance only the EID, since we're still in the same draw + // advance only the EID, since we're still in the same action eid++; break; @@ -3800,7 +3800,7 @@ void WrappedID3D12GraphicsCommandList::PatchExecuteIndirect(BakedCmdListInfo &in structuriser.Serialise("ArgumentData"_lit, *ib).Important(); - // advance only the EID, since we're still in the same draw + // advance only the EID, since we're still in the same action eid++; break; @@ -3850,7 +3850,7 @@ void WrappedID3D12GraphicsCommandList::PatchExecuteIndirect(BakedCmdListInfo &in structuriser.Serialise("ArgumentData"_lit, buf).Important(); - // advance only the EID, since we're still in the same draw + // advance only the EID, since we're still in the same action eid++; break; @@ -3867,28 +3867,28 @@ void WrappedID3D12GraphicsCommandList::PatchExecuteIndirect(BakedCmdListInfo &in exec.argBuf->Unmap(0, &range); - // remove excesss draws if count < maxCount + // remove excesss actions if count < maxCount if(count < exec.maxCount) { uint32_t shiftEID = (exec.maxCount - count) * sigSize; uint32_t lastEID = exec.baseEvent + 1 + sigSize * exec.maxCount; - uint32_t shiftDrawID = 0; + uint32_t shiftActionID = 0; - while(idx < draws.size() && draws[idx].draw.eventId < lastEID) + while(idx < actions.size() && actions[idx].action.eventId < lastEID) { - draws.erase(idx); - shiftDrawID++; + actions.erase(idx); + shiftActionID++; } - // shift all subsequent EIDs and drawcall IDs so they're contiguous - info.ShiftForRemoved(shiftDrawID, shiftEID, idx); + // shift all subsequent EIDs and action IDs so they're contiguous + info.ShiftForRemoved(shiftActionID, shiftEID, idx); } - if(!multidraw && exec.maxCount > 1) + if(!multiaction && exec.maxCount > 1) { // remove pop event - draws.erase(idx); + actions.erase(idx); info.ShiftForRemoved(1, 1, idx); } @@ -3923,7 +3923,7 @@ void WrappedID3D12GraphicsCommandList::ReplayExecuteIndirect(ID3D12GraphicsComma uint32_t count = exec.realCount; uint32_t origCount = exec.realCount; - const bool multidraw = (count > 1 || comSig->sig.numDraws > 1); + const bool multiaction = (count > 1 || comSig->sig.numActions > 1); const bool gfx = comSig->sig.graphics; const uint32_t sigSize = (uint32_t)comSig->sig.arguments.size(); @@ -3938,7 +3938,7 @@ void WrappedID3D12GraphicsCommandList::ReplayExecuteIndirect(ID3D12GraphicsComma cmdInfo.curEventID += origCount * sigSize; // skip past the pop event - if(multidraw) + if(multiaction) cmdInfo.curEventID++; return; @@ -3978,19 +3978,19 @@ void WrappedID3D12GraphicsCommandList::ReplayExecuteIndirect(ID3D12GraphicsComma curEID += m_Cmd->m_Partial[D3D12CommandData::Secondary].baseEvent; } - D3D12CommandData::DrawcallUse use(m_Cmd->m_CurChunkOffset, 0); - auto it = std::lower_bound(m_Cmd->m_DrawcallUses.begin(), m_Cmd->m_DrawcallUses.end(), use); + D3D12CommandData::ActionUse use(m_Cmd->m_CurChunkOffset, 0); + auto it = std::lower_bound(m_Cmd->m_ActionUses.begin(), m_Cmd->m_ActionUses.end(), use); - if(it == m_Cmd->m_DrawcallUses.end()) + if(it == m_Cmd->m_ActionUses.end()) { - RDCERR("Unexpected drawcall not found in uses vector, offset %llu", m_Cmd->m_CurChunkOffset); + RDCERR("Unexpected action not found in uses vector, offset %llu", m_Cmd->m_CurChunkOffset); } else { uint32_t baseEventID = it->eventId; - // TODO when using a drawcall callback, we should submit every drawcall individually - if(m_Cmd->m_DrawcallCallback) + // TODO when using an action callback, we should submit every action individually + if(m_Cmd->m_ActionCallback) { firstCommand = 0; firstArg = 0; @@ -4280,7 +4280,7 @@ void WrappedID3D12GraphicsCommandList::ReplayExecuteIndirect(ID3D12GraphicsComma cmdInfo.curEventID += origCount * sigSize; // skip past the pop event - if(multidraw) + if(multiaction) cmdInfo.curEventID++; } @@ -4320,22 +4320,22 @@ bool WrappedID3D12GraphicsCommandList::Serialise_ExecuteIndirect( m_Cmd->AddEvent(); - DrawcallDescription draw; - draw.name = "ExecuteIndirect"; + ActionDescription action; + action.name = "ExecuteIndirect"; - draw.flags |= DrawFlags::MultiDraw; + action.flags |= ActionFlags::MultiAction; - if(MaxCommandCount > 1 || comSig->sig.numDraws > 1) - draw.flags |= DrawFlags::PushMarker; + if(MaxCommandCount > 1 || comSig->sig.numActions > 1) + action.flags |= ActionFlags::PushMarker; - m_Cmd->AddDrawcall(draw); + m_Cmd->AddAction(action); - D3D12DrawcallTreeNode &drawNode = m_Cmd->GetDrawcallStack().back()->children.back(); + D3D12ActionTreeNode &actionNode = m_Cmd->GetActionStack().back()->children.back(); - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(pArgumentBuffer), EventUsage(drawNode.draw.eventId, ResourceUsage::Indirect))); - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(pCountBuffer), EventUsage(drawNode.draw.eventId, ResourceUsage::Indirect))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(pArgumentBuffer), EventUsage(actionNode.action.eventId, ResourceUsage::Indirect))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(pCountBuffer), EventUsage(actionNode.action.eventId, ResourceUsage::Indirect))); ID3D12GraphicsCommandList *cracked = GetCrackedList(); @@ -4397,7 +4397,7 @@ bool WrappedID3D12GraphicsCommandList::Serialise_ExecuteIndirect( m_Cmd->m_BakedCmdListInfo[m_Cmd->m_LastCmdListID].state.ApplyState(m_pDevice, list); } - // perform indirect draw, but from patched buffer. It will be patched between the above list + // perform indirect action, but from patched buffer. It will be patched between the above list // and this list during the first execution of the command list Unwrap(pCommandList) ->ExecuteIndirect(comSig->GetReal(), MaxCommandCount, Unwrap(exec.argBuf), exec.argOffs, @@ -4409,7 +4409,7 @@ bool WrappedID3D12GraphicsCommandList::Serialise_ExecuteIndirect( m_Cmd->m_BakedCmdListInfo[m_Cmd->m_LastCmdListID].curEventID++; - // reserve the right number of drawcalls and events, to later be patched up with the actual + // reserve the right number of actions and events, to later be patched up with the actual // details ReserveExecuteIndirect(pCommandList, comSig, MaxCommandCount); } @@ -4431,7 +4431,7 @@ void WrappedID3D12GraphicsCommandList::ExecuteIndirect(ID3D12CommandSignature *p if(IsCaptureMode(m_State)) { CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D12Chunk::List_ExecuteIndirect); Serialise_ExecuteIndirect(ser, pCommandSignature, MaxCommandCount, pArgumentBuffer, ArgumentBufferOffset, pCountBuffer, CountBufferOffset); @@ -4504,17 +4504,18 @@ bool WrappedID3D12GraphicsCommandList::Serialise_ClearDepthStencilView( D3D12Descriptor *descriptor = GetWrapped(DepthStencilView); - DrawcallDescription draw; - draw.flags |= DrawFlags::Clear | DrawFlags::ClearDepthStencil; - draw.copyDestination = GetResourceManager()->GetOriginalID(descriptor->GetResResourceId()); - draw.copyDestinationSubresource = + ActionDescription action; + action.flags |= ActionFlags::Clear | ActionFlags::ClearDepthStencil; + action.copyDestination = GetResourceManager()->GetOriginalID(descriptor->GetResResourceId()); + action.copyDestinationSubresource = Subresource(GetMipForDsv(descriptor->GetDSV()), GetSliceForDsv(descriptor->GetDSV())); - m_Cmd->AddDrawcall(draw); + m_Cmd->AddAction(action); - D3D12DrawcallTreeNode &drawNode = m_Cmd->GetDrawcallStack().back()->children.back(); + D3D12ActionTreeNode &actionNode = m_Cmd->GetActionStack().back()->children.back(); - drawNode.resourceUsage.push_back(make_rdcpair( - descriptor->GetResResourceId(), EventUsage(drawNode.draw.eventId, ResourceUsage::Clear))); + actionNode.resourceUsage.push_back( + make_rdcpair(descriptor->GetResResourceId(), + EventUsage(actionNode.action.eventId, ResourceUsage::Clear))); } } } @@ -4532,7 +4533,7 @@ void WrappedID3D12GraphicsCommandList::ClearDepthStencilView( if(IsCaptureMode(m_State)) { CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D12Chunk::List_ClearDepthStencilView); Serialise_ClearDepthStencilView(ser, DepthStencilView, ClearFlags, Depth, Stencil, NumRects, pRects); @@ -4595,17 +4596,18 @@ bool WrappedID3D12GraphicsCommandList::Serialise_ClearRenderTargetView( D3D12Descriptor *descriptor = GetWrapped(RenderTargetView); - DrawcallDescription draw; - draw.flags |= DrawFlags::Clear | DrawFlags::ClearColor; - draw.copyDestination = GetResourceManager()->GetOriginalID(descriptor->GetResResourceId()); - draw.copyDestinationSubresource = + ActionDescription action; + action.flags |= ActionFlags::Clear | ActionFlags::ClearColor; + action.copyDestination = GetResourceManager()->GetOriginalID(descriptor->GetResResourceId()); + action.copyDestinationSubresource = Subresource(GetMipForRtv(descriptor->GetRTV()), GetSliceForRtv(descriptor->GetRTV())); - m_Cmd->AddDrawcall(draw); + m_Cmd->AddAction(action); - D3D12DrawcallTreeNode &drawNode = m_Cmd->GetDrawcallStack().back()->children.back(); + D3D12ActionTreeNode &actionNode = m_Cmd->GetActionStack().back()->children.back(); - drawNode.resourceUsage.push_back(make_rdcpair( - descriptor->GetResResourceId(), EventUsage(drawNode.draw.eventId, ResourceUsage::Clear))); + actionNode.resourceUsage.push_back( + make_rdcpair(descriptor->GetResResourceId(), + EventUsage(actionNode.action.eventId, ResourceUsage::Clear))); } } } @@ -4623,7 +4625,7 @@ void WrappedID3D12GraphicsCommandList::ClearRenderTargetView( if(IsCaptureMode(m_State)) { CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D12Chunk::List_ClearRenderTargetView); Serialise_ClearRenderTargetView(ser, RenderTargetView, ColorRGBA, NumRects, pRects); @@ -4691,17 +4693,17 @@ bool WrappedID3D12GraphicsCommandList::Serialise_ClearUnorderedAccessViewUint( { m_Cmd->AddEvent(); - DrawcallDescription draw; - draw.flags |= DrawFlags::Clear; - draw.copyDestination = GetResourceManager()->GetOriginalID(GetResID(pResource)); - draw.copyDestinationSubresource = Subresource(); + ActionDescription action; + action.flags |= ActionFlags::Clear; + action.copyDestination = GetResourceManager()->GetOriginalID(GetResID(pResource)); + action.copyDestinationSubresource = Subresource(); - m_Cmd->AddDrawcall(draw); + m_Cmd->AddAction(action); - D3D12DrawcallTreeNode &drawNode = m_Cmd->GetDrawcallStack().back()->children.back(); + D3D12ActionTreeNode &actionNode = m_Cmd->GetActionStack().back()->children.back(); - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(pResource), EventUsage(drawNode.draw.eventId, ResourceUsage::Clear))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(pResource), EventUsage(actionNode.action.eventId, ResourceUsage::Clear))); } } } @@ -4720,7 +4722,7 @@ void WrappedID3D12GraphicsCommandList::ClearUnorderedAccessViewUint( if(IsCaptureMode(m_State)) { CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D12Chunk::List_ClearUnorderedAccessViewUint); Serialise_ClearUnorderedAccessViewUint(ser, ViewGPUHandleInCurrentHeap, ViewCPUHandle, pResource, Values, NumRects, pRects); @@ -4795,17 +4797,17 @@ bool WrappedID3D12GraphicsCommandList::Serialise_ClearUnorderedAccessViewFloat( { m_Cmd->AddEvent(); - DrawcallDescription draw; - draw.flags |= DrawFlags::Clear; - draw.copyDestination = GetResourceManager()->GetOriginalID(GetResID(pResource)); - draw.copyDestinationSubresource = Subresource(); + ActionDescription action; + action.flags |= ActionFlags::Clear; + action.copyDestination = GetResourceManager()->GetOriginalID(GetResID(pResource)); + action.copyDestinationSubresource = Subresource(); - m_Cmd->AddDrawcall(draw); + m_Cmd->AddAction(action); - D3D12DrawcallTreeNode &drawNode = m_Cmd->GetDrawcallStack().back()->children.back(); + D3D12ActionTreeNode &actionNode = m_Cmd->GetActionStack().back()->children.back(); - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(pResource), EventUsage(drawNode.draw.eventId, ResourceUsage::Clear))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(pResource), EventUsage(actionNode.action.eventId, ResourceUsage::Clear))); } } } @@ -4824,7 +4826,7 @@ void WrappedID3D12GraphicsCommandList::ClearUnorderedAccessViewFloat( if(IsCaptureMode(m_State)) { CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D12Chunk::List_ClearUnorderedAccessViewFloat); Serialise_ClearUnorderedAccessViewFloat(ser, ViewGPUHandleInCurrentHeap, ViewCPUHandle, pResource, Values, NumRects, pRects); @@ -4885,17 +4887,17 @@ bool WrappedID3D12GraphicsCommandList::Serialise_DiscardResource(SerialiserType { m_Cmd->AddEvent(); - DrawcallDescription draw; - draw.flags |= DrawFlags::Clear; - draw.copyDestination = GetResourceManager()->GetOriginalID(GetResID(pResource)); - draw.copyDestinationSubresource = Subresource(); + ActionDescription action; + action.flags |= ActionFlags::Clear; + action.copyDestination = GetResourceManager()->GetOriginalID(GetResID(pResource)); + action.copyDestinationSubresource = Subresource(); - m_Cmd->AddDrawcall(draw); + m_Cmd->AddAction(action); - D3D12DrawcallTreeNode &drawNode = m_Cmd->GetDrawcallStack().back()->children.back(); + D3D12ActionTreeNode &actionNode = m_Cmd->GetActionStack().back()->children.back(); - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(pResource), EventUsage(drawNode.draw.eventId, ResourceUsage::Discard))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(pResource), EventUsage(actionNode.action.eventId, ResourceUsage::Discard))); } } } @@ -4963,29 +4965,29 @@ bool WrappedID3D12GraphicsCommandList::Serialise_CopyBufferRegion(SerialiserType { m_Cmd->AddEvent(); - DrawcallDescription draw; - draw.copySource = GetResourceManager()->GetOriginalID(GetResID(pSrcBuffer)); - draw.copySourceSubresource = Subresource(); - draw.copyDestination = GetResourceManager()->GetOriginalID(GetResID(pDstBuffer)); - draw.copyDestinationSubresource = Subresource(); + ActionDescription action; + action.copySource = GetResourceManager()->GetOriginalID(GetResID(pSrcBuffer)); + action.copySourceSubresource = Subresource(); + action.copyDestination = GetResourceManager()->GetOriginalID(GetResID(pDstBuffer)); + action.copyDestinationSubresource = Subresource(); - draw.flags |= DrawFlags::Copy; + action.flags |= ActionFlags::Copy; - m_Cmd->AddDrawcall(draw); + m_Cmd->AddAction(action); - D3D12DrawcallTreeNode &drawNode = m_Cmd->GetDrawcallStack().back()->children.back(); + D3D12ActionTreeNode &actionNode = m_Cmd->GetActionStack().back()->children.back(); if(pSrcBuffer == pDstBuffer) { - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(pSrcBuffer), EventUsage(drawNode.draw.eventId, ResourceUsage::Copy))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(pSrcBuffer), EventUsage(actionNode.action.eventId, ResourceUsage::Copy))); } else { - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(pSrcBuffer), EventUsage(drawNode.draw.eventId, ResourceUsage::CopySrc))); - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(pDstBuffer), EventUsage(drawNode.draw.eventId, ResourceUsage::CopyDst))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(pSrcBuffer), EventUsage(actionNode.action.eventId, ResourceUsage::CopySrc))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(pDstBuffer), EventUsage(actionNode.action.eventId, ResourceUsage::CopyDst))); } } } @@ -5004,7 +5006,7 @@ void WrappedID3D12GraphicsCommandList::CopyBufferRegion(ID3D12Resource *pDstBuff if(IsCaptureMode(m_State)) { CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D12Chunk::List_CopyBufferRegion); Serialise_CopyBufferRegion(ser, pDstBuffer, DstOffset, pSrcBuffer, SrcOffset, NumBytes); @@ -5061,42 +5063,42 @@ bool WrappedID3D12GraphicsCommandList::Serialise_CopyTextureRegion( ResourceId origSrc = GetResourceManager()->GetOriginalID(liveSrc); ResourceId origDst = GetResourceManager()->GetOriginalID(liveDst); - DrawcallDescription draw; - draw.flags |= DrawFlags::Copy; + ActionDescription action; + action.flags |= ActionFlags::Copy; - draw.copySource = origSrc; - draw.copySourceSubresource = Subresource(); + action.copySource = origSrc; + action.copySourceSubresource = Subresource(); if(unwrappedSrc.Type == D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX) { - draw.copySourceSubresource = Subresource( + action.copySourceSubresource = Subresource( GetMipForSubresource(unwrappedSrc.pResource, unwrappedSrc.SubresourceIndex), GetSliceForSubresource(unwrappedSrc.pResource, unwrappedSrc.SubresourceIndex)); } - draw.copyDestination = origDst; - draw.copyDestinationSubresource = Subresource(); + action.copyDestination = origDst; + action.copyDestinationSubresource = Subresource(); if(unwrappedDst.Type == D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX) { - draw.copyDestinationSubresource = Subresource( + action.copyDestinationSubresource = Subresource( GetMipForSubresource(unwrappedDst.pResource, unwrappedDst.SubresourceIndex), GetSliceForSubresource(unwrappedDst.pResource, unwrappedDst.SubresourceIndex)); } - m_Cmd->AddDrawcall(draw); + m_Cmd->AddAction(action); - D3D12DrawcallTreeNode &drawNode = m_Cmd->GetDrawcallStack().back()->children.back(); + D3D12ActionTreeNode &actionNode = m_Cmd->GetActionStack().back()->children.back(); if(origSrc == origDst) { - drawNode.resourceUsage.push_back( - make_rdcpair(liveSrc, EventUsage(drawNode.draw.eventId, ResourceUsage::Copy))); + actionNode.resourceUsage.push_back( + make_rdcpair(liveSrc, EventUsage(actionNode.action.eventId, ResourceUsage::Copy))); } else { - drawNode.resourceUsage.push_back( - make_rdcpair(liveSrc, EventUsage(drawNode.draw.eventId, ResourceUsage::CopySrc))); - drawNode.resourceUsage.push_back( - make_rdcpair(liveDst, EventUsage(drawNode.draw.eventId, ResourceUsage::CopyDst))); + actionNode.resourceUsage.push_back( + make_rdcpair(liveSrc, EventUsage(actionNode.action.eventId, ResourceUsage::CopySrc))); + actionNode.resourceUsage.push_back( + make_rdcpair(liveDst, EventUsage(actionNode.action.eventId, ResourceUsage::CopyDst))); } } } @@ -5121,7 +5123,7 @@ void WrappedID3D12GraphicsCommandList::CopyTextureRegion(const D3D12_TEXTURE_COP if(IsCaptureMode(m_State)) { CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D12Chunk::List_CopyTextureRegion); Serialise_CopyTextureRegion(ser, pDst, DstX, DstY, DstZ, pSrc, pSrcBox); @@ -5163,29 +5165,29 @@ bool WrappedID3D12GraphicsCommandList::Serialise_CopyResource(SerialiserType &se { m_Cmd->AddEvent(); - DrawcallDescription draw; - draw.copySource = GetResourceManager()->GetOriginalID(GetResID(pSrcResource)); - draw.copySourceSubresource = Subresource(); - draw.copyDestination = GetResourceManager()->GetOriginalID(GetResID(pDstResource)); - draw.copyDestinationSubresource = Subresource(); + ActionDescription action; + action.copySource = GetResourceManager()->GetOriginalID(GetResID(pSrcResource)); + action.copySourceSubresource = Subresource(); + action.copyDestination = GetResourceManager()->GetOriginalID(GetResID(pDstResource)); + action.copyDestinationSubresource = Subresource(); - draw.flags |= DrawFlags::Copy; + action.flags |= ActionFlags::Copy; - m_Cmd->AddDrawcall(draw); + m_Cmd->AddAction(action); - D3D12DrawcallTreeNode &drawNode = m_Cmd->GetDrawcallStack().back()->children.back(); + D3D12ActionTreeNode &actionNode = m_Cmd->GetActionStack().back()->children.back(); if(pSrcResource == pDstResource) { - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(pSrcResource), EventUsage(drawNode.draw.eventId, ResourceUsage::Copy))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(pSrcResource), EventUsage(actionNode.action.eventId, ResourceUsage::Copy))); } else { - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(pSrcResource), EventUsage(drawNode.draw.eventId, ResourceUsage::CopySrc))); - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(pDstResource), EventUsage(drawNode.draw.eventId, ResourceUsage::CopyDst))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(pSrcResource), EventUsage(actionNode.action.eventId, ResourceUsage::CopySrc))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(pDstResource), EventUsage(actionNode.action.eventId, ResourceUsage::CopyDst))); } } } @@ -5202,7 +5204,7 @@ void WrappedID3D12GraphicsCommandList::CopyResource(ID3D12Resource *pDstResource if(IsCaptureMode(m_State)) { CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D12Chunk::List_CopyResource); Serialise_CopyResource(ser, pDstResource, pSrcResource); @@ -5251,34 +5253,36 @@ bool WrappedID3D12GraphicsCommandList::Serialise_ResolveSubresource( { m_Cmd->AddEvent(); - DrawcallDescription draw; - draw.copySource = GetResourceManager()->GetOriginalID(GetResID(pSrcResource)); - draw.copySourceSubresource = + ActionDescription action; + action.copySource = GetResourceManager()->GetOriginalID(GetResID(pSrcResource)); + action.copySourceSubresource = Subresource(GetMipForSubresource(pSrcResource, SrcSubresource), GetSliceForSubresource(pSrcResource, SrcSubresource)); - draw.copyDestination = GetResourceManager()->GetOriginalID(GetResID(pDstResource)); - draw.copyDestinationSubresource = + action.copyDestination = GetResourceManager()->GetOriginalID(GetResID(pDstResource)); + action.copyDestinationSubresource = Subresource(GetMipForSubresource(pDstResource, DstSubresource), GetSliceForSubresource(pDstResource, DstSubresource)); - draw.flags |= DrawFlags::Resolve; + action.flags |= ActionFlags::Resolve; - m_Cmd->AddDrawcall(draw); + m_Cmd->AddAction(action); - D3D12DrawcallTreeNode &drawNode = m_Cmd->GetDrawcallStack().back()->children.back(); + D3D12ActionTreeNode &actionNode = m_Cmd->GetActionStack().back()->children.back(); if(pSrcResource == pDstResource) { - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(pSrcResource), EventUsage(drawNode.draw.eventId, ResourceUsage::Resolve))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(pSrcResource), EventUsage(actionNode.action.eventId, ResourceUsage::Resolve))); } else { - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(pSrcResource), EventUsage(drawNode.draw.eventId, ResourceUsage::ResolveSrc))); - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(pDstResource), EventUsage(drawNode.draw.eventId, ResourceUsage::ResolveDst))); + actionNode.resourceUsage.push_back( + make_rdcpair(GetResID(pSrcResource), + EventUsage(actionNode.action.eventId, ResourceUsage::ResolveSrc))); + actionNode.resourceUsage.push_back( + make_rdcpair(GetResID(pDstResource), + EventUsage(actionNode.action.eventId, ResourceUsage::ResolveDst))); } } } @@ -5298,7 +5302,7 @@ void WrappedID3D12GraphicsCommandList::ResolveSubresource(ID3D12Resource *pDstRe if(IsCaptureMode(m_State)) { CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D12Chunk::List_ResolveSubresource); Serialise_ResolveSubresource(ser, pDstResource, DstSubresource, pSrcResource, SrcSubresource, Format); @@ -5360,29 +5364,29 @@ bool WrappedID3D12GraphicsCommandList::Serialise_CopyTiles( ResourceId origSrc = GetResourceManager()->GetOriginalID(liveSrc); ResourceId origDst = GetResourceManager()->GetOriginalID(liveDst); - DrawcallDescription draw; - draw.flags |= DrawFlags::Copy; + ActionDescription action; + action.flags |= ActionFlags::Copy; - draw.copySource = origSrc; - draw.copyDestination = origDst; + action.copySource = origSrc; + action.copyDestination = origDst; Subresource tileSub = Subresource( GetMipForSubresource(pTiledResource, TileRegionStartCoordinate.Subresource), GetSliceForSubresource(pTiledResource, TileRegionStartCoordinate.Subresource)); if(Flags & D3D12_TILE_COPY_FLAG_SWIZZLED_TILED_RESOURCE_TO_LINEAR_BUFFER) - draw.copySourceSubresource = tileSub; + action.copySourceSubresource = tileSub; else - draw.copyDestinationSubresource = tileSub; + action.copyDestinationSubresource = tileSub; - m_Cmd->AddDrawcall(draw); + m_Cmd->AddAction(action); - D3D12DrawcallTreeNode &drawNode = m_Cmd->GetDrawcallStack().back()->children.back(); + D3D12ActionTreeNode &actionNode = m_Cmd->GetActionStack().back()->children.back(); - drawNode.resourceUsage.push_back( - make_rdcpair(liveSrc, EventUsage(drawNode.draw.eventId, ResourceUsage::CopySrc))); - drawNode.resourceUsage.push_back( - make_rdcpair(liveDst, EventUsage(drawNode.draw.eventId, ResourceUsage::CopyDst))); + actionNode.resourceUsage.push_back( + make_rdcpair(liveSrc, EventUsage(actionNode.action.eventId, ResourceUsage::CopySrc))); + actionNode.resourceUsage.push_back( + make_rdcpair(liveDst, EventUsage(actionNode.action.eventId, ResourceUsage::CopyDst))); } } } @@ -5402,7 +5406,7 @@ void WrappedID3D12GraphicsCommandList::CopyTiles( if(IsCaptureMode(m_State)) { CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D12Chunk::List_CopyTiles); Serialise_CopyTiles(ser, pTiledResource, pTileRegionStartCoordinate, pTileRegionSize, pBuffer, BufferStartOffsetInBytes, Flags); diff --git a/renderdoc/driver/d3d12/d3d12_command_queue.h b/renderdoc/driver/d3d12/d3d12_command_queue.h index 7588e0963..68818f244 100644 --- a/renderdoc/driver/d3d12/d3d12_command_queue.h +++ b/renderdoc/driver/d3d12/d3d12_command_queue.h @@ -194,7 +194,7 @@ public: D3D12ResourceRecord *GetCreationRecord() { return m_CreationRecord; } WrappedID3D12Device *GetWrappedDevice() { return m_pDevice; } const rdcarray &GetCmdLists() { return m_CmdListRecords; } - D3D12DrawcallTreeNode &GetParentDrawcall() { return m_Cmd.m_ParentDrawcall; } + D3D12ActionTreeNode &GetParentAction() { return m_Cmd.m_ParentAction; } const APIEvent &GetEvent(uint32_t eventId); uint32_t GetMaxEID() { return m_Cmd.m_Events.back().eventId; } void ClearAfterCapture(); diff --git a/renderdoc/driver/d3d12/d3d12_command_queue_wrap.cpp b/renderdoc/driver/d3d12/d3d12_command_queue_wrap.cpp index 34de1b73f..4702a553e 100644 --- a/renderdoc/driver/d3d12/d3d12_command_queue_wrap.cpp +++ b/renderdoc/driver/d3d12/d3d12_command_queue_wrap.cpp @@ -79,7 +79,7 @@ void STDMETHODCALLTYPE WrappedID3D12CommandQueue::UpdateTileMappings( if(IsActiveCapturing(m_State)) { CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D12Chunk::Queue_UpdateTileMappings); Serialise_UpdateTileMappings(ser, pResource, NumResourceRegions, pResourceRegionStartCoordinates, pResourceRegionSizes, pHeap, NumRanges, pRangeFlags, @@ -369,7 +369,7 @@ void STDMETHODCALLTYPE WrappedID3D12CommandQueue::CopyTileMappings( if(IsActiveCapturing(m_State)) { CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D12Chunk::Queue_CopyTileMappings); Serialise_CopyTileMappings(ser, pDstResource, pDstRegionStartCoordinate, pSrcResource, pSrcRegionStartCoordinate, pRegionSize, Flags); @@ -535,29 +535,29 @@ bool WrappedID3D12CommandQueue::Serialise_ExecuteCommandLists(SerialiserType &se BakedCmdListInfo &cmdListInfo = m_Cmd.m_BakedCmdListInfo[cmd]; // add a fake marker - DrawcallDescription draw; + ActionDescription action; { - draw.name = + action.name = StringFormat::Fmt("=> %s[%u]: Reset(%s)", basename.c_str(), c, ToStr(cmd).c_str()); - draw.flags = - DrawFlags::CommandBufferBoundary | DrawFlags::PassBoundary | DrawFlags::BeginPass; + action.flags = ActionFlags::CommandBufferBoundary | ActionFlags::PassBoundary | + ActionFlags::BeginPass; m_Cmd.AddEvent(); m_Cmd.m_RootEvents.back().chunkIndex = cmdListInfo.beginChunk; m_Cmd.m_Events.back().chunkIndex = cmdListInfo.beginChunk; - m_Cmd.AddDrawcall(draw); + m_Cmd.AddAction(action); m_Cmd.m_RootEventID++; } // insert the baked command list in-line into this list of notes, assigning new event and // drawIDs - m_Cmd.InsertDrawsAndRefreshIDs(cmd, cmdListInfo.draw->children); + m_Cmd.InsertActionsAndRefreshIDs(cmd, cmdListInfo.action->children); - for(size_t e = 0; e < cmdListInfo.draw->executedCmds.size(); e++) + for(size_t e = 0; e < cmdListInfo.action->executedCmds.size(); e++) { rdcarray &submits = m_Cmd.m_Partial[D3D12CommandData::Secondary] - .cmdListExecs[cmdListInfo.draw->executedCmds[e]]; + .cmdListExecs[cmdListInfo.action->executedCmds[e]]; for(size_t s = 0; s < submits.size(); s++) submits[s] += m_Cmd.m_RootEventID; @@ -584,19 +584,19 @@ bool WrappedID3D12CommandQueue::Serialise_ExecuteCommandLists(SerialiserType &se } m_Cmd.m_RootEventID += cmdListInfo.eventCount; - m_Cmd.m_RootDrawcallID += cmdListInfo.drawCount; + m_Cmd.m_RootActionID += cmdListInfo.actionCount; { - draw.name = + action.name = StringFormat::Fmt("=> %s[%u]: Close(%s)", basename.c_str(), c, ToStr(cmd).c_str()); - draw.flags = - DrawFlags::CommandBufferBoundary | DrawFlags::PassBoundary | DrawFlags::EndPass; + action.flags = + ActionFlags::CommandBufferBoundary | ActionFlags::PassBoundary | ActionFlags::EndPass; m_Cmd.AddEvent(); m_Cmd.m_RootEvents.back().chunkIndex = cmdListInfo.endChunk; m_Cmd.m_Events.back().chunkIndex = cmdListInfo.endChunk; - m_Cmd.AddDrawcall(draw); + m_Cmd.AddAction(action); m_Cmd.m_RootEventID++; } } @@ -618,12 +618,12 @@ bool WrappedID3D12CommandQueue::Serialise_ExecuteCommandLists(SerialiserType &se ResourceId cmd = GetResourceManager()->GetOriginalID(GetResID(ppCommandLists[c])); m_Cmd.m_RootEventID += m_Cmd.m_BakedCmdListInfo[cmd].eventCount; - m_Cmd.m_RootDrawcallID += m_Cmd.m_BakedCmdListInfo[cmd].drawCount; + m_Cmd.m_RootActionID += m_Cmd.m_BakedCmdListInfo[cmd].actionCount; // 2 extra for the virtual labels around the command list { m_Cmd.m_RootEventID += 2; - m_Cmd.m_RootDrawcallID += 2; + m_Cmd.m_RootActionID += 2; } } @@ -1004,7 +1004,7 @@ void WrappedID3D12CommandQueue::ExecuteCommandListsInternal(UINT NumCommandLists { WriteSerialiser &ser = GetThreadSerialiser(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D12Chunk::Queue_ExecuteCommandLists); Serialise_ExecuteCommandLists(ser, NumCommandLists, ppCommandLists); @@ -1040,12 +1040,12 @@ bool WrappedID3D12CommandQueue::Serialise_SetMarker(SerialiserType &ser, UINT Me if(IsLoading(m_State)) { - DrawcallDescription draw; - draw.name = MarkerText; - draw.flags |= DrawFlags::SetMarker; + ActionDescription action; + action.name = MarkerText; + action.flags |= ActionFlags::SetMarker; m_Cmd.AddEvent(); - m_Cmd.AddDrawcall(draw); + m_Cmd.AddAction(action); } } @@ -1060,7 +1060,7 @@ void STDMETHODCALLTYPE WrappedID3D12CommandQueue::SetMarker(UINT Metadata, const if(IsActiveCapturing(m_State)) { CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D12Chunk::Queue_SetMarker); Serialise_SetMarker(ser, Metadata, pData, Size); @@ -1089,15 +1089,15 @@ bool WrappedID3D12CommandQueue::Serialise_BeginEvent(SerialiserType &ser, UINT M if(IsLoading(m_State)) { - DrawcallDescription draw; - draw.name = MarkerText; - draw.flags |= DrawFlags::PushMarker; + ActionDescription action; + action.name = MarkerText; + action.flags |= ActionFlags::PushMarker; m_Cmd.AddEvent(); - m_Cmd.AddDrawcall(draw); + m_Cmd.AddAction(action); - // now push the drawcall stack - m_Cmd.GetDrawcallStack().push_back(&m_Cmd.GetDrawcallStack().back()->children.back()); + // now push the action stack + m_Cmd.GetActionStack().push_back(&m_Cmd.GetActionStack().back()->children.back()); } } @@ -1112,7 +1112,7 @@ void STDMETHODCALLTYPE WrappedID3D12CommandQueue::BeginEvent(UINT Metadata, cons if(IsActiveCapturing(m_State)) { CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D12Chunk::Queue_BeginEvent); Serialise_BeginEvent(ser, Metadata, pData, Size); @@ -1134,14 +1134,14 @@ bool WrappedID3D12CommandQueue::Serialise_EndEvent(SerialiserType &ser) if(IsLoading(m_State)) { - DrawcallDescription draw; - draw.flags |= DrawFlags::PopMarker; + ActionDescription action; + action.flags |= ActionFlags::PopMarker; m_Cmd.AddEvent(); - m_Cmd.AddDrawcall(draw); + m_Cmd.AddAction(action); - if(m_Cmd.GetDrawcallStack().size() > 1) - m_Cmd.GetDrawcallStack().pop_back(); + if(m_Cmd.GetActionStack().size() > 1) + m_Cmd.GetActionStack().pop_back(); } } @@ -1155,7 +1155,7 @@ void STDMETHODCALLTYPE WrappedID3D12CommandQueue::EndEvent() if(IsActiveCapturing(m_State)) { CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D12Chunk::Queue_EndEvent); Serialise_EndEvent(ser); @@ -1277,7 +1277,7 @@ HRESULT STDMETHODCALLTYPE WrappedID3D12CommandQueue::Present( { CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(D3D12Chunk::List_Close); list->Serialise_Close(ser); diff --git a/renderdoc/driver/d3d12/d3d12_commands.cpp b/renderdoc/driver/d3d12/d3d12_commands.cpp index 8358fd5c9..32695268b 100644 --- a/renderdoc/driver/d3d12/d3d12_commands.cpp +++ b/renderdoc/driver/d3d12/d3d12_commands.cpp @@ -571,7 +571,7 @@ const APIEvent &WrappedID3D12CommandQueue::GetEvent(uint32_t eventId) bool WrappedID3D12CommandQueue::ProcessChunk(ReadSerialiser &ser, D3D12Chunk chunk) { - m_Cmd.m_AddedDrawcall = false; + m_Cmd.m_AddedAction = false; bool ret = false; @@ -866,13 +866,13 @@ bool WrappedID3D12CommandQueue::ProcessChunk(ReadSerialiser &ser, D3D12Chunk chu { m_Cmd.AddEvent(); - DrawcallDescription draw; - draw.name = "End of Capture"; - draw.flags |= DrawFlags::Present; + ActionDescription action; + action.name = "End of Capture"; + action.flags |= ActionFlags::Present; - draw.copyDestination = m_Cmd.m_LastPresentedImage; + action.copyDestination = m_Cmd.m_LastPresentedImage; - m_Cmd.AddDrawcall(draw); + m_Cmd.AddAction(action); } ret = true; @@ -892,16 +892,16 @@ bool WrappedID3D12CommandQueue::ProcessChunk(ReadSerialiser &ser, D3D12Chunk chu } else if(chunk == D3D12Chunk::Queue_EndEvent) { - // also ignore, this just pops the drawcall stack + // also ignore, this just pops the action stack } else { - if(!m_Cmd.m_AddedDrawcall) + if(!m_Cmd.m_AddedAction) m_Cmd.AddEvent(); } } - m_Cmd.m_AddedDrawcall = false; + m_Cmd.m_AddedAction = false; return ret; } @@ -973,10 +973,10 @@ ReplayStatus WrappedID3D12CommandQueue::ReplayLog(CaptureState readType, uint32_ { ser.GetReader()->SetOffset(ev.fileOffset); - D3D12CommandData::DrawcallUse use(ev.fileOffset, 0); - auto it = std::lower_bound(m_Cmd.m_DrawcallUses.begin(), m_Cmd.m_DrawcallUses.end(), use); + D3D12CommandData::ActionUse use(ev.fileOffset, 0); + auto it = std::lower_bound(m_Cmd.m_ActionUses.begin(), m_Cmd.m_ActionUses.end(), use); - if(it != m_Cmd.m_DrawcallUses.end()) + if(it != m_Cmd.m_ActionUses.end()) { BakedCmdListInfo &cmdInfo = m_Cmd.m_BakedCmdListInfo[it->cmdList]; cmdInfo.curEventID = it->relativeEID; @@ -989,7 +989,7 @@ ReplayStatus WrappedID3D12CommandQueue::ReplayLog(CaptureState readType, uint32_ else { m_Cmd.m_RootEventID = 1; - m_Cmd.m_RootDrawcallID = 1; + m_Cmd.m_RootActionID = 1; m_Cmd.m_FirstEventID = 0; m_Cmd.m_LastEventID = ~0U; } @@ -1379,35 +1379,35 @@ HRESULT STDMETHODCALLTYPE WrappedID3D12GraphicsCommandList::QueryInterface(REFII return m_RefCounter.QueryInterface("ID3D12GraphicsCommandList", riid, ppvObject); } -void BakedCmdListInfo::ShiftForRemoved(uint32_t shiftDrawID, uint32_t shiftEID, size_t idx) +void BakedCmdListInfo::ShiftForRemoved(uint32_t shiftActionID, uint32_t shiftEID, size_t idx) { - rdcarray &draws = draw->children; + rdcarray &actions = action->children; - drawCount -= shiftDrawID; + actionCount -= shiftActionID; eventCount -= shiftEID; - if(idx < draws.size()) + if(idx < actions.size()) { - for(size_t i = idx; i < draws.size(); i++) + for(size_t i = idx; i < actions.size(); i++) { // should have no children as we don't push in for markers since they // can cross command list boundaries. - RDCASSERT(draws[i].children.empty()); + RDCASSERT(actions[i].children.empty()); - draws[i].draw.eventId -= shiftEID; - draws[i].draw.drawcallId -= shiftDrawID; + actions[i].action.eventId -= shiftEID; + actions[i].action.actionId -= shiftActionID; - for(APIEvent &ev : draws[i].draw.events) + for(APIEvent &ev : actions[i].action.events) ev.eventId -= shiftEID; } - uint32_t lastEID = draws[idx].draw.eventId; + uint32_t lastEID = actions[idx].action.eventId; - // shift any resource usage for drawcalls after the removed section - for(size_t i = 0; i < draw->resourceUsage.size(); i++) + // shift any resource usage for actions after the removed section + for(size_t i = 0; i < action->resourceUsage.size(); i++) { - if(draw->resourceUsage[i].second.eventId >= lastEID) - draw->resourceUsage[i].second.eventId -= shiftEID; + if(action->resourceUsage[i].second.eventId >= lastEID) + action->resourceUsage[i].second.eventId -= shiftEID; } // patch any subsequent executes @@ -1431,7 +1431,7 @@ D3D12CommandData::D3D12CommandData() m_IndirectOffset = 0; m_RootEventID = 1; - m_RootDrawcallID = 1; + m_RootActionID = 1; m_FirstEventID = 0; m_LastEventID = ~0U; @@ -1439,11 +1439,11 @@ D3D12CommandData::D3D12CommandData() m_pDevice = NULL; - m_DrawcallCallback = NULL; + m_ActionCallback = NULL; - m_AddedDrawcall = false; + m_AddedAction = false; - m_RootDrawcallStack.push_back(&m_ParentDrawcall); + m_RootActionStack.push_back(&m_ParentAction); } void D3D12CommandData::GetIndirectBuffer(size_t size, ID3D12Resource **buf, uint64_t *offs) @@ -1497,16 +1497,16 @@ void D3D12CommandData::GetIndirectBuffer(size_t size, ID3D12Resource **buf, uint uint32_t D3D12CommandData::HandlePreCallback(ID3D12GraphicsCommandListX *list, bool dispatch, uint32_t multiDrawOffset) { - if(!m_DrawcallCallback) + if(!m_ActionCallback) return 0; - // look up the EID this drawcall came from - DrawcallUse use(m_CurChunkOffset, 0); - auto it = std::lower_bound(m_DrawcallUses.begin(), m_DrawcallUses.end(), use); + // look up the EID this action came from + ActionUse use(m_CurChunkOffset, 0); + auto it = std::lower_bound(m_ActionUses.begin(), m_ActionUses.end(), use); - if(it == m_DrawcallUses.end()) + if(it == m_ActionUses.end()) { - RDCERR("Couldn't find drawcall use entry for %llu", m_CurChunkOffset); + RDCERR("Couldn't find action use entry for %llu", m_CurChunkOffset); return 0; } @@ -1514,15 +1514,15 @@ uint32_t D3D12CommandData::HandlePreCallback(ID3D12GraphicsCommandListX *list, b RDCASSERT(eventId != 0); - // handle all aliases of this drawcall as long as it's not a multidraw - const DrawcallDescription *draw = m_pDevice->GetDrawcall(eventId); + // handle all aliases of this action as long as it's not a multidraw + const ActionDescription *action = m_pDevice->GetAction(eventId); - if(draw == NULL || !(draw->flags & DrawFlags::MultiDraw)) + if(action == NULL || !(action->flags & ActionFlags::MultiAction)) { ++it; - while(it != m_DrawcallUses.end() && it->fileOffset == m_CurChunkOffset) + while(it != m_ActionUses.end() && it->fileOffset == m_CurChunkOffset) { - m_DrawcallCallback->AliasEvent(eventId, it->eventId); + m_ActionCallback->AliasEvent(eventId, it->eventId); ++it; } } @@ -1530,9 +1530,9 @@ uint32_t D3D12CommandData::HandlePreCallback(ID3D12GraphicsCommandListX *list, b eventId += multiDrawOffset; if(dispatch) - m_DrawcallCallback->PreDispatch(eventId, list); + m_ActionCallback->PreDispatch(eventId, list); else - m_DrawcallCallback->PreDraw(eventId, list); + m_ActionCallback->PreDraw(eventId, list); return eventId; } @@ -1636,13 +1636,13 @@ void D3D12CommandData::AddEvent() m_EventMessages.clear(); } -void D3D12CommandData::AddUsage(D3D12DrawcallTreeNode &drawNode, ResourceId id, uint32_t EID, +void D3D12CommandData::AddUsage(D3D12ActionTreeNode &actionNode, ResourceId id, uint32_t EID, ResourceUsage usage) { if(id == ResourceId()) return; - drawNode.resourceUsage.push_back(make_rdcpair(id, EventUsage(EID, usage))); + actionNode.resourceUsage.push_back(make_rdcpair(id, EventUsage(EID, usage))); } void D3D12CommandData::AddUsage(ResourceId id, ResourceUsage usage) @@ -1650,21 +1650,21 @@ void D3D12CommandData::AddUsage(ResourceId id, ResourceUsage usage) m_ResourceUses[id].push_back(EventUsage(m_RootEventID, usage)); } -void D3D12CommandData::AddUsage(const D3D12RenderState &state, D3D12DrawcallTreeNode &drawNode) +void D3D12CommandData::AddUsage(const D3D12RenderState &state, D3D12ActionTreeNode &actionNode) { - DrawcallDescription &d = drawNode.draw; + ActionDescription &a = actionNode.action; - uint32_t e = d.eventId; + uint32_t e = a.eventId; - DrawFlags DrawMask = DrawFlags::Drawcall | DrawFlags::Dispatch; - if(!(d.flags & DrawMask)) + ActionFlags DrawMask = ActionFlags::Drawcall | ActionFlags::Dispatch; + if(!(a.flags & DrawMask)) return; static bool hugeRangeWarned = false; const D3D12RenderState::RootSignature *rootdata = NULL; - if((d.flags & DrawFlags::Dispatch) && state.compute.rootsig != ResourceId()) + if((a.flags & ActionFlags::Dispatch) && state.compute.rootsig != ResourceId()) { rootdata = &state.compute; } @@ -1672,24 +1672,24 @@ void D3D12CommandData::AddUsage(const D3D12RenderState &state, D3D12DrawcallTree { rootdata = &state.graphics; - if(d.flags & DrawFlags::Indexed && state.ibuffer.buf != ResourceId()) - drawNode.resourceUsage.push_back( + if(a.flags & ActionFlags::Indexed && state.ibuffer.buf != ResourceId()) + actionNode.resourceUsage.push_back( make_rdcpair(state.ibuffer.buf, EventUsage(e, ResourceUsage::IndexBuffer))); for(size_t i = 0; i < state.vbuffers.size(); i++) { if(state.vbuffers[i].buf != ResourceId()) - drawNode.resourceUsage.push_back( + actionNode.resourceUsage.push_back( make_rdcpair(state.vbuffers[i].buf, EventUsage(e, ResourceUsage::VertexBuffer))); } for(size_t i = 0; i < state.streamouts.size(); i++) { if(state.streamouts[i].buf != ResourceId()) - drawNode.resourceUsage.push_back( + actionNode.resourceUsage.push_back( make_rdcpair(state.streamouts[i].buf, EventUsage(e, ResourceUsage::StreamOut))); if(state.streamouts[i].countbuf != ResourceId()) - drawNode.resourceUsage.push_back( + actionNode.resourceUsage.push_back( make_rdcpair(state.streamouts[i].countbuf, EventUsage(e, ResourceUsage::StreamOut))); } @@ -1698,13 +1698,13 @@ void D3D12CommandData::AddUsage(const D3D12RenderState &state, D3D12DrawcallTree for(size_t i = 0; i < rts.size(); i++) { if(rts[i] != ResourceId()) - drawNode.resourceUsage.push_back( + actionNode.resourceUsage.push_back( make_rdcpair(rts[i], EventUsage(e, ResourceUsage::ColorTarget))); } ResourceId id = state.GetDSVID(); if(id != ResourceId()) - drawNode.resourceUsage.push_back( + actionNode.resourceUsage.push_back( make_rdcpair(id, EventUsage(e, ResourceUsage::DepthStencilTarget))); } @@ -1743,15 +1743,15 @@ void D3D12CommandData::AddUsage(const D3D12RenderState &state, D3D12DrawcallTree if(p.ParameterType == D3D12_ROOT_PARAMETER_TYPE_CBV && el.type == eRootCBV) { - AddUsage(drawNode, el.id, e, cb); + AddUsage(actionNode, el.id, e, cb); } else if(p.ParameterType == D3D12_ROOT_PARAMETER_TYPE_SRV && el.type == eRootSRV) { - AddUsage(drawNode, el.id, e, ro); + AddUsage(actionNode, el.id, e, ro); } else if(p.ParameterType == D3D12_ROOT_PARAMETER_TYPE_UAV && el.type == eRootUAV) { - AddUsage(drawNode, el.id, e, rw); + AddUsage(actionNode, el.id, e, rw); } else if(p.ParameterType == D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE && el.type == eRootTable) { @@ -1803,7 +1803,7 @@ void D3D12CommandData::AddUsage(const D3D12RenderState &state, D3D12DrawcallTree ResourceId id = WrappedID3D12Resource::GetResIDFromAddr(desc->GetCBV().BufferLocation); - AddUsage(drawNode, id, e, cb); + AddUsage(actionNode, id, e, cb); desc++; } @@ -1824,7 +1824,7 @@ void D3D12CommandData::AddUsage(const D3D12RenderState &state, D3D12DrawcallTree { for(UINT i = 0; i < num; i++) { - AddUsage(drawNode, desc->GetResResourceId(), e, usage); + AddUsage(actionNode, desc->GetResResourceId(), e, usage); desc++; } @@ -1836,92 +1836,92 @@ void D3D12CommandData::AddUsage(const D3D12RenderState &state, D3D12DrawcallTree } } -void D3D12CommandData::AddDrawcall(const DrawcallDescription &d) +void D3D12CommandData::AddAction(const ActionDescription &a) { - m_AddedDrawcall = true; + m_AddedAction = true; - DrawcallDescription draw = d; - draw.eventId = m_LastCmdListID != ResourceId() ? m_BakedCmdListInfo[m_LastCmdListID].curEventID - : m_RootEventID; - draw.drawcallId = m_LastCmdListID != ResourceId() ? m_BakedCmdListInfo[m_LastCmdListID].drawCount - : m_RootDrawcallID; + ActionDescription action = a; + action.eventId = m_LastCmdListID != ResourceId() ? m_BakedCmdListInfo[m_LastCmdListID].curEventID + : m_RootEventID; + action.actionId = m_LastCmdListID != ResourceId() ? m_BakedCmdListInfo[m_LastCmdListID].actionCount + : m_RootActionID; for(int i = 0; i < 8; i++) - draw.outputs[i] = ResourceId(); + action.outputs[i] = ResourceId(); - draw.depthOut = ResourceId(); + action.depthOut = ResourceId(); if(m_LastCmdListID != ResourceId()) { rdcarray rts = m_BakedCmdListInfo[m_LastCmdListID].state.GetRTVIDs(); - for(size_t i = 0; i < ARRAY_COUNT(draw.outputs); i++) + for(size_t i = 0; i < ARRAY_COUNT(action.outputs); i++) { if(i < rts.size()) - draw.outputs[i] = m_pDevice->GetResourceManager()->GetOriginalID(rts[i]); + action.outputs[i] = m_pDevice->GetResourceManager()->GetOriginalID(rts[i]); else - draw.outputs[i] = ResourceId(); + action.outputs[i] = ResourceId(); } - draw.depthOut = m_pDevice->GetResourceManager()->GetOriginalID( + action.depthOut = m_pDevice->GetResourceManager()->GetOriginalID( m_BakedCmdListInfo[m_LastCmdListID].state.GetDSVID()); } - // markers don't increment drawcall ID - DrawFlags MarkerMask = - DrawFlags::SetMarker | DrawFlags::PushMarker | DrawFlags::PopMarker | DrawFlags::PassBoundary; - if(!(draw.flags & MarkerMask)) + // markers don't increment action ID + ActionFlags MarkerMask = ActionFlags::SetMarker | ActionFlags::PushMarker | + ActionFlags::PopMarker | ActionFlags::PassBoundary; + if(!(action.flags & MarkerMask)) { if(m_LastCmdListID != ResourceId()) - m_BakedCmdListInfo[m_LastCmdListID].drawCount++; + m_BakedCmdListInfo[m_LastCmdListID].actionCount++; else - m_RootDrawcallID++; + m_RootActionID++; } - draw.events.swap(m_LastCmdListID != ResourceId() ? m_BakedCmdListInfo[m_LastCmdListID].curEvents - : m_RootEvents); + action.events.swap(m_LastCmdListID != ResourceId() ? m_BakedCmdListInfo[m_LastCmdListID].curEvents + : m_RootEvents); - // should have at least the root drawcall here, push this drawcall + // should have at least the root action here, push this action // onto the back's children list. - if(!GetDrawcallStack().empty()) + if(!GetActionStack().empty()) { - D3D12DrawcallTreeNode node(draw); + D3D12ActionTreeNode node(action); node.resourceUsage.swap(m_BakedCmdListInfo[m_LastCmdListID].resourceUsage); if(m_LastCmdListID != ResourceId()) AddUsage(m_BakedCmdListInfo[m_LastCmdListID].state, node); - for(const DrawcallDescription &child : draw.children) - node.children.push_back(D3D12DrawcallTreeNode(child)); - GetDrawcallStack().back()->children.push_back(node); + for(const ActionDescription &child : action.children) + node.children.push_back(D3D12ActionTreeNode(child)); + GetActionStack().back()->children.push_back(node); } else - RDCERR("Somehow lost drawcall stack!"); + RDCERR("Somehow lost action stack!"); } -void D3D12CommandData::InsertDrawsAndRefreshIDs(ResourceId cmd, - rdcarray &cmdBufNodes) +void D3D12CommandData::InsertActionsAndRefreshIDs(ResourceId cmd, + rdcarray &cmdBufNodes) { - // assign new drawcall IDs + // assign new action IDs for(size_t i = 0; i < cmdBufNodes.size(); i++) { - D3D12DrawcallTreeNode n = cmdBufNodes[i]; - n.draw.eventId += m_RootEventID; - n.draw.drawcallId += m_RootDrawcallID; + D3D12ActionTreeNode n = cmdBufNodes[i]; + n.action.eventId += m_RootEventID; + n.action.actionId += m_RootActionID; - for(APIEvent &ev : n.draw.events) + for(APIEvent &ev : n.action.events) { ev.eventId += m_RootEventID; m_Events.resize(ev.eventId + 1); m_Events[ev.eventId] = ev; } - DrawcallUse use(m_Events.back().fileOffset, n.draw.eventId, cmd, cmdBufNodes[i].draw.eventId); + ActionUse use(m_Events.back().fileOffset, n.action.eventId, cmd, cmdBufNodes[i].action.eventId); // insert in sorted location - auto drawit = std::lower_bound(m_DrawcallUses.begin(), m_DrawcallUses.end(), use); - m_DrawcallUses.insert(drawit - m_DrawcallUses.begin(), use); + auto drawit = std::lower_bound(m_ActionUses.begin(), m_ActionUses.end(), use); + m_ActionUses.insert(drawit - m_ActionUses.begin(), use); RDCASSERT(n.children.empty()); @@ -1932,14 +1932,14 @@ void D3D12CommandData::InsertDrawsAndRefreshIDs(ResourceId cmd, m_ResourceUses[it->first].push_back(u); } - GetDrawcallStack().back()->children.push_back(n); + GetActionStack().back()->children.push_back(n); - // if this is a push marker too, step down the drawcall stack - if(cmdBufNodes[i].draw.flags & DrawFlags::PushMarker) - GetDrawcallStack().push_back(&GetDrawcallStack().back()->children.back()); + // if this is a push marker too, step down the action stack + if(cmdBufNodes[i].action.flags & ActionFlags::PushMarker) + GetActionStack().push_back(&GetActionStack().back()->children.back()); // similarly for a pop, but don't pop off the root - if((cmdBufNodes[i].draw.flags & DrawFlags::PopMarker) && GetDrawcallStack().size() > 1) - GetDrawcallStack().pop_back(); + if((cmdBufNodes[i].action.flags & ActionFlags::PopMarker) && GetActionStack().size() > 1) + GetActionStack().pop_back(); } } diff --git a/renderdoc/driver/d3d12/d3d12_commands.h b/renderdoc/driver/d3d12/d3d12_commands.h index 378b5a3a6..416e69d42 100644 --- a/renderdoc/driver/d3d12/d3d12_commands.h +++ b/renderdoc/driver/d3d12/d3d12_commands.h @@ -28,14 +28,14 @@ #include "d3d12_common.h" #include "d3d12_state.h" -struct D3D12DrawcallTreeNode +struct D3D12ActionTreeNode { - D3D12DrawcallTreeNode() {} - explicit D3D12DrawcallTreeNode(const DrawcallDescription &d) : draw(d) {} - D3D12DrawcallTreeNode(const D3D12DrawcallTreeNode &other) { *this = other; } - ~D3D12DrawcallTreeNode() { SAFE_DELETE(state); } - DrawcallDescription draw; - rdcarray children; + D3D12ActionTreeNode() {} + explicit D3D12ActionTreeNode(const ActionDescription &a) : action(a) {} + D3D12ActionTreeNode(const D3D12ActionTreeNode &other) { *this = other; } + ~D3D12ActionTreeNode() { SAFE_DELETE(state); } + ActionDescription action; + rdcarray children; D3D12RenderState *state = NULL; @@ -43,30 +43,29 @@ struct D3D12DrawcallTreeNode rdcarray executedCmds; - D3D12DrawcallTreeNode &operator=(const DrawcallDescription &d) + D3D12ActionTreeNode &operator=(const ActionDescription &a) { - *this = D3D12DrawcallTreeNode(d); + *this = D3D12ActionTreeNode(a); return *this; } - D3D12DrawcallTreeNode &operator=(const D3D12DrawcallTreeNode &d) + D3D12ActionTreeNode &operator=(const D3D12ActionTreeNode &a) { - draw = d.draw; - children = d.children; + action = a.action; + children = a.children; - if(d.state) - state = new D3D12RenderState(*d.state); + if(a.state) + state = new D3D12RenderState(*a.state); else state = NULL; - resourceUsage = d.resourceUsage; + resourceUsage = a.resourceUsage; - executedCmds = d.executedCmds; + executedCmds = a.executedCmds; return *this; } - void InsertAndUpdateIDs(const D3D12DrawcallTreeNode &child, uint32_t baseEventID, - uint32_t baseDrawID) + void InsertAndUpdateIDs(const D3D12ActionTreeNode &child, uint32_t baseEventID, uint32_t baseDrawID) { for(size_t i = 0; i < child.resourceUsage.size(); i++) { @@ -77,24 +76,24 @@ struct D3D12DrawcallTreeNode for(size_t i = 0; i < child.children.size(); i++) { children.push_back(child.children[i]); - children.back().draw.eventId += baseEventID; - children.back().draw.drawcallId += baseDrawID; + children.back().action.eventId += baseEventID; + children.back().action.actionId += baseDrawID; - for(APIEvent &ev : children.back().draw.events) + for(APIEvent &ev : children.back().action.events) ev.eventId += baseEventID; } } - rdcarray Bake() + rdcarray Bake() { - rdcarray ret; + rdcarray ret; if(children.empty()) return ret; ret.resize(children.size()); for(size_t i = 0; i < children.size(); i++) { - ret[i] = children[i].draw; + ret[i] = children[i].action; ret[i].children = children[i].Bake(); } @@ -102,7 +101,7 @@ struct D3D12DrawcallTreeNode } }; -struct D3D12DrawcallCallback +struct D3D12ActionCallback { // the three callbacks are used to allow the callback implementor to either // do a modified draw before or after the real thing. @@ -131,7 +130,7 @@ struct D3D12DrawcallCallback // called immediately before a command list is closed virtual void PreCloseCommandList(ID3D12GraphicsCommandListX *cmd) = 0; // if a command list is recorded once and submitted N > 1 times, then the same - // drawcall will have several EIDs that refer to it. We'll only do the full + // action will have several EIDs that refer to it. We'll only do the full // callbacks above for the first EID, then call this function for the others // to indicate that they are the same. virtual void AliasEvent(uint32_t primary, uint32_t alias) = 0; @@ -171,8 +170,8 @@ class WrappedID3D12CommandSignature; struct BakedCmdListInfo { - ~BakedCmdListInfo() { SAFE_DELETE(draw); } - void ShiftForRemoved(uint32_t shiftDrawID, uint32_t shiftEID, size_t idx); + ~BakedCmdListInfo() { SAFE_DELETE(action); } + void ShiftForRemoved(uint32_t shiftActionID, uint32_t shiftEID, size_t idx); struct ExecuteData { @@ -193,7 +192,7 @@ struct BakedCmdListInfo rdcarray curEvents; rdcarray debugMessages; - rdcarray drawStack; + rdcarray actionStack; rdcarray > resourceUsage; @@ -213,10 +212,10 @@ struct BakedCmdListInfo uint32_t beginChunk = 0; uint32_t endChunk = 0; - D3D12DrawcallTreeNode *draw = NULL; // the root draw to copy from when submitting + D3D12ActionTreeNode *action = NULL; // the root action to copy from when submitting uint32_t eventCount; // how many events are in this cmd list, for quick skipping uint32_t curEventID; // current event ID while reading or executing - uint32_t drawCount; // similar to above + uint32_t actionCount; // similar to above }; class WrappedID3D12Device; @@ -227,7 +226,7 @@ struct D3D12CommandData WrappedID3D12Device *m_pDevice; - D3D12DrawcallCallback *m_DrawcallCallback; + D3D12ActionCallback *m_ActionCallback; ResourceId m_LastCmdListID; @@ -297,22 +296,22 @@ struct D3D12CommandData bool renderPassActive; } m_Partial[ePartialNum]; - // if we're replaying just a single draw or a particular command + // if we're replaying just a single action or a particular command // list subsection of command events, we don't go through the // whole original command lists to set up the partial replay, // so we just set this command list ID3D12GraphicsCommandListX *m_OutsideCmdList = NULL; - void InsertDrawsAndRefreshIDs(ResourceId cmd, rdcarray &cmdBufNodes); + void InsertActionsAndRefreshIDs(ResourceId cmd, rdcarray &cmdBufNodes); // this is a list of uint64_t file offset -> uint32_t EIDs of where each - // drawcall is used. E.g. the drawcall at offset 873954 is EID 50. If a + // action is used. E.g. the action at offset 873954 is EID 50. If a // command list is executed more than once, there may be more than - // one entry here - the drawcall will be aliased among several EIDs, with + // one entry here - the action will be aliased among several EIDs, with // the first one being the 'primary' - struct DrawcallUse + struct ActionUse { - DrawcallUse(uint64_t offs, uint32_t eid, ResourceId cmd = ResourceId(), uint32_t rel = 0) + ActionUse(uint64_t offs, uint32_t eid, ResourceId cmd = ResourceId(), uint32_t rel = 0) : fileOffset(offs), cmdList(cmd), eventId(eid), relativeEID(rel) { } @@ -320,27 +319,27 @@ struct D3D12CommandData ResourceId cmdList; uint32_t eventId; uint32_t relativeEID; - bool operator<(const DrawcallUse &o) const + bool operator<(const ActionUse &o) const { if(fileOffset != o.fileOffset) return fileOffset < o.fileOffset; return eventId < o.eventId; } }; - rdcarray m_DrawcallUses; + rdcarray m_ActionUses; rdcarray m_EventMessages; std::map m_RerecordCmds; rdcarray m_RerecordCmdList; - bool m_AddedDrawcall; + bool m_AddedAction; rdcarray m_RootEvents, m_Events; uint64_t m_CurChunkOffset; SDChunkMetaData m_ChunkMetadata; - uint32_t m_RootEventID, m_RootDrawcallID; + uint32_t m_RootEventID, m_RootActionID; uint32_t m_FirstEventID, m_LastEventID; D3D12Chunk m_LastChunk; @@ -352,16 +351,16 @@ struct D3D12CommandData std::map > m_ResourceUses; - D3D12DrawcallTreeNode m_ParentDrawcall; + D3D12ActionTreeNode m_ParentAction; - rdcarray m_RootDrawcallStack; + rdcarray m_RootActionStack; - rdcarray &GetDrawcallStack() + rdcarray &GetActionStack() { if(m_LastCmdListID != ResourceId()) - return m_BakedCmdListInfo[m_LastCmdListID].drawStack; + return m_BakedCmdListInfo[m_LastCmdListID].actionStack; - return m_RootDrawcallStack; + return m_RootActionStack; } void GetIndirectBuffer(size_t size, ID3D12Resource **buf, uint64_t *offs); @@ -377,9 +376,9 @@ struct D3D12CommandData ID3D12GraphicsCommandListX *RerecordCmdList(ResourceId cmdid, PartialReplayIndex partialType = ePartialNum); - void AddDrawcall(const DrawcallDescription &d); + void AddAction(const ActionDescription &a); void AddEvent(); - void AddUsage(const D3D12RenderState &state, D3D12DrawcallTreeNode &drawNode); - void AddUsage(D3D12DrawcallTreeNode &drawNode, ResourceId id, uint32_t EID, ResourceUsage usage); + void AddUsage(const D3D12RenderState &state, D3D12ActionTreeNode &actionNode); + void AddUsage(D3D12ActionTreeNode &actionNode, ResourceId id, uint32_t EID, ResourceUsage usage); void AddUsage(ResourceId id, ResourceUsage usage); }; diff --git a/renderdoc/driver/d3d12/d3d12_common.h b/renderdoc/driver/d3d12/d3d12_common.h index f1684f287..17c22ebeb 100644 --- a/renderdoc/driver/d3d12/d3d12_common.h +++ b/renderdoc/driver/d3d12/d3d12_common.h @@ -368,7 +368,7 @@ DECLARE_REFLECTION_STRUCT(D3D12RootSignature); struct D3D12CommandSignature { bool graphics = true; - UINT numDraws = 0; + UINT numActions = 0; UINT ByteStride = 0; rdcarray arguments; }; diff --git a/renderdoc/driver/d3d12/d3d12_counters.cpp b/renderdoc/driver/d3d12/d3d12_counters.cpp index 50e481176..53baa5e4f 100644 --- a/renderdoc/driver/d3d12/d3d12_counters.cpp +++ b/renderdoc/driver/d3d12/d3d12_counters.cpp @@ -188,18 +188,18 @@ CounterDescription D3D12Replay::DescribeCounter(GPUCounter counterID) return desc; } -struct D3D12AMDDrawCallback : public D3D12DrawcallCallback +struct D3D12AMDActionCallback : public D3D12ActionCallback { - D3D12AMDDrawCallback(WrappedID3D12Device *dev, D3D12Replay *rp, uint32_t &sampleIndex, - rdcarray &eventIDs) + D3D12AMDActionCallback(WrappedID3D12Device *dev, D3D12Replay *rp, uint32_t &sampleIndex, + rdcarray &eventIDs) : m_pDevice(dev), m_pReplay(rp), m_pSampleId(&sampleIndex), m_pEventIds(&eventIDs) { - m_pDevice->GetQueue()->GetCommandData()->m_DrawcallCallback = this; + m_pDevice->GetQueue()->GetCommandData()->m_ActionCallback = this; } - virtual ~D3D12AMDDrawCallback() + virtual ~D3D12AMDActionCallback() { - m_pDevice->GetQueue()->GetCommandData()->m_DrawcallCallback = NULL; + m_pDevice->GetQueue()->GetCommandData()->m_ActionCallback = NULL; } void PreDraw(uint32_t eid, ID3D12GraphicsCommandListX *cmd) override @@ -276,7 +276,7 @@ void D3D12Replay::FillTimersAMD(uint32_t *eventStartID, uint32_t *sampleIndex, { uint32_t maxEID = m_pDevice->GetQueue()->GetMaxEID(); - m_pAMDDrawCallback = new D3D12AMDDrawCallback(m_pDevice, this, *sampleIndex, *eventIDs); + m_pAMDActionCallback = new D3D12AMDActionCallback(m_pDevice, this, *sampleIndex, *eventIDs); // replay the events to perform all the queries m_pDevice->ReplayLog(*eventStartID, maxEID, eReplay_Full); @@ -331,13 +331,13 @@ rdcarray D3D12Replay::FetchCountersAMD(const rdcarray rdcarray ret = m_pAMDCounters->GetCounterData(sessionID, sampleIndex, eventIDs, counters); - for(size_t i = 0; i < m_pAMDDrawCallback->m_AliasEvents.size(); i++) + for(size_t i = 0; i < m_pAMDActionCallback->m_AliasEvents.size(); i++) { for(size_t c = 0; c < counters.size(); c++) { CounterResult search; search.counter = counters[c]; - search.eventId = m_pAMDDrawCallback->m_AliasEvents[i].first; + search.eventId = m_pAMDActionCallback->m_AliasEvents[i].first; // find the result we're aliasing int32_t idx = ret.indexOf(search); @@ -345,7 +345,7 @@ rdcarray D3D12Replay::FetchCountersAMD(const rdcarray { // duplicate the result and append CounterResult aliased = ret[idx]; - aliased.eventId = m_pAMDDrawCallback->m_AliasEvents[i].second; + aliased.eventId = m_pAMDActionCallback->m_AliasEvents[i].second; ret.push_back(aliased); } else @@ -356,14 +356,14 @@ rdcarray D3D12Replay::FetchCountersAMD(const rdcarray } } - SAFE_DELETE(m_pAMDDrawCallback); + SAFE_DELETE(m_pAMDActionCallback); m_pAMDCounters->EndMeasurementMode(); return ret; } -struct D3D12GPUTimerCallback : public D3D12DrawcallCallback +struct D3D12GPUTimerCallback : public D3D12ActionCallback { D3D12GPUTimerCallback(WrappedID3D12Device *dev, D3D12Replay *rp, ID3D12QueryHeap *tqh, ID3D12QueryHeap *psqh, ID3D12QueryHeap *oqh) @@ -375,9 +375,9 @@ struct D3D12GPUTimerCallback : public D3D12DrawcallCallback m_NumStatsQueries(0), m_NumTimestampQueries(0) { - m_pDevice->GetQueue()->GetCommandData()->m_DrawcallCallback = this; + m_pDevice->GetQueue()->GetCommandData()->m_ActionCallback = this; } - ~D3D12GPUTimerCallback() { m_pDevice->GetQueue()->GetCommandData()->m_DrawcallCallback = NULL; } + ~D3D12GPUTimerCallback() { m_pDevice->GetQueue()->GetCommandData()->m_ActionCallback = NULL; } void PreDraw(uint32_t eid, ID3D12GraphicsCommandListX *cmd) override { if(cmd->GetType() == D3D12_COMMAND_LIST_TYPE_DIRECT) diff --git a/renderdoc/driver/d3d12/d3d12_device.cpp b/renderdoc/driver/d3d12/d3d12_device.cpp index 993b73f4e..48b988fee 100644 --- a/renderdoc/driver/d3d12/d3d12_device.cpp +++ b/renderdoc/driver/d3d12/d3d12_device.cpp @@ -2113,15 +2113,15 @@ bool WrappedID3D12Device::Serialise_Present(SerialiserType &ser, ID3D12Resource D3D12CommandData &cmd = *m_Queue->GetCommandData(); cmd.AddEvent(); - DrawcallDescription draw; + ActionDescription action; - draw.name = StringFormat::Fmt("Present(%s)", ToStr(PresentedBackbuffer).c_str()); - draw.flags |= DrawFlags::Present; + action.name = StringFormat::Fmt("Present(%s)", ToStr(PresentedBackbuffer).c_str()); + action.flags |= ActionFlags::Present; cmd.m_LastPresentedImage = PresentedBackbuffer; - draw.copyDestination = PresentedBackbuffer; + action.copyDestination = PresentedBackbuffer; - cmd.AddDrawcall(draw); + cmd.AddAction(action); } return true; @@ -2192,7 +2192,7 @@ template bool WrappedID3D12Device::Serialise_BeginCaptureFrame(WriteSerialiser & void WrappedID3D12Device::EndCaptureFrame() { WriteSerialiser &ser = GetThreadSerialiser(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(SystemChunk::CaptureEnd); // here for compatibility reasons, this used to store the presented Resource. @@ -2834,15 +2834,15 @@ void WrappedID3D12Device::AddDebugMessage(MessageCategory c, MessageSeverity sv, msg.description = d; if(IsActiveReplaying(m_State)) { - // look up the EID this drawcall came from - D3D12CommandData::DrawcallUse use(cmd.m_CurChunkOffset, 0); - auto it = std::lower_bound(cmd.m_DrawcallUses.begin(), cmd.m_DrawcallUses.end(), use); - RDCASSERT(it != cmd.m_DrawcallUses.end()); + // look up the EID this action came from + D3D12CommandData::ActionUse use(cmd.m_CurChunkOffset, 0); + auto it = std::lower_bound(cmd.m_ActionUses.begin(), cmd.m_ActionUses.end(), use); + RDCASSERT(it != cmd.m_ActionUses.end()); - if(it != cmd.m_DrawcallUses.end()) + if(it != cmd.m_ActionUses.end()) msg.eventId = it->eventId; else - RDCERR("Couldn't locate drawcall use for current chunk offset %llu", cmd.m_CurChunkOffset); + RDCERR("Couldn't locate action use for current chunk offset %llu", cmd.m_CurChunkOffset); AddDebugMessage(msg); } @@ -3583,12 +3583,12 @@ void WrappedID3D12Device::FlushLists(bool forceSync, ID3D12CommandQueue *queue) } } -const DrawcallDescription *WrappedID3D12Device::GetDrawcall(uint32_t eventId) +const ActionDescription *WrappedID3D12Device::GetAction(uint32_t eventId) { - if(eventId >= m_Drawcalls.size()) + if(eventId >= m_Actions.size()) return NULL; - return m_Drawcalls[eventId]; + return m_Actions[eventId]; } bool WrappedID3D12Device::ProcessChunk(ReadSerialiser &ser, D3D12Chunk context) @@ -3982,11 +3982,11 @@ ReplayStatus WrappedID3D12Device::ReadLogInitialisation(RDCFile *rdc, bool store if(!IsStructuredExporting(m_State)) { - GetReplay()->WriteFrameRecord().drawcallList = m_Queue->GetParentDrawcall().Bake(); + GetReplay()->WriteFrameRecord().actionList = m_Queue->GetParentAction().Bake(); - m_Queue->GetParentDrawcall().children.clear(); + m_Queue->GetParentAction().children.clear(); - SetupDrawcallPointers(m_Drawcalls, GetReplay()->WriteFrameRecord().drawcallList); + SetupActionPointers(m_Actions, GetReplay()->WriteFrameRecord().actionList); D3D12CommandData &cmd = *m_Queue->GetCommandData(); @@ -4106,7 +4106,7 @@ void WrappedID3D12Device::ReplayLog(uint32_t startEventID, uint32_t endEventID, // we'll need our own command list if we're replaying just a subsection // of events within a single command list record - always if it's only - // one drawcall, or if start event ID is > 0 we assume the outside code + // one action, or if start event ID is > 0 we assume the outside code // has chosen a subsection that lies within a command list if(partial) { diff --git a/renderdoc/driver/d3d12/d3d12_device.h b/renderdoc/driver/d3d12/d3d12_device.h index acdd00ee6..2e882b6e2 100644 --- a/renderdoc/driver/d3d12/d3d12_device.h +++ b/renderdoc/driver/d3d12/d3d12_device.h @@ -675,7 +675,7 @@ private: uint32_t m_FrameCounter = 0; rdcarray m_CapturedFrames; - rdcarray m_Drawcalls; + rdcarray m_Actions; ReplayStatus m_FailedReplayStatus = ReplayStatus::APIReplayFailed; @@ -793,7 +793,7 @@ public: Threading::RWLock &GetCapTransitionLock() { return m_CapTransitionLock; } void ReleaseSwapchainResources(IDXGISwapChain *swap, IUnknown **backbuffers, int numBackbuffers); void FirstFrame(IDXGISwapper *swapper); - const DrawcallDescription *GetDrawcall(uint32_t eventId); + const ActionDescription *GetAction(uint32_t eventId); ResourceId GetFrameCaptureResourceId() { return m_FrameCaptureRecord->GetResourceID(); } void AddDebugMessage(MessageCategory c, MessageSeverity sv, MessageSource src, rdcstr d); diff --git a/renderdoc/driver/d3d12/d3d12_device_wrap.cpp b/renderdoc/driver/d3d12/d3d12_device_wrap.cpp index b33e9e6fe..7b743a63c 100644 --- a/renderdoc/driver/d3d12/d3d12_device_wrap.cpp +++ b/renderdoc/driver/d3d12/d3d12_device_wrap.cpp @@ -2323,10 +2323,10 @@ bool WrappedID3D12Device::Serialise_CreateCommandSignature(SerialiserType &ser, wrapped->sig.arguments.assign(Descriptor.pArgumentDescs, Descriptor.NumArgumentDescs); wrapped->sig.graphics = true; - wrapped->sig.numDraws = 0; + wrapped->sig.numActions = 0; // From MSDN, command signatures are either graphics or compute so just search for dispatches: - // "A given command signature is either a draw or a compute command signature. If a command + // "A given command signature is either an action or a compute command signature. If a command // signature contains a drawing operation, then it is a graphics command signature. Otherwise, // the command signature must contain a dispatch operation, and it is a compute command // signature." @@ -2338,7 +2338,7 @@ bool WrappedID3D12Device::Serialise_CreateCommandSignature(SerialiserType &ser, if(Descriptor.pArgumentDescs[i].Type == D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH || Descriptor.pArgumentDescs[i].Type == D3D12_INDIRECT_ARGUMENT_TYPE_DRAW || Descriptor.pArgumentDescs[i].Type == D3D12_INDIRECT_ARGUMENT_TYPE_DRAW_INDEXED) - wrapped->sig.numDraws++; + wrapped->sig.numActions++; } ret = wrapped; diff --git a/renderdoc/driver/d3d12/d3d12_overlay.cpp b/renderdoc/driver/d3d12/d3d12_overlay.cpp index 1f37445df..aafbb729a 100644 --- a/renderdoc/driver/d3d12/d3d12_overlay.cpp +++ b/renderdoc/driver/d3d12/d3d12_overlay.cpp @@ -40,7 +40,7 @@ #include "data/hlsl/hlsl_cbuffers.h" -struct D3D12QuadOverdrawCallback : public D3D12DrawcallCallback +struct D3D12QuadOverdrawCallback : public D3D12ActionCallback { D3D12QuadOverdrawCallback(WrappedID3D12Device *dev, D3D12_SHADER_BYTECODE quadWrite, D3D12_SHADER_BYTECODE quadWriteDXIL, const rdcarray &events, @@ -55,12 +55,9 @@ struct D3D12QuadOverdrawCallback : public D3D12DrawcallCallback m_DSV(dsv), m_UAV(uav) { - m_pDevice->GetQueue()->GetCommandData()->m_DrawcallCallback = this; - } - ~D3D12QuadOverdrawCallback() - { - m_pDevice->GetQueue()->GetCommandData()->m_DrawcallCallback = NULL; + m_pDevice->GetQueue()->GetCommandData()->m_ActionCallback = this; } + ~D3D12QuadOverdrawCallback() { m_pDevice->GetQueue()->GetCommandData()->m_ActionCallback = NULL; } void PreDraw(uint32_t eid, ID3D12GraphicsCommandListX *cmd) { if(!m_Events.contains(eid)) @@ -170,7 +167,7 @@ struct D3D12QuadOverdrawCallback : public D3D12DrawcallCallback m_PipelineCache[rs.pipe] = cache; } - // modify state for first draw call + // modify state for first action call rs.pipe = GetResID(cache.pipe); rs.graphics.rootsig = GetResID(cache.sig); @@ -226,7 +223,7 @@ struct D3D12QuadOverdrawCallback : public D3D12DrawcallCallback cmd->ResourceBarrier(1, &b); } - // restore the render state and go ahead with the real draw + // restore the render state and go ahead with the real action m_pDevice->GetQueue()->GetCommandData()->GetCurRenderState() = m_PrevState; RDCASSERT(cmd); @@ -1079,10 +1076,10 @@ ResourceId D3D12Replay::RenderOverlay(ResourceId texid, FloatVector clearCol, De while(!events.empty()) { - const DrawcallDescription *draw = m_pDevice->GetDrawcall(events[0]); + const ActionDescription *action = m_pDevice->GetAction(events[0]); // remove any non-drawcalls, like the pass boundary. - if(!(draw->flags & DrawFlags::Drawcall)) + if(!(action->flags & ActionFlags::Drawcall)) events.erase(0); else break; @@ -1187,9 +1184,9 @@ ResourceId D3D12Replay::RenderOverlay(ResourceId texid, FloatVector clearCol, De rs.ApplyState(m_pDevice, list); - const DrawcallDescription *draw = m_pDevice->GetDrawcall(events[i]); + const ActionDescription *action = m_pDevice->GetAction(events[i]); - for(uint32_t inst = 0; draw && inst < RDCMAX(1U, draw->numInstances); inst++) + for(uint32_t inst = 0; action && inst < RDCMAX(1U, action->numInstances); inst++) { MeshFormat fmt = GetPostVSBuffers(events[i], inst, 0, MeshDataStage::GSOut); if(fmt.vertexResourceId == ResourceId()) diff --git a/renderdoc/driver/d3d12/d3d12_postvs.cpp b/renderdoc/driver/d3d12/d3d12_postvs.cpp index 825ee7ab4..28e7063c3 100644 --- a/renderdoc/driver/d3d12/d3d12_postvs.cpp +++ b/renderdoc/driver/d3d12/d3d12_postvs.cpp @@ -194,9 +194,9 @@ void D3D12Replay::InitPostVSBuffers(uint32_t eventId) D3D_PRIMITIVE_TOPOLOGY topo = rs.topo; - const DrawcallDescription *drawcall = m_pDevice->GetDrawcall(eventId); + const ActionDescription *action = m_pDevice->GetAction(eventId); - if(drawcall->numIndices == 0 || drawcall->numInstances == 0) + if(action->numIndices == 0 || action->numInstances == 0) return; DXBC::DXBCContainer *dxbcVS = vs->GetDXBC(); @@ -348,7 +348,7 @@ void D3D12Replay::InitPostVSBuffers(uint32_t eventId) bool recreate = false; // we add 64 to account for the stream-out data counter - uint64_t outputSize = uint64_t(drawcall->numIndices) * drawcall->numInstances * stride + 64; + uint64_t outputSize = uint64_t(action->numIndices) * action->numInstances * stride + 64; if(m_SOBufferSize < outputSize) { @@ -361,7 +361,7 @@ void D3D12Replay::InitPostVSBuffers(uint32_t eventId) ID3D12GraphicsCommandListX *list = NULL; - if(!(drawcall->flags & DrawFlags::Indexed)) + if(!(action->flags & ActionFlags::Indexed)) { if(recreate) { @@ -394,15 +394,15 @@ void D3D12Replay::InitPostVSBuffers(uint32_t eventId) list->SOSetTargets(0, 1, &view); list->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_POINTLIST); - list->DrawInstanced(drawcall->numIndices, drawcall->numInstances, drawcall->vertexOffset, - drawcall->instanceOffset); + list->DrawInstanced(action->numIndices, action->numInstances, action->vertexOffset, + action->instanceOffset); } else // drawcall is indexed { bytebuf idxdata; if(rs.ibuffer.buf != ResourceId() && rs.ibuffer.size > 0) - GetBufferData(rs.ibuffer.buf, rs.ibuffer.offs + drawcall->indexOffset * rs.ibuffer.bytewidth, - RDCMIN(drawcall->numIndices * rs.ibuffer.bytewidth, rs.ibuffer.size), idxdata); + GetBufferData(rs.ibuffer.buf, rs.ibuffer.offs + action->indexOffset * rs.ibuffer.bytewidth, + RDCMIN(action->numIndices * rs.ibuffer.bytewidth, rs.ibuffer.size), idxdata); rdcarray indices; @@ -411,7 +411,7 @@ void D3D12Replay::InitPostVSBuffers(uint32_t eventId) // only read as many indices as were available in the buffer uint32_t numIndices = - RDCMIN(uint32_t(idxdata.size() / RDCMAX(1, rs.ibuffer.bytewidth)), drawcall->numIndices); + RDCMIN(uint32_t(idxdata.size() / RDCMAX(1, rs.ibuffer.bytewidth)), action->numIndices); // grab all unique vertex indices referenced for(uint32_t i = 0; i < numIndices; i++) @@ -428,7 +428,7 @@ void D3D12Replay::InitPostVSBuffers(uint32_t eventId) // if we read out of bounds, we'll also have a 0 index being referenced // (as 0 is read). Don't insert 0 if we already have 0 though - if(numIndices < drawcall->numIndices && (indices.empty() || indices[0] != 0)) + if(numIndices < action->numIndices && (indices.empty() || indices[0] != 0)) indices.insert(0, 0); // An index buffer could be something like: 500, 501, 502, 501, 503, 502 @@ -504,8 +504,8 @@ void D3D12Replay::InitPostVSBuffers(uint32_t eventId) list->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_POINTLIST); - list->DrawIndexedInstanced((UINT)indices.size(), drawcall->numInstances, 0, - drawcall->baseVertex, drawcall->instanceOffset); + list->DrawIndexedInstanced((UINT)indices.size(), action->numInstances, 0, action->baseVertex, + action->instanceOffset); uint32_t stripCutValue = 0; if(psoDesc.IBStripCutValue == D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_0xFFFF) @@ -724,13 +724,13 @@ void D3D12Replay::InitPostVSBuffers(uint32_t eventId) m_PostVSData[eventId].vsout.nearPlane = nearp; m_PostVSData[eventId].vsout.farPlane = farp; - m_PostVSData[eventId].vsout.useIndices = bool(drawcall->flags & DrawFlags::Indexed); - m_PostVSData[eventId].vsout.numVerts = drawcall->numIndices; + m_PostVSData[eventId].vsout.useIndices = bool(action->flags & ActionFlags::Indexed); + m_PostVSData[eventId].vsout.numVerts = action->numIndices; m_PostVSData[eventId].vsout.instStride = 0; - if(drawcall->flags & DrawFlags::Instanced) + if(action->flags & ActionFlags::Instanced) m_PostVSData[eventId].vsout.instStride = - uint32_t(numBytesWritten / RDCMAX(1U, drawcall->numInstances)); + uint32_t(numBytesWritten / RDCMAX(1U, action->numInstances)); m_PostVSData[eventId].vsout.idxBuf = NULL; if(m_PostVSData[eventId].vsout.useIndices && idxBuf) @@ -840,8 +840,8 @@ void D3D12Replay::InitPostVSBuffers(uint32_t eventId) view.BufferLocation = m_SOBuffer->GetGPUVirtualAddress() + 64; view.SizeInBytes = m_SOBufferSize - 64; // draws with multiple instances must be replayed one at a time so we can record the number of - // primitives from each drawcall, as due to expansion this can vary per-instance. - if(drawcall->numInstances > 1) + // primitives from each action, as due to expansion this can vary per-instance. + if(action->numInstances > 1) { list = GetDebugManager()->ResetDebugList(); @@ -865,16 +865,15 @@ void D3D12Replay::InitPostVSBuffers(uint32_t eventId) list->BeginQuery(m_SOQueryHeap, D3D12_QUERY_TYPE_SO_STATISTICS_STREAM0, 0); // because the result is expanded we don't have to remap index buffers or anything - if(drawcall->flags & DrawFlags::Indexed) + if(action->flags & ActionFlags::Indexed) { - list->DrawIndexedInstanced(drawcall->numIndices, drawcall->numInstances, - drawcall->indexOffset, drawcall->baseVertex, - drawcall->instanceOffset); + list->DrawIndexedInstanced(action->numIndices, action->numInstances, action->indexOffset, + action->baseVertex, action->instanceOffset); } else { - list->DrawInstanced(drawcall->numIndices, drawcall->numInstances, drawcall->vertexOffset, - drawcall->instanceOffset); + list->DrawInstanced(action->numIndices, action->numInstances, action->vertexOffset, + action->instanceOffset); } list->EndQuery(m_SOQueryHeap, D3D12_QUERY_TYPE_SO_STATISTICS_STREAM0, 0); @@ -952,7 +951,7 @@ void D3D12Replay::InitPostVSBuffers(uint32_t eventId) } // reserve space for enough 'buffer filled size' locations - UINT64 SizeCounterBytes = AlignUp(uint64_t(drawcall->numInstances * sizeof(UINT64)), 64ULL); + UINT64 SizeCounterBytes = AlignUp(uint64_t(action->numInstances * sizeof(UINT64)), 64ULL); view.BufferLocation = m_SOBuffer->GetGPUVirtualAddress() + SizeCounterBytes; view.SizeInBytes = m_SOBufferSize - SizeCounterBytes; @@ -960,23 +959,22 @@ void D3D12Replay::InitPostVSBuffers(uint32_t eventId) // there's no way to replay only a single instance. We have to replay 1, 2, 3, ... N instances // and count the total number of verts each time, then we can see from the difference how much // each instance wrote. - for(uint32_t inst = 1; inst <= drawcall->numInstances; inst++) + for(uint32_t inst = 1; inst <= action->numInstances; inst++) { - if(drawcall->flags & DrawFlags::Indexed) + if(action->flags & ActionFlags::Indexed) { view.BufferFilledSizeLocation = m_SOBuffer->GetGPUVirtualAddress() + (inst - 1) * sizeof(UINT64); list->SOSetTargets(0, 1, &view); - list->DrawIndexedInstanced(drawcall->numIndices, inst, drawcall->indexOffset, - drawcall->baseVertex, drawcall->instanceOffset); + list->DrawIndexedInstanced(action->numIndices, inst, action->indexOffset, + action->baseVertex, action->instanceOffset); } else { view.BufferFilledSizeLocation = m_SOBuffer->GetGPUVirtualAddress() + (inst - 1) * sizeof(UINT64); list->SOSetTargets(0, 1, &view); - list->DrawInstanced(drawcall->numIndices, inst, drawcall->vertexOffset, - drawcall->instanceOffset); + list->DrawInstanced(action->numIndices, inst, action->vertexOffset, action->instanceOffset); } // Instanced draws with a wild number of instances can hang the GPU, sync after every 1000 @@ -1030,16 +1028,15 @@ void D3D12Replay::InitPostVSBuffers(uint32_t eventId) list->BeginQuery(m_SOQueryHeap, D3D12_QUERY_TYPE_SO_STATISTICS_STREAM0, 0); // because the result is expanded we don't have to remap index buffers or anything - if(drawcall->flags & DrawFlags::Indexed) + if(action->flags & ActionFlags::Indexed) { - list->DrawIndexedInstanced(drawcall->numIndices, drawcall->numInstances, - drawcall->indexOffset, drawcall->baseVertex, - drawcall->instanceOffset); + list->DrawIndexedInstanced(action->numIndices, action->numInstances, action->indexOffset, + action->baseVertex, action->instanceOffset); } else { - list->DrawInstanced(drawcall->numIndices, drawcall->numInstances, drawcall->vertexOffset, - drawcall->instanceOffset); + list->DrawInstanced(action->numIndices, action->numInstances, action->vertexOffset, + action->instanceOffset); } list->EndQuery(m_SOQueryHeap, D3D12_QUERY_TYPE_SO_STATISTICS_STREAM0, 0); @@ -1137,11 +1134,11 @@ void D3D12Replay::InitPostVSBuffers(uint32_t eventId) uint64_t numBytesWritten = 0; rdcarray instData; - if(drawcall->numInstances > 1) + if(action->numInstances > 1) { uint64_t prevByteCount = 0; - for(uint32_t inst = 0; inst < drawcall->numInstances; inst++) + for(uint32_t inst = 0; inst < action->numInstances; inst++) { uint64_t byteCount = counters[inst]; @@ -1268,9 +1265,9 @@ void D3D12Replay::InitPostVSBuffers(uint32_t eventId) m_PostVSData[eventId].gsout.buf = gsoutBuffer; m_PostVSData[eventId].gsout.instStride = 0; - if(drawcall->flags & DrawFlags::Instanced) + if(action->flags & ActionFlags::Instanced) m_PostVSData[eventId].gsout.instStride = - uint32_t(numBytesWritten / RDCMAX(1U, drawcall->numInstances)); + uint32_t(numBytesWritten / RDCMAX(1U, action->numInstances)); m_PostVSData[eventId].gsout.vertStride = stride; m_PostVSData[eventId].gsout.nearPlane = nearp; m_PostVSData[eventId].gsout.farPlane = farp; @@ -1294,8 +1291,8 @@ void D3D12Replay::InitPostVSBuffers(uint32_t eventId) m_PostVSData[eventId].gsout.numVerts = (uint32_t)numVerts; - if(drawcall->flags & DrawFlags::Instanced) - m_PostVSData[eventId].gsout.numVerts /= RDCMAX(1U, drawcall->numInstances); + if(action->flags & ActionFlags::Instanced) + m_PostVSData[eventId].gsout.numVerts /= RDCMAX(1U, action->numInstances); m_PostVSData[eventId].gsout.instData = instData; } @@ -1303,15 +1300,15 @@ void D3D12Replay::InitPostVSBuffers(uint32_t eventId) SAFE_RELEASE(soSig); } -struct D3D12InitPostVSCallback : public D3D12DrawcallCallback +struct D3D12InitPostVSCallback : public D3D12ActionCallback { D3D12InitPostVSCallback(WrappedID3D12Device *dev, D3D12Replay *replay, const rdcarray &events) : m_pDevice(dev), m_Replay(replay), m_Events(events) { - m_pDevice->GetQueue()->GetCommandData()->m_DrawcallCallback = this; + m_pDevice->GetQueue()->GetCommandData()->m_ActionCallback = this; } - ~D3D12InitPostVSCallback() { m_pDevice->GetQueue()->GetCommandData()->m_DrawcallCallback = NULL; } + ~D3D12InitPostVSCallback() { m_pDevice->GetQueue()->GetCommandData()->m_ActionCallback = NULL; } void PreDraw(uint32_t eid, ID3D12GraphicsCommandListX *cmd) override { if(m_Events.contains(eid)) diff --git a/renderdoc/driver/d3d12/d3d12_replay.cpp b/renderdoc/driver/d3d12/d3d12_replay.cpp index 4ba7c45a0..af39528e8 100644 --- a/renderdoc/driver/d3d12/d3d12_replay.cpp +++ b/renderdoc/driver/d3d12/d3d12_replay.cpp @@ -2711,23 +2711,23 @@ rdcarray D3D12Replay::GetPassEvents(uint32_t eventId) { rdcarray passEvents; - const DrawcallDescription *draw = m_pDevice->GetDrawcall(eventId); + const ActionDescription *action = m_pDevice->GetAction(eventId); - if(!draw) + if(!action) return passEvents; // for D3D12 a pass == everything writing to the same RTs in a command list. - const DrawcallDescription *start = draw; + const ActionDescription *start = action; while(start) { // if we've come to the beginning of a list, break out of the loop, we've // found the start. - if(start->flags & DrawFlags::BeginPass) + if(start->flags & ActionFlags::BeginPass) break; // if we come to the END of a list, since we were iterating backwards that // means we started outside of a list, so return empty set. - if(start->flags & DrawFlags::EndPass) + if(start->flags & ActionFlags::EndPass) return passEvents; // if we've come to the start of the log we were outside of a list @@ -2736,10 +2736,10 @@ rdcarray D3D12Replay::GetPassEvents(uint32_t eventId) return passEvents; // step back - const DrawcallDescription *prev = start->previous; + const ActionDescription *prev = start->previous; // if the previous is a clear, we're done - if(prev->flags & DrawFlags::Clear) + if(prev->flags & ActionFlags::Clear) break; // if the outputs changed, we're done @@ -2749,17 +2749,17 @@ rdcarray D3D12Replay::GetPassEvents(uint32_t eventId) start = prev; } - // store all the draw eventIDs up to the one specified at the start + // store all the action eventIDs up to the one specified at the start while(start) { - if(start->eventId >= draw->eventId) + if(start->eventId >= action->eventId) break; // include pass boundaries, these will be filtered out later - // so we don't actually do anything (init postvs/draw overlay) + // so we don't actually do anything (init postvs/action overlay) // but it's useful to have the first part of the pass as part // of the list - if(start->flags & (DrawFlags::Drawcall | DrawFlags::PassBoundary)) + if(start->flags & (ActionFlags::Drawcall | ActionFlags::PassBoundary)) passEvents.push_back(start->eventId); start = start->next; diff --git a/renderdoc/driver/d3d12/d3d12_replay.h b/renderdoc/driver/d3d12/d3d12_replay.h index 0b3e1b784..e7841f4b7 100644 --- a/renderdoc/driver/d3d12/d3d12_replay.h +++ b/renderdoc/driver/d3d12/d3d12_replay.h @@ -31,7 +31,7 @@ #include "d3d12_state.h" class AMDCounters; -struct D3D12AMDDrawCallback; +struct D3D12AMDActionCallback; class WrappedID3D12Device; class D3D12DebugManager; @@ -437,7 +437,7 @@ private: DriverInformation m_DriverInfo; - D3D12AMDDrawCallback *m_pAMDDrawCallback = NULL; + D3D12AMDActionCallback *m_pAMDActionCallback = NULL; rdcarray m_CustomShaderIncludes; diff --git a/renderdoc/driver/d3d12/d3d12_shaderdebug.cpp b/renderdoc/driver/d3d12/d3d12_shaderdebug.cpp index 33fae47ab..7c1e987a8 100644 --- a/renderdoc/driver/d3d12/d3d12_shaderdebug.cpp +++ b/renderdoc/driver/d3d12/d3d12_shaderdebug.cpp @@ -111,12 +111,13 @@ D3D12DebugAPIWrapper::D3D12DebugAPIWrapper(WrappedID3D12Device *device, D3D12DebugAPIWrapper::~D3D12DebugAPIWrapper() { - // if we replayed to before the draw for fetching some UAVs, replay back to after the draw to keep + // if we replayed to before the action for fetching some UAVs, replay back to after the action to + // keep // the state consistent. if(m_DidReplay) { D3D12MarkerRegion region(m_pDevice->GetQueue()->GetReal(), "ResetReplay"); - // replay the draw to get back to 'normal' state for this event, and mark that we need to + // replay the action to get back to 'normal' state for this event, and mark that we need to // replay back to pristine state next time we need to fetch data. m_pDevice->ReplayLog(0, m_EventID, eReplay_OnlyDraw); } @@ -287,7 +288,7 @@ void D3D12DebugAPIWrapper::FetchSRV(const DXBCDebug::BindingSlot &slot) void D3D12DebugAPIWrapper::FetchUAV(const DXBCDebug::BindingSlot &slot) { - // if the UAV might be dirty from side-effects from the draw, replay back to right + // if the UAV might be dirty from side-effects from the action, replay back to right // before it. if(!m_DidReplay) { @@ -1622,7 +1623,7 @@ bool D3D12DebugAPIWrapper::CalculateSampleGather( rs.pipe = GetResID(samplePso); rs.rts.clear(); // Set viewport/scissor unconditionally - we need to set this all the time for sampling for a - // compute shader, but also a graphics draw might exclude pixel (0, 0) from its view or scissor + // compute shader, but also a graphics action might exclude pixel (0, 0) from its view or scissor rs.views.clear(); rs.views.push_back({0, 0, 1, 1, 0, 1}); rs.scissors.clear(); @@ -1847,7 +1848,7 @@ ShaderDebugTrace *D3D12Replay::DebugVertex(uint32_t eventId, uint32_t vertid, ui WrappedID3D12PipelineState *pso = m_pDevice->GetResourceManager()->GetCurrentAs(rs.pipe); - const DrawcallDescription *draw = m_pDevice->GetDrawcall(eventId); + const ActionDescription *action = m_pDevice->GetAction(eventId); rdcarray inputlayout; uint32_t numElements = pso->graphics->InputLayout.NumElements; @@ -1864,7 +1865,7 @@ ShaderDebugTrace *D3D12Replay::DebugVertex(uint32_t eventId, uint32_t vertid, ui for(size_t i = 0; i < inputlayout.size(); i++) { if(inputlayout[i].InputSlotClass == D3D12_INPUT_CLASSIFICATION_PER_INSTANCE_DATA && - inputlayout[i].InstanceDataStepRate < draw->numInstances) + inputlayout[i].InstanceDataStepRate < action->numInstances) MaxStepRate = RDCMAX(inputlayout[i].InstanceDataStepRate, MaxStepRate); UINT slot = @@ -1898,20 +1899,20 @@ ShaderDebugTrace *D3D12Replay::DebugVertex(uint32_t eventId, uint32_t vertid, ui const D3D12RenderState::VertBuffer &vb = rs.vbuffers[i]; ID3D12Resource *buffer = m_pDevice->GetResourceManager()->GetCurrentAs(vb.buf); - if(vb.stride * (draw->vertexOffset + idx) < vb.size) - GetDebugManager()->GetBufferData(buffer, vb.offs + vb.stride * (draw->vertexOffset + idx), + if(vb.stride * (action->vertexOffset + idx) < vb.size) + GetDebugManager()->GetBufferData(buffer, vb.offs + vb.stride * (action->vertexOffset + idx), vb.stride, vertData[i]); for(UINT isr = 1; isr <= MaxStepRate; isr++) { - if((draw->instanceOffset + (instid / isr)) < vb.size) + if((action->instanceOffset + (instid / isr)) < vb.size) GetDebugManager()->GetBufferData( - buffer, vb.offs + vb.stride * (draw->instanceOffset + (instid / isr)), vb.stride, + buffer, vb.offs + vb.stride * (action->instanceOffset + (instid / isr)), vb.stride, instData[i * MaxStepRate + isr - 1]); } - if(vb.stride * draw->instanceOffset < vb.size) - GetDebugManager()->GetBufferData(buffer, vb.offs + vb.stride * draw->instanceOffset, + if(vb.stride * action->instanceOffset < vb.size) + GetDebugManager()->GetBufferData(buffer, vb.offs + vb.stride * action->instanceOffset, vb.stride, staticData[i]); } } @@ -1973,7 +1974,7 @@ ShaderDebugTrace *D3D12Replay::DebugVertex(uint32_t eventId, uint32_t vertid, ui } else { - if(el->InstanceDataStepRate == 0 || el->InstanceDataStepRate >= draw->numInstances) + if(el->InstanceDataStepRate == 0 || el->InstanceDataStepRate >= action->numInstances) { if(staticData[el->InputSlot].size() >= el->AlignedByteOffset) { @@ -2145,8 +2146,8 @@ ShaderDebugTrace *D3D12Replay::DebugVertex(uint32_t eventId, uint32_t vertid, ui { uint32_t sv_vertid = vertid; - if(draw->flags & DrawFlags::Indexed) - sv_vertid = idx - draw->baseVertex; + if(action->flags & ActionFlags::Indexed) + sv_vertid = idx - action->baseVertex; if(dxbc->GetReflection()->InputSig[i].varType == VarType::Float) state.inputs[i].value.f32v[0] = state.inputs[i].value.f32v[1] = diff --git a/renderdoc/driver/gl/gl_counters.cpp b/renderdoc/driver/gl/gl_counters.cpp index 82d9eb1a3..cf6fec26f 100644 --- a/renderdoc/driver/gl/gl_counters.cpp +++ b/renderdoc/driver/gl/gl_counters.cpp @@ -250,18 +250,18 @@ GLenum glCounters[] = { eGL_COMPUTE_SHADER_INVOCATIONS_ARB // GPUCounter::CSInvocations }; -void GLReplay::FillTimers(GLCounterContext &ctx, const DrawcallDescription &drawnode, +void GLReplay::FillTimers(GLCounterContext &ctx, const ActionDescription &actionnode, const rdcarray &counters) { - if(drawnode.children.empty()) + if(actionnode.children.empty()) return; - for(size_t i = 0; i < drawnode.children.size(); i++) + for(size_t i = 0; i < actionnode.children.size(); i++) { - const DrawcallDescription &d = drawnode.children[i]; - FillTimers(ctx, drawnode.children[i], counters); + const ActionDescription &a = actionnode.children[i]; + FillTimers(ctx, actionnode.children[i], counters); - if(d.events.empty()) + if(a.events.empty()) continue; GPUQueries *queries = NULL; @@ -270,7 +270,7 @@ void GLReplay::FillTimers(GLCounterContext &ctx, const DrawcallDescription &draw ctx.queries.push_back(GPUQueries()); queries = &ctx.queries.back(); - queries->eventId = d.eventId; + queries->eventId = a.eventId; for(auto q : indices()) queries->obj[q] = 0; @@ -282,7 +282,7 @@ void GLReplay::FillTimers(GLCounterContext &ctx, const DrawcallDescription &draw } } - m_pDriver->ReplayLog(ctx.eventStart, d.eventId, eReplay_WithoutDraw); + m_pDriver->ReplayLog(ctx.eventStart, a.eventId, eReplay_WithoutDraw); ClearGLErrors(); @@ -300,42 +300,42 @@ void GLReplay::FillTimers(GLCounterContext &ctx, const DrawcallDescription &draw } } - m_pDriver->ReplayLog(ctx.eventStart, d.eventId, eReplay_OnlyDraw); + m_pDriver->ReplayLog(ctx.eventStart, a.eventId, eReplay_OnlyDraw); for(auto q : indices()) if(queries->obj[q]) m_pDriver->glEndQuery(glCounters[q]); - ctx.eventStart = d.eventId + 1; + ctx.eventStart = a.eventId + 1; } } void GLReplay::FillTimersAMD(uint32_t *eventStartID, uint32_t *sampleIndex, - rdcarray *eventIDs, const DrawcallDescription &drawnode) + rdcarray *eventIDs, const ActionDescription &actionnode) { - if(drawnode.children.empty()) + if(actionnode.children.empty()) return; - for(size_t i = 0; i < drawnode.children.size(); i++) + for(size_t i = 0; i < actionnode.children.size(); i++) { - const DrawcallDescription &d = drawnode.children[i]; + const ActionDescription &a = actionnode.children[i]; - FillTimersAMD(eventStartID, sampleIndex, eventIDs, drawnode.children[i]); + FillTimersAMD(eventStartID, sampleIndex, eventIDs, actionnode.children[i]); - if(d.events.empty()) + if(a.events.empty()) continue; - eventIDs->push_back(d.eventId); + eventIDs->push_back(a.eventId); - m_pDriver->ReplayLog(*eventStartID, d.eventId, eReplay_WithoutDraw); + m_pDriver->ReplayLog(*eventStartID, a.eventId, eReplay_WithoutDraw); m_pAMDCounters->BeginSample(*sampleIndex); - m_pDriver->ReplayLog(*eventStartID, d.eventId, eReplay_OnlyDraw); + m_pDriver->ReplayLog(*eventStartID, a.eventId, eReplay_OnlyDraw); m_pAMDCounters->EndSample(); - *eventStartID = d.eventId + 1; + *eventStartID = a.eventId + 1; ++*sampleIndex; } } @@ -379,7 +379,7 @@ rdcarray GLReplay::FetchCountersAMD(const rdcarray &c eventIDs.clear(); - FillTimersAMD(&eventStartID, &sampleIndex, &eventIDs, m_pDriver->GetRootDraw()); + FillTimersAMD(&eventStartID, &sampleIndex, &eventIDs, m_pDriver->GetRootAction()); m_pAMDCounters->EndCommandList(); m_pAMDCounters->EndPass(); } @@ -397,31 +397,31 @@ rdcarray GLReplay::FetchCountersAMD(const rdcarray &c } void GLReplay::FillTimersIntel(uint32_t *eventStartID, uint32_t *sampleIndex, - rdcarray *eventIDs, const DrawcallDescription &drawnode) + rdcarray *eventIDs, const ActionDescription &actionnode) { - if(drawnode.children.empty()) + if(actionnode.children.empty()) return; - for(size_t i = 0; i < drawnode.children.size(); i++) + for(size_t i = 0; i < actionnode.children.size(); i++) { - const DrawcallDescription &d = drawnode.children[i]; + const ActionDescription &a = actionnode.children[i]; - FillTimersIntel(eventStartID, sampleIndex, eventIDs, drawnode.children[i]); + FillTimersIntel(eventStartID, sampleIndex, eventIDs, actionnode.children[i]); - if(d.events.empty()) + if(a.events.empty()) continue; - eventIDs->push_back(d.eventId); + eventIDs->push_back(a.eventId); - m_pDriver->ReplayLog(*eventStartID, d.eventId, eReplay_WithoutDraw); + m_pDriver->ReplayLog(*eventStartID, a.eventId, eReplay_WithoutDraw); m_pIntelCounters->BeginSample(*sampleIndex); - m_pDriver->ReplayLog(*eventStartID, d.eventId, eReplay_OnlyDraw); + m_pDriver->ReplayLog(*eventStartID, a.eventId, eReplay_OnlyDraw); m_pIntelCounters->EndSample(); - *eventStartID = d.eventId + 1; + *eventStartID = a.eventId + 1; ++*sampleIndex; } } @@ -459,7 +459,7 @@ rdcarray GLReplay::FetchCountersIntel(const rdcarray eventIDs.clear(); - FillTimersIntel(&eventStartID, &sampleIndex, &eventIDs, m_pDriver->GetRootDraw()); + FillTimersIntel(&eventStartID, &sampleIndex, &eventIDs, m_pDriver->GetRootAction()); m_pIntelCounters->EndPass(); } @@ -473,27 +473,27 @@ rdcarray GLReplay::FetchCountersIntel(const rdcarray } void GLReplay::FillTimersARM(uint32_t *eventStartID, uint32_t *sampleIndex, - rdcarray *eventIDs, const DrawcallDescription &drawnode) + rdcarray *eventIDs, const ActionDescription &actionnode) { - if(drawnode.children.empty()) + if(actionnode.children.empty()) return; - for(size_t i = 0; i < drawnode.children.size(); i++) + for(size_t i = 0; i < actionnode.children.size(); i++) { - const DrawcallDescription &d = drawnode.children[i]; + const ActionDescription &a = actionnode.children[i]; - FillTimersARM(eventStartID, sampleIndex, eventIDs, drawnode.children[i]); + FillTimersARM(eventStartID, sampleIndex, eventIDs, actionnode.children[i]); - if(d.events.empty()) + if(a.events.empty()) continue; - eventIDs->push_back(d.eventId); + eventIDs->push_back(a.eventId); - m_pDriver->ReplayLog(*eventStartID, d.eventId, eReplay_WithoutDraw); + m_pDriver->ReplayLog(*eventStartID, a.eventId, eReplay_WithoutDraw); - m_pARMCounters->BeginSample(d.eventId); + m_pARMCounters->BeginSample(a.eventId); - m_pDriver->ReplayLog(*eventStartID, d.eventId, eReplay_OnlyDraw); + m_pDriver->ReplayLog(*eventStartID, a.eventId, eReplay_OnlyDraw); // wait for the GPU to process all commands GLsync sync = GL.glFenceSync(eGL_SYNC_GPU_COMMANDS_COMPLETE, 0); @@ -503,7 +503,7 @@ void GLReplay::FillTimersARM(uint32_t *eventStartID, uint32_t *sampleIndex, GL.glDeleteSync(sync); - *eventStartID = d.eventId + 1; + *eventStartID = a.eventId + 1; ++*sampleIndex; } } @@ -539,7 +539,7 @@ rdcarray GLReplay::FetchCountersARM(const rdcarray &c eventIDs.clear(); - FillTimersARM(&eventStartID, &sampleIndex, &eventIDs, m_pDriver->GetRootDraw()); + FillTimersARM(&eventStartID, &sampleIndex, &eventIDs, m_pDriver->GetRootAction()); m_pARMCounters->EndPass(); } @@ -617,7 +617,7 @@ rdcarray GLReplay::FetchCounters(const rdcarray &allC m_pDriver->ReplayMarkers(false); m_pDriver->SetFetchCounters(true); - FillTimers(ctx, m_pDriver->GetRootDraw(), counters); + FillTimers(ctx, m_pDriver->GetRootAction(), counters); m_pDriver->SetFetchCounters(false); m_pDriver->ReplayMarkers(true); diff --git a/renderdoc/driver/gl/gl_driver.cpp b/renderdoc/driver/gl/gl_driver.cpp index a3b93f95d..ea152b30e 100644 --- a/renderdoc/driver/gl/gl_driver.cpp +++ b/renderdoc/driver/gl/gl_driver.cpp @@ -642,10 +642,10 @@ WrappedOpenGL::WrappedOpenGL(GLPlatform &platform) m_SuppressDebugMessages = false; - m_DrawcallStack.push_back(&m_ParentDrawcall); + m_ActionStack.push_back(&m_ParentAction); m_CurEventID = 0; - m_CurDrawcallID = 0; + m_CurActionID = 0; m_FirstEventID = 0; m_LastEventID = ~0U; @@ -700,7 +700,7 @@ WrappedOpenGL::WrappedOpenGL(GLPlatform &platform) m_CurrentDefaultFBO = 0; m_CurChunkOffset = 0; - m_AddedDrawcall = false; + m_AddedAction = false; m_CurCtxDataTLS = Threading::AllocateTLSSlot(); } @@ -2111,7 +2111,7 @@ void WrappedOpenGL::SwapBuffers(WindowingSystem winSystem, void *windowHandle) SERIALISE_TIME_CALL(); USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_Present(ser); @@ -2661,21 +2661,21 @@ bool WrappedOpenGL::Serialise_Present(SerialiserType &ser) { AddEvent(); - DrawcallDescription draw; + ActionDescription action; GLuint col = 0; GL.glGetNamedFramebufferAttachmentParameterivEXT(m_CurrentDefaultFBO, eGL_COLOR_ATTACHMENT0, eGL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, (GLint *)&col); - draw.copyDestination = GetResourceManager()->GetOriginalID( + action.copyDestination = GetResourceManager()->GetOriginalID( GetResourceManager()->GetResID(TextureRes(GetCtx(), col))); - draw.name = - StringFormat::Fmt("%s(%s)", ToStr(gl_CurChunk).c_str(), ToStr(draw.copyDestination).c_str()); - draw.flags |= DrawFlags::Present; + action.name = StringFormat::Fmt("%s(%s)", ToStr(gl_CurChunk).c_str(), + ToStr(action.copyDestination).c_str()); + action.flags |= ActionFlags::Present; - AddDrawcall(draw); + AddAction(action); } return true; @@ -2730,7 +2730,7 @@ bool WrappedOpenGL::Serialise_ContextInit(ReadSerialiser &ser) void WrappedOpenGL::ContextEndFrame() { USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(SystemChunk::CaptureEnd); m_ContextRecord->AddChunk(scope.Get()); @@ -3477,19 +3477,19 @@ bool WrappedOpenGL::ProcessChunk(ReadSerialiser &ser, GLChunk chunk) { AddEvent(); - DrawcallDescription draw; - draw.name = "End of Capture"; - draw.flags |= DrawFlags::Present; + ActionDescription action; + action.name = "End of Capture"; + action.flags |= ActionFlags::Present; GLuint col = 0; GL.glGetNamedFramebufferAttachmentParameterivEXT(m_CurrentDefaultFBO, eGL_COLOR_ATTACHMENT0, eGL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, (GLint *)&col); - draw.copyDestination = GetResourceManager()->GetOriginalID( + action.copyDestination = GetResourceManager()->GetOriginalID( GetResourceManager()->GetResID(TextureRes(GetCtx(), col))); - AddDrawcall(draw); + AddAction(action); } return true; } @@ -5118,7 +5118,7 @@ ReplayStatus WrappedOpenGL::ContextReplayLog(CaptureState readType, uint32_t sta else { m_CurEventID = 1; - m_CurDrawcallID = 1; + m_CurActionID = 1; m_FirstEventID = 0; m_LastEventID = ~0U; } @@ -5173,13 +5173,13 @@ ReplayStatus WrappedOpenGL::ContextReplayLog(CaptureState readType, uint32_t sta if(IsLoading(m_State)) { - GetReplay()->WriteFrameRecord().drawcallList = m_ParentDrawcall.children; + GetReplay()->WriteFrameRecord().actionList = m_ParentAction.children; GetReplay()->WriteFrameRecord().frameInfo.debugMessages = GetDebugMessages(); - SetupDrawcallPointers(m_Drawcalls, GetReplay()->WriteFrameRecord().drawcallList); + SetupActionPointers(m_Actions, GetReplay()->WriteFrameRecord().actionList); // it's easier to remove duplicate usages here than check it as we go. - // this means if textures are bound in multiple places in the same draw + // this means if textures are bound in multiple places in the same action // we don't have duplicate uses for(auto it = m_ResourceUses.begin(); it != m_ResourceUses.end(); ++it) { @@ -5229,7 +5229,7 @@ ReplayStatus WrappedOpenGL::ContextReplayLog(CaptureState readType, uint32_t sta bool WrappedOpenGL::ContextProcessChunk(ReadSerialiser &ser, GLChunk chunk) { - m_AddedDrawcall = false; + m_AddedAction = false; bool success = ProcessChunk(ser, chunk); @@ -5251,47 +5251,47 @@ bool WrappedOpenGL::ContextProcessChunk(ReadSerialiser &ser, GLChunk chunk) case GLChunk::glPushDebugGroup: case GLChunk::glPushDebugGroupKHR: { - // push down the drawcallstack to the latest drawcall - m_DrawcallStack.push_back(&m_DrawcallStack.back()->children.back()); + // push down the action stack to the latest action + m_ActionStack.push_back(&m_ActionStack.back()->children.back()); break; } case GLChunk::glPopGroupMarkerEXT: case GLChunk::glPopDebugGroup: case GLChunk::glPopDebugGroupKHR: { - // refuse to pop off further than the root drawcall (mismatched begin/end events e.g.) - if(m_DrawcallStack.size() > 1) - m_DrawcallStack.pop_back(); + // refuse to pop off further than the root action (mismatched begin/end events e.g.) + if(m_ActionStack.size() > 1) + m_ActionStack.pop_back(); break; } default: break; } - if(!m_AddedDrawcall) + if(!m_AddedAction) AddEvent(); } - m_AddedDrawcall = false; + m_AddedAction = false; return true; } -void WrappedOpenGL::AddUsage(const DrawcallDescription &d) +void WrappedOpenGL::AddUsage(const ActionDescription &a) { - DrawFlags DrawDispatchMask = DrawFlags::Drawcall | DrawFlags::Dispatch; - if(!(d.flags & DrawDispatchMask)) + ActionFlags DrawDispatchMask = ActionFlags::Drawcall | ActionFlags::Dispatch; + if(!(a.flags & DrawDispatchMask)) return; GLResourceManager *rm = GetResourceManager(); ContextPair &ctx = GetCtx(); - uint32_t e = d.eventId; + uint32_t e = a.eventId; ////////////////////////////// // Input - if(d.flags & DrawFlags::Indexed) + if(a.flags & ActionFlags::Indexed) { GLuint ibuffer = 0; GL.glGetIntegerv(eGL_ELEMENT_ARRAY_BUFFER_BINDING, (GLint *)&ibuffer); @@ -5332,7 +5332,7 @@ void WrappedOpenGL::AddUsage(const DrawcallDescription &d) if(curProg == 0) { - // no program bound at this draw + // no program bound at this action } else { @@ -5520,15 +5520,15 @@ void WrappedOpenGL::AddUsage(const DrawcallDescription &d) } } -void WrappedOpenGL::AddDrawcall(const DrawcallDescription &d) +void WrappedOpenGL::AddAction(const ActionDescription &a) { - m_AddedDrawcall = true; + m_AddedAction = true; WrappedOpenGL *context = this; - DrawcallDescription draw = d; - draw.eventId = m_CurEventID; - draw.drawcallId = m_CurDrawcallID; + ActionDescription action = a; + action.eventId = m_CurEventID; + action.actionId = m_CurActionID; m_DrawcallParams.resize_for_index(m_CurEventID); m_DrawcallParams[m_CurEventID].indexWidth = m_LastIndexWidth; @@ -5542,7 +5542,7 @@ void WrappedOpenGL::AddDrawcall(const DrawcallDescription &d) GLint numCols = 8; GL.glGetIntegerv(eGL_MAX_COLOR_ATTACHMENTS, &numCols); - RDCEraseEl(draw.outputs); + RDCEraseEl(action.outputs); for(GLint i = 0; i < RDCMIN(numCols, 8); i++) { @@ -5556,10 +5556,10 @@ void WrappedOpenGL::AddDrawcall(const DrawcallDescription &d) eGL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, (GLint *)&type); if(type == eGL_TEXTURE) - draw.outputs[i] = GetResourceManager()->GetOriginalID( + action.outputs[i] = GetResourceManager()->GetOriginalID( GetResourceManager()->GetResID(TextureRes(GetCtx(), curCol[i]))); else - draw.outputs[i] = GetResourceManager()->GetOriginalID( + action.outputs[i] = GetResourceManager()->GetOriginalID( GetResourceManager()->GetResID(RenderbufferRes(GetCtx(), curCol[i]))); } @@ -5571,29 +5571,29 @@ void WrappedOpenGL::AddDrawcall(const DrawcallDescription &d) GL.glGetFramebufferAttachmentParameteriv(eGL_DRAW_FRAMEBUFFER, eGL_DEPTH_ATTACHMENT, eGL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, (GLint *)&type); if(type == eGL_TEXTURE) - draw.depthOut = GetResourceManager()->GetOriginalID( + action.depthOut = GetResourceManager()->GetOriginalID( GetResourceManager()->GetResID(TextureRes(GetCtx(), curDepth))); else - draw.depthOut = GetResourceManager()->GetOriginalID( + action.depthOut = GetResourceManager()->GetOriginalID( GetResourceManager()->GetResID(RenderbufferRes(GetCtx(), curDepth))); } - // markers don't increment drawcall ID - DrawFlags MarkerMask = - DrawFlags::SetMarker | DrawFlags::PushMarker | DrawFlags::PopMarker | DrawFlags::MultiDraw; - if(!(draw.flags & MarkerMask)) - m_CurDrawcallID++; + // markers don't increment action ID + ActionFlags MarkerMask = ActionFlags::SetMarker | ActionFlags::PushMarker | + ActionFlags::PopMarker | ActionFlags::MultiAction; + if(!(action.flags & MarkerMask)) + m_CurActionID++; - draw.events.swap(m_CurEvents); + action.events.swap(m_CurEvents); - AddUsage(draw); + AddUsage(action); - // should have at least the root drawcall here, push this drawcall + // should have at least the root action here, push this action // onto the back's children list. - if(!context->m_DrawcallStack.empty()) - m_DrawcallStack.back()->children.push_back(draw); + if(!context->m_ActionStack.empty()) + m_ActionStack.back()->children.push_back(action); else - RDCERR("Somehow lost drawcall stack!"); + RDCERR("Somehow lost action stack!"); } void WrappedOpenGL::AddEvent() @@ -5626,15 +5626,15 @@ const APIEvent &WrappedOpenGL::GetEvent(uint32_t eventId) return m_Events[RDCMIN(idx, m_Events.size() - 1)]; } -const DrawcallDescription *WrappedOpenGL::GetDrawcall(uint32_t eventId) +const ActionDescription *WrappedOpenGL::GetAction(uint32_t eventId) { - if(eventId >= m_Drawcalls.size()) + if(eventId >= m_Actions.size()) return NULL; - return m_Drawcalls[eventId]; + return m_Actions[eventId]; } -const GLDrawParams &WrappedOpenGL::GetDrawcallParameters(uint32_t eventId) +const GLDrawParams &WrappedOpenGL::GetDrawParameters(uint32_t eventId) { m_DrawcallParams.resize_for_index(eventId); return m_DrawcallParams[eventId]; diff --git a/renderdoc/driver/gl/gl_driver.h b/renderdoc/driver/gl/gl_driver.h index 045660690..79ce38092 100644 --- a/renderdoc/driver/gl/gl_driver.h +++ b/renderdoc/driver/gl/gl_driver.h @@ -136,7 +136,7 @@ private: } // checks if the given object has tons of updates. If so it's probably - // in the vein of "one global object, updated per-draw as necessary", or it's just + // in the vein of "one global object, updated per-action as necessary", or it's just // really high traffic, in which case we just want to save the state of it at frame // start, then track changes while frame capturing bool RecordUpdateCheck(GLResourceRecord *record); @@ -269,13 +269,13 @@ private: } rdcarray m_CapturedFrames; - rdcarray m_Drawcalls; + rdcarray m_Actions; rdcarray m_DrawcallParams; // replay rdcarray m_CurEvents, m_Events; - bool m_AddedDrawcall; + bool m_AddedAction; ArrayMSPrograms m_ArrayMS; @@ -288,19 +288,19 @@ private: uint64_t m_CurChunkOffset; SDChunkMetaData m_ChunkMetadata; - uint32_t m_CurEventID, m_CurDrawcallID; + uint32_t m_CurEventID, m_CurActionID; uint32_t m_FirstEventID; uint32_t m_LastEventID; GLChunk m_LastChunk; ReplayStatus m_FailedReplayStatus = ReplayStatus::APIReplayFailed; - DrawcallDescription m_ParentDrawcall; + ActionDescription m_ParentAction; Topology m_LastTopology = Topology::Unknown; uint32_t m_LastIndexWidth = 0; - rdcarray m_DrawcallStack; + rdcarray m_ActionStack; std::map> m_ResourceUses; @@ -338,8 +338,8 @@ private: ReplayStatus ContextReplayLog(CaptureState readType, uint32_t startEventID, uint32_t endEventID, bool partial); bool ContextProcessChunk(ReadSerialiser &ser, GLChunk chunk); - void AddUsage(const DrawcallDescription &d); - void AddDrawcall(const DrawcallDescription &d); + void AddUsage(const ActionDescription &a); + void AddAction(const ActionDescription &a); void AddEvent(); template @@ -654,9 +654,9 @@ public: GLuint GetCurrentDefaultFBO() { return m_CurrentDefaultFBO; } const APIEvent &GetEvent(uint32_t eventId); - const DrawcallDescription &GetRootDraw() { return m_ParentDrawcall; } - const DrawcallDescription *GetDrawcall(uint32_t eventId); - const GLDrawParams &GetDrawcallParameters(uint32_t eventId); + const ActionDescription &GetRootAction() { return m_ParentAction; } + const ActionDescription *GetAction(uint32_t eventId); + const GLDrawParams &GetDrawParameters(uint32_t eventId); void SuppressDebugMessages(bool suppress) { m_SuppressDebugMessages = suppress; } rdcarray GetUsage(ResourceId id) { return m_ResourceUses[id]; } diff --git a/renderdoc/driver/gl/gl_overlay.cpp b/renderdoc/driver/gl/gl_overlay.cpp index 1f77a36e4..ce1e2af47 100644 --- a/renderdoc/driver/gl/gl_overlay.cpp +++ b/renderdoc/driver/gl/gl_overlay.cpp @@ -736,8 +736,8 @@ ResourceId GLReplay::RenderOverlay(ResourceId texid, FloatVector clearCol, Debug GLint idxbuf = 0; drv.glGetIntegerv(eGL_ELEMENT_ARRAY_BUFFER_BINDING, &idxbuf); - const DrawcallDescription *draw = m_pDriver->GetDrawcall(eventId); - const GLDrawParams &drawParams = m_pDriver->GetDrawcallParameters(eventId); + const ActionDescription *action = m_pDriver->GetAction(eventId); + const GLDrawParams &drawParams = m_pDriver->GetDrawParameters(eventId); rdcarray patchedIndices; @@ -745,7 +745,7 @@ ResourceId GLReplay::RenderOverlay(ResourceId texid, FloatVector clearCol, Debug if(idxbuf) { rdcarray idxs; - uint32_t offset = draw->indexOffset * drawParams.indexWidth; + uint32_t offset = action->indexOffset * drawParams.indexWidth; uint32_t length = 1; drv.glGetNamedBufferParameterivEXT(idxbuf, eGL_BUFFER_SIZE, (GLint *)&length); @@ -753,13 +753,13 @@ ResourceId GLReplay::RenderOverlay(ResourceId texid, FloatVector clearCol, Debug drv.glGetBufferSubData( eGL_ELEMENT_ARRAY_BUFFER, offset, RDCMIN(GLsizeiptr(length - offset), - GLsizeiptr(draw->numIndices) * GLsizeiptr(drawParams.indexWidth)), + GLsizeiptr(action->numIndices) * GLsizeiptr(drawParams.indexWidth)), &idxs[0]); // unbind the real index buffer drv.glBindBuffer(eGL_ELEMENT_ARRAY_BUFFER, 0); - uint32_t expectedSize = draw->numIndices * drawParams.indexWidth; + uint32_t expectedSize = action->numIndices * drawParams.indexWidth; if(idxs.size() < expectedSize) { @@ -768,7 +768,7 @@ ResourceId GLReplay::RenderOverlay(ResourceId texid, FloatVector clearCol, Debug } PatchLineStripIndexBuffer( - draw, drawParams.topo, + action, drawParams.topo, drawParams.indexWidth == 1 ? (uint8_t *)idxs.data() : (uint8_t *)NULL, drawParams.indexWidth == 2 ? (uint16_t *)idxs.data() : (uint16_t *)NULL, drawParams.indexWidth == 4 ? (uint32_t *)idxs.data() : (uint32_t *)NULL, patchedIndices); @@ -777,28 +777,28 @@ ResourceId GLReplay::RenderOverlay(ResourceId texid, FloatVector clearCol, Debug { // generate 'index' list rdcarray idxs; - idxs.resize(draw->numIndices); - for(uint32_t i = 0; i < draw->numIndices; i++) + idxs.resize(action->numIndices); + for(uint32_t i = 0; i < action->numIndices; i++) idxs[i] = i; - PatchLineStripIndexBuffer(draw, drawParams.topo, NULL, NULL, idxs.data(), patchedIndices); + PatchLineStripIndexBuffer(action, drawParams.topo, NULL, NULL, idxs.data(), patchedIndices); } GLboolean primRestart = drv.glIsEnabled(eGL_PRIMITIVE_RESTART_FIXED_INDEX); drv.glEnable(eGL_PRIMITIVE_RESTART_FIXED_INDEX); - if(draw->flags & DrawFlags::Instanced) + if(action->flags & ActionFlags::Instanced) { if(HasExt[ARB_base_instance]) { drv.glDrawElementsInstancedBaseVertexBaseInstance( eGL_LINE_STRIP, (GLsizei)patchedIndices.size(), eGL_UNSIGNED_INT, - patchedIndices.data(), draw->numInstances, 0, draw->instanceOffset); + patchedIndices.data(), action->numInstances, 0, action->instanceOffset); } else { drv.glDrawElementsInstancedBaseVertex(eGL_LINE_STRIP, (GLsizei)patchedIndices.size(), eGL_UNSIGNED_INT, patchedIndices.data(), - draw->numInstances, 0); + action->numInstances, 0); } } else @@ -1653,9 +1653,9 @@ ResourceId GLReplay::RenderOverlay(ResourceId texid, FloatVector clearCol, Debug drv.glUseProgram(DebugData.trisizeProg); drv.glBindProgramPipeline(0); - const DrawcallDescription *draw = m_pDriver->GetDrawcall(events[i]); + const ActionDescription *action = m_pDriver->GetAction(events[i]); - for(uint32_t inst = 0; draw && inst < RDCMAX(1U, draw->numInstances); inst++) + for(uint32_t inst = 0; action && inst < RDCMAX(1U, action->numInstances); inst++) { MeshFormat postvs = GetPostVSBuffers(events[i], inst, 0, MeshDataStage::GSOut); if(postvs.vertexResourceId == ResourceId()) diff --git a/renderdoc/driver/gl/gl_postvs.cpp b/renderdoc/driver/gl/gl_postvs.cpp index dc3b2883b..abc45d6e0 100644 --- a/renderdoc/driver/gl/gl_postvs.cpp +++ b/renderdoc/driver/gl/gl_postvs.cpp @@ -265,11 +265,11 @@ void GLReplay::InitPostVSBuffers(uint32_t eventId) // one program per stage (vs = 0, etc) GLuint stageSrcPrograms[4] = {}; - const DrawcallDescription *drawcall = m_pDriver->GetDrawcall(eventId); - const GLDrawParams &drawParams = m_pDriver->GetDrawcallParameters(eventId); + const ActionDescription *action = m_pDriver->GetAction(eventId); + const GLDrawParams &drawParams = m_pDriver->GetDrawParameters(eventId); - if(drawcall->numIndices == 0 || !(drawcall->flags & DrawFlags::Drawcall) || - ((drawcall->flags & DrawFlags::Instanced) && drawcall->numInstances == 0)) + if(action->numIndices == 0 || !(action->flags & ActionFlags::Drawcall) || + ((action->flags & ActionFlags::Instanced) && action->numInstances == 0)) { // draw is 0 length, nothing to do m_PostVSData[eventId] = GLPostVSData(); @@ -399,7 +399,7 @@ void GLReplay::InitPostVSBuffers(uint32_t eventId) { const WrappedOpenGL::ShaderData &shadDetails = m_pDriver->m_Shaders[recompile[i]]; - stageShaders[i] = tmpShaders[i] = RecompileShader(drv, shadDetails, drawcall->drawIndex); + stageShaders[i] = tmpShaders[i] = RecompileShader(drv, shadDetails, action->drawIndex); } } @@ -759,12 +759,12 @@ void GLReplay::InitPostVSBuffers(uint32_t eventId) } else { - if(!(drawcall->flags & DrawFlags::Indexed)) + if(!(action->flags & ActionFlags::Indexed)) { - uint64_t outputSize = uint64_t(drawcall->numIndices) * stride; + uint64_t outputSize = uint64_t(action->numIndices) * stride; - if(drawcall->flags & DrawFlags::Instanced) - outputSize *= drawcall->numInstances; + if(action->flags & ActionFlags::Instanced) + outputSize *= action->numInstances; // resize up the buffer if needed for the vertex output data if(DebugData.feedbackBufferSize < outputSize) @@ -791,32 +791,31 @@ void GLReplay::InitPostVSBuffers(uint32_t eventId) drv.glBeginQuery(eGL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, DebugData.feedbackQueries[0]); drv.glBeginTransformFeedback(eGL_POINTS); - if(drawcall->flags & DrawFlags::Instanced) + if(action->flags & ActionFlags::Instanced) { if(HasExt[ARB_base_instance]) { - drv.glDrawArraysInstancedBaseInstance(eGL_POINTS, drawcall->vertexOffset, - drawcall->numIndices, drawcall->numInstances, - drawcall->instanceOffset); + drv.glDrawArraysInstancedBaseInstance(eGL_POINTS, action->vertexOffset, action->numIndices, + action->numInstances, action->instanceOffset); } else { - drv.glDrawArraysInstanced(eGL_POINTS, drawcall->vertexOffset, drawcall->numIndices, - drawcall->numInstances); + drv.glDrawArraysInstanced(eGL_POINTS, action->vertexOffset, action->numIndices, + action->numInstances); } } else { - drv.glDrawArrays(eGL_POINTS, drawcall->vertexOffset, drawcall->numIndices); + drv.glDrawArrays(eGL_POINTS, action->vertexOffset, action->numIndices); } } - else // drawcall is indexed + else // action is indexed { ResourceId idxId = rm->GetResID(BufferRes(drv.GetCtx(), elArrayBuffer)); bytebuf idxdata; - GetBufferData(idxId, drawcall->indexOffset * drawParams.indexWidth, - drawcall->numIndices * drawParams.indexWidth, idxdata); + GetBufferData(idxId, action->indexOffset * drawParams.indexWidth, + action->numIndices * drawParams.indexWidth, idxdata); rdcarray indices; @@ -826,7 +825,7 @@ void GLReplay::InitPostVSBuffers(uint32_t eventId) // only read as many indices as were available in the buffer uint32_t numIndices = - RDCMIN(uint32_t(idxdata.size() / drawParams.indexWidth), drawcall->numIndices); + RDCMIN(uint32_t(idxdata.size() / drawParams.indexWidth), action->numIndices); // grab all unique vertex indices referenced for(uint32_t i = 0; i < numIndices; i++) @@ -849,7 +848,7 @@ void GLReplay::InitPostVSBuffers(uint32_t eventId) // if we read out of bounds, we'll also have a 0 index being referenced // (as 0 is read). Don't insert 0 if we already have 0 though - if(numIndices < drawcall->numIndices && (indices.empty() || indices[0] != 0)) + if(numIndices < action->numIndices && (indices.empty() || indices[0] != 0)) indices.insert(0, 0); // An index buffer could be something like: 500, 501, 502, 501, 503, 502 @@ -882,8 +881,8 @@ void GLReplay::InitPostVSBuffers(uint32_t eventId) uint32_t outputSize = (uint32_t)indices.size() * stride; - if(drawcall->flags & DrawFlags::Instanced) - outputSize *= drawcall->numInstances; + if(action->flags & ActionFlags::Instanced) + outputSize *= action->numInstances; // resize up the buffer if needed for the vertex output data if(DebugData.feedbackBufferSize < outputSize) @@ -910,24 +909,24 @@ void GLReplay::InitPostVSBuffers(uint32_t eventId) drv.glBeginQuery(eGL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, DebugData.feedbackQueries[0]); drv.glBeginTransformFeedback(eGL_POINTS); - if(drawcall->flags & DrawFlags::Instanced) + if(action->flags & ActionFlags::Instanced) { if(HasExt[ARB_base_instance]) { drv.glDrawElementsInstancedBaseVertexBaseInstance( - eGL_POINTS, (GLsizei)indices.size(), eGL_UNSIGNED_INT, NULL, drawcall->numInstances, - drawcall->baseVertex, drawcall->instanceOffset); + eGL_POINTS, (GLsizei)indices.size(), eGL_UNSIGNED_INT, NULL, action->numInstances, + action->baseVertex, action->instanceOffset); } else { drv.glDrawElementsInstancedBaseVertex(eGL_POINTS, (GLsizei)indices.size(), eGL_UNSIGNED_INT, - NULL, drawcall->numInstances, drawcall->baseVertex); + NULL, action->numInstances, action->baseVertex); } } else { drv.glDrawElementsBaseVertex(eGL_POINTS, (GLsizei)indices.size(), eGL_UNSIGNED_INT, NULL, - drawcall->baseVertex); + action->baseVertex); } // delete the buffer, we don't need it anymore @@ -1134,13 +1133,13 @@ void GLReplay::InitPostVSBuffers(uint32_t eventId) m_PostVSData[eventId].vsout.nearPlane = nearp; m_PostVSData[eventId].vsout.farPlane = farp; - m_PostVSData[eventId].vsout.useIndices = bool(drawcall->flags & DrawFlags::Indexed); - m_PostVSData[eventId].vsout.numVerts = drawcall->numIndices; + m_PostVSData[eventId].vsout.useIndices = bool(action->flags & ActionFlags::Indexed); + m_PostVSData[eventId].vsout.numVerts = action->numIndices; m_PostVSData[eventId].vsout.instStride = 0; - if(drawcall->flags & DrawFlags::Instanced) + if(action->flags & ActionFlags::Instanced) m_PostVSData[eventId].vsout.instStride = - (stride * primsWritten) / RDCMAX(1U, drawcall->numInstances); + (stride * primsWritten) / RDCMAX(1U, action->numInstances); m_PostVSData[eventId].vsout.idxBuf = 0; m_PostVSData[eventId].vsout.idxByteWidth = drawParams.indexWidth; @@ -1438,10 +1437,10 @@ void GLReplay::InitPostVSBuffers(uint32_t eventId) uint32_t maxOutputSize = stride; - if(drawcall->flags & DrawFlags::Instanced) - maxOutputSize *= drawcall->numInstances; + if(action->flags & ActionFlags::Instanced) + maxOutputSize *= action->numInstances; - uint32_t numInputPrimitives = drawcall->numIndices; + uint32_t numInputPrimitives = action->numIndices; GLenum drawtopo = MakeGLPrimitiveTopology(drawParams.topo); switch(drawParams.topo) @@ -1572,18 +1571,18 @@ void GLReplay::InitPostVSBuffers(uint32_t eventId) // instanced draws must be replayed one at a time so we can record the number of primitives // from // each drawcall, as due to expansion this can vary per-instance. - if(drawcall->flags & DrawFlags::Instanced) + if(action->flags & ActionFlags::Instanced) { // if there is only one instance it's a trivial case and we don't need to bother with the // expensive path - if(drawcall->numInstances > 1) + if(action->numInstances > 1) { // ensure we have enough queries uint32_t curSize = (uint32_t)DebugData.feedbackQueries.size(); - if(curSize < drawcall->numInstances) + if(curSize < action->numInstances) { - DebugData.feedbackQueries.resize(drawcall->numInstances); - drv.glGenQueries(drawcall->numInstances - curSize, + DebugData.feedbackQueries.resize(action->numInstances); + drv.glGenQueries(action->numInstances - curSize, DebugData.feedbackQueries.data() + curSize); } @@ -1591,25 +1590,23 @@ void GLReplay::InitPostVSBuffers(uint32_t eventId) // there's no way to replay only a single instance. We have to replay 1, 2, 3, ... N // instances and count the total number of verts each time, then we can see from the // difference how much each instance wrote. - for(uint32_t inst = 1; inst <= drawcall->numInstances; inst++) + for(uint32_t inst = 1; inst <= action->numInstances; inst++) { drv.glBindBufferBase(eGL_TRANSFORM_FEEDBACK_BUFFER, 0, DebugData.feedbackBuffer); drv.glBeginQuery(eGL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, DebugData.feedbackQueries[inst - 1]); drv.glBeginTransformFeedback(lastOutTopo); - if(!(drawcall->flags & DrawFlags::Indexed)) + if(!(action->flags & ActionFlags::Indexed)) { if(HasExt[ARB_base_instance]) { - drv.glDrawArraysInstancedBaseInstance(drawtopo, drawcall->vertexOffset, - drawcall->numIndices, inst, - drawcall->instanceOffset); + drv.glDrawArraysInstancedBaseInstance( + drawtopo, action->vertexOffset, action->numIndices, inst, action->instanceOffset); } else { - drv.glDrawArraysInstanced(drawtopo, drawcall->vertexOffset, drawcall->numIndices, - inst); + drv.glDrawArraysInstanced(drawtopo, action->vertexOffset, action->numIndices, inst); } } else @@ -1617,18 +1614,16 @@ void GLReplay::InitPostVSBuffers(uint32_t eventId) if(HasExt[ARB_base_instance]) { drv.glDrawElementsInstancedBaseVertexBaseInstance( - drawtopo, drawcall->numIndices, idxType, - (const void *)(uintptr_t(drawcall->indexOffset) * - uintptr_t(drawParams.indexWidth)), - inst, drawcall->baseVertex, drawcall->instanceOffset); + drawtopo, action->numIndices, idxType, + (const void *)(uintptr_t(action->indexOffset) * uintptr_t(drawParams.indexWidth)), + inst, action->baseVertex, action->instanceOffset); } else { drv.glDrawElementsInstancedBaseVertex( - drawtopo, drawcall->numIndices, idxType, - (const void *)(uintptr_t(drawcall->indexOffset) * - uintptr_t(drawParams.indexWidth)), - inst, drawcall->baseVertex); + drawtopo, action->numIndices, idxType, + (const void *)(uintptr_t(action->indexOffset) * uintptr_t(drawParams.indexWidth)), + inst, action->baseVertex); } } @@ -1641,18 +1636,18 @@ void GLReplay::InitPostVSBuffers(uint32_t eventId) drv.glBeginQuery(eGL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, DebugData.feedbackQueries[0]); drv.glBeginTransformFeedback(lastOutTopo); - if(!(drawcall->flags & DrawFlags::Indexed)) + if(!(action->flags & ActionFlags::Indexed)) { if(HasExt[ARB_base_instance]) { - drv.glDrawArraysInstancedBaseInstance(drawtopo, drawcall->vertexOffset, - drawcall->numIndices, drawcall->numInstances, - drawcall->instanceOffset); + drv.glDrawArraysInstancedBaseInstance(drawtopo, action->vertexOffset, + action->numIndices, action->numInstances, + action->instanceOffset); } else { - drv.glDrawArraysInstanced(drawtopo, drawcall->vertexOffset, drawcall->numIndices, - drawcall->numInstances); + drv.glDrawArraysInstanced(drawtopo, action->vertexOffset, action->numIndices, + action->numInstances); } } else @@ -1660,16 +1655,16 @@ void GLReplay::InitPostVSBuffers(uint32_t eventId) if(HasExt[ARB_base_instance]) { drv.glDrawElementsInstancedBaseVertexBaseInstance( - drawtopo, drawcall->numIndices, idxType, - (const void *)(uintptr_t(drawcall->indexOffset) * uintptr_t(drawParams.indexWidth)), - drawcall->numInstances, drawcall->baseVertex, drawcall->instanceOffset); + drawtopo, action->numIndices, idxType, + (const void *)(uintptr_t(action->indexOffset) * uintptr_t(drawParams.indexWidth)), + action->numInstances, action->baseVertex, action->instanceOffset); } else { drv.glDrawElementsInstancedBaseVertex( - drawtopo, drawcall->numIndices, idxType, - (const void *)(uintptr_t(drawcall->indexOffset) * uintptr_t(drawParams.indexWidth)), - drawcall->numInstances, drawcall->baseVertex); + drawtopo, action->numIndices, idxType, + (const void *)(uintptr_t(action->indexOffset) * uintptr_t(drawParams.indexWidth)), + action->numInstances, action->baseVertex); } } @@ -1682,16 +1677,16 @@ void GLReplay::InitPostVSBuffers(uint32_t eventId) drv.glBeginQuery(eGL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, DebugData.feedbackQueries[0]); drv.glBeginTransformFeedback(lastOutTopo); - if(!(drawcall->flags & DrawFlags::Indexed)) + if(!(action->flags & ActionFlags::Indexed)) { - drv.glDrawArrays(drawtopo, drawcall->vertexOffset, drawcall->numIndices); + drv.glDrawArrays(drawtopo, action->vertexOffset, action->numIndices); } else { drv.glDrawElementsBaseVertex( - drawtopo, drawcall->numIndices, idxType, - (const void *)(uintptr_t(drawcall->indexOffset) * uintptr_t(drawParams.indexWidth)), - drawcall->baseVertex); + drawtopo, action->numIndices, idxType, + (const void *)(uintptr_t(action->indexOffset) * uintptr_t(drawParams.indexWidth)), + action->baseVertex); } drv.glEndTransformFeedback(); @@ -1702,11 +1697,11 @@ void GLReplay::InitPostVSBuffers(uint32_t eventId) GLuint primsWritten = 0; - if((drawcall->flags & DrawFlags::Instanced) && drawcall->numInstances > 1) + if((action->flags & ActionFlags::Instanced) && action->numInstances > 1) { uint64_t prevVertCount = 0; - for(uint32_t inst = 0; inst < drawcall->numInstances; inst++) + for(uint32_t inst = 0; inst < action->numInstances; inst++) { drv.glGetQueryObjectuiv(DebugData.feedbackQueries[inst], eGL_QUERY_RESULT, &primsWritten); @@ -1867,9 +1862,9 @@ void GLReplay::InitPostVSBuffers(uint32_t eventId) // store everything out to the PostVS data cache m_PostVSData[eventId].gsout.buf = lastoutBuffer; m_PostVSData[eventId].gsout.instStride = 0; - if(drawcall->flags & DrawFlags::Instanced) + if(action->flags & ActionFlags::Instanced) { - m_PostVSData[eventId].gsout.numVerts /= RDCMAX(1U, drawcall->numInstances); + m_PostVSData[eventId].gsout.numVerts /= RDCMAX(1U, action->numInstances); m_PostVSData[eventId].gsout.instStride = stride * m_PostVSData[eventId].gsout.numVerts; } m_PostVSData[eventId].gsout.vertStride = stride; @@ -1940,7 +1935,7 @@ void GLReplay::InitPostVSBuffers(const rdcarray &passEvents) prev = passEvents[i]; } - const DrawcallDescription *d = m_pDriver->GetDrawcall(passEvents[i]); + const ActionDescription *d = m_pDriver->GetAction(passEvents[i]); if(d) InitPostVSBuffers(passEvents[i]); diff --git a/renderdoc/driver/gl/gl_replay.cpp b/renderdoc/driver/gl/gl_replay.cpp index 17fe0980a..969da94ce 100644 --- a/renderdoc/driver/gl/gl_replay.cpp +++ b/renderdoc/driver/gl/gl_replay.cpp @@ -114,12 +114,12 @@ rdcarray GLReplay::GetPassEvents(uint32_t eventId) { rdcarray passEvents; - const DrawcallDescription *draw = m_pDriver->GetDrawcall(eventId); + const ActionDescription *action = m_pDriver->GetAction(eventId); - const DrawcallDescription *start = draw; - while(start && start->previous && !(start->previous->flags & DrawFlags::Clear)) + const ActionDescription *start = action; + while(start && start->previous && !(start->previous->flags & ActionFlags::Clear)) { - const DrawcallDescription *prev = start->previous; + const ActionDescription *prev = start->previous; if(start->outputs != prev->outputs || start->depthOut != prev->depthOut) break; @@ -129,10 +129,10 @@ rdcarray GLReplay::GetPassEvents(uint32_t eventId) while(start) { - if(start == draw) + if(start == action) break; - if(start->flags & DrawFlags::Drawcall) + if(start->flags & ActionFlags::Drawcall) passEvents.push_back(start->eventId); start = start->next; @@ -810,7 +810,7 @@ void GLReplay::SavePipelineState(uint32_t eventId) ? ~0U : rs.PrimitiveRestartIndex; - const GLDrawParams &drawParams = m_pDriver->GetDrawcallParameters(eventId); + const GLDrawParams &drawParams = m_pDriver->GetDrawParameters(eventId); pipe.vertexInput.indexByteStride = drawParams.indexWidth; pipe.vertexInput.topology = drawParams.topo; diff --git a/renderdoc/driver/gl/gl_replay.h b/renderdoc/driver/gl/gl_replay.h index 25670967d..e3b7ec3ac 100644 --- a/renderdoc/driver/gl/gl_replay.h +++ b/renderdoc/driver/gl/gl_replay.h @@ -298,7 +298,7 @@ private: // this FBO is the same as the above, but on the replay context, // for any cases where we need to use the replay context (like - // re-rendering a draw). + // re-rendering an action). GLuint replayFBO = 0; // read FBO for blit to window @@ -435,7 +435,7 @@ private: void CheckGLSLVersion(const char *sl, int &glslVersion); - void FillTimers(GLCounterContext &ctx, const DrawcallDescription &drawnode, + void FillTimers(GLCounterContext &ctx, const ActionDescription &actionnode, const rdcarray &counters); void InitOutputWindow(OutputWindow &outwin); @@ -475,7 +475,7 @@ private: AMDCounters *m_pAMDCounters = NULL; void FillTimersAMD(uint32_t *eventStartID, uint32_t *sampleIndex, rdcarray *eventIDs, - const DrawcallDescription &drawnode); + const ActionDescription &actionnode); rdcarray FetchCountersAMD(const rdcarray &counters); @@ -483,7 +483,7 @@ private: IntelGlCounters *m_pIntelCounters = NULL; void FillTimersIntel(uint32_t *eventStartID, uint32_t *sampleIndex, rdcarray *eventIDs, - const DrawcallDescription &drawnode); + const ActionDescription &actionnode); rdcarray FetchCountersIntel(const rdcarray &counters); @@ -491,7 +491,7 @@ private: ARMCounters *m_pARMCounters = NULL; void FillTimersARM(uint32_t *eventStartID, uint32_t *sampleIndex, rdcarray *eventIDs, - const DrawcallDescription &drawnode); + const ActionDescription &actionnode); rdcarray FetchCountersARM(const rdcarray &counters); }; diff --git a/renderdoc/driver/gl/gl_shader_refl.cpp b/renderdoc/driver/gl/gl_shader_refl.cpp index de3ddff2a..e54045112 100644 --- a/renderdoc/driver/gl/gl_shader_refl.cpp +++ b/renderdoc/driver/gl/gl_shader_refl.cpp @@ -2784,7 +2784,8 @@ void ResortBindings(ShaderReflection *refl, ShaderBindpointMapping *mapping) // at runtime, and in practice everyone either uses the layout qualifiers in shaders to fix the // bindings are shader compile time anyway (hah), or they reflect the samplers and set them one // time, then leave them fixed. In the worst case, if an application does actually remap the - // uniforms from draw to draw, they will end up seeing the bindings re-order themselves in the UI. + // uniforms from action to action, they will end up seeing the bindings re-order themselves in the + // UI. // This might be confusing, but it's a) technically what the application is actually doing, from a // certain perspective, and b) limited to a very small niche of people that are doing something // kind of ridiculous. diff --git a/renderdoc/driver/gl/wrappers/gl_buffer_funcs.cpp b/renderdoc/driver/gl/wrappers/gl_buffer_funcs.cpp index f99007ff4..320853999 100644 --- a/renderdoc/driver/gl/wrappers/gl_buffer_funcs.cpp +++ b/renderdoc/driver/gl/wrappers/gl_buffer_funcs.cpp @@ -1117,13 +1117,13 @@ bool WrappedOpenGL::Serialise_glNamedCopyBufferSubDataEXT(SerialiserType &ser, ResourceId srcid = GetResourceManager()->GetResID(readBuffer); ResourceId dstid = GetResourceManager()->GetResID(writeBuffer); - DrawcallDescription draw; - draw.flags |= DrawFlags::Copy; + ActionDescription action; + action.flags |= ActionFlags::Copy; - draw.copySource = GetResourceManager()->GetOriginalID(srcid); - draw.copyDestination = GetResourceManager()->GetOriginalID(dstid); + action.copySource = GetResourceManager()->GetOriginalID(srcid); + action.copyDestination = GetResourceManager()->GetOriginalID(dstid); - AddDrawcall(draw); + AddAction(action); if(srcid == dstid) { @@ -2005,12 +2005,12 @@ bool WrappedOpenGL::Serialise_glInvalidateBufferData(SerialiserType &ser, GLuint { AddEvent(); - DrawcallDescription draw; - draw.flags |= DrawFlags::Clear; + ActionDescription action; + action.flags |= ActionFlags::Clear; - draw.copyDestination = GetResourceManager()->GetOriginalID(id); + action.copyDestination = GetResourceManager()->GetOriginalID(id); - AddDrawcall(draw); + AddAction(action); m_ResourceUses[id].push_back(EventUsage(m_CurEventID, ResourceUsage::Discard)); } @@ -2082,12 +2082,12 @@ bool WrappedOpenGL::Serialise_glInvalidateBufferSubData(SerialiserType &ser, GLu { AddEvent(); - DrawcallDescription draw; - draw.flags |= DrawFlags::Clear; + ActionDescription action; + action.flags |= ActionFlags::Clear; - draw.copyDestination = GetResourceManager()->GetOriginalID(id); + action.copyDestination = GetResourceManager()->GetOriginalID(id); - AddDrawcall(draw); + AddAction(action); m_ResourceUses[id].push_back(EventUsage(m_CurEventID, ResourceUsage::Discard)); } @@ -2221,7 +2221,7 @@ void WrappedOpenGL::glInvalidateBufferSubData(GLuint buffer, GLintptr offset, GL * segment of the buffer. * * The reason for finding the actual difference segment is that many maps will be of a large region - * or even the whole buffer, but only update a small section, perhaps once per drawcall. So + * or even the whole buffer, but only update a small section, perhaps once per action. So * serialising the entirety of a large buffer many many times can rapidly inflate the size of the * log. The savings from this can be many GBs as if a 4MB buffer is updated 1000 times, each time * only updating 1KB, this is a difference between 1MB and 4000MB in written data, most of which is @@ -2283,8 +2283,8 @@ void WrappedOpenGL::glInvalidateBufferSubData(GLuint buffer, GLintptr offset, GL * * When frame capturing, we insert an implicit call to PersistentMapMemoryBarrier() over all * coherent maps whenever any GL function is called that could conceivably read from buffer memory. - * This is at the very least all draw calls but also any texture calls that could read from a PBO or - * other calls. When PersistentMapMemoryBarrier() is called we check to see what has changed and + * This is at the very least all action calls but also any texture calls that could read from a PBO + * or other calls. When PersistentMapMemoryBarrier() is called we check to see what has changed and * serialise it - similar in principle to an implicit call to glFlushMappedBufferRange() over the * whole buffer. * diff --git a/renderdoc/driver/gl/wrappers/gl_debug_funcs.cpp b/renderdoc/driver/gl/wrappers/gl_debug_funcs.cpp index 067987d6b..6e3c1bcd8 100644 --- a/renderdoc/driver/gl/wrappers/gl_debug_funcs.cpp +++ b/renderdoc/driver/gl/wrappers/gl_debug_funcs.cpp @@ -280,12 +280,12 @@ bool WrappedOpenGL::Serialise_glDebugMessageInsert(SerialiserType &ser, GLenum s if(IsLoading(m_State)) { - DrawcallDescription draw; - draw.name = name; - draw.flags |= DrawFlags::SetMarker; + ActionDescription action; + action.name = name; + action.flags |= ActionFlags::SetMarker; AddEvent(); - AddDrawcall(draw); + AddAction(action); } } @@ -331,7 +331,7 @@ void WrappedOpenGL::glDebugMessageInsert(GLenum source, GLenum type, GLuint id, if(IsActiveCapturing(m_State) && type == eGL_DEBUG_TYPE_MARKER) { USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glDebugMessageInsert(ser, source, type, id, severity, length, buf); @@ -381,12 +381,12 @@ bool WrappedOpenGL::Serialise_glInsertEventMarkerEXT(SerialiserType &ser, GLsize if(IsLoading(m_State)) { - DrawcallDescription draw; - draw.name = marker; - draw.flags |= DrawFlags::SetMarker; + ActionDescription action; + action.name = marker; + action.flags |= ActionFlags::SetMarker; AddEvent(); - AddDrawcall(draw); + AddAction(action); } } @@ -398,7 +398,7 @@ void WrappedOpenGL::glInsertEventMarkerEXT(GLsizei length, const GLchar *marker) if(IsActiveCapturing(m_State)) { USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glInsertEventMarkerEXT(ser, length, marker); @@ -452,12 +452,12 @@ bool WrappedOpenGL::Serialise_glPushDebugGroup(SerialiserType &ser, GLenum sourc if(IsLoading(m_State)) { - DrawcallDescription draw; - draw.name = message; - draw.flags |= DrawFlags::PushMarker; + ActionDescription action; + action.name = message; + action.flags |= ActionFlags::PushMarker; AddEvent(); - AddDrawcall(draw); + AddAction(action); } } @@ -478,7 +478,7 @@ void WrappedOpenGL::glPushDebugGroup(GLenum source, GLuint id, GLsizei length, c if(IsActiveCapturing(m_State)) { USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glPushDebugGroup(ser, source, id, length, message); @@ -497,12 +497,12 @@ bool WrappedOpenGL::Serialise_glPopDebugGroup(SerialiserType &ser) if(IsLoading(m_State)) { - DrawcallDescription draw; - draw.name = ToStr(gl_CurChunk) + "()"; - draw.flags |= DrawFlags::PopMarker; + ActionDescription action; + action.name = ToStr(gl_CurChunk) + "()"; + action.flags |= ActionFlags::PopMarker; AddEvent(); - AddDrawcall(draw); + AddAction(action); } } @@ -523,7 +523,7 @@ void WrappedOpenGL::glPopDebugGroup() if(IsActiveCapturing(m_State)) { USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glPopDebugGroup(ser); diff --git a/renderdoc/driver/gl/wrappers/gl_draw_funcs.cpp b/renderdoc/driver/gl/wrappers/gl_draw_funcs.cpp index 8ddbe3883..ae60c6d68 100644 --- a/renderdoc/driver/gl/wrappers/gl_draw_funcs.cpp +++ b/renderdoc/driver/gl/wrappers/gl_draw_funcs.cpp @@ -311,12 +311,12 @@ bool WrappedOpenGL::Serialise_glDispatchCompute(SerialiserType &ser, GLuint num_ { AddEvent(); - DrawcallDescription draw; - draw.flags |= DrawFlags::Dispatch; + ActionDescription action; + action.flags |= ActionFlags::Dispatch; - draw.dispatchDimension[0] = num_groups_x; - draw.dispatchDimension[1] = num_groups_y; - draw.dispatchDimension[2] = num_groups_z; + action.dispatchDimension[0] = num_groups_x; + action.dispatchDimension[1] = num_groups_y; + action.dispatchDimension[2] = num_groups_z; if(num_groups_x == 0) AddDebugMessage(MessageCategory::Execution, MessageSeverity::Medium, @@ -334,7 +334,7 @@ bool WrappedOpenGL::Serialise_glDispatchCompute(SerialiserType &ser, GLuint num_ "Dispatch call has num_groups_z=0. This will do nothing, which is unusual " "for a non-indirect Dispatch. Did you mean Z=1?"); - AddDrawcall(draw); + AddAction(action); } } @@ -361,7 +361,7 @@ void WrappedOpenGL::glDispatchCompute(GLuint num_groups_x, GLuint num_groups_y, if(IsActiveCapturing(m_State)) { USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glDispatchCompute(ser, num_groups_x, num_groups_y, num_groups_z); @@ -397,15 +397,15 @@ bool WrappedOpenGL::Serialise_glDispatchComputeGroupSizeARB(SerialiserType &ser, { AddEvent(); - DrawcallDescription draw; - draw.flags |= DrawFlags::Dispatch; + ActionDescription action; + action.flags |= ActionFlags::Dispatch; - draw.dispatchDimension[0] = num_groups_x; - draw.dispatchDimension[1] = num_groups_y; - draw.dispatchDimension[2] = num_groups_z; - draw.dispatchThreadsDimension[0] = group_size_x; - draw.dispatchThreadsDimension[1] = group_size_y; - draw.dispatchThreadsDimension[2] = group_size_z; + action.dispatchDimension[0] = num_groups_x; + action.dispatchDimension[1] = num_groups_y; + action.dispatchDimension[2] = num_groups_z; + action.dispatchThreadsDimension[0] = group_size_x; + action.dispatchThreadsDimension[1] = group_size_y; + action.dispatchThreadsDimension[2] = group_size_z; if(num_groups_x == 0) AddDebugMessage(MessageCategory::Execution, MessageSeverity::Medium, @@ -439,7 +439,7 @@ bool WrappedOpenGL::Serialise_glDispatchComputeGroupSizeARB(SerialiserType &ser, "Dispatch call has group_size_z=0. This will do nothing, which is unusual " "for a non-indirect Dispatch. Did you mean Z=1?"); - AddDrawcall(draw); + AddAction(action); } } @@ -469,7 +469,7 @@ void WrappedOpenGL::glDispatchComputeGroupSizeARB(GLuint num_groups_x, GLuint nu if(IsActiveCapturing(m_State)) { USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glDispatchComputeGroupSizeARB(ser, num_groups_x, num_groups_y, num_groups_z, group_size_x, group_size_y, group_size_z); @@ -501,16 +501,16 @@ bool WrappedOpenGL::Serialise_glDispatchComputeIndirect(SerialiserType &ser, GLi AddEvent(); - DrawcallDescription draw; - draw.name = StringFormat::Fmt("%s(<%u, %u, %u>)", ToStr(gl_CurChunk).c_str(), groupSizes[0], - groupSizes[1], groupSizes[2]); - draw.flags |= DrawFlags::Dispatch | DrawFlags::Indirect; + ActionDescription action; + action.name = StringFormat::Fmt("%s(<%u, %u, %u>)", ToStr(gl_CurChunk).c_str(), groupSizes[0], + groupSizes[1], groupSizes[2]); + action.flags |= ActionFlags::Dispatch | ActionFlags::Indirect; - draw.dispatchDimension[0] = groupSizes[0]; - draw.dispatchDimension[1] = groupSizes[1]; - draw.dispatchDimension[2] = groupSizes[2]; + action.dispatchDimension[0] = groupSizes[0]; + action.dispatchDimension[1] = groupSizes[1]; + action.dispatchDimension[2] = groupSizes[2]; - AddDrawcall(draw); + AddAction(action); GLuint buf = 0; GL.glGetIntegerv(eGL_DISPATCH_INDIRECT_BUFFER_BINDING, (GLint *)&buf); @@ -543,7 +543,7 @@ void WrappedOpenGL::glDispatchComputeIndirect(GLintptr indirect) if(IsActiveCapturing(m_State)) { USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glDispatchComputeIndirect(ser, indirect); @@ -672,19 +672,19 @@ bool WrappedOpenGL::Serialise_glDrawTransformFeedback(SerialiserType &ser, GLenu GLNOTIMP("Not fetching feedback object count for glDrawTransformFeedback() display"); - DrawcallDescription draw; - draw.name = ToStr(gl_CurChunk) + "()"; - draw.numIndices = 1; - draw.numInstances = 1; - draw.indexOffset = 0; - draw.vertexOffset = 0; - draw.instanceOffset = 0; + ActionDescription action; + action.name = ToStr(gl_CurChunk) + "()"; + action.numIndices = 1; + action.numInstances = 1; + action.indexOffset = 0; + action.vertexOffset = 0; + action.instanceOffset = 0; - draw.flags |= DrawFlags::Drawcall; + action.flags |= ActionFlags::Drawcall; m_LastTopology = MakePrimitiveTopology(mode); - AddDrawcall(draw); + AddAction(action); } } @@ -712,7 +712,7 @@ void WrappedOpenGL::glDrawTransformFeedback(GLenum mode, GLuint id) { USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glDrawTransformFeedback(ser, mode, id); @@ -744,19 +744,19 @@ bool WrappedOpenGL::Serialise_glDrawTransformFeedbackInstanced(SerialiserType &s GLNOTIMP("Not fetching feedback object count for glDrawTransformFeedbackInstanced() display"); - DrawcallDescription draw; - draw.name = StringFormat::Fmt("%s()", ToStr(gl_CurChunk).c_str(), instancecount); - draw.numIndices = 1; - draw.numInstances = 1; - draw.indexOffset = 0; - draw.vertexOffset = 0; - draw.instanceOffset = 0; + ActionDescription action; + action.name = StringFormat::Fmt("%s()", ToStr(gl_CurChunk).c_str(), instancecount); + action.numIndices = 1; + action.numInstances = 1; + action.indexOffset = 0; + action.vertexOffset = 0; + action.instanceOffset = 0; - draw.flags |= DrawFlags::Drawcall | DrawFlags::Instanced; + action.flags |= ActionFlags::Drawcall | ActionFlags::Instanced; m_LastTopology = MakePrimitiveTopology(mode); - AddDrawcall(draw); + AddAction(action); } } @@ -784,7 +784,7 @@ void WrappedOpenGL::glDrawTransformFeedbackInstanced(GLenum mode, GLuint id, GLs { USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glDrawTransformFeedbackInstanced(ser, mode, id, instancecount); @@ -815,19 +815,19 @@ bool WrappedOpenGL::Serialise_glDrawTransformFeedbackStream(SerialiserType &ser, GLNOTIMP("Not fetching feedback object count for glDrawTransformFeedbackStream() display"); - DrawcallDescription draw; - draw.name = ToStr(gl_CurChunk) + "()"; - draw.numIndices = 1; - draw.numInstances = 1; - draw.indexOffset = 0; - draw.vertexOffset = 0; - draw.instanceOffset = 0; + ActionDescription action; + action.name = ToStr(gl_CurChunk) + "()"; + action.numIndices = 1; + action.numInstances = 1; + action.indexOffset = 0; + action.vertexOffset = 0; + action.instanceOffset = 0; - draw.flags |= DrawFlags::Drawcall; + action.flags |= ActionFlags::Drawcall; m_LastTopology = MakePrimitiveTopology(mode); - AddDrawcall(draw); + AddAction(action); } } @@ -855,7 +855,7 @@ void WrappedOpenGL::glDrawTransformFeedbackStream(GLenum mode, GLuint id, GLuint { USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glDrawTransformFeedbackStream(ser, mode, id, stream); @@ -890,19 +890,19 @@ bool WrappedOpenGL::Serialise_glDrawTransformFeedbackStreamInstanced(SerialiserT "Not fetching feedback object count for glDrawTransformFeedbackStreamInstanced() " "display"); - DrawcallDescription draw; - draw.name = StringFormat::Fmt("%s()", ToStr(gl_CurChunk).c_str(), instancecount); - draw.numIndices = 1; - draw.numInstances = 1; - draw.indexOffset = 0; - draw.vertexOffset = 0; - draw.instanceOffset = 0; + ActionDescription action; + action.name = StringFormat::Fmt("%s()", ToStr(gl_CurChunk).c_str(), instancecount); + action.numIndices = 1; + action.numInstances = 1; + action.indexOffset = 0; + action.vertexOffset = 0; + action.instanceOffset = 0; - draw.flags |= DrawFlags::Drawcall | DrawFlags::Instanced; + action.flags |= ActionFlags::Drawcall | ActionFlags::Instanced; m_LastTopology = MakePrimitiveTopology(mode); - AddDrawcall(draw); + AddAction(action); } } @@ -931,7 +931,7 @@ void WrappedOpenGL::glDrawTransformFeedbackStreamInstanced(GLenum mode, GLuint i { USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glDrawTransformFeedbackStreamInstanced(ser, mode, id, stream, instancecount); @@ -960,18 +960,18 @@ bool WrappedOpenGL::Serialise_glDrawArrays(SerialiserType &ser, GLenum mode, GLi { AddEvent(); - DrawcallDescription draw; - draw.numIndices = count; - draw.numInstances = 1; - draw.indexOffset = 0; - draw.vertexOffset = first; - draw.instanceOffset = 0; + ActionDescription action; + action.numIndices = count; + action.numInstances = 1; + action.indexOffset = 0; + action.vertexOffset = first; + action.instanceOffset = 0; - draw.flags |= DrawFlags::Drawcall; + action.flags |= ActionFlags::Drawcall; m_LastTopology = MakePrimitiveTopology(mode); - AddDrawcall(draw); + AddAction(action); } } @@ -1185,7 +1185,7 @@ void WrappedOpenGL::glDrawArrays(GLenum mode, GLint first, GLsizei count) USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glDrawArrays(ser, mode, first, count); @@ -1220,19 +1220,19 @@ bool WrappedOpenGL::Serialise_glDrawArraysIndirect(SerialiserType &ser, GLenum m AddEvent(); - DrawcallDescription draw; - draw.name = StringFormat::Fmt("%s(<%u, %u>)", ToStr(gl_CurChunk).c_str(), params.count, - params.instanceCount); - draw.numIndices = params.count; - draw.numInstances = params.instanceCount; - draw.vertexOffset = params.first; - draw.instanceOffset = params.baseInstance; + ActionDescription action; + action.name = StringFormat::Fmt("%s(<%u, %u>)", ToStr(gl_CurChunk).c_str(), params.count, + params.instanceCount); + action.numIndices = params.count; + action.numInstances = params.instanceCount; + action.vertexOffset = params.first; + action.instanceOffset = params.baseInstance; - draw.flags |= DrawFlags::Drawcall | DrawFlags::Instanced | DrawFlags::Indirect; + action.flags |= ActionFlags::Drawcall | ActionFlags::Instanced | ActionFlags::Indirect; m_LastTopology = MakePrimitiveTopology(mode); - AddDrawcall(draw); + AddAction(action); GLuint buf = 0; GL.glGetIntegerv(eGL_DRAW_INDIRECT_BUFFER_BINDING, (GLint *)&buf); @@ -1266,7 +1266,7 @@ void WrappedOpenGL::glDrawArraysIndirect(GLenum mode, const void *indirect) { USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glDrawArraysIndirect(ser, mode, indirect); @@ -1296,18 +1296,18 @@ bool WrappedOpenGL::Serialise_glDrawArraysInstanced(SerialiserType &ser, GLenum { AddEvent(); - DrawcallDescription draw; - draw.numIndices = count; - draw.numInstances = instancecount; - draw.indexOffset = 0; - draw.vertexOffset = first; - draw.instanceOffset = 0; + ActionDescription action; + action.numIndices = count; + action.numInstances = instancecount; + action.indexOffset = 0; + action.vertexOffset = first; + action.instanceOffset = 0; - draw.flags |= DrawFlags::Drawcall | DrawFlags::Instanced; + action.flags |= ActionFlags::Drawcall | ActionFlags::Instanced; m_LastTopology = MakePrimitiveTopology(mode); - AddDrawcall(draw); + AddAction(action); } } @@ -1340,7 +1340,7 @@ void WrappedOpenGL::glDrawArraysInstanced(GLenum mode, GLint first, GLsizei coun USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glDrawArraysInstanced(ser, mode, first, count, instancecount); @@ -1375,18 +1375,18 @@ bool WrappedOpenGL::Serialise_glDrawArraysInstancedBaseInstance(SerialiserType & { AddEvent(); - DrawcallDescription draw; - draw.numIndices = count; - draw.numInstances = instancecount; - draw.indexOffset = 0; - draw.vertexOffset = first; - draw.instanceOffset = baseinstance; + ActionDescription action; + action.numIndices = count; + action.numInstances = instancecount; + action.indexOffset = 0; + action.vertexOffset = first; + action.instanceOffset = baseinstance; - draw.flags |= DrawFlags::Drawcall | DrawFlags::Instanced; + action.flags |= ActionFlags::Drawcall | ActionFlags::Instanced; m_LastTopology = MakePrimitiveTopology(mode); - AddDrawcall(draw); + AddAction(action); } } @@ -1420,7 +1420,7 @@ void WrappedOpenGL::glDrawArraysInstancedBaseInstance(GLenum mode, GLint first, USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glDrawArraysInstancedBaseInstance(ser, mode, first, count, instancecount, baseinstance); @@ -1454,19 +1454,19 @@ bool WrappedOpenGL::Serialise_glDrawElements(SerialiserType &ser, GLenum mode, G uint32_t IdxSize = GetIdxSize(type); - DrawcallDescription draw; - draw.numIndices = count; - draw.numInstances = 1; - draw.indexOffset = uint32_t(indices) / IdxSize; - draw.vertexOffset = 0; - draw.instanceOffset = 0; + ActionDescription action; + action.numIndices = count; + action.numInstances = 1; + action.indexOffset = uint32_t(indices) / IdxSize; + action.vertexOffset = 0; + action.instanceOffset = 0; - draw.flags |= DrawFlags::Drawcall | DrawFlags::Indexed; + action.flags |= ActionFlags::Drawcall | ActionFlags::Indexed; m_LastTopology = MakePrimitiveTopology(mode); m_LastIndexWidth = IdxSize; - AddDrawcall(draw); + AddAction(action); } } @@ -1496,7 +1496,7 @@ void WrappedOpenGL::glDrawElements(GLenum mode, GLsizei count, GLenum type, cons USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glDrawElements(ser, mode, count, type, indices); @@ -1534,22 +1534,22 @@ bool WrappedOpenGL::Serialise_glDrawElementsIndirect(SerialiserType &ser, GLenum uint32_t IdxSize = GetIdxSize(type); - DrawcallDescription draw; - draw.name = StringFormat::Fmt("%s(<%u, %u>)", ToStr(gl_CurChunk).c_str(), params.count, - params.instanceCount); - draw.numIndices = params.count; - draw.numInstances = params.instanceCount; - draw.indexOffset = params.firstIndex; - draw.baseVertex = params.baseVertex; - draw.instanceOffset = params.baseInstance; + ActionDescription action; + action.name = StringFormat::Fmt("%s(<%u, %u>)", ToStr(gl_CurChunk).c_str(), params.count, + params.instanceCount); + action.numIndices = params.count; + action.numInstances = params.instanceCount; + action.indexOffset = params.firstIndex; + action.baseVertex = params.baseVertex; + action.instanceOffset = params.baseInstance; - draw.flags |= - DrawFlags::Drawcall | DrawFlags::Indexed | DrawFlags::Instanced | DrawFlags::Indirect; + action.flags |= ActionFlags::Drawcall | ActionFlags::Indexed | ActionFlags::Instanced | + ActionFlags::Indirect; m_LastTopology = MakePrimitiveTopology(mode); m_LastIndexWidth = IdxSize; - AddDrawcall(draw); + AddAction(action); GLuint buf = 0; GL.glGetIntegerv(eGL_DRAW_INDIRECT_BUFFER_BINDING, (GLint *)&buf); @@ -1583,7 +1583,7 @@ void WrappedOpenGL::glDrawElementsIndirect(GLenum mode, GLenum type, const void { USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glDrawElementsIndirect(ser, mode, type, indirect); @@ -1618,19 +1618,19 @@ bool WrappedOpenGL::Serialise_glDrawRangeElements(SerialiserType &ser, GLenum mo uint32_t IdxSize = GetIdxSize(type); - DrawcallDescription draw; - draw.numIndices = count; - draw.numInstances = 1; - draw.indexOffset = uint32_t(indices) / IdxSize; - draw.vertexOffset = 0; - draw.instanceOffset = 0; + ActionDescription action; + action.numIndices = count; + action.numInstances = 1; + action.indexOffset = uint32_t(indices) / IdxSize; + action.vertexOffset = 0; + action.instanceOffset = 0; - draw.flags |= DrawFlags::Drawcall | DrawFlags::Indexed; + action.flags |= ActionFlags::Drawcall | ActionFlags::Indexed; m_LastTopology = MakePrimitiveTopology(mode); m_LastIndexWidth = IdxSize; - AddDrawcall(draw); + AddAction(action); } } @@ -1661,7 +1661,7 @@ void WrappedOpenGL::glDrawRangeElements(GLenum mode, GLuint start, GLuint end, G USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glDrawRangeElements(ser, mode, start, end, count, type, indices); @@ -1701,19 +1701,19 @@ bool WrappedOpenGL::Serialise_glDrawRangeElementsBaseVertex(SerialiserType &ser, uint32_t IdxSize = GetIdxSize(type); - DrawcallDescription draw; - draw.numIndices = count; - draw.numInstances = 1; - draw.indexOffset = uint32_t(indices) / IdxSize; - draw.baseVertex = basevertex; - draw.instanceOffset = 0; + ActionDescription action; + action.numIndices = count; + action.numInstances = 1; + action.indexOffset = uint32_t(indices) / IdxSize; + action.baseVertex = basevertex; + action.instanceOffset = 0; - draw.flags |= DrawFlags::Drawcall | DrawFlags::Indexed; + action.flags |= ActionFlags::Drawcall | ActionFlags::Indexed; m_LastTopology = MakePrimitiveTopology(mode); m_LastIndexWidth = IdxSize; - AddDrawcall(draw); + AddAction(action); } } @@ -1746,7 +1746,7 @@ void WrappedOpenGL::glDrawRangeElementsBaseVertex(GLenum mode, GLuint start, GLu USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glDrawRangeElementsBaseVertex(ser, mode, start, end, count, type, indices, basevertex); @@ -1782,19 +1782,19 @@ bool WrappedOpenGL::Serialise_glDrawElementsBaseVertex(SerialiserType &ser, GLen uint32_t IdxSize = GetIdxSize(type); - DrawcallDescription draw; - draw.numIndices = count; - draw.numInstances = 1; - draw.indexOffset = uint32_t(indices) / IdxSize; - draw.baseVertex = basevertex; - draw.instanceOffset = 0; + ActionDescription action; + action.numIndices = count; + action.numInstances = 1; + action.indexOffset = uint32_t(indices) / IdxSize; + action.baseVertex = basevertex; + action.instanceOffset = 0; - draw.flags |= DrawFlags::Drawcall | DrawFlags::Indexed; + action.flags |= ActionFlags::Drawcall | ActionFlags::Indexed; m_LastTopology = MakePrimitiveTopology(mode); m_LastIndexWidth = IdxSize; - AddDrawcall(draw); + AddAction(action); } } @@ -1825,7 +1825,7 @@ void WrappedOpenGL::glDrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glDrawElementsBaseVertex(ser, mode, count, type, indices, basevertex); @@ -1861,19 +1861,19 @@ bool WrappedOpenGL::Serialise_glDrawElementsInstanced(SerialiserType &ser, GLenu uint32_t IdxSize = GetIdxSize(type); - DrawcallDescription draw; - draw.numIndices = count; - draw.numInstances = instancecount; - draw.indexOffset = uint32_t(indices) / IdxSize; - draw.vertexOffset = 0; - draw.instanceOffset = 0; + ActionDescription action; + action.numIndices = count; + action.numInstances = instancecount; + action.indexOffset = uint32_t(indices) / IdxSize; + action.vertexOffset = 0; + action.instanceOffset = 0; - draw.flags |= DrawFlags::Drawcall | DrawFlags::Indexed | DrawFlags::Instanced; + action.flags |= ActionFlags::Drawcall | ActionFlags::Indexed | ActionFlags::Instanced; m_LastTopology = MakePrimitiveTopology(mode); m_LastIndexWidth = IdxSize; - AddDrawcall(draw); + AddAction(action); } } @@ -1905,7 +1905,7 @@ void WrappedOpenGL::glDrawElementsInstanced(GLenum mode, GLsizei count, GLenum t USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glDrawElementsInstanced(ser, mode, count, type, indices, instancecount); @@ -1945,19 +1945,19 @@ bool WrappedOpenGL::Serialise_glDrawElementsInstancedBaseInstance(SerialiserType uint32_t IdxSize = GetIdxSize(type); - DrawcallDescription draw; - draw.numIndices = count; - draw.numInstances = instancecount; - draw.indexOffset = uint32_t(indices) / IdxSize; - draw.vertexOffset = 0; - draw.instanceOffset = baseinstance; + ActionDescription action; + action.numIndices = count; + action.numInstances = instancecount; + action.indexOffset = uint32_t(indices) / IdxSize; + action.vertexOffset = 0; + action.instanceOffset = baseinstance; - draw.flags |= DrawFlags::Drawcall | DrawFlags::Instanced | DrawFlags::Indexed; + action.flags |= ActionFlags::Drawcall | ActionFlags::Instanced | ActionFlags::Indexed; m_LastTopology = MakePrimitiveTopology(mode); m_LastIndexWidth = IdxSize; - AddDrawcall(draw); + AddAction(action); } } @@ -1991,7 +1991,7 @@ void WrappedOpenGL::glDrawElementsInstancedBaseInstance(GLenum mode, GLsizei cou USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glDrawElementsInstancedBaseInstance(ser, mode, count, type, indices, instancecount, baseinstance); @@ -2032,19 +2032,19 @@ bool WrappedOpenGL::Serialise_glDrawElementsInstancedBaseVertex(SerialiserType & uint32_t IdxSize = GetIdxSize(type); - DrawcallDescription draw; - draw.numIndices = count; - draw.numInstances = instancecount; - draw.indexOffset = uint32_t(indices) / IdxSize; - draw.baseVertex = basevertex; - draw.instanceOffset = 0; + ActionDescription action; + action.numIndices = count; + action.numInstances = instancecount; + action.indexOffset = uint32_t(indices) / IdxSize; + action.baseVertex = basevertex; + action.instanceOffset = 0; - draw.flags |= DrawFlags::Drawcall | DrawFlags::Instanced | DrawFlags::Indexed; + action.flags |= ActionFlags::Drawcall | ActionFlags::Instanced | ActionFlags::Indexed; m_LastTopology = MakePrimitiveTopology(mode); m_LastIndexWidth = IdxSize; - AddDrawcall(draw); + AddAction(action); } } @@ -2078,7 +2078,7 @@ void WrappedOpenGL::glDrawElementsInstancedBaseVertex(GLenum mode, GLsizei count USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glDrawElementsInstancedBaseVertex(ser, mode, count, type, indices, instancecount, basevertex); @@ -2118,19 +2118,19 @@ bool WrappedOpenGL::Serialise_glDrawElementsInstancedBaseVertexBaseInstance( uint32_t IdxSize = GetIdxSize(type); - DrawcallDescription draw; - draw.numIndices = count; - draw.numInstances = instancecount; - draw.indexOffset = uint32_t(indices) / IdxSize; - draw.baseVertex = basevertex; - draw.instanceOffset = baseinstance; + ActionDescription action; + action.numIndices = count; + action.numInstances = instancecount; + action.indexOffset = uint32_t(indices) / IdxSize; + action.baseVertex = basevertex; + action.instanceOffset = baseinstance; - draw.flags |= DrawFlags::Drawcall | DrawFlags::Instanced | DrawFlags::Indexed; + action.flags |= ActionFlags::Drawcall | ActionFlags::Instanced | ActionFlags::Indexed; m_LastTopology = MakePrimitiveTopology(mode); m_LastIndexWidth = IdxSize; - AddDrawcall(draw); + AddAction(action); } } @@ -2166,7 +2166,7 @@ void WrappedOpenGL::glDrawElementsInstancedBaseVertexBaseInstance(GLenum mode, G USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glDrawElementsInstancedBaseVertexBaseInstance( ser, mode, count, type, indices, instancecount, basevertex, baseinstance); @@ -2197,22 +2197,22 @@ bool WrappedOpenGL::Serialise_glMultiDrawArrays(SerialiserType &ser, GLenum mode if(drawcount == 0 || count == 0 || Check_SafeDraw(false)) GL.glMultiDrawArrays(mode, first, count, drawcount); - DrawcallDescription draw; - draw.name = StringFormat::Fmt("%s(%i)", ToStr(gl_CurChunk).c_str(), drawcount); - draw.flags |= DrawFlags::MultiDraw; + ActionDescription action; + action.name = StringFormat::Fmt("%s(%i)", ToStr(gl_CurChunk).c_str(), drawcount); + action.flags |= ActionFlags::MultiAction; m_LastTopology = MakePrimitiveTopology(mode); AddEvent(); - AddDrawcall(draw); + AddAction(action); - m_DrawcallStack.push_back(&m_DrawcallStack.back()->children.back()); + m_ActionStack.push_back(&m_ActionStack.back()->children.back()); for(GLsizei i = 0; i < drawcount; i++) { m_CurEventID++; - DrawcallDescription multidraw; + ActionDescription multidraw; multidraw.drawIndex = i; multidraw.numIndices = count[i]; multidraw.vertexOffset = first[i]; @@ -2220,15 +2220,15 @@ bool WrappedOpenGL::Serialise_glMultiDrawArrays(SerialiserType &ser, GLenum mode multidraw.name = StringFormat::Fmt("%s[%i](%u)", ToStr(gl_CurChunk).c_str(), i, multidraw.numIndices); - multidraw.flags |= DrawFlags::Drawcall; + multidraw.flags |= ActionFlags::Drawcall; m_LastTopology = MakePrimitiveTopology(mode); AddEvent(); - AddDrawcall(multidraw); + AddAction(multidraw); } - m_DrawcallStack.pop_back(); + m_ActionStack.pop_back(); } else if(IsActiveReplaying(m_State)) { @@ -2310,7 +2310,7 @@ void WrappedOpenGL::glMultiDrawArrays(GLenum mode, const GLint *first, const GLs { USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glMultiDrawArrays(ser, mode, first, count, drawcount); @@ -2356,25 +2356,25 @@ bool WrappedOpenGL::Serialise_glMultiDrawElements(SerialiserType &ser, GLenum mo uint32_t IdxSize = GetIdxSize(type); - DrawcallDescription draw; - draw.name = StringFormat::Fmt("%s(%i)", ToStr(gl_CurChunk).c_str(), drawcount); + ActionDescription action; + action.name = StringFormat::Fmt("%s(%i)", ToStr(gl_CurChunk).c_str(), drawcount); - draw.flags |= DrawFlags::MultiDraw; + action.flags |= ActionFlags::MultiAction; m_LastIndexWidth = IdxSize; - draw.numIndices = 0; + action.numIndices = 0; m_LastTopology = MakePrimitiveTopology(mode); AddEvent(); - AddDrawcall(draw); + AddAction(action); - m_DrawcallStack.push_back(&m_DrawcallStack.back()->children.back()); + m_ActionStack.push_back(&m_ActionStack.back()->children.back()); for(GLsizei i = 0; i < drawcount; i++) { m_CurEventID++; - DrawcallDescription multidraw; + ActionDescription multidraw; multidraw.drawIndex = i; multidraw.numIndices = count[i]; multidraw.indexOffset = (uint32_t)(indices[i] & 0xFFFFFFFF); @@ -2385,15 +2385,15 @@ bool WrappedOpenGL::Serialise_glMultiDrawElements(SerialiserType &ser, GLenum mo multidraw.name = StringFormat::Fmt("%s[%i](%u)", ToStr(gl_CurChunk).c_str(), i, multidraw.numIndices); - multidraw.flags |= DrawFlags::Drawcall | DrawFlags::Indexed; + multidraw.flags |= ActionFlags::Drawcall | ActionFlags::Indexed; m_LastTopology = MakePrimitiveTopology(mode); AddEvent(); - AddDrawcall(multidraw); + AddAction(multidraw); } - m_DrawcallStack.pop_back(); + m_ActionStack.pop_back(); } else if(IsActiveReplaying(m_State)) { @@ -2477,7 +2477,7 @@ void WrappedOpenGL::glMultiDrawElements(GLenum mode, const GLsizei *count, GLenu { USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glMultiDrawElements(ser, mode, count, type, indices, drawcount); @@ -2526,24 +2526,24 @@ bool WrappedOpenGL::Serialise_glMultiDrawElementsBaseVertex(SerialiserType &ser, uint32_t IdxSize = GetIdxSize(type); - DrawcallDescription draw; - draw.name = StringFormat::Fmt("%s(%i)", ToStr(gl_CurChunk).c_str(), drawcount); + ActionDescription action; + action.name = StringFormat::Fmt("%s(%i)", ToStr(gl_CurChunk).c_str(), drawcount); - draw.flags |= DrawFlags::MultiDraw; + action.flags |= ActionFlags::MultiAction; m_LastTopology = MakePrimitiveTopology(mode); m_LastIndexWidth = IdxSize; AddEvent(); - AddDrawcall(draw); + AddAction(action); - m_DrawcallStack.push_back(&m_DrawcallStack.back()->children.back()); + m_ActionStack.push_back(&m_ActionStack.back()->children.back()); for(GLsizei i = 0; i < drawcount; i++) { m_CurEventID++; - DrawcallDescription multidraw; + ActionDescription multidraw; multidraw.drawIndex = i; multidraw.numIndices = count[i]; multidraw.indexOffset = (uint32_t)(indices[i] & 0xFFFFFFFF); @@ -2554,16 +2554,16 @@ bool WrappedOpenGL::Serialise_glMultiDrawElementsBaseVertex(SerialiserType &ser, multidraw.name = StringFormat::Fmt("%s[%i](%u)", ToStr(gl_CurChunk).c_str(), i, multidraw.numIndices); - multidraw.flags |= DrawFlags::Drawcall | DrawFlags::Indexed; + multidraw.flags |= ActionFlags::Drawcall | ActionFlags::Indexed; m_LastTopology = MakePrimitiveTopology(mode); m_LastIndexWidth = IdxSize; AddEvent(); - AddDrawcall(multidraw); + AddAction(multidraw); } - m_DrawcallStack.pop_back(); + m_ActionStack.pop_back(); } else if(IsActiveReplaying(m_State)) { @@ -2650,7 +2650,7 @@ void WrappedOpenGL::glMultiDrawElementsBaseVertex(GLenum mode, const GLsizei *co { USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glMultiDrawElementsBaseVertex(ser, mode, count, type, indices, drawcount, basevertex); @@ -2681,17 +2681,17 @@ bool WrappedOpenGL::Serialise_glMultiDrawArraysIndirect(SerialiserType &ser, GLe if(drawcount == 0 || Check_SafeDraw(false)) GL.glMultiDrawArraysIndirect(mode, (const void *)offset, drawcount, stride); - DrawcallDescription draw; - draw.name = StringFormat::Fmt("%s(<%i>)", ToStr(gl_CurChunk).c_str(), drawcount); + ActionDescription action; + action.name = StringFormat::Fmt("%s(<%i>)", ToStr(gl_CurChunk).c_str(), drawcount); - draw.flags |= DrawFlags::MultiDraw; + action.flags |= ActionFlags::MultiAction; m_LastTopology = MakePrimitiveTopology(mode); AddEvent(); - AddDrawcall(draw); + AddAction(action); - m_DrawcallStack.push_back(&m_DrawcallStack.back()->children.back()); + m_ActionStack.push_back(&m_ActionStack.back()->children.back()); { GLuint buf = 0; @@ -2718,7 +2718,7 @@ bool WrappedOpenGL::Serialise_glMultiDrawArraysIndirect(SerialiserType &ser, GLe else offs += sizeof(params); - DrawcallDescription multidraw; + ActionDescription multidraw; multidraw.drawIndex = i; multidraw.numIndices = params.count; multidraw.numInstances = params.instanceCount; @@ -2728,7 +2728,7 @@ bool WrappedOpenGL::Serialise_glMultiDrawArraysIndirect(SerialiserType &ser, GLe multidraw.name = StringFormat::Fmt("%s[%i](<%u, %u>)", ToStr(gl_CurChunk).c_str(), i, multidraw.numIndices, multidraw.numInstances); - multidraw.flags |= DrawFlags::Drawcall | DrawFlags::Instanced | DrawFlags::Indirect; + multidraw.flags |= ActionFlags::Drawcall | ActionFlags::Instanced | ActionFlags::Indirect; m_LastTopology = MakePrimitiveTopology(mode); @@ -2748,10 +2748,10 @@ bool WrappedOpenGL::Serialise_glMultiDrawArraysIndirect(SerialiserType &ser, GLe m_StructuredFile->chunks.push_back(fakeChunk); AddEvent(); - AddDrawcall(multidraw); + AddAction(multidraw); } - m_DrawcallStack.pop_back(); + m_ActionStack.pop_back(); } else if(IsActiveReplaying(m_State)) { @@ -2866,7 +2866,7 @@ void WrappedOpenGL::glMultiDrawArraysIndirect(GLenum mode, const void *indirect, { USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glMultiDrawArraysIndirect(ser, mode, indirect, drawcount, stride); @@ -2903,18 +2903,18 @@ bool WrappedOpenGL::Serialise_glMultiDrawElementsIndirect(SerialiserType &ser, G if(drawcount == 0 || Check_SafeDraw(true)) GL.glMultiDrawElementsIndirect(mode, type, (const void *)offset, drawcount, stride); - DrawcallDescription draw; - draw.name = StringFormat::Fmt("%s(<%i>)", ToStr(gl_CurChunk).c_str(), drawcount); + ActionDescription action; + action.name = StringFormat::Fmt("%s(<%i>)", ToStr(gl_CurChunk).c_str(), drawcount); - draw.flags |= DrawFlags::MultiDraw; + action.flags |= ActionFlags::MultiAction; m_LastTopology = MakePrimitiveTopology(mode); m_LastIndexWidth = IdxSize; AddEvent(); - AddDrawcall(draw); + AddAction(action); - m_DrawcallStack.push_back(&m_DrawcallStack.back()->children.back()); + m_ActionStack.push_back(&m_ActionStack.back()->children.back()); { GLuint buf = 0; @@ -2941,7 +2941,7 @@ bool WrappedOpenGL::Serialise_glMultiDrawElementsIndirect(SerialiserType &ser, G else offs += sizeof(params); - DrawcallDescription multidraw; + ActionDescription multidraw; multidraw.drawIndex = i; multidraw.numIndices = params.count; multidraw.numInstances = params.instanceCount; @@ -2952,8 +2952,8 @@ bool WrappedOpenGL::Serialise_glMultiDrawElementsIndirect(SerialiserType &ser, G multidraw.name = StringFormat::Fmt("%s[%i](<%u, %u>)", ToStr(gl_CurChunk).c_str(), i, multidraw.numIndices, multidraw.numInstances); - multidraw.flags |= - DrawFlags::Drawcall | DrawFlags::Indexed | DrawFlags::Instanced | DrawFlags::Indirect; + multidraw.flags |= ActionFlags::Drawcall | ActionFlags::Indexed | ActionFlags::Instanced | + ActionFlags::Indirect; m_LastTopology = MakePrimitiveTopology(mode); m_LastIndexWidth = IdxSize; @@ -2974,10 +2974,10 @@ bool WrappedOpenGL::Serialise_glMultiDrawElementsIndirect(SerialiserType &ser, G m_StructuredFile->chunks.push_back(fakeChunk); AddEvent(); - AddDrawcall(multidraw); + AddAction(multidraw); } - m_DrawcallStack.pop_back(); + m_ActionStack.pop_back(); } else if(IsActiveReplaying(m_State)) { @@ -3092,7 +3092,7 @@ void WrappedOpenGL::glMultiDrawElementsIndirect(GLenum mode, GLenum type, const { USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glMultiDrawElementsIndirect(ser, mode, type, indirect, drawcount, stride); @@ -3133,17 +3133,17 @@ bool WrappedOpenGL::Serialise_glMultiDrawArraysIndirectCount(SerialiserType &ser GL.glMultiDrawArraysIndirectCount(mode, (const void *)offset, (GLintptr)drawcount, maxdrawcount, stride); - DrawcallDescription draw; - draw.name = StringFormat::Fmt("%s(<%i>)", ToStr(gl_CurChunk).c_str(), realdrawcount); + ActionDescription action; + action.name = StringFormat::Fmt("%s(<%i>)", ToStr(gl_CurChunk).c_str(), realdrawcount); - draw.flags |= DrawFlags::MultiDraw; + action.flags |= ActionFlags::MultiAction; m_LastTopology = MakePrimitiveTopology(mode); AddEvent(); - AddDrawcall(draw); + AddAction(action); - m_DrawcallStack.push_back(&m_DrawcallStack.back()->children.back()); + m_ActionStack.push_back(&m_ActionStack.back()->children.back()); { GLuint buf = 0; @@ -3170,7 +3170,7 @@ bool WrappedOpenGL::Serialise_glMultiDrawArraysIndirectCount(SerialiserType &ser else offs += sizeof(params); - DrawcallDescription multidraw; + ActionDescription multidraw; multidraw.drawIndex = i; multidraw.numIndices = params.count; multidraw.numInstances = params.instanceCount; @@ -3180,7 +3180,7 @@ bool WrappedOpenGL::Serialise_glMultiDrawArraysIndirectCount(SerialiserType &ser multidraw.name = StringFormat::Fmt("%s[%i](<%u, %u>)", ToStr(gl_CurChunk).c_str(), i, multidraw.numIndices, multidraw.numInstances); - multidraw.flags |= DrawFlags::Drawcall | DrawFlags::Instanced | DrawFlags::Indirect; + multidraw.flags |= ActionFlags::Drawcall | ActionFlags::Instanced | ActionFlags::Indirect; m_LastTopology = MakePrimitiveTopology(mode); @@ -3200,10 +3200,10 @@ bool WrappedOpenGL::Serialise_glMultiDrawArraysIndirectCount(SerialiserType &ser m_StructuredFile->chunks.push_back(fakeChunk); AddEvent(); - AddDrawcall(multidraw); + AddAction(multidraw); } - m_DrawcallStack.pop_back(); + m_ActionStack.pop_back(); } else if(IsActiveReplaying(m_State)) { @@ -3320,7 +3320,7 @@ void WrappedOpenGL::glMultiDrawArraysIndirectCount(GLenum mode, const void *indi { USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glMultiDrawArraysIndirectCount(ser, mode, indirect, drawcount, maxdrawcount, stride); @@ -3364,18 +3364,18 @@ bool WrappedOpenGL::Serialise_glMultiDrawElementsIndirectCount(SerialiserType &s GL.glMultiDrawElementsIndirectCount(mode, type, (const void *)offset, (GLintptr)drawcount, maxdrawcount, stride); - DrawcallDescription draw; - draw.name = StringFormat::Fmt("%s(<%i>)", ToStr(gl_CurChunk).c_str(), realdrawcount); + ActionDescription action; + action.name = StringFormat::Fmt("%s(<%i>)", ToStr(gl_CurChunk).c_str(), realdrawcount); - draw.flags |= DrawFlags::MultiDraw; + action.flags |= ActionFlags::MultiAction; m_LastTopology = MakePrimitiveTopology(mode); m_LastIndexWidth = IdxSize; AddEvent(); - AddDrawcall(draw); + AddAction(action); - m_DrawcallStack.push_back(&m_DrawcallStack.back()->children.back()); + m_ActionStack.push_back(&m_ActionStack.back()->children.back()); { GLuint buf = 0; @@ -3402,7 +3402,7 @@ bool WrappedOpenGL::Serialise_glMultiDrawElementsIndirectCount(SerialiserType &s else offs += sizeof(params); - DrawcallDescription multidraw; + ActionDescription multidraw; multidraw.drawIndex = i; multidraw.numIndices = params.count; multidraw.numInstances = params.instanceCount; @@ -3413,8 +3413,8 @@ bool WrappedOpenGL::Serialise_glMultiDrawElementsIndirectCount(SerialiserType &s multidraw.name = StringFormat::Fmt("%s[%i](<%u, %u>)", ToStr(gl_CurChunk).c_str(), i, multidraw.numIndices, multidraw.numInstances); - multidraw.flags |= - DrawFlags::Drawcall | DrawFlags::Indexed | DrawFlags::Instanced | DrawFlags::Indirect; + multidraw.flags |= ActionFlags::Drawcall | ActionFlags::Indexed | ActionFlags::Instanced | + ActionFlags::Indirect; m_LastTopology = MakePrimitiveTopology(mode); m_LastIndexWidth = IdxSize; @@ -3435,10 +3435,10 @@ bool WrappedOpenGL::Serialise_glMultiDrawElementsIndirectCount(SerialiserType &s m_StructuredFile->chunks.push_back(fakeChunk); AddEvent(); - AddDrawcall(multidraw); + AddAction(multidraw); } - m_DrawcallStack.pop_back(); + m_ActionStack.pop_back(); } else if(IsActiveReplaying(m_State)) { @@ -3555,7 +3555,7 @@ void WrappedOpenGL::glMultiDrawElementsIndirectCount(GLenum mode, GLenum type, c { USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glMultiDrawElementsIndirectCount(ser, mode, type, indirect, drawcount, maxdrawcount, stride); @@ -3593,12 +3593,12 @@ bool WrappedOpenGL::Serialise_glClearNamedFramebufferfv(SerialiserType &ser, { AddEvent(); - DrawcallDescription draw; - draw.flags |= DrawFlags::Clear; + ActionDescription action; + action.flags |= ActionFlags::Clear; if(buffer == eGL_COLOR) - draw.flags |= DrawFlags::ClearColor; + action.flags |= ActionFlags::ClearColor; else - draw.flags |= DrawFlags::ClearDepthStencil; + action.flags |= ActionFlags::ClearDepthStencil; GLuint attachment = 0; GLenum attachName = @@ -3619,18 +3619,18 @@ bool WrappedOpenGL::Serialise_glClearNamedFramebufferfv(SerialiserType &ser, id = GetResourceManager()->GetResID(RenderbufferRes(GetCtx(), attachment)); m_ResourceUses[id].push_back(EventUsage(m_CurEventID, ResourceUsage::Clear)); - draw.copyDestination = GetResourceManager()->GetOriginalID(id); + action.copyDestination = GetResourceManager()->GetOriginalID(id); if(type == eGL_TEXTURE) { GLint mip = 0, slice = 0; GetFramebufferMipAndLayer(framebuffer.name, attachName, &mip, &slice); - draw.copyDestinationSubresource.mip = mip; - draw.copyDestinationSubresource.slice = slice; + action.copyDestinationSubresource.mip = mip; + action.copyDestinationSubresource.slice = slice; } } - AddDrawcall(draw); + AddAction(action); } } @@ -3663,7 +3663,7 @@ void WrappedOpenGL::glClearNamedFramebufferfv(GLuint framebuffer, GLenum buffer, { USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glClearNamedFramebufferfv(ser, framebuffer, buffer, drawbuffer, value); @@ -3696,7 +3696,7 @@ void WrappedOpenGL::glClearBufferfv(GLenum buffer, GLint drawbuffer, const GLflo USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glClearNamedFramebufferfv(ser, framebuffer, buffer, drawbuffer, value); @@ -3733,12 +3733,12 @@ bool WrappedOpenGL::Serialise_glClearNamedFramebufferiv(SerialiserType &ser, { AddEvent(); - DrawcallDescription draw; - draw.flags |= DrawFlags::Clear; + ActionDescription action; + action.flags |= ActionFlags::Clear; if(buffer == eGL_COLOR) - draw.flags |= DrawFlags::ClearColor; + action.flags |= ActionFlags::ClearColor; else - draw.flags |= DrawFlags::ClearDepthStencil; + action.flags |= ActionFlags::ClearDepthStencil; GLuint attachment = 0; GLenum attachName = @@ -3759,18 +3759,18 @@ bool WrappedOpenGL::Serialise_glClearNamedFramebufferiv(SerialiserType &ser, id = GetResourceManager()->GetResID(RenderbufferRes(GetCtx(), attachment)); m_ResourceUses[id].push_back(EventUsage(m_CurEventID, ResourceUsage::Clear)); - draw.copyDestination = GetResourceManager()->GetOriginalID(id); + action.copyDestination = GetResourceManager()->GetOriginalID(id); if(type == eGL_TEXTURE) { GLint mip = 0, slice = 0; GetFramebufferMipAndLayer(framebuffer.name, eGL_COLOR_ATTACHMENT0, &mip, &slice); - draw.copyDestinationSubresource.mip = mip; - draw.copyDestinationSubresource.slice = slice; + action.copyDestinationSubresource.mip = mip; + action.copyDestinationSubresource.slice = slice; } } - AddDrawcall(draw); + AddAction(action); } } @@ -3788,7 +3788,7 @@ void WrappedOpenGL::glClearNamedFramebufferiv(GLuint framebuffer, GLenum buffer, { USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glClearNamedFramebufferiv(ser, framebuffer, buffer, drawbuffer, value); @@ -3821,7 +3821,7 @@ void WrappedOpenGL::glClearBufferiv(GLenum buffer, GLint drawbuffer, const GLint USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glClearNamedFramebufferiv(ser, framebuffer, buffer, drawbuffer, value); @@ -3858,8 +3858,8 @@ bool WrappedOpenGL::Serialise_glClearNamedFramebufferuiv(SerialiserType &ser, { AddEvent(); - DrawcallDescription draw; - draw.flags |= DrawFlags::Clear | DrawFlags::ClearColor; + ActionDescription action; + action.flags |= ActionFlags::Clear | ActionFlags::ClearColor; GLuint attachment = 0; GLenum attachName = GLenum(eGL_COLOR_ATTACHMENT0 + drawbuffer); @@ -3879,18 +3879,18 @@ bool WrappedOpenGL::Serialise_glClearNamedFramebufferuiv(SerialiserType &ser, id = GetResourceManager()->GetResID(RenderbufferRes(GetCtx(), attachment)); m_ResourceUses[id].push_back(EventUsage(m_CurEventID, ResourceUsage::Clear)); - draw.copyDestination = GetResourceManager()->GetOriginalID(id); + action.copyDestination = GetResourceManager()->GetOriginalID(id); if(type == eGL_TEXTURE) { GLint mip = 0, slice = 0; GetFramebufferMipAndLayer(framebuffer.name, eGL_COLOR_ATTACHMENT0, &mip, &slice); - draw.copyDestinationSubresource.mip = mip; - draw.copyDestinationSubresource.slice = slice; + action.copyDestinationSubresource.mip = mip; + action.copyDestinationSubresource.slice = slice; } } - AddDrawcall(draw); + AddAction(action); } } @@ -3908,7 +3908,7 @@ void WrappedOpenGL::glClearNamedFramebufferuiv(GLuint framebuffer, GLenum buffer { USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glClearNamedFramebufferuiv(ser, framebuffer, buffer, drawbuffer, value); @@ -3941,7 +3941,7 @@ void WrappedOpenGL::glClearBufferuiv(GLenum buffer, GLint drawbuffer, const GLui USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glClearNamedFramebufferuiv(ser, framebuffer, buffer, drawbuffer, value); @@ -3979,8 +3979,8 @@ bool WrappedOpenGL::Serialise_glClearNamedFramebufferfi(SerialiserType &ser, GLu { AddEvent(); - DrawcallDescription draw; - draw.flags |= DrawFlags::Clear | DrawFlags::ClearDepthStencil; + ActionDescription action; + action.flags |= ActionFlags::Clear | ActionFlags::ClearDepthStencil; GLuint attachment = 0; GLenum type = eGL_TEXTURE; @@ -4001,18 +4001,18 @@ bool WrappedOpenGL::Serialise_glClearNamedFramebufferfi(SerialiserType &ser, GLu id = GetResourceManager()->GetResID(RenderbufferRes(GetCtx(), attachment)); m_ResourceUses[id].push_back(EventUsage(m_CurEventID, ResourceUsage::Clear)); - draw.copyDestination = GetResourceManager()->GetOriginalID(id); + action.copyDestination = GetResourceManager()->GetOriginalID(id); if(type == eGL_TEXTURE) { GLint mip = 0, slice = 0; GetFramebufferMipAndLayer(framebuffer.name, eGL_COLOR_ATTACHMENT0, &mip, &slice); - draw.copyDestinationSubresource.mip = mip; - draw.copyDestinationSubresource.slice = slice; + action.copyDestinationSubresource.mip = mip; + action.copyDestinationSubresource.slice = slice; } } - AddDrawcall(draw); + AddAction(action); attachment = 0; type = eGL_TEXTURE; @@ -4049,7 +4049,7 @@ void WrappedOpenGL::glClearNamedFramebufferfi(GLuint framebuffer, GLenum buffer, { USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glClearNamedFramebufferfi(ser, framebuffer, buffer, drawbuffer, depth, stencil); @@ -4082,7 +4082,7 @@ void WrappedOpenGL::glClearBufferfi(GLenum buffer, GLint drawbuffer, GLfloat dep USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glClearNamedFramebufferfi(ser, framebuffer, buffer, drawbuffer, depth, stencil); @@ -4187,7 +4187,7 @@ void WrappedOpenGL::glClearNamedBufferDataEXT(GLuint buffer, GLenum internalform { USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glClearNamedBufferDataEXT(ser, buffer, internalformat, format, type, data); @@ -4225,7 +4225,7 @@ void WrappedOpenGL::glClearBufferData(GLenum target, GLenum internalformat, GLen { USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glClearNamedBufferDataEXT(ser, record->Resource.name, internalformat, format, type, data); @@ -4343,7 +4343,7 @@ void WrappedOpenGL::glClearNamedBufferSubDataEXT(GLuint buffer, GLenum internalf { USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glClearNamedBufferSubDataEXT(ser, buffer, internalformat, offset, size, format, type, data); @@ -4389,7 +4389,7 @@ void WrappedOpenGL::glClearBufferSubData(GLenum target, GLenum internalformat, G { USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glClearNamedBufferSubDataEXT(ser, record->Resource.name, internalformat, offset, size, format, type, data); @@ -4444,13 +4444,13 @@ bool WrappedOpenGL::Serialise_glClear(SerialiserType &ser, GLbitfield mask) name += ")"; - DrawcallDescription draw; - draw.name = name; - draw.flags |= DrawFlags::Clear; + ActionDescription action; + action.name = name; + action.flags |= ActionFlags::Clear; if(mask & GL_COLOR_BUFFER_BIT) - draw.flags |= DrawFlags::ClearColor; + action.flags |= ActionFlags::ClearColor; if(mask & (eGL_DEPTH_BUFFER_BIT | eGL_STENCIL_BUFFER_BIT)) - draw.flags |= DrawFlags::ClearDepthStencil; + action.flags |= ActionFlags::ClearDepthStencil; ResourceId dstId; @@ -4497,7 +4497,7 @@ bool WrappedOpenGL::Serialise_glClear(SerialiserType &ser, GLbitfield mask) } } - draw.copyDestination = GetResourceManager()->GetOriginalID(dstId); + action.copyDestination = GetResourceManager()->GetOriginalID(dstId); if(m_Textures[dstId].curType != eGL_RENDERBUFFER) { @@ -4505,11 +4505,11 @@ bool WrappedOpenGL::Serialise_glClear(SerialiserType &ser, GLbitfield mask) GL.glGetIntegerv(eGL_DRAW_FRAMEBUFFER_BINDING, (GLint *)&curDrawFBO); GLint mip = 0, slice = 0; GetFramebufferMipAndLayer(curDrawFBO, eGL_COLOR_ATTACHMENT0, &mip, &slice); - draw.copyDestinationSubresource.mip = mip; - draw.copyDestinationSubresource.slice = slice; + action.copyDestinationSubresource.mip = mip; + action.copyDestinationSubresource.slice = slice; } - AddDrawcall(draw); + AddAction(action); } } return true; @@ -4525,7 +4525,7 @@ void WrappedOpenGL::glClear(GLbitfield mask) { USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glClear(ser, mask); @@ -4631,17 +4631,17 @@ bool WrappedOpenGL::Serialise_glClearTexImage(SerialiserType &ser, GLuint textur ResourceId liveId = GetResourceManager()->GetResID(texture); ResourceId id = GetResourceManager()->GetOriginalID(liveId); - DrawcallDescription draw; - draw.flags |= DrawFlags::Clear; + ActionDescription action; + action.flags |= ActionFlags::Clear; if(format == eGL_DEPTH_STENCIL || format == eGL_DEPTH_COMPONENT || format == eGL_STENCIL_INDEX) - draw.flags |= DrawFlags::ClearDepthStencil; + action.flags |= ActionFlags::ClearDepthStencil; else - draw.flags |= DrawFlags::ClearColor; + action.flags |= ActionFlags::ClearColor; - draw.copyDestination = id; - draw.copyDestinationSubresource.mip = level; + action.copyDestination = id; + action.copyDestinationSubresource.mip = level; - AddDrawcall(draw); + AddAction(action); m_ResourceUses[liveId].push_back(EventUsage(m_CurEventID, ResourceUsage::Clear)); } @@ -4666,7 +4666,7 @@ void WrappedOpenGL::glClearTexImage(GLuint texture, GLint level, GLenum format, { USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glClearTexImage(ser, texture, level, format, type, data); @@ -4779,17 +4779,17 @@ bool WrappedOpenGL::Serialise_glClearTexSubImage(SerialiserType &ser, GLuint tex ResourceId liveId = GetResourceManager()->GetResID(texture); ResourceId id = GetResourceManager()->GetOriginalID(liveId); - DrawcallDescription draw; - draw.flags |= DrawFlags::Clear; + ActionDescription action; + action.flags |= ActionFlags::Clear; if(format == eGL_DEPTH_STENCIL || format == eGL_DEPTH_COMPONENT || format == eGL_STENCIL_INDEX) - draw.flags |= DrawFlags::ClearDepthStencil; + action.flags |= ActionFlags::ClearDepthStencil; else - draw.flags |= DrawFlags::ClearColor; + action.flags |= ActionFlags::ClearColor; - draw.copyDestination = id; - draw.copyDestinationSubresource.mip = level; + action.copyDestination = id; + action.copyDestinationSubresource.mip = level; - AddDrawcall(draw); + AddAction(action); m_ResourceUses[liveId].push_back(EventUsage(m_CurEventID, ResourceUsage::Clear)); } @@ -4816,7 +4816,7 @@ void WrappedOpenGL::glClearTexSubImage(GLuint texture, GLint level, GLint xoffse { USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glClearTexSubImage(ser, texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data); @@ -4835,11 +4835,11 @@ bool WrappedOpenGL::Serialise_glFlush(SerialiserType &ser) if(IsLoading(m_State)) { - DrawcallDescription draw; - draw.flags |= DrawFlags::PassBoundary | DrawFlags::EndPass; + ActionDescription action; + action.flags |= ActionFlags::PassBoundary | ActionFlags::EndPass; AddEvent(); - AddDrawcall(draw); + AddAction(action); } } @@ -4856,7 +4856,7 @@ void WrappedOpenGL::glFlush() { USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glFlush(ser); @@ -4875,10 +4875,10 @@ bool WrappedOpenGL::Serialise_glFinish(SerialiserType &ser) { AddEvent(); - DrawcallDescription draw; - draw.flags |= DrawFlags::PassBoundary | DrawFlags::EndPass; + ActionDescription action; + action.flags |= ActionFlags::PassBoundary | ActionFlags::EndPass; - AddDrawcall(draw); + AddAction(action); } } @@ -4895,7 +4895,7 @@ void WrappedOpenGL::glFinish() { USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glFinish(ser); diff --git a/renderdoc/driver/gl/wrappers/gl_framebuffer_funcs.cpp b/renderdoc/driver/gl/wrappers/gl_framebuffer_funcs.cpp index 8f5edf519..5108e346d 100644 --- a/renderdoc/driver/gl/wrappers/gl_framebuffer_funcs.cpp +++ b/renderdoc/driver/gl/wrappers/gl_framebuffer_funcs.cpp @@ -1816,8 +1816,8 @@ bool WrappedOpenGL::Serialise_glInvalidateNamedFramebufferData(SerialiserType &s ResourceId fbid = GetResourceManager()->GetResID(framebuffer); - DrawcallDescription draw; - draw.flags |= DrawFlags::Clear; + ActionDescription action; + action.flags |= ActionFlags::Clear; for(GLsizei i = 0; i < numAttachments; i++) { @@ -1836,13 +1836,13 @@ bool WrappedOpenGL::Serialise_glInvalidateNamedFramebufferData(SerialiserType &s else id = GetResourceManager()->GetResID(RenderbufferRes(GetCtx(), obj)); - if(draw.copyDestination == ResourceId()) - draw.copyDestination = GetResourceManager()->GetOriginalID(id); + if(action.copyDestination == ResourceId()) + action.copyDestination = GetResourceManager()->GetOriginalID(id); m_ResourceUses[id].push_back(EventUsage(m_CurEventID, ResourceUsage::Discard)); } - AddDrawcall(draw); + AddAction(action); } } @@ -2014,8 +2014,8 @@ bool WrappedOpenGL::Serialise_glInvalidateNamedFramebufferSubData( ResourceId fbid = GetResourceManager()->GetResID(framebuffer); - DrawcallDescription draw; - draw.flags |= DrawFlags::Clear; + ActionDescription action; + action.flags |= ActionFlags::Clear; for(GLsizei i = 0; i < numAttachments; i++) { @@ -2034,13 +2034,13 @@ bool WrappedOpenGL::Serialise_glInvalidateNamedFramebufferSubData( else id = GetResourceManager()->GetResID(RenderbufferRes(GetCtx(), obj)); - if(draw.copyDestination == ResourceId()) - draw.copyDestination = GetResourceManager()->GetOriginalID(id); + if(action.copyDestination == ResourceId()) + action.copyDestination = GetResourceManager()->GetOriginalID(id); m_ResourceUses[id].push_back(EventUsage(m_CurEventID, ResourceUsage::Discard)); } - AddDrawcall(draw); + AddAction(action); } } @@ -2169,8 +2169,8 @@ bool WrappedOpenGL::Serialise_glBlitNamedFramebuffer(SerialiserType &ser, ResourceId readId = GetResourceManager()->GetResID(readFramebuffer); ResourceId drawId = GetResourceManager()->GetResID(drawFramebuffer); - DrawcallDescription draw; - draw.flags |= DrawFlags::Resolve; + ActionDescription action; + action.flags |= ActionFlags::Resolve; GLint numCols = 8; GL.glGetIntegerv(eGL_MAX_COLOR_ATTACHMENTS, &numCols); @@ -2216,42 +2216,42 @@ bool WrappedOpenGL::Serialise_glBlitNamedFramebuffer(SerialiserType &ser, { if(attachName == eGL_COLOR_ATTACHMENT0) { - draw.copySource = GetResourceManager()->GetOriginalID(srcid); - draw.copyDestination = GetResourceManager()->GetOriginalID(dstid); + action.copySource = GetResourceManager()->GetOriginalID(srcid); + action.copyDestination = GetResourceManager()->GetOriginalID(dstid); GLint mip = 0, slice = 0; if(dsttype == eGL_TEXTURE) GetFramebufferMipAndLayer(drawFramebuffer.name, eGL_COLOR_ATTACHMENT0, &mip, &slice); - draw.copyDestinationSubresource.mip = mip; - draw.copyDestinationSubresource.slice = slice; + action.copyDestinationSubresource.mip = mip; + action.copyDestinationSubresource.slice = slice; mip = 0; slice = 0; if(srctype == eGL_TEXTURE) GetFramebufferMipAndLayer(readFramebuffer.name, eGL_COLOR_ATTACHMENT0, &mip, &slice); - draw.copySourceSubresource.mip = mip; - draw.copySourceSubresource.slice = slice; + action.copySourceSubresource.mip = mip; + action.copySourceSubresource.slice = slice; } } else { if(attachName == eGL_DEPTH_ATTACHMENT) { - draw.copySource = GetResourceManager()->GetOriginalID(srcid); - draw.copyDestination = GetResourceManager()->GetOriginalID(dstid); + action.copySource = GetResourceManager()->GetOriginalID(srcid); + action.copyDestination = GetResourceManager()->GetOriginalID(dstid); GLint mip = 0, slice = 0; if(dsttype == eGL_TEXTURE) GetFramebufferMipAndLayer(drawFramebuffer.name, eGL_DEPTH_ATTACHMENT, &mip, &slice); - draw.copyDestinationSubresource.mip = mip; - draw.copyDestinationSubresource.slice = slice; + action.copyDestinationSubresource.mip = mip; + action.copyDestinationSubresource.slice = slice; mip = 0; slice = 0; if(srctype == eGL_TEXTURE) GetFramebufferMipAndLayer(readFramebuffer.name, eGL_DEPTH_ATTACHMENT, &mip, &slice); - draw.copySourceSubresource.mip = mip; - draw.copySourceSubresource.slice = slice; + action.copySourceSubresource.mip = mip; + action.copySourceSubresource.slice = slice; } } @@ -2278,7 +2278,7 @@ bool WrappedOpenGL::Serialise_glBlitNamedFramebuffer(SerialiserType &ser, } } - AddDrawcall(draw); + AddAction(action); } } @@ -2302,7 +2302,7 @@ void WrappedOpenGL::glBlitNamedFramebuffer(GLuint readFramebuffer, GLuint drawFr if(IsActiveCapturing(m_State)) { USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glBlitNamedFramebuffer(ser, readFramebuffer, drawFramebuffer, srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); diff --git a/renderdoc/driver/gl/wrappers/gl_texture_funcs.cpp b/renderdoc/driver/gl/wrappers/gl_texture_funcs.cpp index 5c25357d7..4881c125b 100644 --- a/renderdoc/driver/gl/wrappers/gl_texture_funcs.cpp +++ b/renderdoc/driver/gl/wrappers/gl_texture_funcs.cpp @@ -816,10 +816,10 @@ bool WrappedOpenGL::Serialise_glGenerateTextureMipmapEXT(SerialiserType &ser, GL CalcNumMips(m_Textures[liveId].width, m_Textures[liveId].height, m_Textures[liveId].depth); m_Textures[liveId].mipsValid = (1 << mips) - 1; - DrawcallDescription draw; - draw.flags |= DrawFlags::GenMips; + ActionDescription action; + action.flags |= ActionFlags::GenMips; - AddDrawcall(draw); + AddAction(action); m_ResourceUses[GetResourceManager()->GetResID(texture)].push_back( EventUsage(m_CurEventID, ResourceUsage::GenMips)); @@ -846,7 +846,7 @@ void WrappedOpenGL::Common_glGenerateTextureMipmapEXT(GLResourceRecord *record, if(IsActiveCapturing(m_State)) { USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glGenerateTextureMipmapEXT(ser, record->Resource.name, target); @@ -1019,12 +1019,12 @@ bool WrappedOpenGL::Serialise_glInvalidateTexImage(SerialiserType &ser, GLuint t { AddEvent(); - DrawcallDescription draw; - draw.flags |= DrawFlags::Clear; + ActionDescription action; + action.flags |= ActionFlags::Clear; - draw.copyDestination = GetResourceManager()->GetOriginalID(liveId); + action.copyDestination = GetResourceManager()->GetOriginalID(liveId); - AddDrawcall(draw); + AddAction(action); m_ResourceUses[GetResourceManager()->GetResID(texture)].push_back( EventUsage(m_CurEventID, ResourceUsage::Discard)); @@ -1049,7 +1049,7 @@ void WrappedOpenGL::glInvalidateTexImage(GLuint texture, GLint level) if(IsActiveCapturing(m_State)) { USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glInvalidateTexImage(ser, texture, level); @@ -1171,12 +1171,12 @@ bool WrappedOpenGL::Serialise_glInvalidateTexSubImage(SerialiserType &ser, GLuin { AddEvent(); - DrawcallDescription draw; - draw.flags |= DrawFlags::Clear; + ActionDescription action; + action.flags |= ActionFlags::Clear; - draw.copyDestination = GetResourceManager()->GetOriginalID(liveId); + action.copyDestination = GetResourceManager()->GetOriginalID(liveId); - AddDrawcall(draw); + AddAction(action); m_ResourceUses[GetResourceManager()->GetResID(texture)].push_back( EventUsage(m_CurEventID, ResourceUsage::Discard)); @@ -1204,7 +1204,7 @@ void WrappedOpenGL::glInvalidateTexSubImage(GLuint texture, GLint level, GLint x if(IsActiveCapturing(m_State)) { USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glInvalidateTexSubImage(ser, texture, level, xoffset, yoffset, zoffset, width, height, depth); @@ -1267,21 +1267,21 @@ bool WrappedOpenGL::Serialise_glCopyImageSubData(SerialiserType &ser, GLuint src ResourceId srcid = GetResourceManager()->GetResID(srcName); ResourceId dstid = GetResourceManager()->GetResID(dstName); - DrawcallDescription draw; - draw.flags |= DrawFlags::Copy; + ActionDescription action; + action.flags |= ActionFlags::Copy; - draw.copySource = GetResourceManager()->GetOriginalID(srcid); - draw.copyDestination = GetResourceManager()->GetOriginalID(dstid); + action.copySource = GetResourceManager()->GetOriginalID(srcid); + action.copyDestination = GetResourceManager()->GetOriginalID(dstid); - draw.copyDestinationSubresource.mip = dstLevel; + action.copyDestinationSubresource.mip = dstLevel; if(dstTarget != eGL_TEXTURE_3D) - draw.copyDestinationSubresource.slice = dstZ; + action.copyDestinationSubresource.slice = dstZ; - draw.copySourceSubresource.mip = srcLevel; + action.copySourceSubresource.mip = srcLevel; if(srcTarget != eGL_TEXTURE_3D) - draw.copySourceSubresource.slice = srcZ; + action.copySourceSubresource.slice = srcZ; - AddDrawcall(draw); + AddAction(action); if(srcid == dstid) { @@ -1335,7 +1335,7 @@ void WrappedOpenGL::glCopyImageSubData(GLuint srcName, GLenum srcTarget, GLint s return; USE_SCRATCH_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(gl_CurChunk); Serialise_glCopyImageSubData(ser, srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight, diff --git a/renderdoc/driver/shaders/spirv/spirv_reflect.cpp b/renderdoc/driver/shaders/spirv/spirv_reflect.cpp index a61fc8efe..51991b271 100644 --- a/renderdoc/driver/shaders/spirv/spirv_reflect.cpp +++ b/renderdoc/driver/shaders/spirv/spirv_reflect.cpp @@ -955,7 +955,7 @@ void Reflector::MakeReflection(const GraphicsAPI sourceAPI, const ShaderStage st // on Vulkan should never have elements that have no binding declared but are used. On GL we // should have gotten a location // above, which will be rewritten later when looking up the pipeline state since it's - // mutable from draw to draw in theory. + // mutable from action to action in theory. RDCASSERT(!bindmap.used || bindmap.bind != INVALID_BIND); // opaque type - buffers, images, etc @@ -1040,7 +1040,7 @@ void Reflector::MakeReflection(const GraphicsAPI sourceAPI, const ShaderStage st // on Vulkan should never have elements that have no binding declared but are used, unless // it's push constants (which is handled elsewhere). On GL we should have gotten a // location above, which will be rewritten later when looking up the pipeline state since - // it's mutable from draw to draw in theory. + // it's mutable from action to action in theory. RDCASSERT(!bindmap.used || pushConst || bindmap.bind != INVALID_BIND); if(ssbo) diff --git a/renderdoc/driver/vulkan/vk_core.cpp b/renderdoc/driver/vulkan/vk_core.cpp index de9c1f332..ca0610bff 100644 --- a/renderdoc/driver/vulkan/vk_core.cpp +++ b/renderdoc/driver/vulkan/vk_core.cpp @@ -127,19 +127,19 @@ WrappedVulkan::WrappedVulkan() debugMessageSinkTLSSlot = Threading::AllocateTLSSlot(); m_RootEventID = 1; - m_RootDrawcallID = 1; + m_RootActionID = 1; m_FirstEventID = 0; m_LastEventID = ~0U; - m_DrawcallCallback = NULL; + m_ActionCallback = NULL; m_SubmitChain = NULL; m_CurChunkOffset = 0; - m_AddedDrawcall = false; + m_AddedAction = false; m_LastCmdBufferID = ResourceId(); - m_DrawcallStack.push_back(&m_ParentDrawcall); + m_ActionStack.push_back(&m_ParentAction); m_SetDeviceLoaderData = NULL; @@ -576,19 +576,19 @@ void WrappedVulkan::InlineCleanupImageBarriers(VkCommandBuffer cmd, ImageBarrier DoPipelineBarrier(cmd, (uint32_t)batch.size(), batch.data()); } -uint32_t WrappedVulkan::HandlePreCallback(VkCommandBuffer commandBuffer, DrawFlags type, +uint32_t WrappedVulkan::HandlePreCallback(VkCommandBuffer commandBuffer, ActionFlags type, uint32_t multiDrawOffset) { - if(!m_DrawcallCallback) + if(!m_ActionCallback) return 0; - // look up the EID this drawcall came from - DrawcallUse use(m_CurChunkOffset, 0); - auto it = std::lower_bound(m_DrawcallUses.begin(), m_DrawcallUses.end(), use); + // look up the EID this action came from + ActionUse use(m_CurChunkOffset, 0); + auto it = std::lower_bound(m_ActionUses.begin(), m_ActionUses.end(), use); - if(it == m_DrawcallUses.end()) + if(it == m_ActionUses.end()) { - RDCERR("Couldn't find drawcall use entry for %llu", m_CurChunkOffset); + RDCERR("Couldn't find action use entry for %llu", m_CurChunkOffset); return 0; } @@ -596,27 +596,27 @@ uint32_t WrappedVulkan::HandlePreCallback(VkCommandBuffer commandBuffer, DrawFla RDCASSERT(eventId != 0); - // handle all aliases of this drawcall as long as it's not a multidraw - const DrawcallDescription *draw = GetDrawcall(eventId); + // handle all aliases of this action as long as it's not a multidraw + const ActionDescription *action = GetAction(eventId); - if(draw == NULL || !(draw->flags & DrawFlags::MultiDraw)) + if(action == NULL || !(action->flags & ActionFlags::MultiAction)) { ++it; - while(it != m_DrawcallUses.end() && it->fileOffset == m_CurChunkOffset) + while(it != m_ActionUses.end() && it->fileOffset == m_CurChunkOffset) { - m_DrawcallCallback->AliasEvent(eventId, it->eventId); + m_ActionCallback->AliasEvent(eventId, it->eventId); ++it; } } eventId += multiDrawOffset; - if(type == DrawFlags::Drawcall) - m_DrawcallCallback->PreDraw(eventId, commandBuffer); - else if(type == DrawFlags::Dispatch) - m_DrawcallCallback->PreDispatch(eventId, commandBuffer); + if(type == ActionFlags::Drawcall) + m_ActionCallback->PreDraw(eventId, commandBuffer); + else if(type == ActionFlags::Dispatch) + m_ActionCallback->PreDispatch(eventId, commandBuffer); else - m_DrawcallCallback->PreMisc(eventId, type, commandBuffer); + m_ActionCallback->PreMisc(eventId, type, commandBuffer); return eventId; } @@ -1642,7 +1642,7 @@ bool WrappedVulkan::Serialise_CaptureScope(SerialiserType &ser) void WrappedVulkan::EndCaptureFrame(VkImage presentImage) { CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(SystemChunk::CaptureEnd); SERIALISE_ELEMENT_LOCAL(PresentedImage, GetResID(presentImage)).TypedAs("VkImage"_lit); @@ -2568,7 +2568,7 @@ ReplayStatus WrappedVulkan::ReadLogInitialisation(RDCFile *rdc, bool storeStruct RDCASSERT(m_Device != VK_NULL_HANDLE && m_Queue != VK_NULL_HANDLE && m_InternalCmds.cmdpool != VK_NULL_HANDLE); - // create indirect draw buffer + // create indirect action buffer m_IndirectBufferSize = AlignUp(m_IndirectBufferSize + 63, (size_t)64); m_IndirectBuffer.Create(this, GetDev(), m_IndirectBufferSize * 2, 1, @@ -2670,7 +2670,7 @@ ReplayStatus WrappedVulkan::ContextReplayLog(CaptureState readType, uint32_t sta else { m_RootEventID = 1; - m_RootDrawcallID = 1; + m_RootActionID = 1; m_FirstEventID = 0; m_LastEventID = ~0U; } @@ -2760,11 +2760,11 @@ ReplayStatus WrappedVulkan::ContextReplayLog(CaptureState readType, uint32_t sta if(IsLoading(m_State)) { - GetReplay()->WriteFrameRecord().drawcallList = m_ParentDrawcall.Bake(); + GetReplay()->WriteFrameRecord().actionList = m_ParentAction.Bake(); - SetupDrawcallPointers(m_Drawcalls, GetReplay()->WriteFrameRecord().drawcallList); + SetupActionPointers(m_Actions, GetReplay()->WriteFrameRecord().actionList); - m_ParentDrawcall.children.clear(); + m_ParentAction.children.clear(); } if(!IsStructuredExporting(m_State)) @@ -2964,7 +2964,7 @@ void WrappedVulkan::ApplyInitialContents() bool WrappedVulkan::ContextProcessChunk(ReadSerialiser &ser, VulkanChunk chunk) { - m_AddedDrawcall = false; + m_AddedAction = false; bool success = ProcessChunk(ser, chunk); @@ -2979,16 +2979,16 @@ bool WrappedVulkan::ContextProcessChunk(ReadSerialiser &ser, VulkanChunk chunk) } else if(chunk == VulkanChunk::vkQueueEndDebugUtilsLabelEXT) { - // also ignore, this just pops the drawcall stack + // also ignore, this just pops the action stack } else { - if(!m_AddedDrawcall) + if(!m_AddedAction) AddEvent(); } } - m_AddedDrawcall = false; + m_AddedAction = false; return true; } @@ -3448,13 +3448,13 @@ bool WrappedVulkan::ProcessChunk(ReadSerialiser &ser, VulkanChunk chunk) { AddEvent(); - DrawcallDescription draw; - draw.name = "End of Capture"; - draw.flags |= DrawFlags::Present; + ActionDescription action; + action.name = "End of Capture"; + action.flags |= ActionFlags::Present; - draw.copyDestination = m_LastPresentedImage; + action.copyDestination = m_LastPresentedImage; - AddDrawcall(draw); + AddAction(action); } return true; @@ -3558,7 +3558,7 @@ void WrappedVulkan::ReplayLog(uint32_t startEventID, uint32_t endEventID, Replay // we'll need our own command buffer if we're replaying just a subsection // of events within a single command buffer record - always if it's only - // one drawcall, or if start event ID is > 0 we assume the outside code + // one action, or if start event ID is > 0 we assume the outside code // has chosen a subsection that lies within a command buffer if(partial) { @@ -3577,29 +3577,28 @@ void WrappedVulkan::ReplayLog(uint32_t startEventID, uint32_t endEventID, Replay if(m_Partial[Primary].renderPassActive) { - const DrawcallDescription *draw = GetDrawcall(endEventID); + const ActionDescription *action = GetAction(endEventID); bool rpUnneeded = false; - // if we're only replaying a draw, and it's not a drawcall or dispatch, don't try and bind + // if we're only replaying an action, and it's not an draw or dispatch, don't try and bind // all the replay state as we don't know if it will be valid. if(replayType == eReplay_OnlyDraw) { - if(!draw) + if(!action) { rpUnneeded = true; } - else if(!(draw->flags & (DrawFlags::Drawcall | DrawFlags::Dispatch))) + else if(!(action->flags & (ActionFlags::Drawcall | ActionFlags::Dispatch))) { rpUnneeded = true; } } - // if we have an indirect draw with one draw, the subcommand will have an event which isn't - // a DrawcallDescription and selecting it will still replay that indirect draw. We need to - // detect this case and ensure we prepare the RP. - // This doesn't happen for multi-draw indirects because there each subcommand has an actual - // DrawcallDescription + // if we have an indirect action with one action, the subcommand will have an event which + // isn't a ActionDescription and selecting it will still replay that indirect action. We + // need to detect this case and ensure we prepare the RP. This doesn't happen for + // multi-action indirects because there each subcommand has an actual ActionDescription if(rpUnneeded) { APIEvent ev = GetEvent(endEventID); @@ -3646,7 +3645,7 @@ void WrappedVulkan::ReplayLog(uint32_t startEventID, uint32_t endEventID, Replay // check if the render pass is active - it could have become active // even if it wasn't before (if the above event was a CmdBeginRenderPass). - // If we began our own custom single-draw loadrp, and it was ended by a CmdEndRenderPass, + // If we began our own custom single-action loadrp, and it was ended by a CmdEndRenderPass, // we need to reverse the virtual transitions we did above, as it won't happen otherwise if(m_Partial[Primary].renderPassActive) m_RenderState.EndRenderPass(cmd); @@ -3825,14 +3824,14 @@ void WrappedVulkan::AddDebugMessage(MessageCategory c, MessageSeverity sv, Messa msg.eventId = 0; if(IsActiveReplaying(m_State)) { - // look up the EID this drawcall came from - DrawcallUse use(m_CurChunkOffset, 0); - auto it = std::lower_bound(m_DrawcallUses.begin(), m_DrawcallUses.end(), use); + // look up the EID this action came from + ActionUse use(m_CurChunkOffset, 0); + auto it = std::lower_bound(m_ActionUses.begin(), m_ActionUses.end(), use); - if(it != m_DrawcallUses.end()) + if(it != m_ActionUses.end()) msg.eventId = it->eventId; else - RDCERR("Couldn't locate drawcall use for current chunk offset %llu", m_CurChunkOffset); + RDCERR("Couldn't locate action use for current chunk offset %llu", m_CurChunkOffset); } msg.messageID = 0; msg.source = src; @@ -3870,11 +3869,11 @@ VkBool32 WrappedVulkan::DebugCallback(MessageSeverity severity, MessageCategory // during replay we can get an eventId to correspond to this message. if(IsActiveReplaying(m_State)) { - // look up the EID this drawcall came from - DrawcallUse use(m_CurChunkOffset, 0); - auto it = std::lower_bound(m_DrawcallUses.begin(), m_DrawcallUses.end(), use); + // look up the EID this action came from + ActionUse use(m_CurChunkOffset, 0); + auto it = std::lower_bound(m_ActionUses.begin(), m_ActionUses.end(), use); - if(it != m_DrawcallUses.end()) + if(it != m_ActionUses.end()) msg.eventId = it->eventId; } @@ -4092,22 +4091,22 @@ ResourceId WrappedVulkan::GetPartialCommandBuffer() return m_Partial[Primary].partialParent; } -void WrappedVulkan::AddDrawcall(const DrawcallDescription &d) +void WrappedVulkan::AddAction(const ActionDescription &a) { - m_AddedDrawcall = true; + m_AddedAction = true; - DrawcallDescription draw = d; - draw.eventId = m_LastCmdBufferID != ResourceId() - ? m_BakedCmdBufferInfo[m_LastCmdBufferID].curEventID - : m_RootEventID; - draw.drawcallId = m_LastCmdBufferID != ResourceId() - ? m_BakedCmdBufferInfo[m_LastCmdBufferID].drawCount - : m_RootDrawcallID; + ActionDescription action = a; + action.eventId = m_LastCmdBufferID != ResourceId() + ? m_BakedCmdBufferInfo[m_LastCmdBufferID].curEventID + : m_RootEventID; + action.actionId = m_LastCmdBufferID != ResourceId() + ? m_BakedCmdBufferInfo[m_LastCmdBufferID].actionCount + : m_RootActionID; for(int i = 0; i < 8; i++) - draw.outputs[i] = ResourceId(); + action.outputs[i] = ResourceId(); - draw.depthOut = ResourceId(); + action.depthOut = ResourceId(); if(m_LastCmdBufferID != ResourceId()) { @@ -4125,86 +4124,87 @@ void WrappedVulkan::AddDrawcall(const DrawcallDescription &d) rdcarray &colAtt = m_CreationInfo.m_RenderPass[rp].subpasses[sp].colorAttachments; int32_t dsAtt = m_CreationInfo.m_RenderPass[rp].subpasses[sp].depthstencilAttachment; - RDCASSERT(colAtt.size() <= ARRAY_COUNT(draw.outputs)); + RDCASSERT(colAtt.size() <= ARRAY_COUNT(action.outputs)); - for(size_t i = 0; i < ARRAY_COUNT(draw.outputs) && i < colAtt.size(); i++) + for(size_t i = 0; i < ARRAY_COUNT(action.outputs) && i < colAtt.size(); i++) { if(colAtt[i] == VK_ATTACHMENT_UNUSED) continue; RDCASSERT(colAtt[i] < atts.size()); - draw.outputs[i] = + action.outputs[i] = GetResourceManager()->GetOriginalID(m_CreationInfo.m_ImageView[atts[colAtt[i]]].image); } if(dsAtt != -1) { RDCASSERT(dsAtt < (int32_t)atts.size()); - draw.depthOut = + action.depthOut = GetResourceManager()->GetOriginalID(m_CreationInfo.m_ImageView[atts[dsAtt]].image); } } } - // markers don't increment drawcall ID - DrawFlags MarkerMask = - DrawFlags::SetMarker | DrawFlags::PushMarker | DrawFlags::PopMarker | DrawFlags::PassBoundary; - if(!(draw.flags & MarkerMask)) + // markers don't increment action ID + ActionFlags MarkerMask = ActionFlags::SetMarker | ActionFlags::PushMarker | + ActionFlags::PopMarker | ActionFlags::PassBoundary; + if(!(action.flags & MarkerMask)) { if(m_LastCmdBufferID != ResourceId()) - m_BakedCmdBufferInfo[m_LastCmdBufferID].drawCount++; + m_BakedCmdBufferInfo[m_LastCmdBufferID].actionCount++; else - m_RootDrawcallID++; + m_RootActionID++; } - draw.events.swap(m_LastCmdBufferID != ResourceId() ? m_BakedCmdBufferInfo[m_LastCmdBufferID].curEvents - : m_RootEvents); + action.events.swap(m_LastCmdBufferID != ResourceId() + ? m_BakedCmdBufferInfo[m_LastCmdBufferID].curEvents + : m_RootEvents); - // should have at least the root drawcall here, push this drawcall + // should have at least the root action here, push this action // onto the back's children list. - if(!GetDrawcallStack().empty()) + if(!GetActionStack().empty()) { - VulkanDrawcallTreeNode node(draw); + VulkanActionTreeNode node(action); node.resourceUsage.swap(m_BakedCmdBufferInfo[m_LastCmdBufferID].resourceUsage); if(m_LastCmdBufferID != ResourceId()) AddUsage(node, m_BakedCmdBufferInfo[m_LastCmdBufferID].debugMessages); - node.children.reserve(draw.children.size()); - for(const DrawcallDescription &child : draw.children) - node.children.push_back(VulkanDrawcallTreeNode(child)); - GetDrawcallStack().back()->children.push_back(node); + node.children.reserve(action.children.size()); + for(const ActionDescription &child : action.children) + node.children.push_back(VulkanActionTreeNode(child)); + GetActionStack().back()->children.push_back(node); } else - RDCERR("Somehow lost drawcall stack!"); + RDCERR("Somehow lost action stack!"); } -void WrappedVulkan::AddUsage(VulkanDrawcallTreeNode &drawNode, rdcarray &debugMessages) +void WrappedVulkan::AddUsage(VulkanActionTreeNode &actionNode, rdcarray &debugMessages) { - DrawcallDescription &d = drawNode.draw; + ActionDescription &action = actionNode.action; const VulkanRenderState &state = m_BakedCmdBufferInfo[m_LastCmdBufferID].state; VulkanCreationInfo &c = m_CreationInfo; - uint32_t e = d.eventId; + uint32_t eid = action.eventId; - DrawFlags DrawMask = DrawFlags::Drawcall | DrawFlags::Dispatch; - if(!(d.flags & DrawMask)) + ActionFlags DrawMask = ActionFlags::Drawcall | ActionFlags::Dispatch; + if(!(action.flags & DrawMask)) return; ////////////////////////////// // Vertex input - if(d.flags & DrawFlags::Indexed && state.ibuffer.buf != ResourceId()) - drawNode.resourceUsage.push_back( - make_rdcpair(state.ibuffer.buf, EventUsage(e, ResourceUsage::IndexBuffer))); + if(action.flags & ActionFlags::Indexed && state.ibuffer.buf != ResourceId()) + actionNode.resourceUsage.push_back( + make_rdcpair(state.ibuffer.buf, EventUsage(eid, ResourceUsage::IndexBuffer))); for(size_t i = 0; i < state.vbuffers.size(); i++) { if(state.vbuffers[i].buf != ResourceId()) { - drawNode.resourceUsage.push_back( - make_rdcpair(state.vbuffers[i].buf, EventUsage(e, ResourceUsage::VertexBuffer))); + actionNode.resourceUsage.push_back( + make_rdcpair(state.vbuffers[i].buf, EventUsage(eid, ResourceUsage::VertexBuffer))); } } @@ -4213,8 +4213,8 @@ void WrappedVulkan::AddUsage(VulkanDrawcallTreeNode &drawNode, rdcarray &fbattachments) { VulkanCreationInfo &c = m_CreationInfo; - uint32_t e = drawNode.draw.eventId; + uint32_t e = actionNode.action.eventId; if(renderPass != ResourceId() && framebuffer != ResourceId()) { @@ -4426,7 +4426,7 @@ void WrappedVulkan::AddFramebufferUsage(VulkanDrawcallTreeNode &drawNode, Resour uint32_t att = sub.inputAttachments[i]; if(att == VK_ATTACHMENT_UNUSED) continue; - drawNode.resourceUsage.push_back( + actionNode.resourceUsage.push_back( make_rdcpair(c.m_ImageView[fbattachments[att]].image, EventUsage(e, ResourceUsage::InputTarget, fbattachments[att]))); } @@ -4436,7 +4436,7 @@ void WrappedVulkan::AddFramebufferUsage(VulkanDrawcallTreeNode &drawNode, Resour uint32_t att = sub.colorAttachments[i]; if(att == VK_ATTACHMENT_UNUSED) continue; - drawNode.resourceUsage.push_back( + actionNode.resourceUsage.push_back( make_rdcpair(c.m_ImageView[fbattachments[att]].image, EventUsage(e, ResourceUsage::ColorTarget, fbattachments[att]))); } @@ -4444,7 +4444,7 @@ void WrappedVulkan::AddFramebufferUsage(VulkanDrawcallTreeNode &drawNode, Resour if(sub.depthstencilAttachment >= 0) { int32_t att = sub.depthstencilAttachment; - drawNode.resourceUsage.push_back( + actionNode.resourceUsage.push_back( make_rdcpair(c.m_ImageView[fbattachments[att]].image, EventUsage(e, ResourceUsage::DepthStencilTarget, fbattachments[att]))); } @@ -4452,15 +4452,15 @@ void WrappedVulkan::AddFramebufferUsage(VulkanDrawcallTreeNode &drawNode, Resour } } -void WrappedVulkan::AddFramebufferUsageAllChildren(VulkanDrawcallTreeNode &drawNode, +void WrappedVulkan::AddFramebufferUsageAllChildren(VulkanActionTreeNode &actionNode, ResourceId renderPass, ResourceId framebuffer, uint32_t subpass, const rdcarray &fbattachments) { - for(VulkanDrawcallTreeNode &c : drawNode.children) + for(VulkanActionTreeNode &c : actionNode.children) AddFramebufferUsageAllChildren(c, renderPass, framebuffer, subpass, fbattachments); - AddFramebufferUsage(drawNode, renderPass, framebuffer, subpass, fbattachments); + AddFramebufferUsage(actionNode, renderPass, framebuffer, subpass, fbattachments); } void WrappedVulkan::AddEvent() @@ -4506,12 +4506,12 @@ const APIEvent &WrappedVulkan::GetEvent(uint32_t eventId) return m_Events[RDCMIN(idx, m_Events.size() - 1)]; } -const DrawcallDescription *WrappedVulkan::GetDrawcall(uint32_t eventId) +const ActionDescription *WrappedVulkan::GetAction(uint32_t eventId) { - if(eventId >= m_Drawcalls.size()) + if(eventId >= m_Actions.size()) return NULL; - return m_Drawcalls[eventId]; + return m_Actions[eventId]; } uint32_t WrappedVulkan::FindCommandQueueFamily(ResourceId cmdId) @@ -4614,36 +4614,35 @@ void WrappedVulkan::UpdateImageStates(const rdcflatmap & } } -void WrappedVulkan::ReplayDraw(VkCommandBuffer cmd, const DrawcallDescription &drawcall) +void WrappedVulkan::ReplayDraw(VkCommandBuffer cmd, const ActionDescription &action) { - // if this isn't a multidraw (or it's the first draw in a multidraw, it's fairly easy - if(drawcall.drawIndex == 0) + // if this isn't a multidraw (or it's the first action in a multidraw, it's fairly easy + if(action.drawIndex == 0) { - if(drawcall.flags & DrawFlags::Indexed) - ObjDisp(cmd)->CmdDrawIndexed(Unwrap(cmd), drawcall.numIndices, drawcall.numInstances, - drawcall.indexOffset, drawcall.baseVertex, - drawcall.instanceOffset); + if(action.flags & ActionFlags::Indexed) + ObjDisp(cmd)->CmdDrawIndexed(Unwrap(cmd), action.numIndices, action.numInstances, + action.indexOffset, action.baseVertex, action.instanceOffset); else - ObjDisp(cmd)->CmdDraw(Unwrap(cmd), drawcall.numIndices, drawcall.numInstances, - drawcall.vertexOffset, drawcall.instanceOffset); + ObjDisp(cmd)->CmdDraw(Unwrap(cmd), action.numIndices, action.numInstances, + action.vertexOffset, action.instanceOffset); } else { // otherwise it's a bit more complex, we need to set up a multidraw with the first N draws nop'd // out and the parameters added into the last one - VkMarkerRegion::Begin(StringFormat::Fmt("ReplayDraw(drawIndex=%u)", drawcall.drawIndex), cmd); + VkMarkerRegion::Begin(StringFormat::Fmt("ReplayDraw(drawIndex=%u)", action.drawIndex), cmd); bytebuf params; - if(drawcall.flags & DrawFlags::Indexed) + if(action.flags & ActionFlags::Indexed) { VkDrawIndexedIndirectCommand drawParams; - drawParams.indexCount = drawcall.numIndices; - drawParams.instanceCount = drawcall.numInstances; - drawParams.firstIndex = drawcall.indexOffset; - drawParams.vertexOffset = drawcall.baseVertex; - drawParams.firstInstance = drawcall.instanceOffset; + drawParams.indexCount = action.numIndices; + drawParams.instanceCount = action.numInstances; + drawParams.firstIndex = action.indexOffset; + drawParams.vertexOffset = action.baseVertex; + drawParams.firstInstance = action.instanceOffset; params.resize(sizeof(drawParams)); memcpy(params.data(), &drawParams, sizeof(drawParams)); @@ -4652,17 +4651,17 @@ void WrappedVulkan::ReplayDraw(VkCommandBuffer cmd, const DrawcallDescription &d { VkDrawIndirectCommand drawParams; - drawParams.vertexCount = drawcall.numIndices; - drawParams.instanceCount = drawcall.numInstances; - drawParams.firstVertex = drawcall.vertexOffset; - drawParams.firstInstance = drawcall.instanceOffset; + drawParams.vertexCount = action.numIndices; + drawParams.instanceCount = action.numInstances; + drawParams.firstVertex = action.vertexOffset; + drawParams.firstInstance = action.instanceOffset; params.resize(sizeof(drawParams)); memcpy(params.data(), &drawParams, sizeof(drawParams)); } // ensure the custom buffer is large enough - VkDeviceSize bufLength = params.size() * (drawcall.drawIndex + 1); + VkDeviceSize bufLength = params.size() * (action.drawIndex + 1); RDCASSERT(bufLength <= m_IndirectBufferSize, bufLength, m_IndirectBufferSize); @@ -4693,7 +4692,7 @@ void WrappedVulkan::ReplayDraw(VkCommandBuffer cmd, const DrawcallDescription &d // upload the parameters for the draw we want ObjDisp(cmd)->CmdUpdateBuffer(Unwrap(cmd), Unwrap(m_IndirectBuffer.buf), - m_IndirectBufferSize + params.size() * drawcall.drawIndex, + m_IndirectBufferSize + params.size() * action.drawIndex, params.size(), params.data()); // finally wait for copy to complete before drawing from it @@ -4702,13 +4701,13 @@ void WrappedVulkan::ReplayDraw(VkCommandBuffer cmd, const DrawcallDescription &d DoPipelineBarrier(cmd, 1, &bufBarrier); - if(drawcall.flags & DrawFlags::Indexed) + if(action.flags & ActionFlags::Indexed) ObjDisp(cmd)->CmdDrawIndexedIndirect(Unwrap(cmd), Unwrap(m_IndirectBuffer.buf), - m_IndirectBufferSize, drawcall.drawIndex + 1, + m_IndirectBufferSize, action.drawIndex + 1, (uint32_t)params.size()); else ObjDisp(cmd)->CmdDrawIndirect(Unwrap(cmd), Unwrap(m_IndirectBuffer.buf), m_IndirectBufferSize, - drawcall.drawIndex + 1, (uint32_t)params.size()); + action.drawIndex + 1, (uint32_t)params.size()); VkMarkerRegion::End(cmd); } diff --git a/renderdoc/driver/vulkan/vk_core.h b/renderdoc/driver/vulkan/vk_core.h index 59280f5e7..6e8607291 100644 --- a/renderdoc/driver/vulkan/vk_core.h +++ b/renderdoc/driver/vulkan/vk_core.h @@ -117,12 +117,12 @@ struct VkIndirectPatchData ResourceId commandBuffer; }; -struct VulkanDrawcallTreeNode +struct VulkanActionTreeNode { - VulkanDrawcallTreeNode() {} - explicit VulkanDrawcallTreeNode(const DrawcallDescription &d) : draw(d) {} - DrawcallDescription draw; - rdcarray children; + VulkanActionTreeNode() {} + explicit VulkanActionTreeNode(const ActionDescription &a) : action(a) {} + ActionDescription action; + rdcarray children; VkIndirectPatchData indirectPatch; @@ -130,14 +130,13 @@ struct VulkanDrawcallTreeNode rdcarray executedCmds; - VulkanDrawcallTreeNode &operator=(const DrawcallDescription &d) + VulkanActionTreeNode &operator=(const ActionDescription &a) { - *this = VulkanDrawcallTreeNode(d); + *this = VulkanActionTreeNode(a); return *this; } - void InsertAndUpdateIDs(const VulkanDrawcallTreeNode &child, uint32_t baseEventID, - uint32_t baseDrawID) + void InsertAndUpdateIDs(const VulkanActionTreeNode &child, uint32_t baseEventID, uint32_t baseDrawID) { resourceUsage.reserve(child.resourceUsage.size()); for(size_t i = 0; i < child.resourceUsage.size(); i++) @@ -156,10 +155,10 @@ struct VulkanDrawcallTreeNode void UpdateIDs(uint32_t baseEventID, uint32_t baseDrawID) { - draw.eventId += baseEventID; - draw.drawcallId += baseDrawID; + action.eventId += baseEventID; + action.actionId += baseDrawID; - for(APIEvent &ev : draw.events) + for(APIEvent &ev : action.events) ev.eventId += baseEventID; for(size_t i = 0; i < resourceUsage.size(); i++) @@ -169,16 +168,16 @@ struct VulkanDrawcallTreeNode children[i].UpdateIDs(baseEventID, baseDrawID); } - rdcarray Bake() + rdcarray Bake() { - rdcarray ret; + rdcarray ret; if(children.empty()) return ret; ret.resize(children.size()); for(size_t i = 0; i < children.size(); i++) { - ret[i] = children[i].draw; + ret[i] = children[i].action; ret[i].children = children[i].Bake(); } @@ -197,7 +196,7 @@ struct VulkanDrawcallTreeNode // must be at the start of any function that serialises #define CACHE_THREAD_SERIALISER() WriteSerialiser &ser = GetThreadSerialiser(); -struct VulkanDrawcallCallback +struct VulkanActionCallback { // the three callbacks are used to allow the callback implementor to either // do a modified draw before or after the real thing. @@ -224,9 +223,9 @@ struct VulkanDrawcallCallback virtual void PostRedispatch(uint32_t eid, VkCommandBuffer cmd) = 0; // finally, these are for copy/blit/resolve/clear/etc - virtual void PreMisc(uint32_t eid, DrawFlags flags, VkCommandBuffer cmd) = 0; - virtual bool PostMisc(uint32_t eid, DrawFlags flags, VkCommandBuffer cmd) = 0; - virtual void PostRemisc(uint32_t eid, DrawFlags flags, VkCommandBuffer cmd) = 0; + virtual void PreMisc(uint32_t eid, ActionFlags flags, VkCommandBuffer cmd) = 0; + virtual bool PostMisc(uint32_t eid, ActionFlags flags, VkCommandBuffer cmd) = 0; + virtual void PostRemisc(uint32_t eid, ActionFlags flags, VkCommandBuffer cmd) = 0; // called immediately before the command buffer is ended virtual void PreEndCommandBuffer(VkCommandBuffer cmd) = 0; @@ -246,7 +245,7 @@ struct VulkanDrawcallCallback virtual void PreCmdExecute(uint32_t baseEid, uint32_t secondaryFirst, uint32_t secondaryLast, VkCommandBuffer cmd) = 0; - // called after vkCmdExecuteCommands with a range for the draw inside the + // called after vkCmdExecuteCommands with a range for the action inside the // seocndary command buffer. virtual void PostCmdExecute(uint32_t baseEid, uint32_t secondaryFirst, uint32_t secondaryLast, VkCommandBuffer cmd) = 0; @@ -349,7 +348,7 @@ private: Threading::RWLock m_CapTransitionLock; - VulkanDrawcallCallback *m_DrawcallCallback; + VulkanActionCallback *m_ActionCallback; void *m_SubmitChain; uint64_t m_TimeBase = 0; @@ -369,15 +368,15 @@ private: // util function to handle fetching the right eventId, calling any // aliases then calling PreDraw/PreDispatch. - uint32_t HandlePreCallback(VkCommandBuffer commandBuffer, DrawFlags type = DrawFlags::Drawcall, - uint32_t multiDrawOffset = 0); + uint32_t HandlePreCallback(VkCommandBuffer commandBuffer, + ActionFlags type = ActionFlags::Drawcall, uint32_t multiDrawOffset = 0); rdcarray m_SupportedWindowSystems; uint32_t m_FrameCounter = 0; rdcarray m_CapturedFrames; - rdcarray m_Drawcalls; + rdcarray m_Actions; struct PhysicalDeviceData { @@ -577,20 +576,20 @@ private: struct BakedCmdBufferInfo { BakedCmdBufferInfo() - : draw(NULL), + : action(NULL), eventCount(0), curEventID(0), - drawCount(0), + actionCount(0), level(VK_COMMAND_BUFFER_LEVEL_PRIMARY), beginFlags(0), markerCount(0) { } - ~BakedCmdBufferInfo() { SAFE_DELETE(draw); } + ~BakedCmdBufferInfo() { SAFE_DELETE(action); } rdcarray curEvents; rdcarray debugMessages; - rdcarray drawStack; + rdcarray actionStack; rdcarray indirectCopies; @@ -612,10 +611,10 @@ private: ResourceId pushDescriptorID[2][64]; - VulkanDrawcallTreeNode *draw; // the root draw to copy from when submitting + VulkanActionTreeNode *action; // the root action to copy from when submitting uint32_t eventCount; // how many events are in this cmd buffer, for quick skipping uint32_t curEventID; // current event ID while reading or executing - uint32_t drawCount; // similar to above + uint32_t actionCount; // similar to above }; // on replay, the current command buffer for the last chunk we @@ -623,23 +622,23 @@ private: ResourceId m_LastCmdBufferID; // this is a list of uint64_t file offset -> uint32_t EIDs of where each - // drawcall is used. E.g. the drawcall at offset 873954 is EID 50. If a + // action is used. E.g. the action at offset 873954 is EID 50. If a // command buffer is submitted more than once, there may be more than - // one entry here - the drawcall will be aliased among several EIDs, with + // one entry here - the action will be aliased among several EIDs, with // the first one being the 'primary' - struct DrawcallUse + struct ActionUse { - DrawcallUse(uint64_t offs, uint32_t eid) : fileOffset(offs), eventId(eid) {} + ActionUse(uint64_t offs, uint32_t eid) : fileOffset(offs), eventId(eid) {} uint64_t fileOffset; uint32_t eventId; - bool operator<(const DrawcallUse &o) const + bool operator<(const ActionUse &o) const { if(fileOffset != o.fileOffset) return fileOffset < o.fileOffset; return eventId < o.eventId; } }; - rdcarray m_DrawcallUses; + rdcarray m_ActionUses; enum PartialReplayIndex { @@ -695,7 +694,7 @@ private: bool renderPassActive; } m_Partial[ePartialNum]; - // if we're replaying just a single draw or a particular command + // if we're replaying just a single action or a particular command // buffer subsection of command events, we don't go through the // whole original command buffers to set up the partial replay, // so we just set this command buffer @@ -814,7 +813,7 @@ private: // current descriptor set contents std::map m_DescriptorSetState; - // data for a baked command buffer - its drawcalls and events, ready to submit + // data for a baked command buffer - its actions and events, ready to submit std::map m_BakedCmdBufferInfo; // immutable creation data VulkanCreationInfo m_CreationInfo; @@ -905,11 +904,11 @@ private: void ApplyInitialContents(); rdcarray m_RootEvents, m_Events; - bool m_AddedDrawcall; + bool m_AddedAction; uint64_t m_CurChunkOffset; SDChunkMetaData m_ChunkMetadata; - uint32_t m_RootEventID, m_RootDrawcallID; + uint32_t m_RootEventID, m_RootActionID; uint32_t m_FirstEventID, m_LastEventID; VulkanChunk m_LastChunk; @@ -919,7 +918,7 @@ private: ReplayStatus m_FailedReplayStatus = ReplayStatus::APIReplayFailed; - VulkanDrawcallTreeNode m_ParentDrawcall; + VulkanActionTreeNode m_ParentAction; bool m_LayersEnabled[VkCheckLayer_Max] = {}; @@ -928,35 +927,35 @@ private: const std::set &supportedExtensions); bool PatchIndirectDraw(size_t drawIndex, uint32_t paramStride, VkIndirectPatchType type, - DrawcallDescription &draw, byte *&argptr, byte *argend); - void InsertDrawsAndRefreshIDs(BakedCmdBufferInfo &cmdBufInfo); + ActionDescription &action, byte *&argptr, byte *argend); + void InsertActionsAndRefreshIDs(BakedCmdBufferInfo &cmdBufInfo); void CaptureQueueSubmit(VkQueue queue, const rdcarray &commandBuffers, VkFence fence); void ReplayQueueSubmit(VkQueue queue, VkSubmitInfo2KHR submitInfo, rdcstr basename); void DoSubmit(VkQueue queue, VkSubmitInfo2KHR submitInfo); - rdcarray m_DrawcallStack; + rdcarray m_ActionStack; - rdcarray &GetDrawcallStack() + rdcarray &GetActionStack() { if(m_LastCmdBufferID != ResourceId()) - return m_BakedCmdBufferInfo[m_LastCmdBufferID].drawStack; + return m_BakedCmdBufferInfo[m_LastCmdBufferID].actionStack; - return m_DrawcallStack; + return m_ActionStack; } bool ProcessChunk(ReadSerialiser &ser, VulkanChunk chunk); ReplayStatus ContextReplayLog(CaptureState readType, uint32_t startEventID, uint32_t endEventID, bool partial); bool ContextProcessChunk(ReadSerialiser &ser, VulkanChunk chunk); - void AddDrawcall(const DrawcallDescription &d); + void AddAction(const ActionDescription &a); void AddEvent(); - void AddUsage(VulkanDrawcallTreeNode &drawNode, rdcarray &debugMessages); - void AddFramebufferUsage(VulkanDrawcallTreeNode &drawNode, ResourceId renderPass, + void AddUsage(VulkanActionTreeNode &actionNode, rdcarray &debugMessages); + void AddFramebufferUsage(VulkanActionTreeNode &actionNode, ResourceId renderPass, ResourceId framebuffer, uint32_t subpass, const rdcarray &fbattachments); - void AddFramebufferUsageAllChildren(VulkanDrawcallTreeNode &drawNode, ResourceId renderPass, + void AddFramebufferUsageAllChildren(VulkanActionTreeNode &actionNode, ResourceId renderPass, ResourceId framebuffer, uint32_t subpass, const rdcarray &fbattachments); @@ -1038,13 +1037,13 @@ public: } void Shutdown(); void ReplayLog(uint32_t startEventID, uint32_t endEventID, ReplayLogType replayType); - void ReplayDraw(VkCommandBuffer cmd, const DrawcallDescription &drawcall); + void ReplayDraw(VkCommandBuffer cmd, const ActionDescription &action); ReplayStatus ReadLogInitialisation(RDCFile *rdc, bool storeStructuredBuffers); SDFile &GetStructuredFile() { return *m_StructuredFile; } const APIEvent &GetEvent(uint32_t eventId); uint32_t GetMaxEID() { return m_Events.back().eventId; } - const DrawcallDescription *GetDrawcall(uint32_t eventId); + const ActionDescription *GetAction(uint32_t eventId); ResourceId GetDescLayoutForDescSet(ResourceId descSet) { @@ -1107,7 +1106,7 @@ public: bool NULLDescriptorsAllowed() const { return m_NULLDescriptorsAllowed; } bool ExtendedDynamicState() const { return m_ExtendedDynState; } VulkanRenderState &GetRenderState() { return m_RenderState; } - void SetDrawcallCB(VulkanDrawcallCallback *cb) { m_DrawcallCallback = cb; } + void SetActionCB(VulkanActionCallback *cb) { m_ActionCallback = cb; } void SetSubmitChain(void *submitChain) { m_SubmitChain = submitChain; } static bool IsSupportedExtension(const char *extName); static void FilterToSupportedExtensions(rdcarray &exts, diff --git a/renderdoc/driver/vulkan/vk_counters.cpp b/renderdoc/driver/vulkan/vk_counters.cpp index 563db0aad..06b2e05ff 100644 --- a/renderdoc/driver/vulkan/vk_counters.cpp +++ b/renderdoc/driver/vulkan/vk_counters.cpp @@ -330,16 +330,16 @@ CounterDescription VulkanReplay::DescribeCounter(GPUCounter counterID) return desc; } -struct VulkanAMDDrawCallback : public VulkanDrawcallCallback +struct VulkanAMDActionCallback : public VulkanActionCallback { - VulkanAMDDrawCallback(WrappedVulkan *dev, VulkanReplay *rp, uint32_t &sampleIndex, - rdcarray &eventIDs) + VulkanAMDActionCallback(WrappedVulkan *dev, VulkanReplay *rp, uint32_t &sampleIndex, + rdcarray &eventIDs) : m_pDriver(dev), m_pReplay(rp), m_pSampleId(&sampleIndex), m_pEventIds(&eventIDs) { - m_pDriver->SetDrawcallCB(this); + m_pDriver->SetActionCB(this); } - virtual ~VulkanAMDDrawCallback() { m_pDriver->SetDrawcallCB(NULL); } + virtual ~VulkanAMDActionCallback() { m_pDriver->SetActionCB(NULL); } void PreDraw(uint32_t eid, VkCommandBuffer cmd) override { m_pEventIds->push_back(eid); @@ -384,21 +384,21 @@ struct VulkanAMDDrawCallback : public VulkanDrawcallCallback void PreDispatch(uint32_t eid, VkCommandBuffer cmd) override { PreDraw(eid, cmd); } bool PostDispatch(uint32_t eid, VkCommandBuffer cmd) override { return PostDraw(eid, cmd); } void PostRedispatch(uint32_t eid, VkCommandBuffer cmd) override { PostRedraw(eid, cmd); } - void PreMisc(uint32_t eid, DrawFlags flags, VkCommandBuffer cmd) override + void PreMisc(uint32_t eid, ActionFlags flags, VkCommandBuffer cmd) override { - if(flags & DrawFlags::PassBoundary) + if(flags & ActionFlags::PassBoundary) return; PreDraw(eid, cmd); } - bool PostMisc(uint32_t eid, DrawFlags flags, VkCommandBuffer cmd) override + bool PostMisc(uint32_t eid, ActionFlags flags, VkCommandBuffer cmd) override { - if(flags & DrawFlags::PassBoundary) + if(flags & ActionFlags::PassBoundary) return false; return PostDraw(eid, cmd); } - void PostRemisc(uint32_t eid, DrawFlags flags, VkCommandBuffer cmd) override + void PostRemisc(uint32_t eid, ActionFlags flags, VkCommandBuffer cmd) override { - if(flags & DrawFlags::PassBoundary) + if(flags & ActionFlags::PassBoundary) return; PostRedraw(eid, cmd); } @@ -434,7 +434,7 @@ void VulkanReplay::FillTimersAMD(uint32_t *eventStartID, uint32_t *sampleIndex, { uint32_t maxEID = m_pDriver->GetMaxEID(); - m_pAMDDrawCallback = new VulkanAMDDrawCallback(m_pDriver, this, *sampleIndex, *eventIDs); + m_pAMDActionCallback = new VulkanAMDActionCallback(m_pDriver, this, *sampleIndex, *eventIDs); // replay the events to perform all the queries m_pDriver->ReplayLog(*eventStartID, maxEID, eReplay_Full); @@ -490,13 +490,13 @@ rdcarray VulkanReplay::FetchCountersAMD(const rdcarray ret = m_pAMDCounters->GetCounterData(sessionID, sampleIndex, eventIDs, counters); - for(size_t i = 0; i < m_pAMDDrawCallback->m_AliasEvents.size(); i++) + for(size_t i = 0; i < m_pAMDActionCallback->m_AliasEvents.size(); i++) { for(size_t c = 0; c < counters.size(); c++) { CounterResult search; search.counter = counters[c]; - search.eventId = m_pAMDDrawCallback->m_AliasEvents[i].first; + search.eventId = m_pAMDActionCallback->m_AliasEvents[i].first; // find the result we're aliasing int32_t idx = ret.indexOf(search); @@ -504,7 +504,7 @@ rdcarray VulkanReplay::FetchCountersAMD(const rdcarraym_AliasEvents[i].second; + aliased.eventId = m_pAMDActionCallback->m_AliasEvents[i].second; ret.push_back(aliased); } else @@ -515,7 +515,7 @@ rdcarray VulkanReplay::FetchCountersAMD(const rdcarray VulkanReplay::FetchCountersAMD(const rdcarraySetDrawcallCB(this); + m_pDriver->SetActionCB(this); } - ~VulkanKHRCallback() { m_pDriver->SetDrawcallCB(NULL); } + ~VulkanKHRCallback() { m_pDriver->SetActionCB(NULL); } void PreDraw(uint32_t eid, VkCommandBuffer cmd) override { ObjDisp(cmd)->CmdBeginQuery(Unwrap(cmd), m_QueryPool, (uint32_t)m_Results.size(), 0); @@ -550,12 +550,12 @@ struct VulkanKHRCallback : public VulkanDrawcallCallback void PreDispatch(uint32_t eid, VkCommandBuffer cmd) override { PreDraw(eid, cmd); } bool PostDispatch(uint32_t eid, VkCommandBuffer cmd) override { return PostDraw(eid, cmd); } void PostRedispatch(uint32_t eid, VkCommandBuffer cmd) override { PostRedraw(eid, cmd); } - void PreMisc(uint32_t eid, DrawFlags flags, VkCommandBuffer cmd) override { PreDraw(eid, cmd); } - bool PostMisc(uint32_t eid, DrawFlags flags, VkCommandBuffer cmd) override + void PreMisc(uint32_t eid, ActionFlags flags, VkCommandBuffer cmd) override { PreDraw(eid, cmd); } + bool PostMisc(uint32_t eid, ActionFlags flags, VkCommandBuffer cmd) override { return PostDraw(eid, cmd); } - void PostRemisc(uint32_t eid, DrawFlags flags, VkCommandBuffer cmd) override + void PostRemisc(uint32_t eid, ActionFlags flags, VkCommandBuffer cmd) override { PostRedraw(eid, cmd); } @@ -711,7 +711,7 @@ rdcarray VulkanReplay::FetchCountersKHR(const rdcarraySetDrawcallCB(this); + m_pDriver->SetActionCB(this); } - ~VulkanGPUTimerCallback() { m_pDriver->SetDrawcallCB(NULL); } + ~VulkanGPUTimerCallback() { m_pDriver->SetActionCB(NULL); } void PreDraw(uint32_t eid, VkCommandBuffer cmd) override { if(m_OcclusionQueryPool != VK_NULL_HANDLE) @@ -752,21 +752,21 @@ struct VulkanGPUTimerCallback : public VulkanDrawcallCallback void PreDispatch(uint32_t eid, VkCommandBuffer cmd) override { PreDraw(eid, cmd); } bool PostDispatch(uint32_t eid, VkCommandBuffer cmd) override { return PostDraw(eid, cmd); } void PostRedispatch(uint32_t eid, VkCommandBuffer cmd) override { PostRedraw(eid, cmd); } - void PreMisc(uint32_t eid, DrawFlags flags, VkCommandBuffer cmd) override + void PreMisc(uint32_t eid, ActionFlags flags, VkCommandBuffer cmd) override { - if(flags & DrawFlags::PassBoundary) + if(flags & ActionFlags::PassBoundary) return; PreDraw(eid, cmd); } - bool PostMisc(uint32_t eid, DrawFlags flags, VkCommandBuffer cmd) override + bool PostMisc(uint32_t eid, ActionFlags flags, VkCommandBuffer cmd) override { - if(flags & DrawFlags::PassBoundary) + if(flags & ActionFlags::PassBoundary) return false; return PostDraw(eid, cmd); } - void PostRemisc(uint32_t eid, DrawFlags flags, VkCommandBuffer cmd) override + void PostRemisc(uint32_t eid, ActionFlags flags, VkCommandBuffer cmd) override { - if(flags & DrawFlags::PassBoundary) + if(flags & ActionFlags::PassBoundary) return; PostRedraw(eid, cmd); } diff --git a/renderdoc/driver/vulkan/vk_debug.h b/renderdoc/driver/vulkan/vk_debug.h index 3295c7f66..b2342719a 100644 --- a/renderdoc/driver/vulkan/vk_debug.h +++ b/renderdoc/driver/vulkan/vk_debug.h @@ -90,7 +90,7 @@ public: void PatchOutputLocation(VkShaderModule &mod, BuiltinShader shaderType, uint32_t framebufferIndex); void PatchFixedColShader(VkShaderModule &mod, float col[4]); - void PatchLineStripIndexBuffer(const DrawcallDescription *draw, GPUBuffer &indexBuffer, + void PatchLineStripIndexBuffer(const ActionDescription *action, GPUBuffer &indexBuffer, uint32_t &indexCount); bool PixelHistorySetupResources(PixelHistoryResources &resources, VkImage targetImage, diff --git a/renderdoc/driver/vulkan/vk_overlay.cpp b/renderdoc/driver/vulkan/vk_overlay.cpp index df7c57b62..2b0be09ce 100644 --- a/renderdoc/driver/vulkan/vk_overlay.cpp +++ b/renderdoc/driver/vulkan/vk_overlay.cpp @@ -39,17 +39,17 @@ #define VULKAN 1 #include "data/glsl/glsl_ubos_cpp.h" -struct VulkanQuadOverdrawCallback : public VulkanDrawcallCallback +struct VulkanQuadOverdrawCallback : public VulkanActionCallback { VulkanQuadOverdrawCallback(WrappedVulkan *vk, VkDescriptorSetLayout descSetLayout, VkDescriptorSet descSet, const rdcarray &events) : m_pDriver(vk), m_DescSetLayout(descSetLayout), m_DescSet(descSet), m_Events(events) { - m_pDriver->SetDrawcallCB(this); + m_pDriver->SetActionCB(this); } ~VulkanQuadOverdrawCallback() { - m_pDriver->SetDrawcallCB(NULL); + m_pDriver->SetActionCB(NULL); VkDevice dev = m_pDriver->GetDev(); @@ -258,9 +258,9 @@ struct VulkanQuadOverdrawCallback : public VulkanDrawcallCallback bool PostDispatch(uint32_t eid, VkCommandBuffer cmd) { return false; } void PostRedispatch(uint32_t eid, VkCommandBuffer cmd) {} // Ditto copy/etc - void PreMisc(uint32_t eid, DrawFlags flags, VkCommandBuffer cmd) {} - bool PostMisc(uint32_t eid, DrawFlags flags, VkCommandBuffer cmd) { return false; } - void PostRemisc(uint32_t eid, DrawFlags flags, VkCommandBuffer cmd) {} + void PreMisc(uint32_t eid, ActionFlags flags, VkCommandBuffer cmd) {} + bool PostMisc(uint32_t eid, ActionFlags flags, VkCommandBuffer cmd) { return false; } + void PostRemisc(uint32_t eid, ActionFlags flags, VkCommandBuffer cmd) {} void PreEndCommandBuffer(VkCommandBuffer cmd) {} void AliasEvent(uint32_t primary, uint32_t alias) { @@ -396,7 +396,7 @@ void VulkanDebugManager::PatchFixedColShader(VkShaderModule &mod, float col[4]) RDCASSERTEQUAL(vkr, VK_SUCCESS); } -void VulkanDebugManager::PatchLineStripIndexBuffer(const DrawcallDescription *draw, +void VulkanDebugManager::PatchLineStripIndexBuffer(const ActionDescription *action, GPUBuffer &indexBuffer, uint32_t &indexCount) { VulkanRenderState &rs = m_pDriver->m_RenderState; @@ -407,11 +407,11 @@ void VulkanDebugManager::PatchLineStripIndexBuffer(const DrawcallDescription *dr uint16_t *idx16 = NULL; uint32_t *idx32 = NULL; - if(draw->flags & DrawFlags::Indexed) + if(action->flags & ActionFlags::Indexed) { GetBufferData(rs.ibuffer.buf, - rs.ibuffer.offs + uint64_t(draw->indexOffset) * rs.ibuffer.bytewidth, - uint64_t(draw->numIndices) * rs.ibuffer.bytewidth, indices); + rs.ibuffer.offs + uint64_t(action->indexOffset) * rs.ibuffer.bytewidth, + uint64_t(action->numIndices) * rs.ibuffer.bytewidth, indices); if(rs.ibuffer.bytewidth == 4) idx32 = (uint32_t *)indices.data(); @@ -424,7 +424,7 @@ void VulkanDebugManager::PatchLineStripIndexBuffer(const DrawcallDescription *dr // we just patch up to 32-bit since we'll be adding more indices and we might overflow 16-bit. rdcarray patchedIndices; - ::PatchLineStripIndexBuffer(draw, MakePrimitiveTopology(rs.primitiveTopology, 3), idx8, idx16, + ::PatchLineStripIndexBuffer(action, MakePrimitiveTopology(rs.primitiveTopology, 3), idx8, idx16, idx32, patchedIndices); indexBuffer.Create(m_pDriver, m_Device, patchedIndices.size() * sizeof(uint32_t), 1, @@ -746,16 +746,16 @@ ResourceId VulkanReplay::RenderOverlay(ResourceId texid, FloatVector clearCol, D DoPipelineBarrier(cmd, 1, &barrier); } - const DrawcallDescription *mainDraw = m_pDriver->GetDrawcall(eventId); + const ActionDescription *mainDraw = m_pDriver->GetAction(eventId); const VulkanCreationInfo::Pipeline &pipeInfo = m_pDriver->m_CreationInfo.m_Pipeline[m_pDriver->m_RenderState.graphics.pipeline]; // Secondary commands can't have render passes - if((mainDraw && !(mainDraw->flags & DrawFlags::Drawcall)) || + if((mainDraw && !(mainDraw->flags & ActionFlags::Drawcall)) || !m_pDriver->m_Partial[WrappedVulkan::Primary].renderPassActive) { - // don't do anything, no drawcall capable of making overlays selected + // don't do anything, no action capable of making overlays selected float black[] = {0.0f, 0.0f, 0.0f, 0.0f}; VkImageMemoryBarrier barrier = {VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, @@ -1058,11 +1058,11 @@ ResourceId VulkanReplay::RenderOverlay(ResourceId texid, FloatVector clearCol, D // do single draw m_pDriver->m_RenderState.BeginRenderPassAndApplyState(m_pDriver, cmd, VulkanRenderState::BindGraphics); - DrawcallDescription draw = *mainDraw; - draw.numIndices = patchedIndexCount; - draw.baseVertex = 0; - draw.indexOffset = 0; - m_pDriver->ReplayDraw(cmd, draw); + ActionDescription action = *mainDraw; + action.numIndices = patchedIndexCount; + action.baseVertex = 0; + action.indexOffset = 0; + m_pDriver->ReplayDraw(cmd, action); m_pDriver->m_RenderState.EndRenderPass(cmd); vkr = ObjDisp(cmd)->EndCommandBuffer(Unwrap(cmd)); @@ -1910,8 +1910,8 @@ ResourceId VulkanReplay::RenderOverlay(ResourceId texid, FloatVector clearCol, D // in the loop below if(overlay == DebugOverlay::ClearBeforePass) { - const DrawcallDescription *draw = m_pDriver->GetDrawcall(events[0]); - if(draw && draw->flags & DrawFlags::BeginPass) + const ActionDescription *action = m_pDriver->GetAction(events[0]); + if(action && action->flags & ActionFlags::BeginPass) { if(events.size() == 1) { @@ -2045,13 +2045,13 @@ ResourceId VulkanReplay::RenderOverlay(ResourceId texid, FloatVector clearCol, D events.push_back(eventId); - // if we're rendering the whole pass, and the first draw is a BeginRenderPass, don't include + // if we're rendering the whole pass, and the first action is a BeginRenderPass, don't include // it in the list. We want to start by replaying into the renderpass so that we have the // correct state being applied. if(overlay == DebugOverlay::QuadOverdrawPass) { - const DrawcallDescription *draw = m_pDriver->GetDrawcall(events[0]); - if(draw->flags & DrawFlags::BeginPass) + const ActionDescription *action = m_pDriver->GetAction(events[0]); + if(action->flags & ActionFlags::BeginPass) events.erase(0); } @@ -2299,10 +2299,10 @@ ResourceId VulkanReplay::RenderOverlay(ResourceId texid, FloatVector clearCol, D while(!events.empty()) { - const DrawcallDescription *draw = m_pDriver->GetDrawcall(events[0]); + const ActionDescription *action = m_pDriver->GetAction(events[0]); // remove any non-drawcalls, like the pass boundary. - if(!draw || !(draw->flags & DrawFlags::Drawcall)) + if(!action || !(action->flags & ActionFlags::Drawcall)) events.erase(0); else break; @@ -2572,9 +2572,9 @@ ResourceId VulkanReplay::RenderOverlay(ResourceId texid, FloatVector clearCol, D }; vt->CmdBeginRenderPass(Unwrap(cmd), &rpbegin, VK_SUBPASS_CONTENTS_INLINE); - const DrawcallDescription *draw = m_pDriver->GetDrawcall(events[i]); + const ActionDescription *action = m_pDriver->GetAction(events[i]); - for(uint32_t inst = 0; draw && inst < RDCMAX(1U, draw->numInstances); inst++) + for(uint32_t inst = 0; action && inst < RDCMAX(1U, action->numInstances); inst++) { MeshFormat fmt = GetPostVSBuffers(events[i], inst, 0, MeshDataStage::GSOut); if(fmt.vertexResourceId == ResourceId()) diff --git a/renderdoc/driver/vulkan/vk_pixelhistory.cpp b/renderdoc/driver/vulkan/vk_pixelhistory.cpp index 6bdb225a1..2dafc15cb 100644 --- a/renderdoc/driver/vulkan/vk_pixelhistory.cpp +++ b/renderdoc/driver/vulkan/vk_pixelhistory.cpp @@ -446,9 +446,9 @@ private: std::map m_ShaderReplacements; }; -// VulkanPixelHistoryCallback is a generic VulkanDrawcallCallback that can be used for +// VulkanPixelHistoryCallback is a generic VulkanActionCallback that can be used for // pixel history replays. -struct VulkanPixelHistoryCallback : public VulkanDrawcallCallback +struct VulkanPixelHistoryCallback : public VulkanActionCallback { VulkanPixelHistoryCallback(WrappedVulkan *vk, PixelHistoryShaderCache *shaderCache, const PixelHistoryCallbackInfo &callbackInfo, VkQueryPool occlusionPool) @@ -457,7 +457,7 @@ struct VulkanPixelHistoryCallback : public VulkanDrawcallCallback m_CallbackInfo(callbackInfo), m_OcclusionPool(occlusionPool) { - m_pDriver->SetDrawcallCB(this); + m_pDriver->SetActionCB(this); if(m_pDriver->GetDeviceEnabledFeatures().occlusionQueryPrecise) m_QueryFlags |= VK_QUERY_CONTROL_PRECISE_BIT; @@ -465,7 +465,7 @@ struct VulkanPixelHistoryCallback : public VulkanDrawcallCallback virtual ~VulkanPixelHistoryCallback() { - m_pDriver->SetDrawcallCB(NULL); + m_pDriver->SetActionCB(NULL); for(const VkRenderPass &rp : m_RpsToDestroy) m_pDriver->vkDestroyRenderPass(m_pDriver->GetDev(), rp, NULL); for(const VkFramebuffer &fb : m_FbsToDestroy) @@ -1130,9 +1130,9 @@ struct VulkanOcclusionCallback : public VulkanPixelHistoryCallback void PreDispatch(uint32_t eid, VkCommandBuffer cmd) { return; } bool PostDispatch(uint32_t eid, VkCommandBuffer cmd) { return false; } void PostRedispatch(uint32_t eid, VkCommandBuffer cmd) {} - void PreMisc(uint32_t eid, DrawFlags flags, VkCommandBuffer cmd) { return; } - bool PostMisc(uint32_t eid, DrawFlags flags, VkCommandBuffer cmd) { return false; } - void PostRemisc(uint32_t eid, DrawFlags flags, VkCommandBuffer cmd) {} + void PreMisc(uint32_t eid, ActionFlags flags, VkCommandBuffer cmd) { return; } + bool PostMisc(uint32_t eid, ActionFlags flags, VkCommandBuffer cmd) { return false; } + void PostRemisc(uint32_t eid, ActionFlags flags, VkCommandBuffer cmd) {} void PreEndCommandBuffer(VkCommandBuffer cmd) {} void AliasEvent(uint32_t primary, uint32_t alias) {} bool SplitSecondary() { return false; } @@ -1174,14 +1174,14 @@ private: // draw with an occlusion query. void ReplayDrawWithQuery(VkCommandBuffer cmd, uint32_t eventId) { - const DrawcallDescription *drawcall = m_pDriver->GetDrawcall(eventId); + const ActionDescription *action = m_pDriver->GetAction(eventId); m_pDriver->GetCmdRenderState().BindPipeline(m_pDriver, cmd, VulkanRenderState::BindGraphics, false); uint32_t occlIndex = (uint32_t)m_OcclusionQueries.size(); ObjDisp(cmd)->CmdBeginQuery(Unwrap(cmd), m_OcclusionPool, occlIndex, m_QueryFlags); - m_pDriver->ReplayDraw(cmd, *drawcall); + m_pDriver->ReplayDraw(cmd, *action); ObjDisp(cmd)->CmdEndQuery(Unwrap(cmd), m_OcclusionPool, occlIndex); m_OcclusionQueries.insert(std::make_pair(eventId, occlIndex)); @@ -1469,7 +1469,7 @@ struct VulkanColorAndStencilCallback : public VulkanPixelHistoryCallback return false; } void PostRedispatch(uint32_t eid, VkCommandBuffer cmd) {} - void PreMisc(uint32_t eid, DrawFlags flags, VkCommandBuffer cmd) + void PreMisc(uint32_t eid, ActionFlags flags, VkCommandBuffer cmd) { if(!m_Events.contains(eid)) return; @@ -1484,7 +1484,7 @@ struct VulkanColorAndStencilCallback : public VulkanPixelHistoryCallback } PreDispatch(eid, cmd); } - bool PostMisc(uint32_t eid, DrawFlags flags, VkCommandBuffer cmd) + bool PostMisc(uint32_t eid, ActionFlags flags, VkCommandBuffer cmd) { if(!m_Events.contains(eid)) return false; @@ -1497,12 +1497,12 @@ struct VulkanColorAndStencilCallback : public VulkanPixelHistoryCallback } return false; } - if(flags & DrawFlags::BeginPass) + if(flags & ActionFlags::BeginPass) m_pDriver->GetCmdRenderState().EndRenderPass(cmd); bool ret = PostDispatch(eid, cmd); - if(flags & DrawFlags::BeginPass) + if(flags & ActionFlags::BeginPass) m_pDriver->GetCmdRenderState().BeginRenderPassAndApplyState(m_pDriver, cmd, VulkanRenderState::BindNone); @@ -1510,7 +1510,7 @@ struct VulkanColorAndStencilCallback : public VulkanPixelHistoryCallback } bool SplitSecondary() { return true; } - void PostRemisc(uint32_t eid, DrawFlags flags, VkCommandBuffer cmd) {} + void PostRemisc(uint32_t eid, ActionFlags flags, VkCommandBuffer cmd) {} void PreEndCommandBuffer(VkCommandBuffer cmd) {} void AliasEvent(uint32_t primary, uint32_t alias) { @@ -1615,8 +1615,8 @@ private: ObjDisp(cmd)->CmdClearAttachments(Unwrap(cmd), 1, &att, 1, &rect); } - const DrawcallDescription *drawcall = m_pDriver->GetDrawcall(eventId); - m_pDriver->ReplayDraw(cmd, *drawcall); + const ActionDescription *action = m_pDriver->GetAction(eventId); + m_pDriver->ReplayDraw(cmd, *action); m_pDriver->GetCmdRenderState().EndRenderPass(cmd); } @@ -1728,9 +1728,9 @@ struct TestsFailedCallback : public VulkanPixelHistoryCallback void PreDispatch(uint32_t eid, VkCommandBuffer cmd) {} bool PostDispatch(uint32_t eid, VkCommandBuffer cmd) { return false; } void PostRedispatch(uint32_t eid, VkCommandBuffer cmd) {} - void PreMisc(uint32_t eid, DrawFlags flags, VkCommandBuffer cmd) {} - bool PostMisc(uint32_t eid, DrawFlags flags, VkCommandBuffer cmd) { return false; } - void PostRemisc(uint32_t eid, DrawFlags flags, VkCommandBuffer cmd) {} + void PreMisc(uint32_t eid, ActionFlags flags, VkCommandBuffer cmd) {} + bool PostMisc(uint32_t eid, ActionFlags flags, VkCommandBuffer cmd) { return false; } + void PostRemisc(uint32_t eid, ActionFlags flags, VkCommandBuffer cmd) {} bool SplitSecondary() { return false; } void PreCmdExecute(uint32_t baseEid, uint32_t secondaryFirst, uint32_t secondaryLast, VkCommandBuffer cmd) @@ -2155,8 +2155,8 @@ private: ObjDisp(cmd)->CmdBeginQuery(Unwrap(cmd), m_OcclusionPool, index, m_QueryFlags); - const DrawcallDescription *drawcall = m_pDriver->GetDrawcall(eventId); - m_pDriver->ReplayDraw(cmd, *drawcall); + const ActionDescription *action = m_pDriver->GetAction(eventId); + m_pDriver->ReplayDraw(cmd, *action); ObjDisp(cmd)->CmdEndQuery(Unwrap(cmd), m_OcclusionPool, index); } @@ -2384,8 +2384,8 @@ struct VulkanPixelHistoryPerFragmentCallback : VulkanPixelHistoryCallback ObjDisp(cmd)->CmdSetStencilCompareMask(Unwrap(cmd), VK_STENCIL_FACE_FRONT_AND_BACK, 0xff); ObjDisp(cmd)->CmdSetStencilWriteMask(Unwrap(cmd), VK_STENCIL_FACE_FRONT_AND_BACK, 0xff); ObjDisp(cmd)->CmdSetStencilReference(Unwrap(cmd), VK_STENCIL_FACE_FRONT_AND_BACK, f); - const DrawcallDescription *drawcall = m_pDriver->GetDrawcall(eid); - m_pDriver->ReplayDraw(cmd, *drawcall); + const ActionDescription *action = m_pDriver->GetAction(eid); + m_pDriver->ReplayDraw(cmd, *action); state.EndRenderPass(cmd); if(i == 1) @@ -2475,8 +2475,8 @@ struct VulkanPixelHistoryPerFragmentCallback : VulkanPixelHistoryCallback ObjDisp(cmd)->CmdSetStencilCompareMask(Unwrap(cmd), VK_STENCIL_FACE_FRONT_AND_BACK, 0xff); ObjDisp(cmd)->CmdSetStencilWriteMask(Unwrap(cmd), VK_STENCIL_FACE_FRONT_AND_BACK, 0xff); ObjDisp(cmd)->CmdSetStencilReference(Unwrap(cmd), VK_STENCIL_FACE_FRONT_AND_BACK, f); - const DrawcallDescription *drawcall = m_pDriver->GetDrawcall(eid); - m_pDriver->ReplayDraw(cmd, *drawcall); + const ActionDescription *action = m_pDriver->GetAction(eid); + m_pDriver->ReplayDraw(cmd, *action); state.EndRenderPass(cmd); CopyImagePixel(cmd, colourCopyParams, (fragsProcessed + f) * sizeof(PerFragmentInfo) + @@ -2664,9 +2664,9 @@ struct VulkanPixelHistoryPerFragmentCallback : VulkanPixelHistoryCallback void PreDispatch(uint32_t eid, VkCommandBuffer cmd) {} bool PostDispatch(uint32_t eid, VkCommandBuffer cmd) { return false; } void PostRedispatch(uint32_t eid, VkCommandBuffer cmd) {} - void PreMisc(uint32_t eid, DrawFlags flags, VkCommandBuffer cmd) {} - bool PostMisc(uint32_t eid, DrawFlags flags, VkCommandBuffer cmd) { return false; } - void PostRemisc(uint32_t eid, DrawFlags flags, VkCommandBuffer cmd) {} + void PreMisc(uint32_t eid, ActionFlags flags, VkCommandBuffer cmd) {} + bool PostMisc(uint32_t eid, ActionFlags flags, VkCommandBuffer cmd) { return false; } + void PostRemisc(uint32_t eid, ActionFlags flags, VkCommandBuffer cmd) {} void PreEndCommandBuffer(VkCommandBuffer cmd) {} void AliasEvent(uint32_t primary, uint32_t alias) {} bool SplitSecondary() { return false; } @@ -2743,17 +2743,16 @@ struct VulkanPixelHistoryDiscardedFragmentsCallback : VulkanPixelHistoryCallback { uint32_t queryId = (uint32_t)m_OcclusionIndices.size(); ObjDisp(cmd)->CmdBeginQuery(Unwrap(cmd), m_OcclusionPool, queryId, m_QueryFlags); - const DrawcallDescription *drawcall = m_pDriver->GetDrawcall(eid); uint32_t primId = primIds[i]; - DrawcallDescription draw = *drawcall; - draw.numIndices = RENDERDOC_NumVerticesPerPrimitive(topo); - draw.indexOffset += RENDERDOC_VertexOffset(topo, primId); - draw.vertexOffset += RENDERDOC_VertexOffset(topo, primId); + ActionDescription action = *m_pDriver->GetAction(eid); + action.numIndices = RENDERDOC_NumVerticesPerPrimitive(topo); + action.indexOffset += RENDERDOC_VertexOffset(topo, primId); + action.vertexOffset += RENDERDOC_VertexOffset(topo, primId); // TODO once pixel history distinguishes between instances, draw only the instance for // this fragment. // TODO replay with a dummy index buffer so that all primitives other than the target one are // degenerate - that way the vertex index etc is still the same as it should be. - m_pDriver->ReplayDraw(cmd, draw); + m_pDriver->ReplayDraw(cmd, action); ObjDisp(cmd)->CmdEndQuery(Unwrap(cmd), m_OcclusionPool, queryId); m_OcclusionIndices[make_rdcpair(eid, primId)] = queryId; @@ -2808,9 +2807,9 @@ struct VulkanPixelHistoryDiscardedFragmentsCallback : VulkanPixelHistoryCallback void PreDispatch(uint32_t eid, VkCommandBuffer cmd) {} bool PostDispatch(uint32_t eid, VkCommandBuffer cmd) { return false; } void PostRedispatch(uint32_t eid, VkCommandBuffer cmd) {} - void PreMisc(uint32_t eid, DrawFlags flags, VkCommandBuffer cmd) {} - bool PostMisc(uint32_t eid, DrawFlags flags, VkCommandBuffer cmd) { return false; } - void PostRemisc(uint32_t eid, DrawFlags flags, VkCommandBuffer cmd) {} + void PreMisc(uint32_t eid, ActionFlags flags, VkCommandBuffer cmd) {} + bool PostMisc(uint32_t eid, ActionFlags flags, VkCommandBuffer cmd) { return false; } + void PostRemisc(uint32_t eid, ActionFlags flags, VkCommandBuffer cmd) {} void PreEndCommandBuffer(VkCommandBuffer cmd) {} void AliasEvent(uint32_t primary, uint32_t alias) {} bool SplitSecondary() { return false; } diff --git a/renderdoc/driver/vulkan/vk_postvs.cpp b/renderdoc/driver/vulkan/vk_postvs.cpp index 248889053..405c39347 100644 --- a/renderdoc/driver/vulkan/vk_postvs.cpp +++ b/renderdoc/driver/vulkan/vk_postvs.cpp @@ -64,7 +64,7 @@ enum StorageMode static void ConvertToMeshOutputCompute(const ShaderReflection &refl, const SPIRVPatchData &patchData, const char *entryName, StorageMode storageMode, rdcarray instDivisor, - const DrawcallDescription *draw, uint32_t numVerts, + const ActionDescription *action, uint32_t numVerts, uint32_t numViews, uint32_t baseSpecConstant, rdcarray &modSpirv, uint32_t &bufStride) { @@ -673,7 +673,7 @@ static void ConvertToMeshOutputCompute(const ShaderReflection &refl, editor.SetName(vbuffersVariable, "__rd_vbuffers"); - if(draw->flags & DrawFlags::Indexed) + if(action->flags & ActionFlags::Indexed) { rdcspv::Id ibufferType = editor.DeclareType(rdcspv::Pointer(uintStructType, bufferClass)); @@ -759,7 +759,7 @@ static void ConvertToMeshOutputCompute(const ShaderReflection &refl, rdcspv::Id outBufferVarID; rdcspv::Id outputStructPtrType; rdcspv::Id numVertsConstID = editor.AddConstantImmediate(numVerts); - rdcspv::Id numInstConstID = editor.AddConstantImmediate(draw->numInstances); + rdcspv::Id numInstConstID = editor.AddConstantImmediate(action->numInstances); rdcspv::Id numViewsConstID = editor.AddConstantImmediate(numViews); editor.SetName(numVertsConstID, "numVerts"); @@ -1020,7 +1020,7 @@ static void ConvertToMeshOutputCompute(const ShaderReflection &refl, // if we're indexing, look up the index buffer. We don't have to apply vertexOffset - it was // already applied when we read back and uniq-ified the index buffer. - if(draw->flags & DrawFlags::Indexed) + if(action->flags & ActionFlags::Indexed) { rdcspv::Id idxPtr; @@ -1039,20 +1039,20 @@ static void ConvertToMeshOutputCompute(const ShaderReflection &refl, rdcspv::Id vertexLookupID = vertexIndexID; rdcspv::Id instanceLookupID = instID; - if(!(draw->flags & DrawFlags::Indexed)) + if(!(action->flags & ActionFlags::Indexed)) { // for non-indexed draws, we manually apply the vertex offset, but here after we used the // 0-based one to calculate the array slot vertexIndexID = ops.add(rdcspv::OpIAdd(u32Type, editor.MakeId(), vtxID, - editor.AddConstantImmediate(draw->vertexOffset))); + editor.AddConstantImmediate(action->vertexOffset))); } editor.SetName(vertexIndexID, "vertexIndex"); // instIndex = inst + instOffset rdcspv::Id instIndexID = ops.add(rdcspv::OpIAdd(u32Type, editor.MakeId(), instID, - editor.AddConstantImmediate(draw->instanceOffset))); + editor.AddConstantImmediate(action->instanceOffset))); editor.SetName(instIndexID, "instanceIndex"); rdcspv::Id idxs[64] = {}; @@ -1070,11 +1070,11 @@ static void ConvertToMeshOutputCompute(const ShaderReflection &refl, valueID = vertexIndexID; // although for indexed draws we accounted for vertexOffset when looking up fixed // function vertex inputs, we still need to apply it to the VertexIndex builtin here. - if(draw->flags & DrawFlags::Indexed) + if(action->flags & ActionFlags::Indexed) { - valueID = - ops.add(rdcspv::OpIAdd(u32Type, editor.MakeId(), valueID, - editor.AddConstantImmediate(draw->vertexOffset))); + valueID = ops.add( + rdcspv::OpIAdd(u32Type, editor.MakeId(), valueID, + editor.AddConstantImmediate(action->vertexOffset))); } } else if(builtin == ShaderBuiltin::InstanceIndex) @@ -1087,23 +1087,23 @@ static void ConvertToMeshOutputCompute(const ShaderReflection &refl, } else if(builtin == ShaderBuiltin::BaseVertex) { - if(draw->flags & DrawFlags::Indexed) + if(action->flags & ActionFlags::Indexed) { - valueID = editor.AddConstantImmediate(draw->vertexOffset); + valueID = editor.AddConstantImmediate(action->vertexOffset); } else { - valueID = editor.AddConstantImmediate(draw->baseVertex); + valueID = editor.AddConstantImmediate(action->baseVertex); compType = CompType::SInt; } } else if(builtin == ShaderBuiltin::BaseInstance) { - valueID = editor.AddConstantImmediate(draw->instanceOffset); + valueID = editor.AddConstantImmediate(action->instanceOffset); } else if(builtin == ShaderBuiltin::DrawIndex) { - valueID = editor.AddConstantImmediate(draw->drawIndex); + valueID = editor.AddConstantImmediate(action->drawIndex); } else if(builtin == ShaderBuiltin::SubgroupEqualMask || builtin == ShaderBuiltin::SubgroupGreaterMask || @@ -1425,7 +1425,7 @@ void VulkanReplay::FetchVSOut(uint32_t eventId, VulkanRenderState &state) const VulkanCreationInfo::Pipeline &pipeInfo = creationInfo.m_Pipeline[state.graphics.pipeline]; - const DrawcallDescription *drawcall = m_pDriver->GetDrawcall(eventId); + const ActionDescription *action = m_pDriver->GetAction(eventId); const VulkanCreationInfo::ShaderModule &moduleInfo = creationInfo.m_ShaderModule[pipeInfo.shaders[0].module]; @@ -1625,7 +1625,7 @@ void VulkanReplay::FetchVSOut(uint32_t eventId, VulkanRenderState &state) VkBuffer rebasedIdxBuf = VK_NULL_HANDLE; VkDeviceMemory rebasedIdxBufMem = VK_NULL_HANDLE; - uint32_t numVerts = drawcall->numIndices; + uint32_t numVerts = action->numIndices; VkDeviceSize bufSize = 0; uint32_t numViews = 1; @@ -1645,15 +1645,15 @@ void VulkanReplay::FetchVSOut(uint32_t eventId, VulkanRenderState &state) uint32_t idxsize = state.ibuffer.bytewidth; - uint32_t maxIndex = RDCMAX(drawcall->baseVertex, 0) + numVerts - 1; + uint32_t maxIndex = RDCMAX(action->baseVertex, 0) + numVerts - 1; - uint32_t maxInstance = drawcall->instanceOffset + drawcall->numInstances - 1; + uint32_t maxInstance = action->instanceOffset + action->numInstances - 1; const VkMemoryAllocateFlagsInfo memFlags = { VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO, NULL, VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT, }; - if(drawcall->flags & DrawFlags::Indexed) + if(action->flags & ActionFlags::Indexed) { const bool restart = pipeCreateInfo.pInputAssemblyState->primitiveRestartEnable && SupportsRestart(MakePrimitiveTopology(state.primitiveTopology, 3)); @@ -1665,8 +1665,8 @@ void VulkanReplay::FetchVSOut(uint32_t eventId, VulkanRenderState &state) // fetch ibuffer if(state.ibuffer.buf != ResourceId()) - GetBufferData(state.ibuffer.buf, state.ibuffer.offs + drawcall->indexOffset * idxsize, - uint64_t(drawcall->numIndices) * idxsize, idxdata); + GetBufferData(state.ibuffer.buf, state.ibuffer.offs + action->indexOffset * idxsize, + uint64_t(action->numIndices) * idxsize, idxdata); // figure out what the maximum index could be, so we can clamp our index buffer to something // sane @@ -1703,7 +1703,7 @@ void VulkanReplay::FetchVSOut(uint32_t eventId, VulkanRenderState &state) // in case the vertex buffers were set but had invalid stride (0), max with the number // of vertices too. This is fine since the max here is just a conservative limit - maxIdx = RDCMAX(maxIdx, drawcall->numIndices); + maxIdx = RDCMAX(maxIdx, action->numIndices); // do ibuffer rebasing/remapping @@ -1715,11 +1715,11 @@ void VulkanReplay::FetchVSOut(uint32_t eventId, VulkanRenderState &state) idx16 = (uint16_t *)&idxdata[0]; // only read as many indices as were available in the buffer - uint32_t numIndices = RDCMIN(uint32_t(idxdata.size() / idxsize), drawcall->numIndices); + uint32_t numIndices = RDCMIN(uint32_t(idxdata.size() / idxsize), action->numIndices); uint32_t idxclamp = 0; - if(drawcall->baseVertex < 0) - idxclamp = uint32_t(-drawcall->baseVertex); + if(action->baseVertex < 0) + idxclamp = uint32_t(-action->baseVertex); // grab all unique vertex indices referenced for(uint32_t i = 0; i < numIndices; i++) @@ -1735,10 +1735,10 @@ void VulkanReplay::FetchVSOut(uint32_t eventId, VulkanRenderState &state) // apply baseVertex but clamp to 0 (don't allow index to become negative) if(i32 < idxclamp) i32 = 0; - else if(drawcall->baseVertex < 0) + else if(action->baseVertex < 0) i32 -= idxclamp; - else if(drawcall->baseVertex > 0) - i32 += drawcall->baseVertex; + else if(action->baseVertex > 0) + i32 += action->baseVertex; // we clamp to maxIdx here, to avoid any invalid indices like 0xffffffff // from filtering through. Worst case we index to the end of the vertex @@ -1755,7 +1755,7 @@ void VulkanReplay::FetchVSOut(uint32_t eventId, VulkanRenderState &state) // if we read out of bounds, we'll also have a 0 index being referenced // (as 0 is read). Don't insert 0 if we already have 0 though - if(numIndices < drawcall->numIndices && (indices.empty() || indices[0] != 0)) + if(numIndices < action->numIndices && (indices.empty() || indices[0] != 0)) indices.insert(0, 0); maxIndex = indices.back(); @@ -1861,10 +1861,10 @@ void VulkanReplay::FetchVSOut(uint32_t eventId, VulkanRenderState &state) // apply baseVertex but clamp to 0 (don't allow index to become negative) if(i32 < idxclamp) i32 = 0; - else if(drawcall->baseVertex < 0) + else if(action->baseVertex < 0) i32 -= idxclamp; - else if(drawcall->baseVertex > 0) - i32 += drawcall->baseVertex; + else if(action->baseVertex > 0) + i32 += action->baseVertex; if(idx32) idx32[i] = uint32_t(indexRemap[i32]); @@ -1982,13 +1982,13 @@ void VulkanReplay::FetchVSOut(uint32_t eventId, VulkanRenderState &state) { len = (uint64_t(maxInstance) + 1) * stride; - offs += drawcall->instanceOffset * stride; + offs += action->instanceOffset * stride; } else { len = (uint64_t(maxIndex) + 1) * stride; - offs += drawcall->vertexOffset * stride; + offs += action->vertexOffset * stride; } len = RDCMIN(len, state.vbuffers[binding].size); @@ -2322,7 +2322,7 @@ void VulkanReplay::FetchVSOut(uint32_t eventId, VulkanRenderState &state) ConvertToMeshOutputCompute(*refl, *pipeInfo.shaders[0].patchData, pipeInfo.shaders[0].entryPoint.c_str(), storageMode, attrInstDivisor, - drawcall, numVerts, numViews, baseSpecConstant, modSpirv, bufStride); + action, numVerts, numViews, baseSpecConstant, modSpirv, bufStride); if(!Vulkan_Debug_PostVSDumpDirPath().empty()) FileIO::WriteAll(Vulkan_Debug_PostVSDumpDirPath() + "/debug_postvs_comp.spv", modSpirv); @@ -2336,7 +2336,7 @@ void VulkanReplay::FetchVSOut(uint32_t eventId, VulkanRenderState &state) VkBufferCreateInfo bufInfo = {VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO}; // set bufSize - bufSize = bufInfo.size = uint64_t(numVerts) * uint64_t(drawcall->numInstances) * + bufSize = bufInfo.size = uint64_t(numVerts) * uint64_t(action->numInstances) * uint64_t(bufStride) * uint64_t(numViews); bufInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT; @@ -2574,7 +2574,7 @@ void VulkanReplay::FetchVSOut(uint32_t eventId, VulkanRenderState &state) // do single draw modifiedstate.BindPipeline(m_pDriver, cmd, VulkanRenderState::BindCompute, true); - uint64_t totalVerts = numVerts * uint64_t(drawcall->numInstances) * uint64_t(numViews); + uint64_t totalVerts = numVerts * uint64_t(action->numInstances) * uint64_t(numViews); // the validation layers will probably complain about this dispatch saying some arrays aren't // fully updated. That's because they don't statically analyse that only fixed indices are @@ -2723,12 +2723,12 @@ void VulkanReplay::FetchVSOut(uint32_t eventId, VulkanRenderState &state) m_PostVS.Data[eventId].vsout.nearPlane = nearp; m_PostVS.Data[eventId].vsout.farPlane = farp; - m_PostVS.Data[eventId].vsout.useIndices = bool(drawcall->flags & DrawFlags::Indexed); - m_PostVS.Data[eventId].vsout.numVerts = drawcall->numIndices; + m_PostVS.Data[eventId].vsout.useIndices = bool(action->flags & ActionFlags::Indexed); + m_PostVS.Data[eventId].vsout.numVerts = action->numIndices; m_PostVS.Data[eventId].vsout.instStride = 0; - if(drawcall->flags & DrawFlags::Instanced) - m_PostVS.Data[eventId].vsout.instStride = uint32_t(bufSize / (drawcall->numInstances * numViews)); + if(action->flags & ActionFlags::Instanced) + m_PostVS.Data[eventId].vsout.instStride = uint32_t(bufSize / (action->numInstances * numViews)); m_PostVS.Data[eventId].vsout.idxbuf = VK_NULL_HANDLE; if(m_PostVS.Data[eventId].vsout.useIndices && state.ibuffer.buf != ResourceId()) @@ -2776,7 +2776,7 @@ void VulkanReplay::FetchTessGSOut(uint32_t eventId, VulkanRenderState &state) const VulkanCreationInfo::Pipeline &pipeInfo = creationInfo.m_Pipeline[state.graphics.pipeline]; - const DrawcallDescription *drawcall = m_pDriver->GetDrawcall(eventId); + const ActionDescription *action = m_pDriver->GetAction(eventId); // set defaults so that we don't try to fetch this output again if something goes wrong and the // same event is selected again @@ -2951,7 +2951,7 @@ void VulkanReplay::FetchTessGSOut(uint32_t eventId, VulkanRenderState &state) state.xfbbuffers.clear(); state.xfbcounters.clear(); - if(m_PostVS.XFBQueryPoolSize < drawcall->numInstances) + if(m_PostVS.XFBQueryPoolSize < action->numInstances) { if(m_PostVS.XFBQueryPoolSize != VK_NULL_HANDLE) m_pDriver->vkDestroyQueryPool(m_Device, m_PostVS.XFBQueryPool, NULL); @@ -2961,14 +2961,14 @@ void VulkanReplay::FetchTessGSOut(uint32_t eventId, VulkanRenderState &state) NULL, 0, VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT, - drawcall->numInstances, + action->numInstances, 0, }; vkr = m_pDriver->vkCreateQueryPool(m_Device, &info, NULL, &m_PostVS.XFBQueryPool); RDCASSERTEQUAL(vkr, VK_SUCCESS); - m_PostVS.XFBQueryPoolSize = drawcall->numInstances; + m_PostVS.XFBQueryPoolSize = action->numInstances; } VkBuffer meshBuffer = VK_NULL_HANDLE; @@ -2977,7 +2977,7 @@ void VulkanReplay::FetchTessGSOut(uint32_t eventId, VulkanRenderState &state) // start with bare minimum size, which might be enough if no expansion happens VkDeviceSize bufferSize = 0; VkDeviceSize dataSize = - uint64_t(drawcall->numIndices) * uint64_t(drawcall->numInstances) * uint64_t(xfbStride); + uint64_t(action->numIndices) * uint64_t(action->numInstances) * uint64_t(xfbStride); VkXfbQueryResult queryResult = {}; @@ -3077,7 +3077,7 @@ void VulkanReplay::FetchTessGSOut(uint32_t eventId, VulkanRenderState &state) ObjDisp(cmd)->CmdBeginTransformFeedbackEXT(Unwrap(cmd), 0, 1, NULL, NULL); - m_pDriver->ReplayDraw(cmd, *drawcall); + m_pDriver->ReplayDraw(cmd, *action); ObjDisp(cmd)->CmdEndTransformFeedbackEXT(Unwrap(cmd), 0, 1, NULL, NULL); @@ -3107,7 +3107,7 @@ void VulkanReplay::FetchTessGSOut(uint32_t eventId, VulkanRenderState &state) // instanced draws must be replayed one at a time so we can record the number of primitives from // each drawcall, as due to expansion this can vary per-instance. - if(drawcall->flags & DrawFlags::Instanced && drawcall->numInstances > 1) + if(action->flags & ActionFlags::Instanced && action->numInstances > 1) { VkCommandBuffer cmd = m_pDriver->GetNextCmd(); @@ -3118,17 +3118,17 @@ void VulkanReplay::FetchTessGSOut(uint32_t eventId, VulkanRenderState &state) RDCASSERTEQUAL(vkr, VK_SUCCESS); ObjDisp(dev)->CmdResetQueryPool(Unwrap(cmd), Unwrap(m_PostVS.XFBQueryPool), 0, - drawcall->numInstances); + action->numInstances); state.BeginRenderPassAndApplyState(m_pDriver, cmd, VulkanRenderState::BindGraphics); - DrawcallDescription draw = *drawcall; + ActionDescription act = *action; // do incremental draws to get the output size. We have to do this O(N^2) style because // there's no way to replay only a single instance. We have to replay 1, 2, 3, ... N // instances and count the total number of verts each time, then we can see from the // difference how much each instance wrote. - for(uint32_t inst = 1; inst <= drawcall->numInstances; inst++) + for(uint32_t inst = 1; inst <= action->numInstances; inst++) { ObjDisp(cmd)->CmdBeginQuery(Unwrap(cmd), Unwrap(m_PostVS.XFBQueryPool), inst - 1, 0); @@ -3138,8 +3138,8 @@ void VulkanReplay::FetchTessGSOut(uint32_t eventId, VulkanRenderState &state) ObjDisp(cmd)->CmdBeginTransformFeedbackEXT(Unwrap(cmd), 0, 1, NULL, NULL); - draw.numInstances = inst; - m_pDriver->ReplayDraw(cmd, draw); + act.numInstances = inst; + m_pDriver->ReplayDraw(cmd, act); ObjDisp(cmd)->CmdEndTransformFeedbackEXT(Unwrap(cmd), 0, 1, NULL, NULL); @@ -3155,16 +3155,16 @@ void VulkanReplay::FetchTessGSOut(uint32_t eventId, VulkanRenderState &state) m_pDriver->FlushQ(); rdcarray queryResults; - queryResults.resize(drawcall->numInstances); + queryResults.resize(action->numInstances); vkr = ObjDisp(dev)->GetQueryPoolResults( - Unwrap(dev), Unwrap(m_PostVS.XFBQueryPool), 0, drawcall->numInstances, - sizeof(VkXfbQueryResult) * drawcall->numInstances, queryResults.data(), + Unwrap(dev), Unwrap(m_PostVS.XFBQueryPool), 0, action->numInstances, + sizeof(VkXfbQueryResult) * action->numInstances, queryResults.data(), sizeof(VkXfbQueryResult), VK_QUERY_RESULT_64_BIT | VK_QUERY_RESULT_WAIT_BIT); RDCASSERTEQUAL(vkr, VK_SUCCESS); uint64_t prevVertCount = 0; - for(uint32_t inst = 0; inst < drawcall->numInstances; inst++) + for(uint32_t inst = 0; inst < action->numInstances; inst++) { uint64_t vertCount = queryResults[inst].numPrimitivesWritten * primitiveMultiplier; @@ -3320,9 +3320,9 @@ void VulkanReplay::InitPostVSBuffers(uint32_t eventId, VulkanRenderState state) if(pipeInfo.shaders[0].module == ResourceId()) return; - const DrawcallDescription *drawcall = m_pDriver->GetDrawcall(eventId); + const ActionDescription *action = m_pDriver->GetAction(eventId); - if(drawcall == NULL || drawcall->numIndices == 0 || drawcall->numInstances == 0) + if(action == NULL || action->numIndices == 0 || action->numInstances == 0) return; VkMarkerRegion::Begin(StringFormat::Fmt("FetchVSOut for %u", eventId)); @@ -3347,14 +3347,14 @@ void VulkanReplay::InitPostVSBuffers(uint32_t eventId) InitPostVSBuffers(eventId, m_pDriver->GetRenderState()); } -struct VulkanInitPostVSCallback : public VulkanDrawcallCallback +struct VulkanInitPostVSCallback : public VulkanActionCallback { VulkanInitPostVSCallback(WrappedVulkan *vk, const rdcarray &events) : m_pDriver(vk), m_Events(events) { - m_pDriver->SetDrawcallCB(this); + m_pDriver->SetActionCB(this); } - ~VulkanInitPostVSCallback() { m_pDriver->SetDrawcallCB(NULL); } + ~VulkanInitPostVSCallback() { m_pDriver->SetActionCB(NULL); } void PreDraw(uint32_t eid, VkCommandBuffer cmd) { if(m_Events.contains(eid)) @@ -3368,9 +3368,9 @@ struct VulkanInitPostVSCallback : public VulkanDrawcallCallback bool PostDispatch(uint32_t eid, VkCommandBuffer cmd) { return false; } void PostRedispatch(uint32_t eid, VkCommandBuffer cmd) {} // Ditto copy/etc - void PreMisc(uint32_t eid, DrawFlags flags, VkCommandBuffer cmd) {} - bool PostMisc(uint32_t eid, DrawFlags flags, VkCommandBuffer cmd) { return false; } - void PostRemisc(uint32_t eid, DrawFlags flags, VkCommandBuffer cmd) {} + void PreMisc(uint32_t eid, ActionFlags flags, VkCommandBuffer cmd) {} + bool PostMisc(uint32_t eid, ActionFlags flags, VkCommandBuffer cmd) { return false; } + void PostRemisc(uint32_t eid, ActionFlags flags, VkCommandBuffer cmd) {} void PreEndCommandBuffer(VkCommandBuffer cmd) {} void AliasEvent(uint32_t primary, uint32_t alias) { @@ -3397,8 +3397,8 @@ void VulkanReplay::InitPostVSBuffers(const rdcarray &events) for(; first < events.size(); first++) { - const DrawcallDescription *drawcall = m_pDriver->GetDrawcall(events[first]); - if(drawcall->flags & DrawFlags::PassBoundary) + const ActionDescription *action = m_pDriver->GetAction(events[first]); + if(action->flags & ActionFlags::PassBoundary) continue; break; } @@ -3429,11 +3429,11 @@ MeshFormat VulkanReplay::GetPostVSBuffers(uint32_t eventId, uint32_t instID, uin if(m_PostVS.Data.find(eventId) != m_PostVS.Data.end()) postvs = m_PostVS.Data[eventId]; - const DrawcallDescription *drawcall = m_pDriver->GetDrawcall(eventId); + const ActionDescription *action = m_pDriver->GetAction(eventId); uint32_t numInstances = 1; - if(drawcall && (drawcall->flags & DrawFlags::Instanced)) - numInstances = drawcall->numInstances; + if(action && (action->flags & ActionFlags::Instanced)) + numInstances = action->numInstances; VulkanPostVSData::StageData s = postvs.GetStage(stage); diff --git a/renderdoc/driver/vulkan/vk_replay.cpp b/renderdoc/driver/vulkan/vk_replay.cpp index 7e237d32c..a9f7d34c6 100644 --- a/renderdoc/driver/vulkan/vk_replay.cpp +++ b/renderdoc/driver/vulkan/vk_replay.cpp @@ -212,28 +212,28 @@ rdcarray VulkanReplay::GetPassEvents(uint32_t eventId) { rdcarray passEvents; - const DrawcallDescription *draw = m_pDriver->GetDrawcall(eventId); + const ActionDescription *action = m_pDriver->GetAction(eventId); - if(!draw) + if(!action) return passEvents; // for vulkan a pass == a renderpass, if we're not inside a // renderpass then there are no pass events. - const DrawcallDescription *start = draw; + const ActionDescription *start = action; while(start) { // if we've come to the beginning of a pass, break out of the loop, we've // found the start. // Note that vkCmdNextSubPass has both Begin and End flags set, so it will - // break out here before we hit the terminating case looking for DrawFlags::EndPass - if(start->flags & DrawFlags::BeginPass) + // break out here before we hit the terminating case looking for ActionFlags::EndPass + if(start->flags & ActionFlags::BeginPass) break; // if we come to the END of a pass, since we were iterating backwards that // means we started outside of a pass, so return empty set. // Note that vkCmdNextSubPass has both Begin and End flags set, so it will // break out above before we hit this terminating case - if(start->flags & DrawFlags::EndPass) + if(start->flags & ActionFlags::EndPass) return passEvents; // if we've come to the start of the log we were outside of a render pass @@ -245,17 +245,17 @@ rdcarray VulkanReplay::GetPassEvents(uint32_t eventId) start = start->previous; } - // store all the draw eventIDs up to the one specified at the start + // store all the action eventIDs up to the one specified at the start while(start) { - if(start->eventId >= draw->eventId) + if(start->eventId >= action->eventId) break; // include pass boundaries, these will be filtered out later - // so we don't actually do anything (init postvs/draw overlay) + // so we don't actually do anything (init postvs/action overlay) // but it's useful to have the first part of the pass as part // of the list - if(start->flags & (DrawFlags::Drawcall | DrawFlags::PassBoundary)) + if(start->flags & (ActionFlags::Drawcall | ActionFlags::PassBoundary)) passEvents.push_back(start->eventId); start = start->next; @@ -1642,10 +1642,10 @@ void VulkanReplay::SavePipelineState(uint32_t eventId) usedBindsSize = usage.used.size(); } - const DrawcallDescription *drawcall = m_pDriver->GetDrawcall(eventId); - if(drawcall) + const ActionDescription *action = m_pDriver->GetAction(eventId); + if(action) { - bool isDispatch = bool(drawcall->flags & DrawFlags::Dispatch); + bool isDispatch = bool(action->flags & ActionFlags::Dispatch); // ifor compute stage on draws, and non-compute stages on dispatches, pretend all // resources are dynamically unused, to prevent the lack of data from causing large arrays diff --git a/renderdoc/driver/vulkan/vk_replay.h b/renderdoc/driver/vulkan/vk_replay.h index 7a935f0a9..33d848792 100644 --- a/renderdoc/driver/vulkan/vk_replay.h +++ b/renderdoc/driver/vulkan/vk_replay.h @@ -150,7 +150,7 @@ class WrappedVulkan; class VulkanDebugManager; class VulkanResourceManager; struct VulkanStatePipeline; -struct VulkanAMDDrawCallback; +struct VulkanAMDActionCallback; struct VulkanPostVSData { @@ -782,7 +782,7 @@ private: AMDCounters *m_pAMDCounters = NULL; AMDRGPControl *m_RGP = NULL; - VulkanAMDDrawCallback *m_pAMDDrawCallback = NULL; + VulkanAMDActionCallback *m_pAMDActionCallback = NULL; rdcarray FetchCountersKHR(const rdcarray &counters); diff --git a/renderdoc/driver/vulkan/vk_shader_feedback.cpp b/renderdoc/driver/vulkan/vk_shader_feedback.cpp index fedde7301..95de2d639 100644 --- a/renderdoc/driver/vulkan/vk_shader_feedback.cpp +++ b/renderdoc/driver/vulkan/vk_shader_feedback.cpp @@ -1320,12 +1320,12 @@ void VulkanReplay::FetchShaderFeedback(uint32_t eventId) const VulkanRenderState &state = m_pDriver->m_RenderState; VulkanCreationInfo &creationInfo = m_pDriver->m_CreationInfo; - const DrawcallDescription *drawcall = m_pDriver->GetDrawcall(eventId); + const ActionDescription *action = m_pDriver->GetAction(eventId); - if(drawcall == NULL || !(drawcall->flags & (DrawFlags::Dispatch | DrawFlags::Drawcall))) + if(action == NULL || !(action->flags & (ActionFlags::Dispatch | ActionFlags::Drawcall))) return; - result.compute = bool(drawcall->flags & DrawFlags::Dispatch); + result.compute = bool(action->flags & ActionFlags::Dispatch); const VulkanStatePipeline &pipe = result.compute ? state.compute : state.graphics; @@ -1664,7 +1664,7 @@ void VulkanReplay::FetchShaderFeedback(uint32_t eventId) if(!useBufferAddress) { // replace descriptor set IDs with our temporary sets. The offsets we keep the same. If the - // original draw had no sets, we ensure there's room (with no offsets needed) + // original action had no sets, we ensure there's room (with no offsets needed) if(modifiedpipe.descSets.empty()) modifiedpipe.descSets.resize(1); @@ -1708,14 +1708,14 @@ void VulkanReplay::FetchShaderFeedback(uint32_t eventId) { modifiedstate.BindPipeline(m_pDriver, cmd, VulkanRenderState::BindCompute, true); - ObjDisp(cmd)->CmdDispatch(Unwrap(cmd), drawcall->dispatchDimension[0], - drawcall->dispatchDimension[1], drawcall->dispatchDimension[2]); + ObjDisp(cmd)->CmdDispatch(Unwrap(cmd), action->dispatchDimension[0], + action->dispatchDimension[1], action->dispatchDimension[2]); } else { modifiedstate.BeginRenderPassAndApplyState(m_pDriver, cmd, VulkanRenderState::BindGraphics); - m_pDriver->ReplayDraw(cmd, *drawcall); + m_pDriver->ReplayDraw(cmd, *action); modifiedstate.EndRenderPass(cmd); } @@ -1829,13 +1829,13 @@ void VulkanReplay::FetchShaderFeedback(uint32_t eventId) else if(stage == ShaderStage::Vertex) { msg.location.vertex.vertexIndex = location[0]; - if(!(drawcall->flags & DrawFlags::Indexed)) + if(!(action->flags & ActionFlags::Indexed)) { // for non-indexed draws get back to 0-based index - msg.location.vertex.vertexIndex -= drawcall->vertexOffset; + msg.location.vertex.vertexIndex -= action->vertexOffset; } // go back to a 0-based instance index - msg.location.vertex.instance = location[1] - drawcall->instanceOffset; + msg.location.vertex.instance = location[1] - action->instanceOffset; msg.location.vertex.view = location[2]; } else diff --git a/renderdoc/driver/vulkan/vk_shaderdebug.cpp b/renderdoc/driver/vulkan/vk_shaderdebug.cpp index aa3ee5b52..ba9dbbaa2 100644 --- a/renderdoc/driver/vulkan/vk_shaderdebug.cpp +++ b/renderdoc/driver/vulkan/vk_shaderdebug.cpp @@ -334,7 +334,7 @@ public: if(!m_ResourcesDirty) { VkMarkerRegion region("ResetReplay"); - // replay the draw to get back to 'normal' state for this event, and mark that we need to + // replay the action to get back to 'normal' state for this event, and mark that we need to // replay back to pristine state next time we need to fetch data. m_pDriver->ReplayLog(0, m_EventID, eReplay_OnlyDraw); } @@ -1581,7 +1581,7 @@ private: GetDescriptor("accessing buffer value", bind, valid); if(valid) { - // if the resources might be dirty from side-effects from the draw, replay back to right + // if the resources might be dirty from side-effects from the action, replay back to right // before it. if(m_ResourcesDirty) { @@ -1613,7 +1613,7 @@ private: GetDescriptor("performing image load/store", bind, valid); if(valid) { - // if the resources might be dirty from side-effects from the draw, replay back to right + // if the resources might be dirty from side-effects from the action, replay back to right // before it. if(m_ResourcesDirty) { @@ -3709,22 +3709,22 @@ ShaderDebugTrace *VulkanReplay::DebugVertex(uint32_t eventId, uint32_t vertid, u if(Vulkan_Debug_ShaderDebugLogging()) RDCLOG("%s", regionName.c_str()); - const DrawcallDescription *draw = m_pDriver->GetDrawcall(eventId); + const ActionDescription *action = m_pDriver->GetAction(eventId); - if(!(draw->flags & DrawFlags::Drawcall)) + if(!(action->flags & ActionFlags::Drawcall)) { RDCLOG("No drawcall selected"); return new ShaderDebugTrace(); } uint32_t vertOffset = 0, instOffset = 0; - if(!(draw->flags & DrawFlags::Indexed)) - vertOffset = draw->vertexOffset; + if(!(action->flags & ActionFlags::Indexed)) + vertOffset = action->vertexOffset; - if(draw->flags & DrawFlags::Instanced) - instOffset = draw->instanceOffset; + if(action->flags & ActionFlags::Instanced) + instOffset = action->instanceOffset; - // get ourselves in pristine state before this draw (without any side effects it may have had) + // get ourselves in pristine state before this action (without any side effects it may have had) m_pDriver->ReplayLog(0, eventId, eReplay_WithoutDraw); const VulkanCreationInfo::Pipeline &pipe = c.m_Pipeline[state.graphics.pipeline]; @@ -3754,13 +3754,14 @@ ShaderDebugTrace *VulkanReplay::DebugVertex(uint32_t eventId, uint32_t vertid, u view = 0; std::map &builtins = apiWrapper->builtin_inputs; - builtins[ShaderBuiltin::BaseInstance] = ShaderVariable(rdcstr(), draw->instanceOffset, 0U, 0U, 0U); + builtins[ShaderBuiltin::BaseInstance] = + ShaderVariable(rdcstr(), action->instanceOffset, 0U, 0U, 0U); builtins[ShaderBuiltin::BaseVertex] = ShaderVariable( - rdcstr(), (draw->flags & DrawFlags::Indexed) ? draw->baseVertex : draw->vertexOffset, 0U, 0U, - 0U); + rdcstr(), (action->flags & ActionFlags::Indexed) ? action->baseVertex : action->vertexOffset, + 0U, 0U, 0U); builtins[ShaderBuiltin::DeviceIndex] = ShaderVariable(rdcstr(), 0U, 0U, 0U, 0U); - builtins[ShaderBuiltin::DrawIndex] = ShaderVariable(rdcstr(), draw->drawIndex, 0U, 0U, 0U); - if(draw->flags & DrawFlags::Indexed) + builtins[ShaderBuiltin::DrawIndex] = ShaderVariable(rdcstr(), action->drawIndex, 0U, 0U, 0U); + if(action->flags & ActionFlags::Indexed) builtins[ShaderBuiltin::VertexIndex] = ShaderVariable(rdcstr(), idx, 0U, 0U, 0U); else builtins[ShaderBuiltin::VertexIndex] = ShaderVariable(rdcstr(), vertid + vertOffset, 0U, 0U, 0U); @@ -3956,9 +3957,9 @@ ShaderDebugTrace *VulkanReplay::DebugPixel(uint32_t eventId, uint32_t x, uint32_ if(Vulkan_Debug_ShaderDebugLogging()) RDCLOG("%s", regionName.c_str()); - const DrawcallDescription *draw = m_pDriver->GetDrawcall(eventId); + const ActionDescription *action = m_pDriver->GetAction(eventId); - if(!(draw->flags & DrawFlags::Drawcall)) + if(!(action->flags & ActionFlags::Drawcall)) { RDCLOG("No drawcall selected"); return new ShaderDebugTrace(); @@ -3972,7 +3973,7 @@ ShaderDebugTrace *VulkanReplay::DebugPixel(uint32_t eventId, uint32_t x, uint32_ return new ShaderDebugTrace(); } - // get ourselves in pristine state before this draw (without any side effects it may have had) + // get ourselves in pristine state before this action (without any side effects it may have had) m_pDriver->ReplayLog(0, eventId, eReplay_WithoutDraw); VulkanCreationInfo::ShaderModule &shader = c.m_ShaderModule[pipe.shaders[4].module]; @@ -3995,7 +3996,7 @@ ShaderDebugTrace *VulkanReplay::DebugPixel(uint32_t eventId, uint32_t x, uint32_ std::map &builtins = apiWrapper->builtin_inputs; builtins[ShaderBuiltin::DeviceIndex] = ShaderVariable(rdcstr(), 0U, 0U, 0U, 0U); - builtins[ShaderBuiltin::DrawIndex] = ShaderVariable(rdcstr(), draw->drawIndex, 0U, 0U, 0U); + builtins[ShaderBuiltin::DrawIndex] = ShaderVariable(rdcstr(), action->drawIndex, 0U, 0U, 0U); builtins[ShaderBuiltin::Position] = ShaderVariable(rdcstr(), float(x) + 0.5f, float(y) + 0.5f, 0.0f, 0.0f); @@ -4385,7 +4386,7 @@ ShaderDebugTrace *VulkanReplay::DebugPixel(uint32_t eventId, uint32_t x, uint32_ modifiedstate.BeginRenderPassAndApplyState(m_pDriver, cmd, VulkanRenderState::BindGraphics); - m_pDriver->ReplayDraw(cmd, *draw); + m_pDriver->ReplayDraw(cmd, *action); modifiedstate.EndRenderPass(cmd); @@ -4641,9 +4642,9 @@ ShaderDebugTrace *VulkanReplay::DebugThread(uint32_t eventId, if(Vulkan_Debug_ShaderDebugLogging()) RDCLOG("%s", regionName.c_str()); - const DrawcallDescription *draw = m_pDriver->GetDrawcall(eventId); + const ActionDescription *action = m_pDriver->GetAction(eventId); - if(!(draw->flags & DrawFlags::Dispatch)) + if(!(action->flags & ActionFlags::Dispatch)) { RDCLOG("No dispatch selected"); return new ShaderDebugTrace(); @@ -4678,8 +4679,8 @@ ShaderDebugTrace *VulkanReplay::DebugThread(uint32_t eventId, std::map &builtins = apiWrapper->builtin_inputs; builtins[ShaderBuiltin::DispatchSize] = - ShaderVariable(rdcstr(), draw->dispatchDimension[0], draw->dispatchDimension[1], - draw->dispatchDimension[2], 0U); + ShaderVariable(rdcstr(), action->dispatchDimension[0], action->dispatchDimension[1], + action->dispatchDimension[2], 0U); builtins[ShaderBuiltin::DispatchThreadIndex] = ShaderVariable( rdcstr(), groupid[0] * threadDim[0] + threadid[0], groupid[1] * threadDim[1] + threadid[1], groupid[2] * threadDim[2] + threadid[2], 0U); diff --git a/renderdoc/driver/vulkan/vk_state.cpp b/renderdoc/driver/vulkan/vk_state.cpp index a7ef147ec..c004593cf 100644 --- a/renderdoc/driver/vulkan/vk_state.cpp +++ b/renderdoc/driver/vulkan/vk_state.cpp @@ -386,7 +386,7 @@ void VulkanRenderState::BindDescriptorSets(WrappedVulkan *vk, VkCommandBuffer cm // We can get into this situation if for example we have many sets bound at some point, then // there's a pipeline change that causes most or all of them to be invalidated as // incompatible, then the program only re-binds some subset that it knows is statically used - // by the next drawcall. The remaining sets are invalid, but also unused and this is + // by the next action. The remaining sets are invalid, but also unused and this is // explicitly allowed by the spec. We just have to make sure we don't try to actively bind // an incompatible descriptor set. ResourceId createdDescSetLayoutId = vk->GetDescLayoutForDescSet(pipe.descSets[i].descSet); diff --git a/renderdoc/driver/vulkan/wrappers/vk_cmd_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_cmd_funcs.cpp index af63ac564..bcc92cb57 100644 --- a/renderdoc/driver/vulkan/wrappers/vk_cmd_funcs.cpp +++ b/renderdoc/driver/vulkan/wrappers/vk_cmd_funcs.cpp @@ -985,16 +985,16 @@ bool WrappedVulkan::Serialise_vkBeginCommandBuffer(SerialiserType &ser, VkComman m_CreationInfo.m_Names[m_LastCmdBufferID]; { - VulkanDrawcallTreeNode *draw = new VulkanDrawcallTreeNode; - m_BakedCmdBufferInfo[BakedCommandBuffer].draw = draw; + VulkanActionTreeNode *action = new VulkanActionTreeNode; + m_BakedCmdBufferInfo[BakedCommandBuffer].action = action; - // On queue submit we increment all child events/drawcalls by + // On queue submit we increment all child events/actions by // m_RootEventID and insert them into the tree. m_BakedCmdBufferInfo[BakedCommandBuffer].curEventID = 0; m_BakedCmdBufferInfo[BakedCommandBuffer].eventCount = 0; - m_BakedCmdBufferInfo[BakedCommandBuffer].drawCount = 0; + m_BakedCmdBufferInfo[BakedCommandBuffer].actionCount = 0; - m_BakedCmdBufferInfo[BakedCommandBuffer].drawStack.push_back(draw); + m_BakedCmdBufferInfo[BakedCommandBuffer].actionStack.push_back(action); m_BakedCmdBufferInfo[BakedCommandBuffer].beginChunk = uint32_t(m_StructuredFile->chunks.size() - 1); @@ -1195,8 +1195,8 @@ bool WrappedVulkan::Serialise_vkEndCommandBuffer(SerialiserType &ser, VkCommandB for(int i = 0; i < m_BakedCmdBufferInfo[BakedCommandBuffer].markerCount; i++) ObjDisp(commandBuffer)->CmdDebugMarkerEndEXT(Unwrap(commandBuffer)); - if(m_DrawcallCallback) - m_DrawcallCallback->PreEndCommandBuffer(commandBuffer); + if(m_ActionCallback) + m_ActionCallback->PreEndCommandBuffer(commandBuffer); ObjDisp(commandBuffer)->EndCommandBuffer(Unwrap(commandBuffer)); @@ -1215,8 +1215,8 @@ bool WrappedVulkan::Serialise_vkEndCommandBuffer(SerialiserType &ser, VkCommandB ObjDisp(commandBuffer)->EndCommandBuffer(Unwrap(commandBuffer)); { - if(GetDrawcallStack().size() > 1) - GetDrawcallStack().pop_back(); + if(GetActionStack().size() > 1) + GetActionStack().pop_back(); } { @@ -1229,7 +1229,7 @@ bool WrappedVulkan::Serialise_vkEndCommandBuffer(SerialiserType &ser, VkCommandB m_BakedCmdBufferInfo[CommandBuffer].curEventID = 0; m_BakedCmdBufferInfo[CommandBuffer].eventCount = 0; - m_BakedCmdBufferInfo[CommandBuffer].drawCount = 0; + m_BakedCmdBufferInfo[CommandBuffer].actionCount = 0; } } } @@ -1258,7 +1258,7 @@ VkResult WrappedVulkan::vkEndCommandBuffer(VkCommandBuffer commandBuffer) { CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkEndCommandBuffer); Serialise_vkEndCommandBuffer(ser, commandBuffer); @@ -1461,7 +1461,7 @@ bool WrappedVulkan::Serialise_vkCmdBeginRenderPass(SerialiserType &ser, VkComman } } - DrawFlags drawFlags = DrawFlags::PassBoundary | DrawFlags::BeginPass; + ActionFlags drawFlags = ActionFlags::PassBoundary | ActionFlags::BeginPass; uint32_t eventId = HandlePreCallback(commandBuffer, drawFlags); ObjDisp(commandBuffer)->CmdBeginRenderPass(Unwrap(commandBuffer), &unwrappedInfo, contents); @@ -1510,10 +1510,10 @@ bool WrappedVulkan::Serialise_vkCmdBeginRenderPass(SerialiserType &ser, VkComman clearrects.data()); } - if(eventId && m_DrawcallCallback->PostMisc(eventId, drawFlags, commandBuffer)) + if(eventId && m_ActionCallback->PostMisc(eventId, drawFlags, commandBuffer)) { // Do not call vkCmdBeginRenderPass again. - m_DrawcallCallback->PostRemisc(eventId, drawFlags, commandBuffer); + m_ActionCallback->PostRemisc(eventId, drawFlags, commandBuffer); } GetResourceManager()->RecordBarriers(m_BakedCmdBufferInfo[m_LastCmdBufferID].imageStates, @@ -1528,7 +1528,7 @@ bool WrappedVulkan::Serialise_vkCmdBeginRenderPass(SerialiserType &ser, VkComman { ObjDisp(commandBuffer)->CmdBeginRenderPass(Unwrap(commandBuffer), &unwrappedInfo, contents); - // track while reading, for fetching the right set of outputs in AddDrawcall + // track while reading, for fetching the right set of outputs in AddAction m_BakedCmdBufferInfo[m_LastCmdBufferID].state.subpass = 0; m_BakedCmdBufferInfo[m_LastCmdBufferID].state.renderPass = GetResID(RenderPassBegin.renderPass); @@ -1583,12 +1583,12 @@ bool WrappedVulkan::Serialise_vkCmdBeginRenderPass(SerialiserType &ser, VkComman (uint32_t)imgBarriers.size(), imgBarriers.data()); AddEvent(); - DrawcallDescription draw; - draw.name = + ActionDescription action; + action.name = StringFormat::Fmt("vkCmdBeginRenderPass(%s)", MakeRenderPassOpString(false).c_str()); - draw.flags |= DrawFlags::PassBoundary | DrawFlags::BeginPass; + action.flags |= ActionFlags::PassBoundary | ActionFlags::BeginPass; - AddDrawcall(draw); + AddAction(action); } } @@ -1617,7 +1617,7 @@ void WrappedVulkan::vkCmdBeginRenderPass(VkCommandBuffer commandBuffer, VkResourceRecord *record = GetRecord(commandBuffer); CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkCmdBeginRenderPass); Serialise_vkCmdBeginRenderPass(ser, commandBuffer, pRenderPassBegin, contents); @@ -1725,15 +1725,16 @@ bool WrappedVulkan::Serialise_vkCmdNextSubpass(SerialiserType &ser, VkCommandBuf GetCmdRenderState().subpass++; } - DrawFlags drawFlags = DrawFlags::PassBoundary | DrawFlags::BeginPass | DrawFlags::EndPass; + ActionFlags drawFlags = + ActionFlags::PassBoundary | ActionFlags::BeginPass | ActionFlags::EndPass; uint32_t eventId = HandlePreCallback(commandBuffer, drawFlags); ObjDisp(commandBuffer)->CmdNextSubpass(Unwrap(commandBuffer), contents); - if(eventId && m_DrawcallCallback->PostMisc(eventId, drawFlags, commandBuffer)) + if(eventId && m_ActionCallback->PostMisc(eventId, drawFlags, commandBuffer)) { // Do not call vkCmdNextSubpass again. - m_DrawcallCallback->PostRemisc(eventId, drawFlags, commandBuffer); + m_ActionCallback->PostRemisc(eventId, drawFlags, commandBuffer); } rdcarray imgBarriers = GetImplicitRenderPassBarriers(); @@ -1749,7 +1750,7 @@ bool WrappedVulkan::Serialise_vkCmdNextSubpass(SerialiserType &ser, VkCommandBuf AddImplicitResolveResourceUsage(); - // track while reading, for fetching the right set of outputs in AddDrawcall + // track while reading, for fetching the right set of outputs in AddAction m_BakedCmdBufferInfo[m_LastCmdBufferID].state.subpass++; rdcarray imgBarriers = GetImplicitRenderPassBarriers(); @@ -1759,12 +1760,12 @@ bool WrappedVulkan::Serialise_vkCmdNextSubpass(SerialiserType &ser, VkCommandBuf (uint32_t)imgBarriers.size(), imgBarriers.data()); AddEvent(); - DrawcallDescription draw; - draw.name = StringFormat::Fmt("vkCmdNextSubpass() => %u", - m_BakedCmdBufferInfo[m_LastCmdBufferID].state.subpass); - draw.flags |= DrawFlags::PassBoundary | DrawFlags::BeginPass | DrawFlags::EndPass; + ActionDescription action; + action.name = StringFormat::Fmt("vkCmdNextSubpass() => %u", + m_BakedCmdBufferInfo[m_LastCmdBufferID].state.subpass); + action.flags |= ActionFlags::PassBoundary | ActionFlags::BeginPass | ActionFlags::EndPass; - AddDrawcall(draw); + AddAction(action); } } @@ -1782,7 +1783,7 @@ void WrappedVulkan::vkCmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassCon VkResourceRecord *record = GetRecord(commandBuffer); CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkCmdNextSubpass); Serialise_vkCmdNextSubpass(ser, commandBuffer, contents); @@ -1832,15 +1833,15 @@ bool WrappedVulkan::Serialise_vkCmdEndRenderPass(SerialiserType &ser, VkCommandB renderstate.subpassContents = VK_SUBPASS_CONTENTS_MAX_ENUM; } - DrawFlags drawFlags = DrawFlags::PassBoundary | DrawFlags::EndPass; + ActionFlags drawFlags = ActionFlags::PassBoundary | ActionFlags::EndPass; uint32_t eventId = HandlePreCallback(commandBuffer, drawFlags); ObjDisp(commandBuffer)->CmdEndRenderPass(Unwrap(commandBuffer)); - if(eventId && m_DrawcallCallback->PostMisc(eventId, drawFlags, commandBuffer)) + if(eventId && m_ActionCallback->PostMisc(eventId, drawFlags, commandBuffer)) { // Do not call vkCmdEndRenderPass again. - m_DrawcallCallback->PostRemisc(eventId, drawFlags, commandBuffer); + m_ActionCallback->PostRemisc(eventId, drawFlags, commandBuffer); } if(m_ReplayOptions.optimisation != ReplayOptimisationLevel::Fastest) @@ -1886,14 +1887,14 @@ bool WrappedVulkan::Serialise_vkCmdEndRenderPass(SerialiserType &ser, VkCommandB AddImplicitResolveResourceUsage(~0U); AddEvent(); - DrawcallDescription draw; - draw.name = StringFormat::Fmt("vkCmdEndRenderPass(%s)", MakeRenderPassOpString(true).c_str()); - draw.flags |= DrawFlags::PassBoundary | DrawFlags::EndPass; + ActionDescription action; + action.name = StringFormat::Fmt("vkCmdEndRenderPass(%s)", MakeRenderPassOpString(true).c_str()); + action.flags |= ActionFlags::PassBoundary | ActionFlags::EndPass; - AddDrawcall(draw); + AddAction(action); - // track while reading, reset this to empty so AddDrawcall sets no outputs, - // but only AFTER the above AddDrawcall (we want it grouped together) + // track while reading, reset this to empty so AddAction sets no outputs, + // but only AFTER the above AddAction (we want it grouped together) m_BakedCmdBufferInfo[m_LastCmdBufferID].state.renderPass = ResourceId(); m_BakedCmdBufferInfo[m_LastCmdBufferID].state.SetFramebuffer(ResourceId(), rdcarray()); @@ -1914,7 +1915,7 @@ void WrappedVulkan::vkCmdEndRenderPass(VkCommandBuffer commandBuffer) VkResourceRecord *record = GetRecord(commandBuffer); CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkCmdEndRenderPass); Serialise_vkCmdEndRenderPass(ser, commandBuffer); @@ -2082,7 +2083,7 @@ bool WrappedVulkan::Serialise_vkCmdBeginRenderPass2(SerialiserType &ser, DoPipelineBarrier(commandBuffer, imgBarriers.size(), imgBarriers.data()); } - DrawFlags drawFlags = DrawFlags::PassBoundary | DrawFlags::BeginPass; + ActionFlags drawFlags = ActionFlags::PassBoundary | ActionFlags::BeginPass; uint32_t eventId = HandlePreCallback(commandBuffer, drawFlags); ObjDisp(commandBuffer) @@ -2132,10 +2133,10 @@ bool WrappedVulkan::Serialise_vkCmdBeginRenderPass2(SerialiserType &ser, clearrects.data()); } - if(eventId && m_DrawcallCallback->PostMisc(eventId, drawFlags, commandBuffer)) + if(eventId && m_ActionCallback->PostMisc(eventId, drawFlags, commandBuffer)) { // Do not call vkCmdBeginRenderPass2 again. - m_DrawcallCallback->PostRemisc(eventId, drawFlags, commandBuffer); + m_ActionCallback->PostRemisc(eventId, drawFlags, commandBuffer); } GetResourceManager()->RecordBarriers(m_BakedCmdBufferInfo[m_LastCmdBufferID].imageStates, @@ -2151,7 +2152,7 @@ bool WrappedVulkan::Serialise_vkCmdBeginRenderPass2(SerialiserType &ser, ObjDisp(commandBuffer) ->CmdBeginRenderPass2(Unwrap(commandBuffer), &unwrappedInfo, &unwrappedBeginInfo); - // track while reading, for fetching the right set of outputs in AddDrawcall + // track while reading, for fetching the right set of outputs in AddAction m_BakedCmdBufferInfo[m_LastCmdBufferID].state.subpass = 0; m_BakedCmdBufferInfo[m_LastCmdBufferID].state.renderPass = GetResID(RenderPassBegin.renderPass); @@ -2206,12 +2207,12 @@ bool WrappedVulkan::Serialise_vkCmdBeginRenderPass2(SerialiserType &ser, (uint32_t)imgBarriers.size(), imgBarriers.data()); AddEvent(); - DrawcallDescription draw; - draw.name = + ActionDescription action; + action.name = StringFormat::Fmt("vkCmdBeginRenderPass2(%s)", MakeRenderPassOpString(false).c_str()); - draw.flags |= DrawFlags::PassBoundary | DrawFlags::BeginPass; + action.flags |= ActionFlags::PassBoundary | ActionFlags::BeginPass; - AddDrawcall(draw); + AddAction(action); } } @@ -2245,7 +2246,7 @@ void WrappedVulkan::vkCmdBeginRenderPass2(VkCommandBuffer commandBuffer, VkResourceRecord *record = GetRecord(commandBuffer); CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkCmdBeginRenderPass2); Serialise_vkCmdBeginRenderPass2(ser, commandBuffer, pRenderPassBegin, pSubpassBeginInfo); @@ -2363,16 +2364,17 @@ bool WrappedVulkan::Serialise_vkCmdNextSubpass2(SerialiserType &ser, VkCommandBu GetCmdRenderState().subpass++; } - DrawFlags drawFlags = DrawFlags::PassBoundary | DrawFlags::BeginPass | DrawFlags::EndPass; + ActionFlags drawFlags = + ActionFlags::PassBoundary | ActionFlags::BeginPass | ActionFlags::EndPass; uint32_t eventId = HandlePreCallback(commandBuffer, drawFlags); ObjDisp(commandBuffer) ->CmdNextSubpass2(Unwrap(commandBuffer), &unwrappedBeginInfo, &unwrappedEndInfo); - if(eventId && m_DrawcallCallback->PostMisc(eventId, drawFlags, commandBuffer)) + if(eventId && m_ActionCallback->PostMisc(eventId, drawFlags, commandBuffer)) { // Do not call vkCmdNextSubpass2 again. - m_DrawcallCallback->PostRemisc(eventId, drawFlags, commandBuffer); + m_ActionCallback->PostRemisc(eventId, drawFlags, commandBuffer); } rdcarray imgBarriers = GetImplicitRenderPassBarriers(); @@ -2389,7 +2391,7 @@ bool WrappedVulkan::Serialise_vkCmdNextSubpass2(SerialiserType &ser, VkCommandBu AddImplicitResolveResourceUsage(); - // track while reading, for fetching the right set of outputs in AddDrawcall + // track while reading, for fetching the right set of outputs in AddAction m_BakedCmdBufferInfo[m_LastCmdBufferID].state.subpass++; rdcarray imgBarriers = GetImplicitRenderPassBarriers(); @@ -2399,12 +2401,12 @@ bool WrappedVulkan::Serialise_vkCmdNextSubpass2(SerialiserType &ser, VkCommandBu (uint32_t)imgBarriers.size(), imgBarriers.data()); AddEvent(); - DrawcallDescription draw; - draw.name = StringFormat::Fmt("vkCmdNextSubpass2() => %u", - m_BakedCmdBufferInfo[m_LastCmdBufferID].state.subpass); - draw.flags |= DrawFlags::PassBoundary | DrawFlags::BeginPass | DrawFlags::EndPass; + ActionDescription action; + action.name = StringFormat::Fmt("vkCmdNextSubpass2() => %u", + m_BakedCmdBufferInfo[m_LastCmdBufferID].state.subpass); + action.flags |= ActionFlags::PassBoundary | ActionFlags::BeginPass | ActionFlags::EndPass; - AddDrawcall(draw); + AddAction(action); } } @@ -2435,7 +2437,7 @@ void WrappedVulkan::vkCmdNextSubpass2(VkCommandBuffer commandBuffer, VkResourceRecord *record = GetRecord(commandBuffer); CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkCmdNextSubpass2); Serialise_vkCmdNextSubpass2(ser, commandBuffer, pSubpassBeginInfo, pSubpassEndInfo); @@ -2493,14 +2495,14 @@ bool WrappedVulkan::Serialise_vkCmdEndRenderPass2(SerialiserType &ser, VkCommand renderstate.subpassContents = VK_SUBPASS_CONTENTS_MAX_ENUM; } - DrawFlags drawFlags = DrawFlags::PassBoundary | DrawFlags::EndPass; + ActionFlags drawFlags = ActionFlags::PassBoundary | ActionFlags::EndPass; uint32_t eventId = HandlePreCallback(commandBuffer, drawFlags); ObjDisp(commandBuffer)->CmdEndRenderPass2(Unwrap(commandBuffer), &unwrappedEndInfo); - if(eventId && m_DrawcallCallback->PostMisc(eventId, drawFlags, commandBuffer)) + if(eventId && m_ActionCallback->PostMisc(eventId, drawFlags, commandBuffer)) { // Do not call vkCmdEndRenderPass2 again. - m_DrawcallCallback->PostRemisc(eventId, drawFlags, commandBuffer); + m_ActionCallback->PostRemisc(eventId, drawFlags, commandBuffer); } if(m_ReplayOptions.optimisation != ReplayOptimisationLevel::Fastest) @@ -2542,14 +2544,15 @@ bool WrappedVulkan::Serialise_vkCmdEndRenderPass2(SerialiserType &ser, VkCommand (uint32_t)imgBarriers.size(), imgBarriers.data()); AddEvent(); - DrawcallDescription draw; - draw.name = StringFormat::Fmt("vkCmdEndRenderPass2(%s)", MakeRenderPassOpString(true).c_str()); - draw.flags |= DrawFlags::PassBoundary | DrawFlags::EndPass; + ActionDescription action; + action.name = + StringFormat::Fmt("vkCmdEndRenderPass2(%s)", MakeRenderPassOpString(true).c_str()); + action.flags |= ActionFlags::PassBoundary | ActionFlags::EndPass; - AddDrawcall(draw); + AddAction(action); - // track while reading, reset this to empty so AddDrawcall sets no outputs, - // but only AFTER the above AddDrawcall (we want it grouped together) + // track while reading, reset this to empty so AddAction sets no outputs, + // but only AFTER the above AddAction (we want it grouped together) m_BakedCmdBufferInfo[m_LastCmdBufferID].state.renderPass = ResourceId(); m_BakedCmdBufferInfo[m_LastCmdBufferID].state.SetFramebuffer(ResourceId(), rdcarray()); @@ -2578,7 +2581,7 @@ void WrappedVulkan::vkCmdEndRenderPass2(VkCommandBuffer commandBuffer, VkResourceRecord *record = GetRecord(commandBuffer); CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkCmdEndRenderPass2); Serialise_vkCmdEndRenderPass2(ser, commandBuffer, pSubpassEndInfo); @@ -2766,7 +2769,7 @@ bool WrappedVulkan::Serialise_vkCmdBindPipeline(SerialiserType &ser, VkCommandBu { ResourceId liveid = GetResID(pipeline); - // track while reading, as we need to bind current topology & index byte width in AddDrawcall + // track while reading, as we need to bind current topology & index byte width in AddAction if(pipelineBindPoint == VK_PIPELINE_BIND_POINT_COMPUTE) { m_BakedCmdBufferInfo[m_LastCmdBufferID].state.compute.pipeline = liveid; @@ -3177,7 +3180,7 @@ bool WrappedVulkan::Serialise_vkCmdBindIndexBuffer(SerialiserType &ser, } else { - // track while reading, as we need to bind current topology & index byte width in AddDrawcall + // track while reading, as we need to bind current topology & index byte width in AddAction if(indexType == VK_INDEX_TYPE_UINT32) m_BakedCmdBufferInfo[m_LastCmdBufferID].state.ibuffer.bytewidth = 4; else if(indexType == VK_INDEX_TYPE_UINT8_EXT) @@ -4158,11 +4161,11 @@ bool WrappedVulkan::Serialise_vkCmdExecuteCommands(SerialiserType &ser, VkComman AddEvent(); - DrawcallDescription draw; - draw.name = StringFormat::Fmt("vkCmdExecuteCommands(%u)", commandBufferCount); - draw.flags = DrawFlags::CmdList | DrawFlags::PushMarker; + ActionDescription action; + action.name = StringFormat::Fmt("vkCmdExecuteCommands(%u)", commandBufferCount); + action.flags = ActionFlags::CmdList | ActionFlags::PushMarker; - AddDrawcall(draw); + AddAction(action); BakedCmdBufferInfo &parentCmdBufInfo = m_BakedCmdBufferInfo[m_LastCmdBufferID]; @@ -4179,16 +4182,16 @@ bool WrappedVulkan::Serialise_vkCmdExecuteCommands(SerialiserType &ser, VkComman BakedCmdBufferInfo &cmdBufInfo = m_BakedCmdBufferInfo[cmd]; // add a fake marker - DrawcallDescription marker; + ActionDescription marker; marker.name = StringFormat::Fmt("=> vkCmdExecuteCommands()[%u]: vkBeginCommandBuffer(%s)", c, ToStr(cmd).c_str()); marker.flags = - DrawFlags::CommandBufferBoundary | DrawFlags::PassBoundary | DrawFlags::BeginPass; + ActionFlags::CommandBufferBoundary | ActionFlags::PassBoundary | ActionFlags::BeginPass; AddEvent(); parentCmdBufInfo.curEvents.back().chunkIndex = cmdBufInfo.beginChunk; - AddDrawcall(marker); + AddAction(marker); parentCmdBufInfo.curEventID++; if(m_BakedCmdBufferInfo[m_LastCmdBufferID].state.renderPass == ResourceId() && @@ -4201,20 +4204,20 @@ bool WrappedVulkan::Serialise_vkCmdExecuteCommands(SerialiserType &ser, VkComman // insert the baked command buffer in-line into this list of notes, assigning new event and // drawIDs - parentCmdBufInfo.draw->InsertAndUpdateIDs(*cmdBufInfo.draw, parentCmdBufInfo.curEventID, - parentCmdBufInfo.drawCount); + parentCmdBufInfo.action->InsertAndUpdateIDs(*cmdBufInfo.action, parentCmdBufInfo.curEventID, + parentCmdBufInfo.actionCount); if(framebufferUsage) { - size_t total = parentCmdBufInfo.draw->children.size(); - size_t numChildren = cmdBufInfo.draw->children.size(); + size_t total = parentCmdBufInfo.action->children.size(); + size_t numChildren = cmdBufInfo.action->children.size(); // iterate through the newly added draws, and recursively add usage to them using our // primary command buffer's state for(size_t i = 0; i < numChildren; i++) { AddFramebufferUsageAllChildren( - parentCmdBufInfo.draw->children[total - numChildren + i], + parentCmdBufInfo.action->children[total - numChildren + i], parentCmdBufInfo.state.renderPass, parentCmdBufInfo.state.GetFramebuffer(), parentCmdBufInfo.state.subpass, parentCmdBufInfo.state.GetFramebufferAttachments()); } @@ -4229,12 +4232,12 @@ bool WrappedVulkan::Serialise_vkCmdExecuteCommands(SerialiserType &ser, VkComman // only primary command buffers can be submitted m_Partial[Secondary].cmdBufferSubmits[cmd].push_back(parentCmdBufInfo.curEventID); - parentCmdBufInfo.draw->executedCmds.push_back(cmd); + parentCmdBufInfo.action->executedCmds.push_back(cmd); parentCmdBufInfo.curEventID += cmdBufInfo.eventCount; - parentCmdBufInfo.drawCount += cmdBufInfo.drawCount; + parentCmdBufInfo.actionCount += cmdBufInfo.actionCount; - // pull in any remaining events on the command buffer that weren't added to a drawcall + // pull in any remaining events on the command buffer that weren't added to an action uint32_t i = 0; for(APIEvent &apievent : cmdBufInfo.curEvents) { @@ -4249,18 +4252,18 @@ bool WrappedVulkan::Serialise_vkCmdExecuteCommands(SerialiserType &ser, VkComman marker.name = StringFormat::Fmt("=> vkCmdExecuteCommands()[%u]: vkEndCommandBuffer(%s)", c, ToStr(cmd).c_str()); marker.flags = - DrawFlags::CommandBufferBoundary | DrawFlags::PassBoundary | DrawFlags::EndPass; + ActionFlags::CommandBufferBoundary | ActionFlags::PassBoundary | ActionFlags::EndPass; AddEvent(); - AddDrawcall(marker); + AddAction(marker); parentCmdBufInfo.curEventID++; } // add an extra pop marker AddEvent(); - draw = DrawcallDescription(); - draw.flags = DrawFlags::PopMarker; + action = ActionDescription(); + action.flags = ActionFlags::PopMarker; - AddDrawcall(draw); + AddAction(action); // don't change curEventID here, as it will be incremented outside in the outer // loop for the EXEC_CMDS event. in vkQueueSubmit we need to decrement curEventID @@ -4391,11 +4394,11 @@ bool WrappedVulkan::Serialise_vkCmdExecuteCommands(SerialiserType &ser, VkComman if(!rerecordedCmds.empty()) { - if(m_DrawcallCallback && m_DrawcallCallback->SplitSecondary()) + if(m_ActionCallback && m_ActionCallback->SplitSecondary()) { - DrawcallUse use(m_CurChunkOffset, 0); - auto it = std::lower_bound(m_DrawcallUses.begin(), m_DrawcallUses.end(), use); - if(it != m_DrawcallUses.end()) + ActionUse use(m_CurChunkOffset, 0); + auto it = std::lower_bound(m_ActionUses.begin(), m_ActionUses.end(), use); + if(it != m_ActionUses.end()) { uint32_t eventId = it->eventId + 2; @@ -4403,16 +4406,16 @@ bool WrappedVulkan::Serialise_vkCmdExecuteCommands(SerialiserType &ser, VkComman { ResourceId cmd = GetResourceManager()->GetOriginalID(GetResID(pCommandBuffers[i])); BakedCmdBufferInfo &info = m_BakedCmdBufferInfo[cmd]; - if(info.draw && info.draw->children.size() > 0) + if(info.action && info.action->children.size() > 0) { - uint32_t firstEventId = eventId + info.draw->children.front().draw.eventId; - uint32_t lastEventId = eventId + info.draw->children.back().draw.eventId; - m_DrawcallCallback->PreCmdExecute(eventId, firstEventId, lastEventId, - commandBuffer); + uint32_t firstEventId = eventId + info.action->children.front().action.eventId; + uint32_t lastEventId = eventId + info.action->children.back().action.eventId; + m_ActionCallback->PreCmdExecute(eventId, firstEventId, lastEventId, + commandBuffer); ObjDisp(commandBuffer) ->CmdExecuteCommands(Unwrap(commandBuffer), 1, &rerecordedCmds[i]); - m_DrawcallCallback->PostCmdExecute(eventId, firstEventId, lastEventId, - commandBuffer); + m_ActionCallback->PostCmdExecute(eventId, firstEventId, lastEventId, + commandBuffer); } else { @@ -4453,7 +4456,7 @@ void WrappedVulkan::vkCmdExecuteCommands(VkCommandBuffer commandBuffer, uint32_t VkResourceRecord *record = GetRecord(commandBuffer); CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkCmdExecuteCommands); Serialise_vkCmdExecuteCommands(ser, commandBuffer, commandBufferCount, pCommandBuffers); @@ -4507,17 +4510,17 @@ bool WrappedVulkan::Serialise_vkCmdDebugMarkerBeginEXT(SerialiserType &ser, if(ObjDisp(commandBuffer)->CmdDebugMarkerBeginEXT) ObjDisp(commandBuffer)->CmdDebugMarkerBeginEXT(Unwrap(commandBuffer), &Marker); - DrawcallDescription draw; - draw.name = Marker.pMarkerName ? Marker.pMarkerName : ""; - draw.flags |= DrawFlags::PushMarker; + ActionDescription action; + action.name = Marker.pMarkerName ? Marker.pMarkerName : ""; + action.flags |= ActionFlags::PushMarker; - draw.markerColor.x = RDCCLAMP(Marker.color[0], 0.0f, 1.0f); - draw.markerColor.y = RDCCLAMP(Marker.color[1], 0.0f, 1.0f); - draw.markerColor.z = RDCCLAMP(Marker.color[2], 0.0f, 1.0f); - draw.markerColor.w = RDCCLAMP(Marker.color[3], 0.0f, 1.0f); + action.markerColor.x = RDCCLAMP(Marker.color[0], 0.0f, 1.0f); + action.markerColor.y = RDCCLAMP(Marker.color[1], 0.0f, 1.0f); + action.markerColor.z = RDCCLAMP(Marker.color[2], 0.0f, 1.0f); + action.markerColor.w = RDCCLAMP(Marker.color[3], 0.0f, 1.0f); AddEvent(); - AddDrawcall(draw); + AddAction(action); } } @@ -4538,7 +4541,7 @@ void WrappedVulkan::vkCmdDebugMarkerBeginEXT(VkCommandBuffer commandBuffer, VkResourceRecord *record = GetRecord(commandBuffer); CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkCmdDebugMarkerBeginEXT); Serialise_vkCmdDebugMarkerBeginEXT(ser, commandBuffer, pMarker); @@ -4576,14 +4579,14 @@ bool WrappedVulkan::Serialise_vkCmdDebugMarkerEndEXT(SerialiserType &ser, if(ObjDisp(commandBuffer)->CmdDebugMarkerEndEXT) ObjDisp(commandBuffer)->CmdDebugMarkerEndEXT(Unwrap(commandBuffer)); - // dummy draw that is consumed when this command buffer + // dummy action that is consumed when this command buffer // is being in-lined into the call stream - DrawcallDescription draw; - draw.name = "vkCmdDebugMarkerEndEXT()"; - draw.flags = DrawFlags::PopMarker; + ActionDescription action; + action.name = "vkCmdDebugMarkerEndEXT()"; + action.flags = ActionFlags::PopMarker; AddEvent(); - AddDrawcall(draw); + AddAction(action); } } @@ -4602,7 +4605,7 @@ void WrappedVulkan::vkCmdDebugMarkerEndEXT(VkCommandBuffer commandBuffer) VkResourceRecord *record = GetRecord(commandBuffer); CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkCmdDebugMarkerEndEXT); Serialise_vkCmdDebugMarkerEndEXT(ser, commandBuffer); @@ -4639,17 +4642,17 @@ bool WrappedVulkan::Serialise_vkCmdDebugMarkerInsertEXT(SerialiserType &ser, if(ObjDisp(commandBuffer)->CmdDebugMarkerInsertEXT) ObjDisp(commandBuffer)->CmdDebugMarkerInsertEXT(Unwrap(commandBuffer), &Marker); - DrawcallDescription draw; - draw.name = Marker.pMarkerName ? Marker.pMarkerName : ""; - draw.flags |= DrawFlags::SetMarker; + ActionDescription action; + action.name = Marker.pMarkerName ? Marker.pMarkerName : ""; + action.flags |= ActionFlags::SetMarker; - draw.markerColor.x = RDCCLAMP(Marker.color[0], 0.0f, 1.0f); - draw.markerColor.y = RDCCLAMP(Marker.color[1], 0.0f, 1.0f); - draw.markerColor.z = RDCCLAMP(Marker.color[2], 0.0f, 1.0f); - draw.markerColor.w = RDCCLAMP(Marker.color[3], 0.0f, 1.0f); + action.markerColor.x = RDCCLAMP(Marker.color[0], 0.0f, 1.0f); + action.markerColor.y = RDCCLAMP(Marker.color[1], 0.0f, 1.0f); + action.markerColor.z = RDCCLAMP(Marker.color[2], 0.0f, 1.0f); + action.markerColor.w = RDCCLAMP(Marker.color[3], 0.0f, 1.0f); AddEvent(); - AddDrawcall(draw); + AddAction(action); } } @@ -4672,7 +4675,7 @@ void WrappedVulkan::vkCmdDebugMarkerInsertEXT(VkCommandBuffer commandBuffer, VkResourceRecord *record = GetRecord(commandBuffer); CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkCmdDebugMarkerInsertEXT); Serialise_vkCmdDebugMarkerInsertEXT(ser, commandBuffer, pMarker); @@ -5496,17 +5499,17 @@ bool WrappedVulkan::Serialise_vkCmdBeginDebugUtilsLabelEXT(SerialiserType &ser, if(ObjDisp(commandBuffer)->CmdBeginDebugUtilsLabelEXT) ObjDisp(commandBuffer)->CmdBeginDebugUtilsLabelEXT(Unwrap(commandBuffer), &Label); - DrawcallDescription draw; - draw.name = Label.pLabelName ? Label.pLabelName : ""; - draw.flags |= DrawFlags::PushMarker; + ActionDescription action; + action.name = Label.pLabelName ? Label.pLabelName : ""; + action.flags |= ActionFlags::PushMarker; - draw.markerColor.x = RDCCLAMP(Label.color[0], 0.0f, 1.0f); - draw.markerColor.y = RDCCLAMP(Label.color[1], 0.0f, 1.0f); - draw.markerColor.z = RDCCLAMP(Label.color[2], 0.0f, 1.0f); - draw.markerColor.w = RDCCLAMP(Label.color[3], 0.0f, 1.0f); + action.markerColor.x = RDCCLAMP(Label.color[0], 0.0f, 1.0f); + action.markerColor.y = RDCCLAMP(Label.color[1], 0.0f, 1.0f); + action.markerColor.z = RDCCLAMP(Label.color[2], 0.0f, 1.0f); + action.markerColor.w = RDCCLAMP(Label.color[3], 0.0f, 1.0f); AddEvent(); - AddDrawcall(draw); + AddAction(action); } } @@ -5527,7 +5530,7 @@ void WrappedVulkan::vkCmdBeginDebugUtilsLabelEXT(VkCommandBuffer commandBuffer, VkResourceRecord *record = GetRecord(commandBuffer); CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkCmdBeginDebugUtilsLabelEXT); Serialise_vkCmdBeginDebugUtilsLabelEXT(ser, commandBuffer, pLabelInfo); @@ -5565,12 +5568,12 @@ bool WrappedVulkan::Serialise_vkCmdEndDebugUtilsLabelEXT(SerialiserType &ser, if(ObjDisp(commandBuffer)->CmdEndDebugUtilsLabelEXT) ObjDisp(commandBuffer)->CmdEndDebugUtilsLabelEXT(Unwrap(commandBuffer)); - DrawcallDescription draw; - draw.name = "vkCmdEndDebugUtilsLabelEXT()"; - draw.flags = DrawFlags::PopMarker; + ActionDescription action; + action.name = "vkCmdEndDebugUtilsLabelEXT()"; + action.flags = ActionFlags::PopMarker; AddEvent(); - AddDrawcall(draw); + AddAction(action); } } @@ -5589,7 +5592,7 @@ void WrappedVulkan::vkCmdEndDebugUtilsLabelEXT(VkCommandBuffer commandBuffer) VkResourceRecord *record = GetRecord(commandBuffer); CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkCmdEndDebugUtilsLabelEXT); Serialise_vkCmdEndDebugUtilsLabelEXT(ser, commandBuffer); @@ -5626,17 +5629,17 @@ bool WrappedVulkan::Serialise_vkCmdInsertDebugUtilsLabelEXT(SerialiserType &ser, if(ObjDisp(commandBuffer)->CmdInsertDebugUtilsLabelEXT) ObjDisp(commandBuffer)->CmdInsertDebugUtilsLabelEXT(Unwrap(commandBuffer), &Label); - DrawcallDescription draw; - draw.name = Label.pLabelName ? Label.pLabelName : ""; - draw.flags |= DrawFlags::SetMarker; + ActionDescription action; + action.name = Label.pLabelName ? Label.pLabelName : ""; + action.flags |= ActionFlags::SetMarker; - draw.markerColor.x = RDCCLAMP(Label.color[0], 0.0f, 1.0f); - draw.markerColor.y = RDCCLAMP(Label.color[1], 0.0f, 1.0f); - draw.markerColor.z = RDCCLAMP(Label.color[2], 0.0f, 1.0f); - draw.markerColor.w = RDCCLAMP(Label.color[3], 0.0f, 1.0f); + action.markerColor.x = RDCCLAMP(Label.color[0], 0.0f, 1.0f); + action.markerColor.y = RDCCLAMP(Label.color[1], 0.0f, 1.0f); + action.markerColor.z = RDCCLAMP(Label.color[2], 0.0f, 1.0f); + action.markerColor.w = RDCCLAMP(Label.color[3], 0.0f, 1.0f); AddEvent(); - AddDrawcall(draw); + AddAction(action); } } @@ -5659,7 +5662,7 @@ void WrappedVulkan::vkCmdInsertDebugUtilsLabelEXT(VkCommandBuffer commandBuffer, VkResourceRecord *record = GetRecord(commandBuffer); CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkCmdInsertDebugUtilsLabelEXT); Serialise_vkCmdInsertDebugUtilsLabelEXT(ser, commandBuffer, pLabelInfo); @@ -5869,7 +5872,7 @@ bool WrappedVulkan::Serialise_vkCmdBeginTransformFeedbackEXT( UnwrapArray(pCounterBuffers, bufferCount), pCounterBufferOffsets); - // track while reading, for fetching the right set of outputs in AddDrawcall + // track while reading, for fetching the right set of outputs in AddAction m_BakedCmdBufferInfo[m_LastCmdBufferID].state.firstxfbcounter = firstBuffer; m_BakedCmdBufferInfo[m_LastCmdBufferID].state.xfbcounters.resize(bufferCount); } @@ -5895,7 +5898,7 @@ void WrappedVulkan::vkCmdBeginTransformFeedbackEXT(VkCommandBuffer commandBuffer VkResourceRecord *record = GetRecord(commandBuffer); CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkCmdBeginTransformFeedbackEXT); Serialise_vkCmdBeginTransformFeedbackEXT(ser, commandBuffer, firstBuffer, bufferCount, pCounterBuffers, pCounterBufferOffsets); @@ -5957,7 +5960,7 @@ bool WrappedVulkan::Serialise_vkCmdEndTransformFeedbackEXT( UnwrapArray(pCounterBuffers, bufferCount), pCounterBufferOffsets); - // track while reading, for fetching the right set of outputs in AddDrawcall + // track while reading, for fetching the right set of outputs in AddAction m_BakedCmdBufferInfo[m_LastCmdBufferID].state.firstxfbcounter = 0; m_BakedCmdBufferInfo[m_LastCmdBufferID].state.xfbcounters.clear(); } @@ -5983,7 +5986,7 @@ void WrappedVulkan::vkCmdEndTransformFeedbackEXT(VkCommandBuffer commandBuffer, VkResourceRecord *record = GetRecord(commandBuffer); CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkCmdEndTransformFeedbackEXT); Serialise_vkCmdEndTransformFeedbackEXT(ser, commandBuffer, firstBuffer, bufferCount, pCounterBuffers, pCounterBufferOffsets); diff --git a/renderdoc/driver/vulkan/wrappers/vk_draw_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_draw_funcs.cpp index 1927a1cb3..a3c0c694e 100644 --- a/renderdoc/driver/vulkan/wrappers/vk_draw_funcs.cpp +++ b/renderdoc/driver/vulkan/wrappers/vk_draw_funcs.cpp @@ -212,12 +212,12 @@ bool WrappedVulkan::Serialise_vkCmdDraw(SerialiserType &ser, VkCommandBuffer com ObjDisp(commandBuffer) ->CmdDraw(Unwrap(commandBuffer), vertexCount, instanceCount, firstVertex, firstInstance); - if(eventId && m_DrawcallCallback->PostDraw(eventId, commandBuffer)) + if(eventId && m_ActionCallback->PostDraw(eventId, commandBuffer)) { ObjDisp(commandBuffer) ->CmdDraw(Unwrap(commandBuffer), vertexCount, instanceCount, firstVertex, firstInstance); - m_DrawcallCallback->PostRedraw(eventId, commandBuffer); + m_ActionCallback->PostRedraw(eventId, commandBuffer); } } } @@ -237,16 +237,16 @@ bool WrappedVulkan::Serialise_vkCmdDraw(SerialiserType &ser, VkCommandBuffer com { AddEvent(); - DrawcallDescription draw; - draw.numIndices = vertexCount; - draw.numInstances = instanceCount; - draw.indexOffset = 0; - draw.vertexOffset = firstVertex; - draw.instanceOffset = firstInstance; + ActionDescription action; + action.numIndices = vertexCount; + action.numInstances = instanceCount; + action.indexOffset = 0; + action.vertexOffset = firstVertex; + action.instanceOffset = firstInstance; - draw.flags |= DrawFlags::Drawcall | DrawFlags::Instanced; + action.flags |= ActionFlags::Drawcall | ActionFlags::Instanced; - AddDrawcall(draw); + AddAction(action); } } } @@ -269,7 +269,7 @@ void WrappedVulkan::vkCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCoun CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkCmdDraw); Serialise_vkCmdDraw(ser, commandBuffer, vertexCount, instanceCount, firstVertex, firstInstance); @@ -310,12 +310,12 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndexed(SerialiserType &ser, VkCommandBuf ->CmdDrawIndexed(Unwrap(commandBuffer), indexCount, instanceCount, firstIndex, vertexOffset, firstInstance); - if(eventId && m_DrawcallCallback->PostDraw(eventId, commandBuffer)) + if(eventId && m_ActionCallback->PostDraw(eventId, commandBuffer)) { ObjDisp(commandBuffer) ->CmdDrawIndexed(Unwrap(commandBuffer), indexCount, instanceCount, firstIndex, vertexOffset, firstInstance); - m_DrawcallCallback->PostRedraw(eventId, commandBuffer); + m_ActionCallback->PostRedraw(eventId, commandBuffer); } } } @@ -336,16 +336,16 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndexed(SerialiserType &ser, VkCommandBuf { AddEvent(); - DrawcallDescription draw; - draw.numIndices = indexCount; - draw.numInstances = instanceCount; - draw.indexOffset = firstIndex; - draw.baseVertex = vertexOffset; - draw.instanceOffset = firstInstance; + ActionDescription action; + action.numIndices = indexCount; + action.numInstances = instanceCount; + action.indexOffset = firstIndex; + action.baseVertex = vertexOffset; + action.instanceOffset = firstInstance; - draw.flags |= DrawFlags::Drawcall | DrawFlags::Indexed | DrawFlags::Instanced; + action.flags |= ActionFlags::Drawcall | ActionFlags::Indexed | ActionFlags::Instanced; - AddDrawcall(draw); + AddAction(action); } } } @@ -369,7 +369,7 @@ void WrappedVulkan::vkCmdDrawIndexed(VkCommandBuffer commandBuffer, uint32_t ind CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkCmdDrawIndexed); Serialise_vkCmdDrawIndexed(ser, commandBuffer, indexCount, instanceCount, firstIndex, vertexOffset, firstInstance); @@ -419,11 +419,11 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndirect(SerialiserType &ser, VkCommandBu ObjDisp(commandBuffer) ->CmdDrawIndirect(Unwrap(commandBuffer), Unwrap(buffer), offset, count, stride); - if(eventId && m_DrawcallCallback->PostDraw(eventId, commandBuffer)) + if(eventId && m_ActionCallback->PostDraw(eventId, commandBuffer)) { ObjDisp(commandBuffer) ->CmdDrawIndirect(Unwrap(commandBuffer), Unwrap(buffer), offset, count, stride); - m_DrawcallCallback->PostRedraw(eventId, commandBuffer); + m_ActionCallback->PostRedraw(eventId, commandBuffer); } } } @@ -445,24 +445,24 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndirect(SerialiserType &ser, VkCommandBu curEID += m_Partial[Secondary].baseEvent; } - DrawcallUse use(m_CurChunkOffset, 0); - auto it = std::lower_bound(m_DrawcallUses.begin(), m_DrawcallUses.end(), use); + ActionUse use(m_CurChunkOffset, 0); + auto it = std::lower_bound(m_ActionUses.begin(), m_ActionUses.end(), use); - if(it == m_DrawcallUses.end()) + if(it == m_ActionUses.end()) { - RDCERR("Unexpected drawcall not found in uses vector, offset %llu", m_CurChunkOffset); + RDCERR("Unexpected action not found in uses vector, offset %llu", m_CurChunkOffset); } else { uint32_t baseEventID = it->eventId; - // when we have a callback, submit every drawcall individually to the callback - if(m_DrawcallCallback && IsDrawInRenderPass()) + // when we have a callback, submit every action individually to the callback + if(m_ActionCallback && IsDrawInRenderPass()) { VkMarkerRegion::Begin( StringFormat::Fmt("Drawcall callback replay (drawCount=%u)", count), commandBuffer); - // first copy off the buffer segment to our indirect draw buffer + // first copy off the buffer segment to our indirect action buffer VkBufferMemoryBarrier bufBarrier = { VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER, NULL, @@ -490,19 +490,19 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndirect(SerialiserType &ser, VkCommandBu for(uint32_t i = 0; i < count; i++) { - uint32_t eventId = HandlePreCallback(commandBuffer, DrawFlags::Drawcall, i + 1); + uint32_t eventId = HandlePreCallback(commandBuffer, ActionFlags::Drawcall, i + 1); - // draw up to and including i. The previous draws will be nop'd out + // action up to and including i. The previous draws will be nop'd out ObjDisp(commandBuffer) ->CmdDrawIndirect(Unwrap(commandBuffer), Unwrap(m_IndirectBuffer.buf), 0, i + 1, stride); - if(eventId && m_DrawcallCallback->PostDraw(eventId, commandBuffer)) + if(eventId && m_ActionCallback->PostDraw(eventId, commandBuffer)) { ObjDisp(commandBuffer) ->CmdDrawIndirect(Unwrap(commandBuffer), Unwrap(m_IndirectBuffer.buf), 0, i + 1, stride); - m_DrawcallCallback->PostRedraw(eventId, commandBuffer); + m_ActionCallback->PostRedraw(eventId, commandBuffer); } // now that we're done, nop out this draw so that the next time around we only draw @@ -614,16 +614,17 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndirect(SerialiserType &ser, VkCommandBu if(IsDrawInRenderPass()) { - uint32_t eventId = HandlePreCallback(commandBuffer, DrawFlags::Drawcall, drawidx + 1); + uint32_t eventId = + HandlePreCallback(commandBuffer, ActionFlags::Drawcall, drawidx + 1); ObjDisp(commandBuffer) ->CmdDrawIndirect(Unwrap(commandBuffer), Unwrap(buffer), offset, count, stride); - if(eventId && m_DrawcallCallback->PostDraw(eventId, commandBuffer)) + if(eventId && m_ActionCallback->PostDraw(eventId, commandBuffer)) { ObjDisp(commandBuffer) ->CmdDrawIndirect(Unwrap(commandBuffer), Unwrap(buffer), offset, count, stride); - m_DrawcallCallback->PostRedraw(eventId, commandBuffer); + m_ActionCallback->PostRedraw(eventId, commandBuffer); } } } @@ -663,7 +664,7 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndirect(SerialiserType &ser, VkCommandBu // for 'single' draws, don't do complex multi-draw just inline it if(count == 1) { - DrawcallDescription draw; + ActionDescription action; AddEvent(); @@ -689,53 +690,53 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndirect(SerialiserType &ser, VkCommandBu AddEvent(); - draw.name = name; - draw.flags = DrawFlags::Drawcall | DrawFlags::Instanced | DrawFlags::Indirect; + action.name = name; + action.flags = ActionFlags::Drawcall | ActionFlags::Instanced | ActionFlags::Indirect; - AddDrawcall(draw); + AddAction(action); - VulkanDrawcallTreeNode &drawNode = GetDrawcallStack().back()->children.back(); + VulkanActionTreeNode &actionNode = GetActionStack().back()->children.back(); - drawNode.indirectPatch = indirectPatch; + actionNode.indirectPatch = indirectPatch; - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(buffer), EventUsage(drawNode.draw.eventId, ResourceUsage::Indirect))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(buffer), EventUsage(actionNode.action.eventId, ResourceUsage::Indirect))); return true; } - DrawcallDescription draw; - draw.name = name; - draw.flags = DrawFlags::MultiDraw | DrawFlags::PushMarker; + ActionDescription action; + action.name = name; + action.flags = ActionFlags::MultiAction | ActionFlags::PushMarker; if(count == 0) { - draw.flags = DrawFlags::Drawcall | DrawFlags::Instanced | DrawFlags::Indirect; - draw.name += "(0)"; + action.flags = ActionFlags::Drawcall | ActionFlags::Instanced | ActionFlags::Indirect; + action.name += "(0)"; } AddEvent(); - AddDrawcall(draw); + AddAction(action); - VulkanDrawcallTreeNode &drawNode = GetDrawcallStack().back()->children.back(); + VulkanActionTreeNode &actionNode = GetActionStack().back()->children.back(); - drawNode.indirectPatch = indirectPatch; + actionNode.indirectPatch = indirectPatch; - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(buffer), EventUsage(drawNode.draw.eventId, ResourceUsage::Indirect))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(buffer), EventUsage(actionNode.action.eventId, ResourceUsage::Indirect))); if(count > 0) m_BakedCmdBufferInfo[m_LastCmdBufferID].curEventID++; for(uint32_t i = 0; i < count; i++) { - DrawcallDescription multi; + ActionDescription multi; multi.name = name; - multi.flags |= DrawFlags::Drawcall | DrawFlags::Instanced | DrawFlags::Indirect; + multi.flags |= ActionFlags::Drawcall | ActionFlags::Instanced | ActionFlags::Indirect; - // add a fake chunk for this individual indirect draw + // add a fake chunk for this individual indirect action SDChunk *fakeChunk = new SDChunk("Indirect sub-command"_lit); fakeChunk->metadata = baseChunk->metadata; fakeChunk->metadata.chunkID = (uint32_t)VulkanChunk::vkCmdIndirectSubCommand; @@ -754,7 +755,7 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndirect(SerialiserType &ser, VkCommandBu m_StructuredFile->chunks.push_back(fakeChunk); AddEvent(); - AddDrawcall(multi); + AddAction(multi); m_BakedCmdBufferInfo[m_LastCmdBufferID].curEventID++; } @@ -762,9 +763,9 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndirect(SerialiserType &ser, VkCommandBu if(count > 0) { AddEvent(); - draw.name = name + " end"; - draw.flags = DrawFlags::PopMarker; - AddDrawcall(draw); + action.name = name + " end"; + action.flags = ActionFlags::PopMarker; + AddAction(action); } } } @@ -787,7 +788,7 @@ void WrappedVulkan::vkCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer bu CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkCmdDrawIndirect); Serialise_vkCmdDrawIndirect(ser, commandBuffer, buffer, offset, count, stride); @@ -844,12 +845,12 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndexedIndirect(SerialiserType &ser, ObjDisp(commandBuffer) ->CmdDrawIndexedIndirect(Unwrap(commandBuffer), Unwrap(buffer), offset, count, stride); - if(eventId && m_DrawcallCallback->PostDraw(eventId, commandBuffer)) + if(eventId && m_ActionCallback->PostDraw(eventId, commandBuffer)) { ObjDisp(commandBuffer) ->CmdDrawIndexedIndirect(Unwrap(commandBuffer), Unwrap(buffer), offset, count, stride); - m_DrawcallCallback->PostRedraw(eventId, commandBuffer); + m_ActionCallback->PostRedraw(eventId, commandBuffer); } } } @@ -871,34 +872,34 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndexedIndirect(SerialiserType &ser, curEID += m_Partial[Secondary].baseEvent; } - DrawcallUse use(m_CurChunkOffset, 0); - auto it = std::lower_bound(m_DrawcallUses.begin(), m_DrawcallUses.end(), use); + ActionUse use(m_CurChunkOffset, 0); + auto it = std::lower_bound(m_ActionUses.begin(), m_ActionUses.end(), use); - if(it == m_DrawcallUses.end()) + if(it == m_ActionUses.end()) { - RDCERR("Unexpected drawcall not found in uses vector, offset %llu", m_CurChunkOffset); + RDCERR("Unexpected action not found in uses vector, offset %llu", m_CurChunkOffset); } else { uint32_t baseEventID = it->eventId; - // when we have a callback, submit every drawcall individually to the callback - if(m_DrawcallCallback && IsDrawInRenderPass()) + // when we have a callback, submit every action individually to the callback + if(m_ActionCallback && IsDrawInRenderPass()) { for(uint32_t i = 0; i < count; i++) { - uint32_t eventId = HandlePreCallback(commandBuffer, DrawFlags::Drawcall, i + 1); + uint32_t eventId = HandlePreCallback(commandBuffer, ActionFlags::Drawcall, i + 1); ObjDisp(commandBuffer) ->CmdDrawIndexedIndirect(Unwrap(commandBuffer), Unwrap(buffer), offset, 1, stride); - if(eventId && m_DrawcallCallback->PostDraw(eventId, commandBuffer)) + if(eventId && m_ActionCallback->PostDraw(eventId, commandBuffer)) { ObjDisp(commandBuffer) ->CmdDrawIndexedIndirect(Unwrap(commandBuffer), Unwrap(buffer), offset, 1, stride); - m_DrawcallCallback->PostRedraw(eventId, commandBuffer); + m_ActionCallback->PostRedraw(eventId, commandBuffer); } offset += stride; @@ -996,18 +997,19 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndexedIndirect(SerialiserType &ser, if(IsDrawInRenderPass()) { - uint32_t eventId = HandlePreCallback(commandBuffer, DrawFlags::Drawcall, drawidx + 1); + uint32_t eventId = + HandlePreCallback(commandBuffer, ActionFlags::Drawcall, drawidx + 1); ObjDisp(commandBuffer) ->CmdDrawIndexedIndirect(Unwrap(commandBuffer), Unwrap(buffer), offset, count, stride); - if(eventId && m_DrawcallCallback->PostDraw(eventId, commandBuffer)) + if(eventId && m_ActionCallback->PostDraw(eventId, commandBuffer)) { ObjDisp(commandBuffer) ->CmdDrawIndexedIndirect(Unwrap(commandBuffer), Unwrap(buffer), offset, count, stride); - m_DrawcallCallback->PostRedraw(eventId, commandBuffer); + m_ActionCallback->PostRedraw(eventId, commandBuffer); } } } @@ -1047,7 +1049,7 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndexedIndirect(SerialiserType &ser, // for 'single' draws, don't do complex multi-draw just inline it if(count == 1) { - DrawcallDescription draw; + ActionDescription action; AddEvent(); @@ -1073,54 +1075,54 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndexedIndirect(SerialiserType &ser, AddEvent(); - draw.name = name; - draw.flags = - DrawFlags::Drawcall | DrawFlags::Instanced | DrawFlags::Indexed | DrawFlags::Indirect; + action.name = name; + action.flags = ActionFlags::Drawcall | ActionFlags::Instanced | ActionFlags::Indexed | + ActionFlags::Indirect; - AddDrawcall(draw); + AddAction(action); - VulkanDrawcallTreeNode &drawNode = GetDrawcallStack().back()->children.back(); + VulkanActionTreeNode &actionNode = GetActionStack().back()->children.back(); - drawNode.indirectPatch = indirectPatch; + actionNode.indirectPatch = indirectPatch; - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(buffer), EventUsage(drawNode.draw.eventId, ResourceUsage::Indirect))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(buffer), EventUsage(actionNode.action.eventId, ResourceUsage::Indirect))); return true; } - DrawcallDescription draw; - draw.name = name; - draw.flags = DrawFlags::MultiDraw | DrawFlags::PushMarker; + ActionDescription action; + action.name = name; + action.flags = ActionFlags::MultiAction | ActionFlags::PushMarker; if(count == 0) { - draw.name += "(0)"; - draw.flags = - DrawFlags::Drawcall | DrawFlags::Instanced | DrawFlags::Indexed | DrawFlags::Indirect; + action.name += "(0)"; + action.flags = ActionFlags::Drawcall | ActionFlags::Instanced | ActionFlags::Indexed | + ActionFlags::Indirect; } AddEvent(); - AddDrawcall(draw); + AddAction(action); - VulkanDrawcallTreeNode &drawNode = GetDrawcallStack().back()->children.back(); + VulkanActionTreeNode &actionNode = GetActionStack().back()->children.back(); - drawNode.indirectPatch = indirectPatch; + actionNode.indirectPatch = indirectPatch; - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(buffer), EventUsage(drawNode.draw.eventId, ResourceUsage::Indirect))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(buffer), EventUsage(actionNode.action.eventId, ResourceUsage::Indirect))); if(count > 0) m_BakedCmdBufferInfo[m_LastCmdBufferID].curEventID++; for(uint32_t i = 0; i < count; i++) { - DrawcallDescription multi; + ActionDescription multi; multi.name = name; - multi.flags |= - DrawFlags::Drawcall | DrawFlags::Instanced | DrawFlags::Indexed | DrawFlags::Indirect; + multi.flags |= ActionFlags::Drawcall | ActionFlags::Instanced | ActionFlags::Indexed | + ActionFlags::Indirect; // add a fake chunk for this individual indirect draw SDChunk *fakeChunk = new SDChunk("Indirect sub-command"_lit); @@ -1141,7 +1143,7 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndexedIndirect(SerialiserType &ser, m_StructuredFile->chunks.push_back(fakeChunk); AddEvent(); - AddDrawcall(multi); + AddAction(multi); m_BakedCmdBufferInfo[m_LastCmdBufferID].curEventID++; } @@ -1149,9 +1151,9 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndexedIndirect(SerialiserType &ser, if(count > 0) { AddEvent(); - draw.name = name + " end"; - draw.flags = DrawFlags::PopMarker; - AddDrawcall(draw); + action.name = name + " end"; + action.flags = ActionFlags::PopMarker; + AddAction(action); } } } @@ -1174,7 +1176,7 @@ void WrappedVulkan::vkCmdDrawIndexedIndirect(VkCommandBuffer commandBuffer, VkBu CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkCmdDrawIndexedIndirect); Serialise_vkCmdDrawIndexedIndirect(ser, commandBuffer, buffer, offset, count, stride); @@ -1212,14 +1214,14 @@ bool WrappedVulkan::Serialise_vkCmdDispatch(SerialiserType &ser, VkCommandBuffer { commandBuffer = RerecordCmdBuf(m_LastCmdBufferID); - uint32_t eventId = HandlePreCallback(commandBuffer, DrawFlags::Dispatch); + uint32_t eventId = HandlePreCallback(commandBuffer, ActionFlags::Dispatch); ObjDisp(commandBuffer)->CmdDispatch(Unwrap(commandBuffer), x, y, z); - if(eventId && m_DrawcallCallback->PostDispatch(eventId, commandBuffer)) + if(eventId && m_ActionCallback->PostDispatch(eventId, commandBuffer)) { ObjDisp(commandBuffer)->CmdDispatch(Unwrap(commandBuffer), x, y, z); - m_DrawcallCallback->PostRedispatch(eventId, commandBuffer); + m_ActionCallback->PostRedispatch(eventId, commandBuffer); } } } @@ -1230,14 +1232,14 @@ bool WrappedVulkan::Serialise_vkCmdDispatch(SerialiserType &ser, VkCommandBuffer { AddEvent(); - DrawcallDescription draw; - draw.dispatchDimension[0] = x; - draw.dispatchDimension[1] = y; - draw.dispatchDimension[2] = z; + ActionDescription action; + action.dispatchDimension[0] = x; + action.dispatchDimension[1] = y; + action.dispatchDimension[2] = z; - draw.flags |= DrawFlags::Dispatch; + action.flags |= ActionFlags::Dispatch; - AddDrawcall(draw); + AddAction(action); } } } @@ -1257,7 +1259,7 @@ void WrappedVulkan::vkCmdDispatch(VkCommandBuffer commandBuffer, uint32_t x, uin CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkCmdDispatch); Serialise_vkCmdDispatch(ser, commandBuffer, x, y, z); @@ -1288,14 +1290,14 @@ bool WrappedVulkan::Serialise_vkCmdDispatchIndirect(SerialiserType &ser, { commandBuffer = RerecordCmdBuf(m_LastCmdBufferID); - uint32_t eventId = HandlePreCallback(commandBuffer, DrawFlags::Dispatch); + uint32_t eventId = HandlePreCallback(commandBuffer, ActionFlags::Dispatch); ObjDisp(commandBuffer)->CmdDispatchIndirect(Unwrap(commandBuffer), Unwrap(buffer), offset); - if(eventId && m_DrawcallCallback->PostDispatch(eventId, commandBuffer)) + if(eventId && m_ActionCallback->PostDispatch(eventId, commandBuffer)) { ObjDisp(commandBuffer)->CmdDispatchIndirect(Unwrap(commandBuffer), Unwrap(buffer), offset); - m_DrawcallCallback->PostRedispatch(eventId, commandBuffer); + m_ActionCallback->PostRedispatch(eventId, commandBuffer); } } } @@ -1309,22 +1311,22 @@ bool WrappedVulkan::Serialise_vkCmdDispatchIndirect(SerialiserType &ser, { AddEvent(); - DrawcallDescription draw; - draw.name = "vkCmdDispatchIndirect()"; - draw.dispatchDimension[0] = 0; - draw.dispatchDimension[1] = 0; - draw.dispatchDimension[2] = 0; + ActionDescription action; + action.name = "vkCmdDispatchIndirect()"; + action.dispatchDimension[0] = 0; + action.dispatchDimension[1] = 0; + action.dispatchDimension[2] = 0; - draw.flags |= DrawFlags::Dispatch | DrawFlags::Indirect; + action.flags |= ActionFlags::Dispatch | ActionFlags::Indirect; - AddDrawcall(draw); + AddAction(action); - VulkanDrawcallTreeNode &drawNode = GetDrawcallStack().back()->children.back(); + VulkanActionTreeNode &actionNode = GetActionStack().back()->children.back(); - drawNode.indirectPatch = indirectPatch; + actionNode.indirectPatch = indirectPatch; - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(buffer), EventUsage(drawNode.draw.eventId, ResourceUsage::Indirect))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(buffer), EventUsage(actionNode.action.eventId, ResourceUsage::Indirect))); } } } @@ -1346,7 +1348,7 @@ void WrappedVulkan::vkCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffe CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkCmdDispatchIndirect); Serialise_vkCmdDispatchIndirect(ser, commandBuffer, buffer, offset); @@ -1387,19 +1389,19 @@ bool WrappedVulkan::Serialise_vkCmdBlitImage(SerialiserType &ser, VkCommandBuffe { commandBuffer = RerecordCmdBuf(m_LastCmdBufferID); - uint32_t eventId = HandlePreCallback(commandBuffer, DrawFlags::Resolve); + uint32_t eventId = HandlePreCallback(commandBuffer, ActionFlags::Resolve); ObjDisp(commandBuffer) ->CmdBlitImage(Unwrap(commandBuffer), Unwrap(srcImage), srcImageLayout, Unwrap(destImage), destImageLayout, regionCount, pRegions, filter); - if(eventId && m_DrawcallCallback->PostMisc(eventId, DrawFlags::Resolve, commandBuffer)) + if(eventId && m_ActionCallback->PostMisc(eventId, ActionFlags::Resolve, commandBuffer)) { ObjDisp(commandBuffer) ->CmdBlitImage(Unwrap(commandBuffer), Unwrap(srcImage), srcImageLayout, Unwrap(destImage), destImageLayout, regionCount, pRegions, filter); - m_DrawcallCallback->PostRemisc(eventId, DrawFlags::Resolve, commandBuffer); + m_ActionCallback->PostRemisc(eventId, ActionFlags::Resolve, commandBuffer); } } } @@ -1415,35 +1417,35 @@ bool WrappedVulkan::Serialise_vkCmdBlitImage(SerialiserType &ser, VkCommandBuffe ResourceId srcid = GetResourceManager()->GetOriginalID(GetResID(srcImage)); ResourceId dstid = GetResourceManager()->GetOriginalID(GetResID(destImage)); - DrawcallDescription draw; - draw.flags |= DrawFlags::Resolve; + ActionDescription action; + action.flags |= ActionFlags::Resolve; - draw.copySource = srcid; - draw.copySourceSubresource = Subresource(); - draw.copyDestination = dstid; - draw.copyDestinationSubresource = Subresource(); + action.copySource = srcid; + action.copySourceSubresource = Subresource(); + action.copyDestination = dstid; + action.copyDestinationSubresource = Subresource(); if(regionCount > 0) { - draw.copySourceSubresource = Subresource(pRegions[0].srcSubresource.mipLevel, - pRegions[0].srcSubresource.baseArrayLayer); - draw.copyDestinationSubresource = Subresource(pRegions[0].dstSubresource.mipLevel, - pRegions[0].dstSubresource.baseArrayLayer); + action.copySourceSubresource = Subresource(pRegions[0].srcSubresource.mipLevel, + pRegions[0].srcSubresource.baseArrayLayer); + action.copyDestinationSubresource = Subresource( + pRegions[0].dstSubresource.mipLevel, pRegions[0].dstSubresource.baseArrayLayer); } - AddDrawcall(draw); + AddAction(action); - VulkanDrawcallTreeNode &drawNode = GetDrawcallStack().back()->children.back(); + VulkanActionTreeNode &actionNode = GetActionStack().back()->children.back(); if(srcImage == destImage) { - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(srcImage), EventUsage(drawNode.draw.eventId, ResourceUsage::Resolve))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(srcImage), EventUsage(actionNode.action.eventId, ResourceUsage::Resolve))); } else { - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(srcImage), EventUsage(drawNode.draw.eventId, ResourceUsage::ResolveSrc))); - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(destImage), EventUsage(drawNode.draw.eventId, ResourceUsage::ResolveDst))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(srcImage), EventUsage(actionNode.action.eventId, ResourceUsage::ResolveSrc))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(destImage), EventUsage(actionNode.action.eventId, ResourceUsage::ResolveDst))); } } } @@ -1470,7 +1472,7 @@ void WrappedVulkan::vkCmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcIma CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkCmdBlitImage); Serialise_vkCmdBlitImage(ser, commandBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, pRegions, filter); @@ -1534,19 +1536,19 @@ bool WrappedVulkan::Serialise_vkCmdResolveImage(SerialiserType &ser, VkCommandBu { commandBuffer = RerecordCmdBuf(m_LastCmdBufferID); - uint32_t eventId = HandlePreCallback(commandBuffer, DrawFlags::Resolve); + uint32_t eventId = HandlePreCallback(commandBuffer, ActionFlags::Resolve); ObjDisp(commandBuffer) ->CmdResolveImage(Unwrap(commandBuffer), Unwrap(srcImage), srcImageLayout, Unwrap(destImage), destImageLayout, regionCount, pRegions); - if(eventId && m_DrawcallCallback->PostMisc(eventId, DrawFlags::Resolve, commandBuffer)) + if(eventId && m_ActionCallback->PostMisc(eventId, ActionFlags::Resolve, commandBuffer)) { ObjDisp(commandBuffer) ->CmdResolveImage(Unwrap(commandBuffer), Unwrap(srcImage), srcImageLayout, Unwrap(destImage), destImageLayout, regionCount, pRegions); - m_DrawcallCallback->PostRemisc(eventId, DrawFlags::Resolve, commandBuffer); + m_ActionCallback->PostRemisc(eventId, ActionFlags::Resolve, commandBuffer); } } } @@ -1562,35 +1564,35 @@ bool WrappedVulkan::Serialise_vkCmdResolveImage(SerialiserType &ser, VkCommandBu ResourceId srcid = GetResourceManager()->GetOriginalID(GetResID(srcImage)); ResourceId dstid = GetResourceManager()->GetOriginalID(GetResID(destImage)); - DrawcallDescription draw; - draw.flags |= DrawFlags::Resolve; + ActionDescription action; + action.flags |= ActionFlags::Resolve; - draw.copySource = srcid; - draw.copySourceSubresource = Subresource(); - draw.copyDestination = dstid; - draw.copyDestinationSubresource = Subresource(); + action.copySource = srcid; + action.copySourceSubresource = Subresource(); + action.copyDestination = dstid; + action.copyDestinationSubresource = Subresource(); if(regionCount > 0) { - draw.copySourceSubresource = Subresource(pRegions[0].srcSubresource.mipLevel, - pRegions[0].srcSubresource.baseArrayLayer); - draw.copyDestinationSubresource = Subresource(pRegions[0].dstSubresource.mipLevel, - pRegions[0].dstSubresource.baseArrayLayer); + action.copySourceSubresource = Subresource(pRegions[0].srcSubresource.mipLevel, + pRegions[0].srcSubresource.baseArrayLayer); + action.copyDestinationSubresource = Subresource( + pRegions[0].dstSubresource.mipLevel, pRegions[0].dstSubresource.baseArrayLayer); } - AddDrawcall(draw); + AddAction(action); - VulkanDrawcallTreeNode &drawNode = GetDrawcallStack().back()->children.back(); + VulkanActionTreeNode &actionNode = GetActionStack().back()->children.back(); if(srcImage == destImage) { - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(srcImage), EventUsage(drawNode.draw.eventId, ResourceUsage::Resolve))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(srcImage), EventUsage(actionNode.action.eventId, ResourceUsage::Resolve))); } else { - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(srcImage), EventUsage(drawNode.draw.eventId, ResourceUsage::ResolveSrc))); - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(destImage), EventUsage(drawNode.draw.eventId, ResourceUsage::ResolveDst))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(srcImage), EventUsage(actionNode.action.eventId, ResourceUsage::ResolveSrc))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(destImage), EventUsage(actionNode.action.eventId, ResourceUsage::ResolveDst))); } } } @@ -1617,7 +1619,7 @@ void WrappedVulkan::vkCmdResolveImage(VkCommandBuffer commandBuffer, VkImage src CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkCmdResolveImage); Serialise_vkCmdResolveImage(ser, commandBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, pRegions); @@ -1670,19 +1672,19 @@ bool WrappedVulkan::Serialise_vkCmdCopyImage(SerialiserType &ser, VkCommandBuffe { commandBuffer = RerecordCmdBuf(m_LastCmdBufferID); - uint32_t eventId = HandlePreCallback(commandBuffer, DrawFlags::Copy); + uint32_t eventId = HandlePreCallback(commandBuffer, ActionFlags::Copy); ObjDisp(commandBuffer) ->CmdCopyImage(Unwrap(commandBuffer), Unwrap(srcImage), srcImageLayout, Unwrap(destImage), destImageLayout, regionCount, pRegions); - if(eventId && m_DrawcallCallback->PostMisc(eventId, DrawFlags::Copy, commandBuffer)) + if(eventId && m_ActionCallback->PostMisc(eventId, ActionFlags::Copy, commandBuffer)) { ObjDisp(commandBuffer) ->CmdCopyImage(Unwrap(commandBuffer), Unwrap(srcImage), srcImageLayout, Unwrap(destImage), destImageLayout, regionCount, pRegions); - m_DrawcallCallback->PostRemisc(eventId, DrawFlags::Copy, commandBuffer); + m_ActionCallback->PostRemisc(eventId, ActionFlags::Copy, commandBuffer); } } } @@ -1698,36 +1700,36 @@ bool WrappedVulkan::Serialise_vkCmdCopyImage(SerialiserType &ser, VkCommandBuffe ResourceId srcid = GetResourceManager()->GetOriginalID(GetResID(srcImage)); ResourceId dstid = GetResourceManager()->GetOriginalID(GetResID(destImage)); - DrawcallDescription draw; - draw.flags |= DrawFlags::Copy; + ActionDescription action; + action.flags |= ActionFlags::Copy; - draw.copySource = srcid; - draw.copySourceSubresource = Subresource(); - draw.copyDestination = dstid; - draw.copyDestinationSubresource = Subresource(); + action.copySource = srcid; + action.copySourceSubresource = Subresource(); + action.copyDestination = dstid; + action.copyDestinationSubresource = Subresource(); if(regionCount > 0) { - draw.copySourceSubresource = Subresource(pRegions[0].srcSubresource.mipLevel, - pRegions[0].srcSubresource.baseArrayLayer); - draw.copyDestinationSubresource = Subresource(pRegions[0].dstSubresource.mipLevel, - pRegions[0].dstSubresource.baseArrayLayer); + action.copySourceSubresource = Subresource(pRegions[0].srcSubresource.mipLevel, + pRegions[0].srcSubresource.baseArrayLayer); + action.copyDestinationSubresource = Subresource( + pRegions[0].dstSubresource.mipLevel, pRegions[0].dstSubresource.baseArrayLayer); } - AddDrawcall(draw); + AddAction(action); - VulkanDrawcallTreeNode &drawNode = GetDrawcallStack().back()->children.back(); + VulkanActionTreeNode &actionNode = GetActionStack().back()->children.back(); if(srcImage == destImage) { - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(srcImage), EventUsage(drawNode.draw.eventId, ResourceUsage::Copy))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(srcImage), EventUsage(actionNode.action.eventId, ResourceUsage::Copy))); } else { - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(srcImage), EventUsage(drawNode.draw.eventId, ResourceUsage::CopySrc))); - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(destImage), EventUsage(drawNode.draw.eventId, ResourceUsage::CopyDst))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(srcImage), EventUsage(actionNode.action.eventId, ResourceUsage::CopySrc))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(destImage), EventUsage(actionNode.action.eventId, ResourceUsage::CopyDst))); } } } @@ -1753,7 +1755,7 @@ void WrappedVulkan::vkCmdCopyImage(VkCommandBuffer commandBuffer, VkImage srcIma CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkCmdCopyImage); Serialise_vkCmdCopyImage(ser, commandBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, pRegions); @@ -1803,19 +1805,19 @@ bool WrappedVulkan::Serialise_vkCmdCopyBufferToImage( { commandBuffer = RerecordCmdBuf(m_LastCmdBufferID); - uint32_t eventId = HandlePreCallback(commandBuffer, DrawFlags::Copy); + uint32_t eventId = HandlePreCallback(commandBuffer, ActionFlags::Copy); ObjDisp(commandBuffer) ->CmdCopyBufferToImage(Unwrap(commandBuffer), Unwrap(srcBuffer), Unwrap(destImage), destImageLayout, regionCount, pRegions); - if(eventId && m_DrawcallCallback->PostMisc(eventId, DrawFlags::Copy, commandBuffer)) + if(eventId && m_ActionCallback->PostMisc(eventId, ActionFlags::Copy, commandBuffer)) { ObjDisp(commandBuffer) ->CmdCopyBufferToImage(Unwrap(commandBuffer), Unwrap(srcBuffer), Unwrap(destImage), destImageLayout, regionCount, pRegions); - m_DrawcallCallback->PostRemisc(eventId, DrawFlags::Copy, commandBuffer); + m_ActionCallback->PostRemisc(eventId, ActionFlags::Copy, commandBuffer); } } } @@ -1831,25 +1833,25 @@ bool WrappedVulkan::Serialise_vkCmdCopyBufferToImage( ResourceId bufid = GetResourceManager()->GetOriginalID(GetResID(srcBuffer)); ResourceId imgid = GetResourceManager()->GetOriginalID(GetResID(destImage)); - DrawcallDescription draw; - draw.flags |= DrawFlags::Copy; + ActionDescription action; + action.flags |= ActionFlags::Copy; - draw.copySource = bufid; - draw.copySourceSubresource = Subresource(); - draw.copyDestination = imgid; - draw.copyDestinationSubresource = Subresource(); + action.copySource = bufid; + action.copySourceSubresource = Subresource(); + action.copyDestination = imgid; + action.copyDestinationSubresource = Subresource(); if(regionCount > 0) - draw.copyDestinationSubresource = Subresource( + action.copyDestinationSubresource = Subresource( pRegions[0].imageSubresource.mipLevel, pRegions[0].imageSubresource.baseArrayLayer); - AddDrawcall(draw); + AddAction(action); - VulkanDrawcallTreeNode &drawNode = GetDrawcallStack().back()->children.back(); + VulkanActionTreeNode &actionNode = GetActionStack().back()->children.back(); - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(srcBuffer), EventUsage(drawNode.draw.eventId, ResourceUsage::CopySrc))); - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(destImage), EventUsage(drawNode.draw.eventId, ResourceUsage::CopyDst))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(srcBuffer), EventUsage(actionNode.action.eventId, ResourceUsage::CopySrc))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(destImage), EventUsage(actionNode.action.eventId, ResourceUsage::CopyDst))); } } } @@ -1874,7 +1876,7 @@ void WrappedVulkan::vkCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuff CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkCmdCopyBufferToImage); Serialise_vkCmdCopyBufferToImage(ser, commandBuffer, srcBuffer, destImage, destImageLayout, regionCount, pRegions); @@ -1914,19 +1916,19 @@ bool WrappedVulkan::Serialise_vkCmdCopyImageToBuffer(SerialiserType &ser, { commandBuffer = RerecordCmdBuf(m_LastCmdBufferID); - uint32_t eventId = HandlePreCallback(commandBuffer, DrawFlags::Copy); + uint32_t eventId = HandlePreCallback(commandBuffer, ActionFlags::Copy); ObjDisp(commandBuffer) ->CmdCopyImageToBuffer(Unwrap(commandBuffer), Unwrap(srcImage), srcImageLayout, Unwrap(destBuffer), regionCount, pRegions); - if(eventId && m_DrawcallCallback->PostMisc(eventId, DrawFlags::Copy, commandBuffer)) + if(eventId && m_ActionCallback->PostMisc(eventId, ActionFlags::Copy, commandBuffer)) { ObjDisp(commandBuffer) ->CmdCopyImageToBuffer(Unwrap(commandBuffer), Unwrap(srcImage), srcImageLayout, Unwrap(destBuffer), regionCount, pRegions); - m_DrawcallCallback->PostRemisc(eventId, DrawFlags::Copy, commandBuffer); + m_ActionCallback->PostRemisc(eventId, ActionFlags::Copy, commandBuffer); } } } @@ -1942,25 +1944,25 @@ bool WrappedVulkan::Serialise_vkCmdCopyImageToBuffer(SerialiserType &ser, ResourceId imgid = GetResourceManager()->GetOriginalID(GetResID(srcImage)); ResourceId bufid = GetResourceManager()->GetOriginalID(GetResID(destBuffer)); - DrawcallDescription draw; - draw.flags |= DrawFlags::Copy; + ActionDescription action; + action.flags |= ActionFlags::Copy; - draw.copySource = imgid; - draw.copySourceSubresource = Subresource(); - draw.copyDestination = bufid; - draw.copyDestinationSubresource = Subresource(); + action.copySource = imgid; + action.copySourceSubresource = Subresource(); + action.copyDestination = bufid; + action.copyDestinationSubresource = Subresource(); if(regionCount > 0) - draw.copySourceSubresource = Subresource(pRegions[0].imageSubresource.mipLevel, - pRegions[0].imageSubresource.baseArrayLayer); + action.copySourceSubresource = Subresource(pRegions[0].imageSubresource.mipLevel, + pRegions[0].imageSubresource.baseArrayLayer); - AddDrawcall(draw); + AddAction(action); - VulkanDrawcallTreeNode &drawNode = GetDrawcallStack().back()->children.back(); + VulkanActionTreeNode &actionNode = GetActionStack().back()->children.back(); - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(srcImage), EventUsage(drawNode.draw.eventId, ResourceUsage::CopySrc))); - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(destBuffer), EventUsage(drawNode.draw.eventId, ResourceUsage::CopyDst))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(srcImage), EventUsage(actionNode.action.eventId, ResourceUsage::CopySrc))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(destBuffer), EventUsage(actionNode.action.eventId, ResourceUsage::CopyDst))); } } } @@ -1985,7 +1987,7 @@ void WrappedVulkan::vkCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImag CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkCmdCopyImageToBuffer); Serialise_vkCmdCopyImageToBuffer(ser, commandBuffer, srcImage, srcImageLayout, destBuffer, regionCount, pRegions); @@ -2022,19 +2024,19 @@ bool WrappedVulkan::Serialise_vkCmdCopyBuffer(SerialiserType &ser, VkCommandBuff { commandBuffer = RerecordCmdBuf(m_LastCmdBufferID); - uint32_t eventId = HandlePreCallback(commandBuffer, DrawFlags::Copy); + uint32_t eventId = HandlePreCallback(commandBuffer, ActionFlags::Copy); ObjDisp(commandBuffer) ->CmdCopyBuffer(Unwrap(commandBuffer), Unwrap(srcBuffer), Unwrap(destBuffer), regionCount, pRegions); - if(eventId && m_DrawcallCallback->PostMisc(eventId, DrawFlags::Copy, commandBuffer)) + if(eventId && m_ActionCallback->PostMisc(eventId, ActionFlags::Copy, commandBuffer)) { ObjDisp(commandBuffer) ->CmdCopyBuffer(Unwrap(commandBuffer), Unwrap(srcBuffer), Unwrap(destBuffer), regionCount, pRegions); - m_DrawcallCallback->PostRemisc(eventId, DrawFlags::Copy, commandBuffer); + m_ActionCallback->PostRemisc(eventId, ActionFlags::Copy, commandBuffer); } } } @@ -2050,29 +2052,29 @@ bool WrappedVulkan::Serialise_vkCmdCopyBuffer(SerialiserType &ser, VkCommandBuff ResourceId srcid = GetResourceManager()->GetOriginalID(GetResID(srcBuffer)); ResourceId dstid = GetResourceManager()->GetOriginalID(GetResID(destBuffer)); - DrawcallDescription draw; - draw.flags |= DrawFlags::Copy; + ActionDescription action; + action.flags |= ActionFlags::Copy; - draw.copySource = srcid; - draw.copySourceSubresource = Subresource(); - draw.copyDestination = dstid; - draw.copyDestinationSubresource = Subresource(); + action.copySource = srcid; + action.copySourceSubresource = Subresource(); + action.copyDestination = dstid; + action.copyDestinationSubresource = Subresource(); - AddDrawcall(draw); + AddAction(action); - VulkanDrawcallTreeNode &drawNode = GetDrawcallStack().back()->children.back(); + VulkanActionTreeNode &actionNode = GetActionStack().back()->children.back(); if(srcBuffer == destBuffer) { - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(srcBuffer), EventUsage(drawNode.draw.eventId, ResourceUsage::Copy))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(srcBuffer), EventUsage(actionNode.action.eventId, ResourceUsage::Copy))); } else { - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(srcBuffer), EventUsage(drawNode.draw.eventId, ResourceUsage::CopySrc))); - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(destBuffer), EventUsage(drawNode.draw.eventId, ResourceUsage::CopyDst))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(srcBuffer), EventUsage(actionNode.action.eventId, ResourceUsage::CopySrc))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(destBuffer), EventUsage(actionNode.action.eventId, ResourceUsage::CopyDst))); } } } @@ -2097,7 +2099,7 @@ void WrappedVulkan::vkCmdCopyBuffer(VkCommandBuffer commandBuffer, VkBuffer srcB CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkCmdCopyBuffer); Serialise_vkCmdCopyBuffer(ser, commandBuffer, srcBuffer, destBuffer, regionCount, pRegions); @@ -2137,17 +2139,17 @@ bool WrappedVulkan::Serialise_vkCmdFillBuffer(SerialiserType &ser, VkCommandBuff { commandBuffer = RerecordCmdBuf(m_LastCmdBufferID); - uint32_t eventId = HandlePreCallback(commandBuffer, DrawFlags::Clear); + uint32_t eventId = HandlePreCallback(commandBuffer, ActionFlags::Clear); ObjDisp(commandBuffer) ->CmdFillBuffer(Unwrap(commandBuffer), Unwrap(destBuffer), destOffset, fillSize, data); - if(eventId && m_DrawcallCallback->PostMisc(eventId, DrawFlags::Clear, commandBuffer)) + if(eventId && m_ActionCallback->PostMisc(eventId, ActionFlags::Clear, commandBuffer)) { ObjDisp(commandBuffer) ->CmdFillBuffer(Unwrap(commandBuffer), Unwrap(destBuffer), destOffset, fillSize, data); - m_DrawcallCallback->PostRemisc(eventId, DrawFlags::Clear, commandBuffer); + m_ActionCallback->PostRemisc(eventId, ActionFlags::Clear, commandBuffer); } } } @@ -2161,17 +2163,17 @@ bool WrappedVulkan::Serialise_vkCmdFillBuffer(SerialiserType &ser, VkCommandBuff ResourceId id = GetResourceManager()->GetOriginalID(GetResID(destBuffer)); - DrawcallDescription draw; - draw.flags = DrawFlags::Clear; - draw.copyDestination = id; - draw.copyDestinationSubresource = Subresource(); + ActionDescription action; + action.flags = ActionFlags::Clear; + action.copyDestination = id; + action.copyDestinationSubresource = Subresource(); - AddDrawcall(draw); + AddAction(action); - VulkanDrawcallTreeNode &drawNode = GetDrawcallStack().back()->children.back(); + VulkanActionTreeNode &actionNode = GetActionStack().back()->children.back(); - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(destBuffer), EventUsage(drawNode.draw.eventId, ResourceUsage::Clear))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(destBuffer), EventUsage(actionNode.action.eventId, ResourceUsage::Clear))); } } } @@ -2232,23 +2234,23 @@ bool WrappedVulkan::Serialise_vkCmdClearColorImage(SerialiserType &ser, VkComman { commandBuffer = RerecordCmdBuf(m_LastCmdBufferID); - uint32_t eventId = - HandlePreCallback(commandBuffer, DrawFlags(DrawFlags::Clear | DrawFlags::ClearColor)); + uint32_t eventId = HandlePreCallback( + commandBuffer, ActionFlags(ActionFlags::Clear | ActionFlags::ClearColor)); ObjDisp(commandBuffer) ->CmdClearColorImage(Unwrap(commandBuffer), Unwrap(image), imageLayout, &Color, rangeCount, pRanges); if(eventId && - m_DrawcallCallback->PostMisc( - eventId, DrawFlags(DrawFlags::Clear | DrawFlags::ClearColor), commandBuffer)) + m_ActionCallback->PostMisc( + eventId, ActionFlags(ActionFlags::Clear | ActionFlags::ClearColor), commandBuffer)) { ObjDisp(commandBuffer) ->CmdClearColorImage(Unwrap(commandBuffer), Unwrap(image), imageLayout, &Color, rangeCount, pRanges); - m_DrawcallCallback->PostRemisc( - eventId, DrawFlags(DrawFlags::Clear | DrawFlags::ClearColor), commandBuffer); + m_ActionCallback->PostRemisc( + eventId, ActionFlags(ActionFlags::Clear | ActionFlags::ClearColor), commandBuffer); } } } @@ -2261,20 +2263,20 @@ bool WrappedVulkan::Serialise_vkCmdClearColorImage(SerialiserType &ser, VkComman { AddEvent(); - DrawcallDescription draw; - draw.flags |= DrawFlags::Clear | DrawFlags::ClearColor; - draw.copyDestination = GetResourceManager()->GetOriginalID(GetResID(image)); - draw.copyDestinationSubresource = Subresource(); + ActionDescription action; + action.flags |= ActionFlags::Clear | ActionFlags::ClearColor; + action.copyDestination = GetResourceManager()->GetOriginalID(GetResID(image)); + action.copyDestinationSubresource = Subresource(); if(rangeCount > 0) - draw.copyDestinationSubresource = + action.copyDestinationSubresource = Subresource(pRanges[0].baseMipLevel, pRanges[0].baseArrayLayer); - AddDrawcall(draw); + AddAction(action); - VulkanDrawcallTreeNode &drawNode = GetDrawcallStack().back()->children.back(); + VulkanActionTreeNode &actionNode = GetActionStack().back()->children.back(); - drawNode.resourceUsage.push_back( - make_rdcpair(GetResID(image), EventUsage(drawNode.draw.eventId, ResourceUsage::Clear))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(image), EventUsage(actionNode.action.eventId, ResourceUsage::Clear))); } } } @@ -2298,7 +2300,7 @@ void WrappedVulkan::vkCmdClearColorImage(VkCommandBuffer commandBuffer, VkImage CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkCmdClearColorImage); Serialise_vkCmdClearColorImage(ser, commandBuffer, image, imageLayout, pColor, rangeCount, pRanges); @@ -2344,22 +2346,24 @@ bool WrappedVulkan::Serialise_vkCmdClearDepthStencilImage( commandBuffer = RerecordCmdBuf(m_LastCmdBufferID); uint32_t eventId = HandlePreCallback( - commandBuffer, DrawFlags(DrawFlags::Clear | DrawFlags::ClearDepthStencil)); + commandBuffer, ActionFlags(ActionFlags::Clear | ActionFlags::ClearDepthStencil)); ObjDisp(commandBuffer) ->CmdClearDepthStencilImage(Unwrap(commandBuffer), Unwrap(image), imageLayout, &DepthStencil, rangeCount, pRanges); if(eventId && - m_DrawcallCallback->PostMisc( - eventId, DrawFlags(DrawFlags::Clear | DrawFlags::ClearDepthStencil), commandBuffer)) + m_ActionCallback->PostMisc( + eventId, ActionFlags(ActionFlags::Clear | ActionFlags::ClearDepthStencil), + commandBuffer)) { ObjDisp(commandBuffer) ->CmdClearDepthStencilImage(Unwrap(commandBuffer), Unwrap(image), imageLayout, &DepthStencil, rangeCount, pRanges); - m_DrawcallCallback->PostRemisc( - eventId, DrawFlags(DrawFlags::Clear | DrawFlags::ClearDepthStencil), commandBuffer); + m_ActionCallback->PostRemisc( + eventId, ActionFlags(ActionFlags::Clear | ActionFlags::ClearDepthStencil), + commandBuffer); } } } @@ -2372,20 +2376,20 @@ bool WrappedVulkan::Serialise_vkCmdClearDepthStencilImage( { AddEvent(); - DrawcallDescription draw; - draw.flags |= DrawFlags::Clear | DrawFlags::ClearDepthStencil; - draw.copyDestination = GetResourceManager()->GetOriginalID(GetResID(image)); - draw.copyDestinationSubresource = Subresource(); + ActionDescription action; + action.flags |= ActionFlags::Clear | ActionFlags::ClearDepthStencil; + action.copyDestination = GetResourceManager()->GetOriginalID(GetResID(image)); + action.copyDestinationSubresource = Subresource(); if(rangeCount > 0) - draw.copyDestinationSubresource = + action.copyDestinationSubresource = Subresource(pRanges[0].baseMipLevel, pRanges[0].baseArrayLayer); - AddDrawcall(draw); + AddAction(action); - VulkanDrawcallTreeNode &drawNode = GetDrawcallStack().back()->children.back(); + VulkanActionTreeNode &actionNode = GetActionStack().back()->children.back(); - drawNode.resourceUsage.push_back( - make_rdcpair(GetResID(image), EventUsage(drawNode.draw.eventId, ResourceUsage::Clear))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(image), EventUsage(actionNode.action.eventId, ResourceUsage::Clear))); } } } @@ -2412,7 +2416,7 @@ void WrappedVulkan::vkCmdClearDepthStencilImage(VkCommandBuffer commandBuffer, V CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkCmdClearDepthStencilImage); Serialise_vkCmdClearDepthStencilImage(ser, commandBuffer, image, imageLayout, pDepthStencil, rangeCount, pRanges); @@ -2458,20 +2462,20 @@ bool WrappedVulkan::Serialise_vkCmdClearAttachments(SerialiserType &ser, { commandBuffer = RerecordCmdBuf(m_LastCmdBufferID); - uint32_t eventId = HandlePreCallback(commandBuffer, DrawFlags(DrawFlags::Clear)); + uint32_t eventId = HandlePreCallback(commandBuffer, ActionFlags(ActionFlags::Clear)); ObjDisp(commandBuffer) ->CmdClearAttachments(Unwrap(commandBuffer), attachmentCount, pAttachments, rectCount, pRects); if(eventId && - m_DrawcallCallback->PostMisc(eventId, DrawFlags(DrawFlags::Clear), commandBuffer)) + m_ActionCallback->PostMisc(eventId, ActionFlags(ActionFlags::Clear), commandBuffer)) { ObjDisp(commandBuffer) ->CmdClearAttachments(Unwrap(commandBuffer), attachmentCount, pAttachments, rectCount, pRects); - m_DrawcallCallback->PostRemisc(eventId, DrawFlags(DrawFlags::Clear), commandBuffer); + m_ActionCallback->PostRemisc(eventId, ActionFlags(ActionFlags::Clear), commandBuffer); } } } @@ -2484,19 +2488,19 @@ bool WrappedVulkan::Serialise_vkCmdClearAttachments(SerialiserType &ser, { AddEvent(); - DrawcallDescription draw; - draw.flags |= DrawFlags::Clear; + ActionDescription action; + action.flags |= ActionFlags::Clear; for(uint32_t a = 0; a < attachmentCount; a++) { if(pAttachments[a].aspectMask & VK_IMAGE_ASPECT_COLOR_BIT) - draw.flags |= DrawFlags::ClearColor; + action.flags |= ActionFlags::ClearColor; if(pAttachments[a].aspectMask & VK_IMAGE_ASPECT_DEPTH_BIT) - draw.flags |= DrawFlags::ClearDepthStencil; + action.flags |= ActionFlags::ClearDepthStencil; } - AddDrawcall(draw); + AddAction(action); - VulkanDrawcallTreeNode &drawNode = GetDrawcallStack().back()->children.back(); + VulkanActionTreeNode &actionNode = GetActionStack().back()->children.back(); const VulkanRenderState &state = m_BakedCmdBufferInfo[m_LastCmdBufferID].state; if(state.renderPass != ResourceId() && state.GetFramebuffer() != ResourceId()) @@ -2514,9 +2518,9 @@ bool WrappedVulkan::Serialise_vkCmdClearAttachments(SerialiserType &ser, if(att < (uint32_t)rp.subpasses[state.subpass].colorAttachments.size()) { att = rp.subpasses[state.subpass].colorAttachments[att]; - drawNode.resourceUsage.push_back(make_rdcpair( + actionNode.resourceUsage.push_back(make_rdcpair( m_CreationInfo.m_ImageView[state.GetFramebufferAttachments()[att]].image, - EventUsage(drawNode.draw.eventId, ResourceUsage::Clear, + EventUsage(actionNode.action.eventId, ResourceUsage::Clear, state.GetFramebufferAttachments()[att]))); } } @@ -2525,9 +2529,9 @@ bool WrappedVulkan::Serialise_vkCmdClearAttachments(SerialiserType &ser, if(rp.subpasses[state.subpass].depthstencilAttachment >= 0) { att = (uint32_t)rp.subpasses[state.subpass].depthstencilAttachment; - drawNode.resourceUsage.push_back(make_rdcpair( + actionNode.resourceUsage.push_back(make_rdcpair( m_CreationInfo.m_ImageView[state.GetFramebufferAttachments()[att]].image, - EventUsage(drawNode.draw.eventId, ResourceUsage::Clear, + EventUsage(actionNode.action.eventId, ResourceUsage::Clear, state.GetFramebufferAttachments()[att]))); } } @@ -2556,7 +2560,7 @@ void WrappedVulkan::vkCmdClearAttachments(VkCommandBuffer commandBuffer, uint32_ CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkCmdClearAttachments); Serialise_vkCmdClearAttachments(ser, commandBuffer, attachmentCount, pAttachments, rectCount, pRects); @@ -2596,18 +2600,18 @@ bool WrappedVulkan::Serialise_vkCmdDispatchBase(SerialiserType &ser, VkCommandBu { commandBuffer = RerecordCmdBuf(m_LastCmdBufferID); - uint32_t eventId = HandlePreCallback(commandBuffer, DrawFlags::Dispatch); + uint32_t eventId = HandlePreCallback(commandBuffer, ActionFlags::Dispatch); ObjDisp(commandBuffer) ->CmdDispatchBase(Unwrap(commandBuffer), baseGroupX, baseGroupY, baseGroupZ, groupCountX, groupCountY, groupCountZ); - if(eventId && m_DrawcallCallback->PostDispatch(eventId, commandBuffer)) + if(eventId && m_ActionCallback->PostDispatch(eventId, commandBuffer)) { ObjDisp(commandBuffer) ->CmdDispatchBase(Unwrap(commandBuffer), baseGroupX, baseGroupY, baseGroupZ, groupCountX, groupCountY, groupCountZ); - m_DrawcallCallback->PostRedispatch(eventId, commandBuffer); + m_ActionCallback->PostRedispatch(eventId, commandBuffer); } } } @@ -2620,17 +2624,17 @@ bool WrappedVulkan::Serialise_vkCmdDispatchBase(SerialiserType &ser, VkCommandBu { AddEvent(); - DrawcallDescription draw; - draw.dispatchDimension[0] = groupCountX; - draw.dispatchDimension[1] = groupCountY; - draw.dispatchDimension[2] = groupCountZ; - draw.dispatchBase[0] = baseGroupX; - draw.dispatchBase[1] = baseGroupY; - draw.dispatchBase[2] = baseGroupZ; + ActionDescription action; + action.dispatchDimension[0] = groupCountX; + action.dispatchDimension[1] = groupCountY; + action.dispatchDimension[2] = groupCountZ; + action.dispatchBase[0] = baseGroupX; + action.dispatchBase[1] = baseGroupY; + action.dispatchBase[2] = baseGroupZ; - draw.flags |= DrawFlags::Dispatch; + action.flags |= ActionFlags::Dispatch; - AddDrawcall(draw); + AddAction(action); } } } @@ -2654,7 +2658,7 @@ void WrappedVulkan::vkCmdDispatchBase(VkCommandBuffer commandBuffer, uint32_t ba CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkCmdDispatchBase); Serialise_vkCmdDispatchBase(ser, commandBuffer, baseGroupX, baseGroupY, baseGroupZ, groupCountX, groupCountY, groupCountZ); @@ -2712,35 +2716,35 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndirectCount(SerialiserType &ser, curEID += m_Partial[Secondary].baseEvent; } - DrawcallUse use(m_CurChunkOffset, 0); - auto it = std::lower_bound(m_DrawcallUses.begin(), m_DrawcallUses.end(), use); + ActionUse use(m_CurChunkOffset, 0); + auto it = std::lower_bound(m_ActionUses.begin(), m_ActionUses.end(), use); - if(it == m_DrawcallUses.end() || GetDrawcall(it->eventId) == NULL) + if(it == m_ActionUses.end() || GetAction(it->eventId) == NULL) { - RDCERR("Unexpected drawcall not found in uses vector, offset %llu", m_CurChunkOffset); + RDCERR("Unexpected action not found in uses vector, offset %llu", m_CurChunkOffset); } else { uint32_t baseEventID = it->eventId; - // get the number of draws by looking at how many children the parent drawcall has. - count = (uint32_t)GetDrawcall(it->eventId)->children.size(); + // get the number of draws by looking at how many children the parent action has. + count = (uint32_t)GetAction(it->eventId)->children.size(); - // when we have a callback, submit every drawcall individually to the callback - if(m_DrawcallCallback && IsDrawInRenderPass()) + // when we have a callback, submit every action individually to the callback + if(m_ActionCallback && IsDrawInRenderPass()) { for(uint32_t i = 0; i < count; i++) { - uint32_t eventId = HandlePreCallback(commandBuffer, DrawFlags::Drawcall, i + 1); + uint32_t eventId = HandlePreCallback(commandBuffer, ActionFlags::Drawcall, i + 1); ObjDisp(commandBuffer) ->CmdDrawIndirect(Unwrap(commandBuffer), Unwrap(buffer), offset, 1, stride); - if(eventId && m_DrawcallCallback->PostDraw(eventId, commandBuffer)) + if(eventId && m_ActionCallback->PostDraw(eventId, commandBuffer)) { ObjDisp(commandBuffer) ->CmdDrawIndirect(Unwrap(commandBuffer), Unwrap(buffer), offset, 1, stride); - m_DrawcallCallback->PostRedraw(eventId, commandBuffer); + m_ActionCallback->PostRedraw(eventId, commandBuffer); } offset += stride; @@ -2837,16 +2841,16 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndirectCount(SerialiserType &ser, if(IsDrawInRenderPass()) { - uint32_t eventId = HandlePreCallback(commandBuffer, DrawFlags::Drawcall, drawidx + 1); + uint32_t eventId = HandlePreCallback(commandBuffer, ActionFlags::Drawcall, drawidx + 1); ObjDisp(commandBuffer) ->CmdDrawIndirect(Unwrap(commandBuffer), Unwrap(buffer), offset, count, stride); - if(eventId && m_DrawcallCallback->PostDraw(eventId, commandBuffer)) + if(eventId && m_ActionCallback->PostDraw(eventId, commandBuffer)) { ObjDisp(commandBuffer) ->CmdDrawIndirect(Unwrap(commandBuffer), Unwrap(buffer), offset, count, stride); - m_DrawcallCallback->PostRedraw(eventId, commandBuffer); + m_ActionCallback->PostRedraw(eventId, commandBuffer); } } } @@ -2885,36 +2889,36 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndirectCount(SerialiserType &ser, SDChunk *baseChunk = m_StructuredFile->chunks.back(); - DrawcallDescription draw; - draw.name = name; - draw.flags = DrawFlags::MultiDraw | DrawFlags::PushMarker; + ActionDescription action; + action.name = name; + action.flags = ActionFlags::MultiAction | ActionFlags::PushMarker; if(maxDrawCount == 0) - draw.name = name + "(0)"; + action.name = name + "(0)"; AddEvent(); - AddDrawcall(draw); + AddAction(action); - VulkanDrawcallTreeNode &drawNode = GetDrawcallStack().back()->children.back(); + VulkanActionTreeNode &actionNode = GetActionStack().back()->children.back(); - drawNode.indirectPatch = indirectPatch; + actionNode.indirectPatch = indirectPatch; - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(buffer), EventUsage(drawNode.draw.eventId, ResourceUsage::Indirect))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(buffer), EventUsage(actionNode.action.eventId, ResourceUsage::Indirect))); m_BakedCmdBufferInfo[m_LastCmdBufferID].curEventID++; // only allocate up to one indirect sub-command to avoid pessimistic allocation if - // maxDrawCount is very high but the actual draw count is low. + // maxDrawCount is very high but the actual action count is low. for(uint32_t i = 0; i < RDCMIN(1U, maxDrawCount); i++) { - DrawcallDescription multi; + ActionDescription multi; multi.name = name; - multi.flags |= DrawFlags::Drawcall | DrawFlags::Instanced | DrawFlags::Indirect; + multi.flags |= ActionFlags::Drawcall | ActionFlags::Instanced | ActionFlags::Indirect; - // add a fake chunk for this individual indirect draw + // add a fake chunk for this individual indirect action SDChunk *fakeChunk = new SDChunk("Indirect sub-command"_lit); fakeChunk->metadata = baseChunk->metadata; fakeChunk->metadata.chunkID = (uint32_t)VulkanChunk::vkCmdIndirectSubCommand; @@ -2933,15 +2937,15 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndirectCount(SerialiserType &ser, m_StructuredFile->chunks.push_back(fakeChunk); AddEvent(); - AddDrawcall(multi); + AddAction(multi); m_BakedCmdBufferInfo[m_LastCmdBufferID].curEventID++; } AddEvent(); - draw.name = name + " end"; - draw.flags = DrawFlags::PopMarker; - AddDrawcall(draw); + action.name = name + " end"; + action.flags = ActionFlags::PopMarker; + AddAction(action); } } @@ -2966,7 +2970,7 @@ void WrappedVulkan::vkCmdDrawIndirectCount(VkCommandBuffer commandBuffer, VkBuff CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkCmdDrawIndirectCount); Serialise_vkCmdDrawIndirectCount(ser, commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride); @@ -3027,22 +3031,22 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndexedIndirectCount( curEID += m_Partial[Secondary].baseEvent; } - DrawcallUse use(m_CurChunkOffset, 0); - auto it = std::lower_bound(m_DrawcallUses.begin(), m_DrawcallUses.end(), use); + ActionUse use(m_CurChunkOffset, 0); + auto it = std::lower_bound(m_ActionUses.begin(), m_ActionUses.end(), use); - if(it == m_DrawcallUses.end() || GetDrawcall(it->eventId) == NULL) + if(it == m_ActionUses.end() || GetAction(it->eventId) == NULL) { - RDCERR("Unexpected drawcall not found in uses vector, offset %llu", m_CurChunkOffset); + RDCERR("Unexpected action not found in uses vector, offset %llu", m_CurChunkOffset); } else { uint32_t baseEventID = it->eventId; - // get the number of draws by looking at how many children the parent drawcall has. - count = (uint32_t)GetDrawcall(it->eventId)->children.size(); + // get the number of draws by looking at how many children the parent action has. + count = (uint32_t)GetAction(it->eventId)->children.size(); - // when we have a callback, submit every drawcall individually to the callback - if(m_DrawcallCallback && IsDrawInRenderPass()) + // when we have a callback, submit every action individually to the callback + if(m_ActionCallback && IsDrawInRenderPass()) { VkMarkerRegion::Begin( StringFormat::Fmt("Drawcall callback replay (drawCount=%u)", count), commandBuffer); @@ -3075,19 +3079,19 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndexedIndirectCount( for(uint32_t i = 0; i < count; i++) { - uint32_t eventId = HandlePreCallback(commandBuffer, DrawFlags::Drawcall, i + 1); + uint32_t eventId = HandlePreCallback(commandBuffer, ActionFlags::Drawcall, i + 1); - // draw up to and including i. The previous draws will be nop'd out + // action up to and including i. The previous draws will be nop'd out ObjDisp(commandBuffer) ->CmdDrawIndexedIndirect(Unwrap(commandBuffer), Unwrap(m_IndirectBuffer.buf), 0, i + 1, stride); - if(eventId && m_DrawcallCallback->PostDraw(eventId, commandBuffer)) + if(eventId && m_ActionCallback->PostDraw(eventId, commandBuffer)) { ObjDisp(commandBuffer) ->CmdDrawIndexedIndirect(Unwrap(commandBuffer), Unwrap(m_IndirectBuffer.buf), 0, i + 1, stride); - m_DrawcallCallback->PostRedraw(eventId, commandBuffer); + m_ActionCallback->PostRedraw(eventId, commandBuffer); } // now that we're done, nop out this draw so that the next time around we only draw @@ -3198,18 +3202,18 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndexedIndirectCount( if(IsDrawInRenderPass()) { - uint32_t eventId = HandlePreCallback(commandBuffer, DrawFlags::Drawcall, drawidx + 1); + uint32_t eventId = HandlePreCallback(commandBuffer, ActionFlags::Drawcall, drawidx + 1); ObjDisp(commandBuffer) ->CmdDrawIndexedIndirect(Unwrap(commandBuffer), Unwrap(buffer), offset, count, stride); - if(eventId && m_DrawcallCallback->PostDraw(eventId, commandBuffer)) + if(eventId && m_ActionCallback->PostDraw(eventId, commandBuffer)) { ObjDisp(commandBuffer) ->CmdDrawIndexedIndirect(Unwrap(commandBuffer), Unwrap(buffer), offset, count, stride); - m_DrawcallCallback->PostRedraw(eventId, commandBuffer); + m_ActionCallback->PostRedraw(eventId, commandBuffer); } } } @@ -3248,37 +3252,37 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndexedIndirectCount( SDChunk *baseChunk = m_StructuredFile->chunks.back(); - DrawcallDescription draw; - draw.name = name; - draw.flags = DrawFlags::MultiDraw | DrawFlags::PushMarker; + ActionDescription action; + action.name = name; + action.flags = ActionFlags::MultiAction | ActionFlags::PushMarker; if(maxDrawCount == 0) - draw.name = name + "(0)"; + action.name = name + "(0)"; AddEvent(); - AddDrawcall(draw); + AddAction(action); - VulkanDrawcallTreeNode &drawNode = GetDrawcallStack().back()->children.back(); + VulkanActionTreeNode &actionNode = GetActionStack().back()->children.back(); - drawNode.indirectPatch = indirectPatch; + actionNode.indirectPatch = indirectPatch; - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(buffer), EventUsage(drawNode.draw.eventId, ResourceUsage::Indirect))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(buffer), EventUsage(actionNode.action.eventId, ResourceUsage::Indirect))); m_BakedCmdBufferInfo[m_LastCmdBufferID].curEventID++; // only allocate up to one indirect sub-command to avoid pessimistic allocation if - // maxDrawCount is very high but the actual draw count is low. + // maxDrawCount is very high but the actual action count is low. for(uint32_t i = 0; i < RDCMIN(1U, maxDrawCount); i++) { - DrawcallDescription multi; + ActionDescription multi; multi.name = name; - multi.flags |= - DrawFlags::Drawcall | DrawFlags::Instanced | DrawFlags::Indexed | DrawFlags::Indirect; + multi.flags |= ActionFlags::Drawcall | ActionFlags::Instanced | ActionFlags::Indexed | + ActionFlags::Indirect; - // add a fake chunk for this individual indirect draw + // add a fake chunk for this individual indirect action SDChunk *fakeChunk = new SDChunk("Indirect sub-command"_lit); fakeChunk->metadata = baseChunk->metadata; fakeChunk->metadata.chunkID = (uint32_t)VulkanChunk::vkCmdIndirectSubCommand; @@ -3297,15 +3301,15 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndexedIndirectCount( m_StructuredFile->chunks.push_back(fakeChunk); AddEvent(); - AddDrawcall(multi); + AddAction(multi); m_BakedCmdBufferInfo[m_LastCmdBufferID].curEventID++; } AddEvent(); - draw.name = name + " end"; - draw.flags = DrawFlags::PopMarker; - AddDrawcall(draw); + action.name = name + " end"; + action.flags = ActionFlags::PopMarker; + AddAction(action); } } @@ -3330,7 +3334,7 @@ void WrappedVulkan::vkCmdDrawIndexedIndirectCount(VkCommandBuffer commandBuffer, CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkCmdDrawIndexedIndirectCount); Serialise_vkCmdDrawIndexedIndirectCount(ser, commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride); @@ -3380,13 +3384,13 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndirectByteCountEXT( Unwrap(counterBuffer), counterBufferOffset, counterOffset, vertexStride); - if(eventId && m_DrawcallCallback->PostDraw(eventId, commandBuffer)) + if(eventId && m_ActionCallback->PostDraw(eventId, commandBuffer)) { ObjDisp(commandBuffer) ->CmdDrawIndirectByteCountEXT(Unwrap(commandBuffer), instanceCount, firstInstance, Unwrap(counterBuffer), counterBufferOffset, counterOffset, vertexStride); - m_DrawcallCallback->PostRedraw(eventId, commandBuffer); + m_ActionCallback->PostRedraw(eventId, commandBuffer); } } } @@ -3412,23 +3416,23 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndirectByteCountEXT( "buffer without RENDER_PASS_CONTINUE_BIT"); } - DrawcallDescription draw; + ActionDescription action; AddEvent(); - draw.name = name; - draw.instanceOffset = firstInstance; - draw.numInstances = instanceCount; - draw.flags = DrawFlags::Drawcall | DrawFlags::Instanced | DrawFlags::Indirect; + action.name = name; + action.instanceOffset = firstInstance; + action.numInstances = instanceCount; + action.flags = ActionFlags::Drawcall | ActionFlags::Instanced | ActionFlags::Indirect; - AddDrawcall(draw); + AddAction(action); - VulkanDrawcallTreeNode &drawNode = GetDrawcallStack().back()->children.back(); + VulkanActionTreeNode &actionNode = GetActionStack().back()->children.back(); - drawNode.indirectPatch = indirectPatch; + actionNode.indirectPatch = indirectPatch; - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(counterBuffer), EventUsage(drawNode.draw.eventId, ResourceUsage::Indirect))); + actionNode.resourceUsage.push_back(make_rdcpair( + GetResID(counterBuffer), EventUsage(actionNode.action.eventId, ResourceUsage::Indirect))); return true; } @@ -3457,7 +3461,7 @@ void WrappedVulkan::vkCmdDrawIndirectByteCountEXT(VkCommandBuffer commandBuffer, CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkCmdDrawIndirectByteCountEXT); Serialise_vkCmdDrawIndirectByteCountEXT(ser, commandBuffer, instanceCount, firstInstance, counterBuffer, counterBufferOffset, counterOffset, @@ -3499,15 +3503,15 @@ bool WrappedVulkan::Serialise_vkCmdCopyBuffer2KHR(SerialiserType &ser, VkCommand { commandBuffer = RerecordCmdBuf(m_LastCmdBufferID); - uint32_t eventId = HandlePreCallback(commandBuffer, DrawFlags::Copy); + uint32_t eventId = HandlePreCallback(commandBuffer, ActionFlags::Copy); ObjDisp(commandBuffer)->CmdCopyBuffer2KHR(Unwrap(commandBuffer), &unwrappedInfo); - if(eventId && m_DrawcallCallback->PostMisc(eventId, DrawFlags::Copy, commandBuffer)) + if(eventId && m_ActionCallback->PostMisc(eventId, ActionFlags::Copy, commandBuffer)) { ObjDisp(commandBuffer)->CmdCopyBuffer2KHR(Unwrap(commandBuffer), &unwrappedInfo); - m_DrawcallCallback->PostRemisc(eventId, DrawFlags::Copy, commandBuffer); + m_ActionCallback->PostRemisc(eventId, ActionFlags::Copy, commandBuffer); } } } @@ -3521,31 +3525,32 @@ bool WrappedVulkan::Serialise_vkCmdCopyBuffer2KHR(SerialiserType &ser, VkCommand ResourceId srcid = GetResourceManager()->GetOriginalID(GetResID(CopyInfo.srcBuffer)); ResourceId dstid = GetResourceManager()->GetOriginalID(GetResID(CopyInfo.dstBuffer)); - DrawcallDescription draw; - draw.flags |= DrawFlags::Copy; + ActionDescription action; + action.flags |= ActionFlags::Copy; - draw.copySource = srcid; - draw.copySourceSubresource = Subresource(); - draw.copyDestination = dstid; - draw.copyDestinationSubresource = Subresource(); + action.copySource = srcid; + action.copySourceSubresource = Subresource(); + action.copyDestination = dstid; + action.copyDestinationSubresource = Subresource(); - AddDrawcall(draw); + AddAction(action); - VulkanDrawcallTreeNode &drawNode = GetDrawcallStack().back()->children.back(); + VulkanActionTreeNode &actionNode = GetActionStack().back()->children.back(); if(srcid == dstid) { - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(CopyInfo.srcBuffer), EventUsage(drawNode.draw.eventId, ResourceUsage::Copy))); + actionNode.resourceUsage.push_back( + make_rdcpair(GetResID(CopyInfo.srcBuffer), + EventUsage(actionNode.action.eventId, ResourceUsage::Copy))); } else { - drawNode.resourceUsage.push_back( + actionNode.resourceUsage.push_back( make_rdcpair(GetResID(CopyInfo.srcBuffer), - EventUsage(drawNode.draw.eventId, ResourceUsage::CopySrc))); - drawNode.resourceUsage.push_back( + EventUsage(actionNode.action.eventId, ResourceUsage::CopySrc))); + actionNode.resourceUsage.push_back( make_rdcpair(GetResID(CopyInfo.dstBuffer), - EventUsage(drawNode.draw.eventId, ResourceUsage::CopyDst))); + EventUsage(actionNode.action.eventId, ResourceUsage::CopyDst))); } } } @@ -3576,7 +3581,7 @@ void WrappedVulkan::vkCmdCopyBuffer2KHR(VkCommandBuffer commandBuffer, CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkCmdCopyBuffer2KHR); Serialise_vkCmdCopyBuffer2KHR(ser, commandBuffer, pCopyBufferInfo); @@ -3623,15 +3628,15 @@ bool WrappedVulkan::Serialise_vkCmdCopyImage2KHR(SerialiserType &ser, VkCommandB { commandBuffer = RerecordCmdBuf(m_LastCmdBufferID); - uint32_t eventId = HandlePreCallback(commandBuffer, DrawFlags::Copy); + uint32_t eventId = HandlePreCallback(commandBuffer, ActionFlags::Copy); ObjDisp(commandBuffer)->CmdCopyImage2KHR(Unwrap(commandBuffer), &unwrappedInfo); - if(eventId && m_DrawcallCallback->PostMisc(eventId, DrawFlags::Copy, commandBuffer)) + if(eventId && m_ActionCallback->PostMisc(eventId, ActionFlags::Copy, commandBuffer)) { ObjDisp(commandBuffer)->CmdCopyImage2KHR(Unwrap(commandBuffer), &unwrappedInfo); - m_DrawcallCallback->PostRemisc(eventId, DrawFlags::Copy, commandBuffer); + m_ActionCallback->PostRemisc(eventId, ActionFlags::Copy, commandBuffer); } } } @@ -3645,29 +3650,32 @@ bool WrappedVulkan::Serialise_vkCmdCopyImage2KHR(SerialiserType &ser, VkCommandB ResourceId srcid = GetResourceManager()->GetOriginalID(GetResID(CopyInfo.srcImage)); ResourceId dstid = GetResourceManager()->GetOriginalID(GetResID(CopyInfo.dstImage)); - DrawcallDescription draw; - draw.flags |= DrawFlags::Copy; + ActionDescription action; + action.flags |= ActionFlags::Copy; - draw.copySource = srcid; - draw.copySourceSubresource = Subresource(); - draw.copyDestination = dstid; - draw.copyDestinationSubresource = Subresource(); + action.copySource = srcid; + action.copySourceSubresource = Subresource(); + action.copyDestination = dstid; + action.copyDestinationSubresource = Subresource(); - AddDrawcall(draw); + AddAction(action); - VulkanDrawcallTreeNode &drawNode = GetDrawcallStack().back()->children.back(); + VulkanActionTreeNode &actionNode = GetActionStack().back()->children.back(); if(srcid == dstid) { - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(CopyInfo.srcImage), EventUsage(drawNode.draw.eventId, ResourceUsage::Copy))); + actionNode.resourceUsage.push_back( + make_rdcpair(GetResID(CopyInfo.srcImage), + EventUsage(actionNode.action.eventId, ResourceUsage::Copy))); } else { - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(CopyInfo.srcImage), EventUsage(drawNode.draw.eventId, ResourceUsage::CopySrc))); - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(CopyInfo.dstImage), EventUsage(drawNode.draw.eventId, ResourceUsage::CopyDst))); + actionNode.resourceUsage.push_back( + make_rdcpair(GetResID(CopyInfo.srcImage), + EventUsage(actionNode.action.eventId, ResourceUsage::CopySrc))); + actionNode.resourceUsage.push_back( + make_rdcpair(GetResID(CopyInfo.dstImage), + EventUsage(actionNode.action.eventId, ResourceUsage::CopyDst))); } } } @@ -3697,7 +3705,7 @@ void WrappedVulkan::vkCmdCopyImage2KHR(VkCommandBuffer commandBuffer, CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkCmdCopyImage2KHR); Serialise_vkCmdCopyImage2KHR(ser, commandBuffer, pCopyImageInfo); @@ -3753,15 +3761,15 @@ bool WrappedVulkan::Serialise_vkCmdCopyBufferToImage2KHR( { commandBuffer = RerecordCmdBuf(m_LastCmdBufferID); - uint32_t eventId = HandlePreCallback(commandBuffer, DrawFlags::Copy); + uint32_t eventId = HandlePreCallback(commandBuffer, ActionFlags::Copy); ObjDisp(commandBuffer)->CmdCopyBufferToImage2KHR(Unwrap(commandBuffer), &unwrappedInfo); - if(eventId && m_DrawcallCallback->PostMisc(eventId, DrawFlags::Copy, commandBuffer)) + if(eventId && m_ActionCallback->PostMisc(eventId, ActionFlags::Copy, commandBuffer)) { ObjDisp(commandBuffer)->CmdCopyBufferToImage2KHR(Unwrap(commandBuffer), &unwrappedInfo); - m_DrawcallCallback->PostRemisc(eventId, DrawFlags::Copy, commandBuffer); + m_ActionCallback->PostRemisc(eventId, ActionFlags::Copy, commandBuffer); } } } @@ -3775,26 +3783,28 @@ bool WrappedVulkan::Serialise_vkCmdCopyBufferToImage2KHR( ResourceId bufid = GetResourceManager()->GetOriginalID(GetResID(CopyInfo.srcBuffer)); ResourceId imgid = GetResourceManager()->GetOriginalID(GetResID(CopyInfo.dstImage)); - DrawcallDescription draw; - draw.flags |= DrawFlags::Copy; + ActionDescription action; + action.flags |= ActionFlags::Copy; - draw.copySource = bufid; - draw.copySourceSubresource = Subresource(); - draw.copyDestination = imgid; - draw.copyDestinationSubresource = Subresource(); + action.copySource = bufid; + action.copySourceSubresource = Subresource(); + action.copyDestination = imgid; + action.copyDestinationSubresource = Subresource(); if(CopyInfo.regionCount > 0) - draw.copyDestinationSubresource = + action.copyDestinationSubresource = Subresource(CopyInfo.pRegions[0].imageSubresource.mipLevel, CopyInfo.pRegions[0].imageSubresource.baseArrayLayer); - AddDrawcall(draw); + AddAction(action); - VulkanDrawcallTreeNode &drawNode = GetDrawcallStack().back()->children.back(); + VulkanActionTreeNode &actionNode = GetActionStack().back()->children.back(); - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(CopyInfo.srcBuffer), EventUsage(drawNode.draw.eventId, ResourceUsage::CopySrc))); - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(CopyInfo.dstImage), EventUsage(drawNode.draw.eventId, ResourceUsage::CopyDst))); + actionNode.resourceUsage.push_back( + make_rdcpair(GetResID(CopyInfo.srcBuffer), + EventUsage(actionNode.action.eventId, ResourceUsage::CopySrc))); + actionNode.resourceUsage.push_back( + make_rdcpair(GetResID(CopyInfo.dstImage), + EventUsage(actionNode.action.eventId, ResourceUsage::CopyDst))); } } } @@ -3825,7 +3835,7 @@ void WrappedVulkan::vkCmdCopyBufferToImage2KHR(VkCommandBuffer commandBuffer, CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkCmdCopyBufferToImage2KHR); Serialise_vkCmdCopyBufferToImage2KHR(ser, commandBuffer, pCopyBufferToImageInfo); @@ -3884,15 +3894,15 @@ bool WrappedVulkan::Serialise_vkCmdCopyImageToBuffer2KHR( { commandBuffer = RerecordCmdBuf(m_LastCmdBufferID); - uint32_t eventId = HandlePreCallback(commandBuffer, DrawFlags::Copy); + uint32_t eventId = HandlePreCallback(commandBuffer, ActionFlags::Copy); ObjDisp(commandBuffer)->CmdCopyImageToBuffer2KHR(Unwrap(commandBuffer), &unwrappedInfo); - if(eventId && m_DrawcallCallback->PostMisc(eventId, DrawFlags::Copy, commandBuffer)) + if(eventId && m_ActionCallback->PostMisc(eventId, ActionFlags::Copy, commandBuffer)) { ObjDisp(commandBuffer)->CmdCopyImageToBuffer2KHR(Unwrap(commandBuffer), &unwrappedInfo); - m_DrawcallCallback->PostRemisc(eventId, DrawFlags::Copy, commandBuffer); + m_ActionCallback->PostRemisc(eventId, ActionFlags::Copy, commandBuffer); } } } @@ -3906,26 +3916,28 @@ bool WrappedVulkan::Serialise_vkCmdCopyImageToBuffer2KHR( ResourceId imgid = GetResourceManager()->GetOriginalID(GetResID(CopyInfo.srcImage)); ResourceId bufid = GetResourceManager()->GetOriginalID(GetResID(CopyInfo.dstBuffer)); - DrawcallDescription draw; - draw.flags |= DrawFlags::Copy; + ActionDescription action; + action.flags |= ActionFlags::Copy; - draw.copySource = imgid; - draw.copySourceSubresource = Subresource(); + action.copySource = imgid; + action.copySourceSubresource = Subresource(); if(CopyInfo.regionCount > 0) - draw.copySourceSubresource = + action.copySourceSubresource = Subresource(CopyInfo.pRegions[0].imageSubresource.mipLevel, CopyInfo.pRegions[0].imageSubresource.baseArrayLayer); - draw.copyDestination = bufid; - draw.copyDestinationSubresource = Subresource(); + action.copyDestination = bufid; + action.copyDestinationSubresource = Subresource(); - AddDrawcall(draw); + AddAction(action); - VulkanDrawcallTreeNode &drawNode = GetDrawcallStack().back()->children.back(); + VulkanActionTreeNode &actionNode = GetActionStack().back()->children.back(); - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(CopyInfo.srcImage), EventUsage(drawNode.draw.eventId, ResourceUsage::CopySrc))); - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(CopyInfo.dstBuffer), EventUsage(drawNode.draw.eventId, ResourceUsage::CopyDst))); + actionNode.resourceUsage.push_back( + make_rdcpair(GetResID(CopyInfo.srcImage), + EventUsage(actionNode.action.eventId, ResourceUsage::CopySrc))); + actionNode.resourceUsage.push_back( + make_rdcpair(GetResID(CopyInfo.dstBuffer), + EventUsage(actionNode.action.eventId, ResourceUsage::CopyDst))); } } } @@ -3956,7 +3968,7 @@ void WrappedVulkan::vkCmdCopyImageToBuffer2KHR(VkCommandBuffer commandBuffer, CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkCmdCopyImageToBuffer2KHR); Serialise_vkCmdCopyImageToBuffer2KHR(ser, commandBuffer, pCopyImageToBufferInfo); @@ -4013,15 +4025,15 @@ bool WrappedVulkan::Serialise_vkCmdBlitImage2KHR(SerialiserType &ser, VkCommandB { commandBuffer = RerecordCmdBuf(m_LastCmdBufferID); - uint32_t eventId = HandlePreCallback(commandBuffer, DrawFlags::Resolve); + uint32_t eventId = HandlePreCallback(commandBuffer, ActionFlags::Resolve); ObjDisp(commandBuffer)->CmdBlitImage2KHR(Unwrap(commandBuffer), &unwrappedInfo); - if(eventId && m_DrawcallCallback->PostMisc(eventId, DrawFlags::Resolve, commandBuffer)) + if(eventId && m_ActionCallback->PostMisc(eventId, ActionFlags::Resolve, commandBuffer)) { ObjDisp(commandBuffer)->CmdBlitImage2KHR(Unwrap(commandBuffer), &unwrappedInfo); - m_DrawcallCallback->PostRemisc(eventId, DrawFlags::Resolve, commandBuffer); + m_ActionCallback->PostRemisc(eventId, ActionFlags::Resolve, commandBuffer); } } } @@ -4035,31 +4047,32 @@ bool WrappedVulkan::Serialise_vkCmdBlitImage2KHR(SerialiserType &ser, VkCommandB ResourceId srcid = GetResourceManager()->GetOriginalID(GetResID(BlitInfo.srcImage)); ResourceId dstid = GetResourceManager()->GetOriginalID(GetResID(BlitInfo.dstImage)); - DrawcallDescription draw; - draw.flags |= DrawFlags::Resolve; + ActionDescription action; + action.flags |= ActionFlags::Resolve; - draw.copySource = srcid; - draw.copySourceSubresource = Subresource(); - draw.copyDestination = dstid; - draw.copyDestinationSubresource = Subresource(); + action.copySource = srcid; + action.copySourceSubresource = Subresource(); + action.copyDestination = dstid; + action.copyDestinationSubresource = Subresource(); - AddDrawcall(draw); + AddAction(action); - VulkanDrawcallTreeNode &drawNode = GetDrawcallStack().back()->children.back(); + VulkanActionTreeNode &actionNode = GetActionStack().back()->children.back(); if(srcid == dstid) { - drawNode.resourceUsage.push_back(make_rdcpair( - GetResID(BlitInfo.srcImage), EventUsage(drawNode.draw.eventId, ResourceUsage::Resolve))); + actionNode.resourceUsage.push_back( + make_rdcpair(GetResID(BlitInfo.srcImage), + EventUsage(actionNode.action.eventId, ResourceUsage::Resolve))); } else { - drawNode.resourceUsage.push_back( + actionNode.resourceUsage.push_back( make_rdcpair(GetResID(BlitInfo.srcImage), - EventUsage(drawNode.draw.eventId, ResourceUsage::ResolveSrc))); - drawNode.resourceUsage.push_back( + EventUsage(actionNode.action.eventId, ResourceUsage::ResolveSrc))); + actionNode.resourceUsage.push_back( make_rdcpair(GetResID(BlitInfo.dstImage), - EventUsage(drawNode.draw.eventId, ResourceUsage::ResolveDst))); + EventUsage(actionNode.action.eventId, ResourceUsage::ResolveDst))); } } } @@ -4089,7 +4102,7 @@ void WrappedVulkan::vkCmdBlitImage2KHR(VkCommandBuffer commandBuffer, CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkCmdBlitImage2KHR); Serialise_vkCmdBlitImage2KHR(ser, commandBuffer, pBlitImageInfo); @@ -4154,15 +4167,15 @@ bool WrappedVulkan::Serialise_vkCmdResolveImage2KHR(SerialiserType &ser, { commandBuffer = RerecordCmdBuf(m_LastCmdBufferID); - uint32_t eventId = HandlePreCallback(commandBuffer, DrawFlags::Resolve); + uint32_t eventId = HandlePreCallback(commandBuffer, ActionFlags::Resolve); ObjDisp(commandBuffer)->CmdResolveImage2KHR(Unwrap(commandBuffer), &unwrappedInfo); - if(eventId && m_DrawcallCallback->PostMisc(eventId, DrawFlags::Resolve, commandBuffer)) + if(eventId && m_ActionCallback->PostMisc(eventId, ActionFlags::Resolve, commandBuffer)) { ObjDisp(commandBuffer)->CmdResolveImage2KHR(Unwrap(commandBuffer), &unwrappedInfo); - m_DrawcallCallback->PostRemisc(eventId, DrawFlags::Resolve, commandBuffer); + m_ActionCallback->PostRemisc(eventId, ActionFlags::Resolve, commandBuffer); } } } @@ -4176,32 +4189,32 @@ bool WrappedVulkan::Serialise_vkCmdResolveImage2KHR(SerialiserType &ser, ResourceId srcid = GetResourceManager()->GetOriginalID(GetResID(ResolveInfo.srcImage)); ResourceId dstid = GetResourceManager()->GetOriginalID(GetResID(ResolveInfo.dstImage)); - DrawcallDescription draw; - draw.flags |= DrawFlags::Resolve; + ActionDescription action; + action.flags |= ActionFlags::Resolve; - draw.copySource = srcid; - draw.copySourceSubresource = Subresource(); - draw.copyDestination = dstid; - draw.copyDestinationSubresource = Subresource(); + action.copySource = srcid; + action.copySourceSubresource = Subresource(); + action.copyDestination = dstid; + action.copyDestinationSubresource = Subresource(); - AddDrawcall(draw); + AddAction(action); - VulkanDrawcallTreeNode &drawNode = GetDrawcallStack().back()->children.back(); + VulkanActionTreeNode &actionNode = GetActionStack().back()->children.back(); if(srcid == dstid) { - drawNode.resourceUsage.push_back( + actionNode.resourceUsage.push_back( make_rdcpair(GetResID(ResolveInfo.srcImage), - EventUsage(drawNode.draw.eventId, ResourceUsage::Resolve))); + EventUsage(actionNode.action.eventId, ResourceUsage::Resolve))); } else { - drawNode.resourceUsage.push_back( + actionNode.resourceUsage.push_back( make_rdcpair(GetResID(ResolveInfo.srcImage), - EventUsage(drawNode.draw.eventId, ResourceUsage::ResolveSrc))); - drawNode.resourceUsage.push_back( + EventUsage(actionNode.action.eventId, ResourceUsage::ResolveSrc))); + actionNode.resourceUsage.push_back( make_rdcpair(GetResID(ResolveInfo.dstImage), - EventUsage(drawNode.draw.eventId, ResourceUsage::ResolveDst))); + EventUsage(actionNode.action.eventId, ResourceUsage::ResolveDst))); } } } @@ -4232,7 +4245,7 @@ void WrappedVulkan::vkCmdResolveImage2KHR(VkCommandBuffer commandBuffer, CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkCmdResolveImage2KHR); Serialise_vkCmdResolveImage2KHR(ser, commandBuffer, pResolveImageInfo); diff --git a/renderdoc/driver/vulkan/wrappers/vk_queue_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_queue_funcs.cpp index b373ac62f..64c6e40ae 100644 --- a/renderdoc/driver/vulkan/wrappers/vk_queue_funcs.cpp +++ b/renderdoc/driver/vulkan/wrappers/vk_queue_funcs.cpp @@ -265,29 +265,29 @@ void WrappedVulkan::ReplayQueueSubmit(VkQueue queue, VkSubmitInfo2KHR submitInfo rdcstr name = StringFormat::Fmt("=> %s[%u]: vkBeginCommandBuffer(%s)", basename.c_str(), c, ToStr(cmd).c_str()); - DrawcallDescription draw; + ActionDescription action; { // add a fake marker - draw.name = name; - draw.flags |= - DrawFlags::CommandBufferBoundary | DrawFlags::PassBoundary | DrawFlags::BeginPass; + action.name = name; + action.flags |= + ActionFlags::CommandBufferBoundary | ActionFlags::PassBoundary | ActionFlags::BeginPass; AddEvent(); m_RootEvents.back().chunkIndex = cmdBufInfo.beginChunk; m_Events.back().chunkIndex = cmdBufInfo.beginChunk; - AddDrawcall(draw); + AddAction(action); m_RootEventID++; } // insert the baked command buffer in-line into this list of notes, assigning new event // and drawIDs - InsertDrawsAndRefreshIDs(cmdBufInfo); + InsertActionsAndRefreshIDs(cmdBufInfo); - for(size_t e = 0; e < cmdBufInfo.draw->executedCmds.size(); e++) + for(size_t e = 0; e < cmdBufInfo.action->executedCmds.size(); e++) { rdcarray &submits = - m_Partial[Secondary].cmdBufferSubmits[cmdBufInfo.draw->executedCmds[e]]; + m_Partial[Secondary].cmdBufferSubmits[cmdBufInfo.action->executedCmds[e]]; for(size_t s = 0; s < submits.size(); s++) { @@ -309,10 +309,10 @@ void WrappedVulkan::ReplayQueueSubmit(VkQueue queue, VkSubmitInfo2KHR submitInfo m_Partial[Primary].cmdBufferSubmits[cmd].push_back(Submission(m_RootEventID)); m_RootEventID += cmdBufInfo.eventCount; - m_RootDrawcallID += cmdBufInfo.drawCount; + m_RootActionID += cmdBufInfo.actionCount; { - // pull in any remaining events on the command buffer that weren't added to a drawcall + // pull in any remaining events on the command buffer that weren't added to an action uint32_t i = 0; for(APIEvent &apievent : cmdBufInfo.curEvents) { @@ -327,14 +327,15 @@ void WrappedVulkan::ReplayQueueSubmit(VkQueue queue, VkSubmitInfo2KHR submitInfo name = StringFormat::Fmt("=> %s[%u]: vkEndCommandBuffer(%s)", basename.c_str(), c, ToStr(cmd).c_str()); - draw.name = name; - draw.flags = DrawFlags::CommandBufferBoundary | DrawFlags::PassBoundary | DrawFlags::EndPass; + action.name = name; + action.flags = + ActionFlags::CommandBufferBoundary | ActionFlags::PassBoundary | ActionFlags::EndPass; AddEvent(); m_RootEvents.back().chunkIndex = cmdBufInfo.endChunk; m_Events.back().chunkIndex = cmdBufInfo.endChunk; - AddDrawcall(draw); + AddAction(action); m_RootEventID++; } } @@ -357,12 +358,12 @@ void WrappedVulkan::ReplayQueueSubmit(VkQueue queue, VkSubmitInfo2KHR submitInfo GetResID(submitInfo.pCommandBufferInfos[c].commandBuffer)); m_RootEventID += m_BakedCmdBufferInfo[cmd].eventCount; - m_RootDrawcallID += m_BakedCmdBufferInfo[cmd].drawCount; + m_RootActionID += m_BakedCmdBufferInfo[cmd].actionCount; // 2 extra for the virtual labels around the command buffer { m_RootEventID += 2; - m_RootDrawcallID += 2; + m_RootActionID += 2; } } @@ -455,12 +456,12 @@ void WrappedVulkan::ReplayQueueSubmit(VkQueue queue, VkSubmitInfo2KHR submitInfo } bool WrappedVulkan::PatchIndirectDraw(size_t drawIndex, uint32_t paramStride, - VkIndirectPatchType type, DrawcallDescription &draw, + VkIndirectPatchType type, ActionDescription &action, byte *&argptr, byte *argend) { bool valid = false; - draw.drawIndex = (uint32_t)drawIndex; + action.drawIndex = (uint32_t)drawIndex; if(type == VkIndirectPatchType::DrawIndirect || type == VkIndirectPatchType::DrawIndirectCount) { @@ -468,10 +469,10 @@ bool WrappedVulkan::PatchIndirectDraw(size_t drawIndex, uint32_t paramStride, { VkDrawIndirectCommand *arg = (VkDrawIndirectCommand *)argptr; - draw.numIndices = arg->vertexCount; - draw.numInstances = arg->instanceCount; - draw.vertexOffset = arg->firstVertex; - draw.instanceOffset = arg->firstInstance; + action.numIndices = arg->vertexCount; + action.numInstances = arg->instanceCount; + action.vertexOffset = arg->firstVertex; + action.instanceOffset = arg->firstInstance; valid = true; } @@ -482,7 +483,7 @@ bool WrappedVulkan::PatchIndirectDraw(size_t drawIndex, uint32_t paramStride, { uint32_t *arg = (uint32_t *)argptr; - draw.numIndices = *arg; + action.numIndices = *arg; valid = true; } @@ -494,26 +495,26 @@ bool WrappedVulkan::PatchIndirectDraw(size_t drawIndex, uint32_t paramStride, { VkDrawIndexedIndirectCommand *arg = (VkDrawIndexedIndirectCommand *)argptr; - draw.numIndices = arg->indexCount; - draw.numInstances = arg->instanceCount; - draw.baseVertex = arg->vertexOffset; - draw.indexOffset = arg->firstIndex; - draw.instanceOffset = arg->firstInstance; + action.numIndices = arg->indexCount; + action.numInstances = arg->instanceCount; + action.baseVertex = arg->vertexOffset; + action.indexOffset = arg->firstIndex; + action.instanceOffset = arg->firstInstance; valid = true; } } else { - RDCERR("Unexpected indirect draw type"); + RDCERR("Unexpected indirect action type"); } - if(valid && !draw.events.empty()) + if(valid && !action.events.empty()) { - SDChunk *chunk = m_StructuredFile->chunks[draw.events.back().chunkIndex]; + SDChunk *chunk = m_StructuredFile->chunks[action.events.back().chunkIndex]; if(chunk->metadata.chunkID != (uint32_t)VulkanChunk::vkCmdIndirectSubCommand) - chunk = m_StructuredFile->chunks[draw.events.back().chunkIndex - 1]; + chunk = m_StructuredFile->chunks[action.events.back().chunkIndex - 1]; SDObject *drawIdx = chunk->FindChild("drawIndex"); @@ -527,41 +528,41 @@ bool WrappedVulkan::PatchIndirectDraw(size_t drawIndex, uint32_t paramStride, SDObject *command = chunk->FindChild("command"); - // single draw indirect draws don't have a command child since it can't be added without + // single action indirect draws don't have a command child since it can't be added without // breaking serialising the chunk. if(command) { // patch up structured data contents if(SDObject *sub = command->FindChild("vertexCount")) - sub->data.basic.u = draw.numIndices; + sub->data.basic.u = action.numIndices; if(SDObject *sub = command->FindChild("indexCount")) - sub->data.basic.u = draw.numIndices; + sub->data.basic.u = action.numIndices; if(SDObject *sub = command->FindChild("instanceCount")) - sub->data.basic.u = draw.numInstances; + sub->data.basic.u = action.numInstances; if(SDObject *sub = command->FindChild("firstVertex")) - sub->data.basic.u = draw.vertexOffset; + sub->data.basic.u = action.vertexOffset; if(SDObject *sub = command->FindChild("vertexOffset")) - sub->data.basic.u = draw.baseVertex; + sub->data.basic.u = action.baseVertex; if(SDObject *sub = command->FindChild("firstIndex")) - sub->data.basic.u = draw.indexOffset; + sub->data.basic.u = action.indexOffset; if(SDObject *sub = command->FindChild("firstInstance")) - sub->data.basic.u = draw.instanceOffset; + sub->data.basic.u = action.instanceOffset; } } return valid; } -void WrappedVulkan::InsertDrawsAndRefreshIDs(BakedCmdBufferInfo &cmdBufInfo) +void WrappedVulkan::InsertActionsAndRefreshIDs(BakedCmdBufferInfo &cmdBufInfo) { - rdcarray &cmdBufNodes = cmdBufInfo.draw->children; + rdcarray &cmdBufNodes = cmdBufInfo.action->children; - // assign new drawcall IDs + // assign new action IDs for(size_t i = 0; i < cmdBufNodes.size(); i++) { - VulkanDrawcallTreeNode n = cmdBufNodes[i]; - n.draw.eventId += m_RootEventID; - n.draw.drawcallId += m_RootDrawcallID; + VulkanActionTreeNode n = cmdBufNodes[i]; + n.action.eventId += m_RootEventID; + n.action.actionId += m_RootActionID; if(n.indirectPatch.type == VkIndirectPatchType::DispatchIndirect) { @@ -576,11 +577,11 @@ void WrappedVulkan::InsertDrawsAndRefreshIDs(BakedCmdBufferInfo &cmdBufInfo) args = &unknown; } - n.draw.name = + n.action.name = StringFormat::Fmt("vkCmdDispatchIndirect(<%u, %u, %u>)", args->x, args->y, args->z); - n.draw.dispatchDimension[0] = args->x; - n.draw.dispatchDimension[1] = args->y; - n.draw.dispatchDimension[2] = args->z; + n.action.dispatchDimension[0] = args->x; + n.action.dispatchDimension[1] = args->y; + n.action.dispatchDimension[2] = args->z; } else if(n.indirectPatch.type == VkIndirectPatchType::DrawIndirectByteCount || n.indirectPatch.type == VkIndirectPatchType::DrawIndirect || @@ -606,7 +607,7 @@ void WrappedVulkan::InsertDrawsAndRefreshIDs(BakedCmdBufferInfo &cmdBufInfo) } else { - RDCERR("Couldn't get indirect draw count"); + RDCERR("Couldn't get indirect action count"); } if(indirectCount > n.indirectPatch.count) @@ -618,20 +619,21 @@ void WrappedVulkan::InsertDrawsAndRefreshIDs(BakedCmdBufferInfo &cmdBufInfo) // this can be negative if indirectCount is 0 int32_t eidShift = indirectCount - 1; - // we reserved one event and drawcall for the indirect count based draw. + // we reserved one event and action for the indirect count based action. // if we ended up with a different number eidShift will be non-zero, so we need to adjust - // all subsequent EIDs and draw IDs and either remove the subdraw we allocated (if no draws + // all subsequent EIDs and action IDs and either remove the subdraw we allocated (if no + // draws // happened) or clone the subdraw to create more that we can then patch. if(eidShift != 0) { // i is the pushmarker, so i + 1 is the sub draws, and i + 2 is the pop marker. - // adjust all EIDs and draw IDs after that point + // adjust all EIDs and action IDs after that point for(size_t j = i + 2; j < cmdBufNodes.size(); j++) { - cmdBufNodes[j].draw.eventId += eidShift; - cmdBufNodes[j].draw.drawcallId += eidShift; + cmdBufNodes[j].action.eventId += eidShift; + cmdBufNodes[j].action.actionId += eidShift; - for(APIEvent &ev : cmdBufNodes[j].draw.events) + for(APIEvent &ev : cmdBufNodes[j].action.events) ev.eventId += eidShift; for(rdcpair &use : cmdBufNodes[j].resourceUsage) @@ -640,12 +642,12 @@ void WrappedVulkan::InsertDrawsAndRefreshIDs(BakedCmdBufferInfo &cmdBufInfo) for(size_t j = 0; j < cmdBufInfo.debugMessages.size(); j++) { - if(cmdBufInfo.debugMessages[j].eventId >= cmdBufNodes[i].draw.eventId + 2) + if(cmdBufInfo.debugMessages[j].eventId >= cmdBufNodes[i].action.eventId + 2) cmdBufInfo.debugMessages[j].eventId += eidShift; } cmdBufInfo.eventCount += eidShift; - cmdBufInfo.drawCount += eidShift; + cmdBufInfo.actionCount += eidShift; // we also need to patch the original secondary command buffer here, if the indirect call // was on a secondary, so that vkCmdExecuteCommands knows accurately how many events are @@ -653,23 +655,23 @@ void WrappedVulkan::InsertDrawsAndRefreshIDs(BakedCmdBufferInfo &cmdBufInfo) if(n.indirectPatch.commandBuffer != ResourceId()) { m_BakedCmdBufferInfo[n.indirectPatch.commandBuffer].eventCount += eidShift; - m_BakedCmdBufferInfo[n.indirectPatch.commandBuffer].drawCount += eidShift; + m_BakedCmdBufferInfo[n.indirectPatch.commandBuffer].actionCount += eidShift; } - for(size_t e = 0; e < cmdBufInfo.draw->executedCmds.size(); e++) + for(size_t e = 0; e < cmdBufInfo.action->executedCmds.size(); e++) { rdcarray &submits = - m_Partial[Secondary].cmdBufferSubmits[cmdBufInfo.draw->executedCmds[e]]; + m_Partial[Secondary].cmdBufferSubmits[cmdBufInfo.action->executedCmds[e]]; for(size_t s = 0; s < submits.size(); s++) { - if(submits[s].baseEvent >= cmdBufNodes[i].draw.eventId + 2) + if(submits[s].baseEvent >= cmdBufNodes[i].action.eventId + 2) submits[s].baseEvent += eidShift; } } - RDCASSERT(cmdBufNodes[i + 1].draw.events.size() == 1); - uint32_t chunkIndex = cmdBufNodes[i + 1].draw.events[0].chunkIndex; + RDCASSERT(cmdBufNodes[i + 1].action.events.size() == 1); + uint32_t chunkIndex = cmdBufNodes[i + 1].action.events[0].chunkIndex; // everything afterwards is adjusted. Now see if we need to remove the subdraw or clone it if(indirectCount == 0) @@ -688,7 +690,7 @@ void WrappedVulkan::InsertDrawsAndRefreshIDs(BakedCmdBufferInfo &cmdBufInfo) m_StructuredFile->chunks.push_back(chunk->Duplicate()); // now copy the subdraw so we're not inserting into the array from itself - VulkanDrawcallTreeNode node = cmdBufNodes[i + 1]; + VulkanActionTreeNode node = cmdBufNodes[i + 1]; cmdBufNodes.resize(cmdBufNodes.size() + eidShift); for(size_t e = cmdBufNodes.size() - 1; e > i + 1 + eidShift; e--) @@ -697,10 +699,10 @@ void WrappedVulkan::InsertDrawsAndRefreshIDs(BakedCmdBufferInfo &cmdBufInfo) // then insert enough duplicates for(int32_t e = 0; e < eidShift; e++) { - node.draw.eventId++; - node.draw.drawcallId++; + node.action.eventId++; + node.action.actionId++; - for(APIEvent &ev : node.draw.events) + for(APIEvent &ev : node.action.events) { ev.eventId++; ev.chunkIndex = baseAddedChunk + e; @@ -716,30 +718,30 @@ void WrappedVulkan::InsertDrawsAndRefreshIDs(BakedCmdBufferInfo &cmdBufInfo) } // indirect count versions always have a multidraw marker regions, but static count of 1 would - // be in-lined as a single draw, so we patch in-place + // be in-lined as a single action, so we patch in-place if(!hasCount && indirectCount == 1) { bool valid = - PatchIndirectDraw(0, n.indirectPatch.stride, n.indirectPatch.type, n.draw, ptr, end); + PatchIndirectDraw(0, n.indirectPatch.stride, n.indirectPatch.type, n.action, ptr, end); if(n.indirectPatch.type == VkIndirectPatchType::DrawIndirectByteCount) { - if(n.draw.numIndices > n.indirectPatch.vertexoffset) - n.draw.numIndices -= n.indirectPatch.vertexoffset; + if(n.action.numIndices > n.indirectPatch.vertexoffset) + n.action.numIndices -= n.indirectPatch.vertexoffset; else - n.draw.numIndices = 0; + n.action.numIndices = 0; - n.draw.numIndices /= n.indirectPatch.stride; + n.action.numIndices /= n.indirectPatch.stride; } - // if the actual draw count was greater than 1, display this as an indirect count + // if the actual action count was greater than 1, display this as an indirect count const char *countString = (n.indirectPatch.count > 1 ? "<1>" : "1"); if(valid) - n.draw.name = StringFormat::Fmt("%s(%s) => <%u, %u>", n.draw.name.c_str(), countString, - n.draw.numIndices, n.draw.numInstances); + n.action.name = StringFormat::Fmt("%s(%s) => <%u, %u>", n.action.name.c_str(), + countString, n.action.numIndices, n.action.numInstances); else - n.draw.name = StringFormat::Fmt("%s(%s) => ", n.draw.name.c_str(), countString); + n.action.name = StringFormat::Fmt("%s(%s) => ", n.action.name.c_str(), countString); } else { @@ -747,25 +749,25 @@ void WrappedVulkan::InsertDrawsAndRefreshIDs(BakedCmdBufferInfo &cmdBufInfo) RDCASSERT(i + indirectCount < cmdBufNodes.size(), i, indirectCount, n.indirectPatch.count, cmdBufNodes.size()); - // patch the count onto the root drawcall name. The root is otherwise un-suffixed to allow + // patch the count onto the root action name. The root is otherwise un-suffixed to allow // for collapsing non-multidraws and making everything generally simpler if(hasCount) - n.draw.name = StringFormat::Fmt("%s(<%u>)", n.draw.name.c_str(), indirectCount); + n.action.name = StringFormat::Fmt("%s(<%u>)", n.action.name.c_str(), indirectCount); else - n.draw.name = StringFormat::Fmt("%s(%u)", n.draw.name.c_str(), n.indirectPatch.count); + n.action.name = StringFormat::Fmt("%s(%u)", n.action.name.c_str(), n.indirectPatch.count); for(size_t j = 0; j < (size_t)indirectCount && i + j + 1 < cmdBufNodes.size(); j++) { - VulkanDrawcallTreeNode &n2 = cmdBufNodes[i + j + 1]; + VulkanActionTreeNode &n2 = cmdBufNodes[i + j + 1]; - bool valid = - PatchIndirectDraw(j, n.indirectPatch.stride, n.indirectPatch.type, n2.draw, ptr, end); + bool valid = PatchIndirectDraw(j, n.indirectPatch.stride, n.indirectPatch.type, n2.action, + ptr, end); if(valid) - n2.draw.name = StringFormat::Fmt("%s[%zu](<%u, %u>)", n2.draw.name.c_str(), j, - n2.draw.numIndices, n2.draw.numInstances); + n2.action.name = StringFormat::Fmt("%s[%zu](<%u, %u>)", n2.action.name.c_str(), j, + n2.action.numIndices, n2.action.numInstances); else - n2.draw.name = StringFormat::Fmt("%s[%zu]()", n2.draw.name.c_str(), j); + n2.action.name = StringFormat::Fmt("%s[%zu]()", n2.action.name.c_str(), j); if(ptr) ptr += n.indirectPatch.stride; @@ -773,20 +775,20 @@ void WrappedVulkan::InsertDrawsAndRefreshIDs(BakedCmdBufferInfo &cmdBufInfo) } } - for(APIEvent &ev : n.draw.events) + for(APIEvent &ev : n.action.events) { ev.eventId += m_RootEventID; m_Events.resize(ev.eventId + 1); m_Events[ev.eventId] = ev; } - if(!n.draw.events.empty()) + if(!n.action.events.empty()) { - DrawcallUse use(n.draw.events.back().fileOffset, n.draw.eventId); + ActionUse use(n.action.events.back().fileOffset, n.action.eventId); // insert in sorted location - auto drawit = std::lower_bound(m_DrawcallUses.begin(), m_DrawcallUses.end(), use); - m_DrawcallUses.insert(drawit - m_DrawcallUses.begin(), use); + auto drawit = std::lower_bound(m_ActionUses.begin(), m_ActionUses.end(), use); + m_ActionUses.insert(drawit - m_ActionUses.begin(), use); } RDCASSERT(n.children.empty()); @@ -799,15 +801,15 @@ void WrappedVulkan::InsertDrawsAndRefreshIDs(BakedCmdBufferInfo &cmdBufInfo) m_EventFlags[u.eventId] |= PipeRWUsageEventFlags(u.usage); } - GetDrawcallStack().back()->children.push_back(n); + GetActionStack().back()->children.push_back(n); - // if this is a push marker too, step down the drawcall stack - if(cmdBufNodes[i].draw.flags & DrawFlags::PushMarker) - GetDrawcallStack().push_back(&GetDrawcallStack().back()->children.back()); + // if this is a push marker too, step down the action stack + if(cmdBufNodes[i].action.flags & ActionFlags::PushMarker) + GetActionStack().push_back(&GetActionStack().back()->children.back()); // similarly for a pop, but don't pop off the root - if((cmdBufNodes[i].draw.flags & DrawFlags::PopMarker) && GetDrawcallStack().size() > 1) - GetDrawcallStack().pop_back(); + if((cmdBufNodes[i].action.flags & ActionFlags::PopMarker) && GetActionStack().size() > 1) + GetActionStack().pop_back(); } } @@ -1176,14 +1178,14 @@ bool WrappedVulkan::Serialise_vkQueueSubmit(SerialiserType &ser, VkQueue queue, if(doWait) ObjDisp(queue)->QueueWaitIdle(Unwrap(queue)); - // add a drawcall use for this submission, to tally up with any debug messages that come from it + // add an action use for this submission, to tally up with any debug messages that come from it if(IsLoading(m_State)) { - DrawcallUse use(m_CurChunkOffset, m_RootEventID); + ActionUse use(m_CurChunkOffset, m_RootEventID); // insert in sorted location - auto drawit = std::lower_bound(m_DrawcallUses.begin(), m_DrawcallUses.end(), use); - m_DrawcallUses.insert(drawit - m_DrawcallUses.begin(), use); + auto drawit = std::lower_bound(m_ActionUses.begin(), m_ActionUses.end(), use); + m_ActionUses.insert(drawit - m_ActionUses.begin(), use); } rdcarray cmds; @@ -1308,7 +1310,7 @@ VkResult WrappedVulkan::vkQueueSubmit(VkQueue queue, uint32_t submitCount, { CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkQueueSubmit); Serialise_vkQueueSubmit(ser, queue, submitCount, pSubmits, fence); @@ -1379,14 +1381,14 @@ bool WrappedVulkan::Serialise_vkQueueSubmit2KHR(SerialiserType &ser, VkQueue que if(doWait) ObjDisp(queue)->QueueWaitIdle(Unwrap(queue)); - // add a drawcall use for this submission, to tally up with any debug messages that come from it + // add an action use for this submission, to tally up with any debug messages that come from it if(IsLoading(m_State)) { - DrawcallUse use(m_CurChunkOffset, m_RootEventID); + ActionUse use(m_CurChunkOffset, m_RootEventID); // insert in sorted location - auto drawit = std::lower_bound(m_DrawcallUses.begin(), m_DrawcallUses.end(), use); - m_DrawcallUses.insert(drawit - m_DrawcallUses.begin(), use); + auto drawit = std::lower_bound(m_ActionUses.begin(), m_ActionUses.end(), use); + m_ActionUses.insert(drawit - m_ActionUses.begin(), use); } for(uint32_t sub = 0; sub < submitCount; sub++) @@ -1474,7 +1476,7 @@ VkResult WrappedVulkan::vkQueueSubmit2KHR(VkQueue queue, uint32_t submitCount, { CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkQueueSubmit2KHR); Serialise_vkQueueSubmit2KHR(ser, queue, submitCount, pSubmits, fence); @@ -1741,7 +1743,7 @@ VkResult WrappedVulkan::vkQueueBindSparse(VkQueue queue, uint32_t bindInfoCount, { SCOPED_SERIALISE_CHUNK(VulkanChunk::vkQueueBindSparse); - ser.SetDrawChunk(); + ser.SetActionChunk(); Serialise_vkQueueBindSparse(ser, queue, bindInfoCount, pBindInfo, fence); m_FrameCaptureRecord->AddChunk(scope.Get()); @@ -1840,20 +1842,20 @@ bool WrappedVulkan::Serialise_vkQueueBeginDebugUtilsLabelEXT(SerialiserType &ser if(IsLoading(m_State)) { - DrawcallDescription draw; - draw.name = Label.pLabelName ? Label.pLabelName : ""; - draw.flags |= DrawFlags::PushMarker; + ActionDescription action; + action.name = Label.pLabelName ? Label.pLabelName : ""; + action.flags |= ActionFlags::PushMarker; - draw.markerColor.x = RDCCLAMP(Label.color[0], 0.0f, 1.0f); - draw.markerColor.y = RDCCLAMP(Label.color[1], 0.0f, 1.0f); - draw.markerColor.z = RDCCLAMP(Label.color[2], 0.0f, 1.0f); - draw.markerColor.w = RDCCLAMP(Label.color[3], 0.0f, 1.0f); + action.markerColor.x = RDCCLAMP(Label.color[0], 0.0f, 1.0f); + action.markerColor.y = RDCCLAMP(Label.color[1], 0.0f, 1.0f); + action.markerColor.z = RDCCLAMP(Label.color[2], 0.0f, 1.0f); + action.markerColor.w = RDCCLAMP(Label.color[3], 0.0f, 1.0f); AddEvent(); - AddDrawcall(draw); + AddAction(action); - // now push the drawcall stack - GetDrawcallStack().push_back(&GetDrawcallStack().back()->children.back()); + // now push the action stack + GetActionStack().push_back(&GetActionStack().back()->children.back()); } } @@ -1871,7 +1873,7 @@ void WrappedVulkan::vkQueueBeginDebugUtilsLabelEXT(VkQueue queue, if(IsActiveCapturing(m_State)) { CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkQueueBeginDebugUtilsLabelEXT); Serialise_vkQueueBeginDebugUtilsLabelEXT(ser, queue, pLabelInfo); @@ -1894,15 +1896,15 @@ bool WrappedVulkan::Serialise_vkQueueEndDebugUtilsLabelEXT(SerialiserType &ser, if(IsLoading(m_State)) { - DrawcallDescription draw; - draw.name = "vkQueueEndDebugUtilsLabelEXT()"; - draw.flags = DrawFlags::PopMarker; + ActionDescription action; + action.name = "vkQueueEndDebugUtilsLabelEXT()"; + action.flags = ActionFlags::PopMarker; AddEvent(); - AddDrawcall(draw); + AddAction(action); - if(GetDrawcallStack().size() > 1) - GetDrawcallStack().pop_back(); + if(GetActionStack().size() > 1) + GetActionStack().pop_back(); } } @@ -1919,7 +1921,7 @@ void WrappedVulkan::vkQueueEndDebugUtilsLabelEXT(VkQueue queue) if(IsActiveCapturing(m_State)) { CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkQueueEndDebugUtilsLabelEXT); Serialise_vkQueueEndDebugUtilsLabelEXT(ser, queue); @@ -1944,17 +1946,17 @@ bool WrappedVulkan::Serialise_vkQueueInsertDebugUtilsLabelEXT(SerialiserType &se if(IsLoading(m_State)) { - DrawcallDescription draw; - draw.name = Label.pLabelName ? Label.pLabelName : ""; - draw.flags |= DrawFlags::SetMarker; + ActionDescription action; + action.name = Label.pLabelName ? Label.pLabelName : ""; + action.flags |= ActionFlags::SetMarker; - draw.markerColor.x = RDCCLAMP(Label.color[0], 0.0f, 1.0f); - draw.markerColor.y = RDCCLAMP(Label.color[1], 0.0f, 1.0f); - draw.markerColor.z = RDCCLAMP(Label.color[2], 0.0f, 1.0f); - draw.markerColor.w = RDCCLAMP(Label.color[3], 0.0f, 1.0f); + action.markerColor.x = RDCCLAMP(Label.color[0], 0.0f, 1.0f); + action.markerColor.y = RDCCLAMP(Label.color[1], 0.0f, 1.0f); + action.markerColor.z = RDCCLAMP(Label.color[2], 0.0f, 1.0f); + action.markerColor.w = RDCCLAMP(Label.color[3], 0.0f, 1.0f); AddEvent(); - AddDrawcall(draw); + AddAction(action); } } @@ -1974,7 +1976,7 @@ void WrappedVulkan::vkQueueInsertDebugUtilsLabelEXT(VkQueue queue, if(IsActiveCapturing(m_State)) { CACHE_THREAD_SERIALISER(); - ser.SetDrawChunk(); + ser.SetActionChunk(); SCOPED_SERIALISE_CHUNK(VulkanChunk::vkQueueInsertDebugUtilsLabelEXT); Serialise_vkQueueInsertDebugUtilsLabelEXT(ser, queue, pLabelInfo); diff --git a/renderdoc/driver/vulkan/wrappers/vk_wsi_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_wsi_funcs.cpp index 5b612dcc7..f806a67c4 100644 --- a/renderdoc/driver/vulkan/wrappers/vk_wsi_funcs.cpp +++ b/renderdoc/driver/vulkan/wrappers/vk_wsi_funcs.cpp @@ -722,14 +722,14 @@ bool WrappedVulkan::Serialise_vkQueuePresentKHR(SerialiserType &ser, VkQueue que { AddEvent(); - DrawcallDescription draw; + ActionDescription action; - draw.name = StringFormat::Fmt("vkQueuePresentKHR(%s)", ToStr(PresentedImage).c_str()); - draw.flags |= DrawFlags::Present; + action.name = StringFormat::Fmt("vkQueuePresentKHR(%s)", ToStr(PresentedImage).c_str()); + action.flags |= ActionFlags::Present; - m_LastPresentedImage = draw.copyDestination = PresentedImage; + m_LastPresentedImage = action.copyDestination = PresentedImage; - AddDrawcall(draw); + AddAction(action); } return true; diff --git a/renderdoc/replay/app_api.cpp b/renderdoc/replay/app_api.cpp index 1cd2ca34f..da5217640 100644 --- a/renderdoc/replay/app_api.cpp +++ b/renderdoc/replay/app_api.cpp @@ -245,22 +245,22 @@ int RENDERDOC_CC SetCaptureOptionF32(RENDERDOC_CaptureOption opt, float val); uint32_t RENDERDOC_CC GetCaptureOptionU32(RENDERDOC_CaptureOption opt); float RENDERDOC_CC GetCaptureOptionF32(RENDERDOC_CaptureOption opt); -void RENDERDOC_CC GetAPIVersion_1_4_1(int *major, int *minor, int *patch) +void RENDERDOC_CC GetAPIVersion_1_4_2(int *major, int *minor, int *patch) { if(major) *major = 1; if(minor) *minor = 4; if(patch) - *patch = 1; + *patch = 2; } -RENDERDOC_API_1_4_1 api_1_4_1; -void Init_1_4_1() +RENDERDOC_API_1_4_2 api_1_4_2; +void Init_1_4_2() { - RENDERDOC_API_1_4_1 &api = api_1_4_1; + RENDERDOC_API_1_4_2 &api = api_1_4_2; - api.GetAPIVersion = &GetAPIVersion_1_4_1; + api.GetAPIVersion = &GetAPIVersion_1_4_2; api.SetCaptureOptionU32 = &SetCaptureOptionU32; api.SetCaptureOptionF32 = &SetCaptureOptionF32; @@ -325,16 +325,17 @@ extern "C" RENDERDOC_API int RENDERDOC_CC RENDERDOC_GetAPI(RENDERDOC_Version ver ret = 1; \ } - API_VERSION_HANDLE(1_0_0, 1_4_1); - API_VERSION_HANDLE(1_0_1, 1_4_1); - API_VERSION_HANDLE(1_0_2, 1_4_1); - API_VERSION_HANDLE(1_1_0, 1_4_1); - API_VERSION_HANDLE(1_1_1, 1_4_1); - API_VERSION_HANDLE(1_1_2, 1_4_1); - API_VERSION_HANDLE(1_2_0, 1_4_1); - API_VERSION_HANDLE(1_3_0, 1_4_1); - API_VERSION_HANDLE(1_4_0, 1_4_1); - API_VERSION_HANDLE(1_4_1, 1_4_1); + API_VERSION_HANDLE(1_0_0, 1_4_2); + API_VERSION_HANDLE(1_0_1, 1_4_2); + API_VERSION_HANDLE(1_0_2, 1_4_2); + API_VERSION_HANDLE(1_1_0, 1_4_2); + API_VERSION_HANDLE(1_1_1, 1_4_2); + API_VERSION_HANDLE(1_1_2, 1_4_2); + API_VERSION_HANDLE(1_2_0, 1_4_2); + API_VERSION_HANDLE(1_3_0, 1_4_2); + API_VERSION_HANDLE(1_4_0, 1_4_2); + API_VERSION_HANDLE(1_4_1, 1_4_2); + API_VERSION_HANDLE(1_4_2, 1_4_2); #undef API_VERSION_HANDLE diff --git a/renderdoc/replay/capture_options.cpp b/renderdoc/replay/capture_options.cpp index 5ccc58af0..ff522697c 100644 --- a/renderdoc/replay/capture_options.cpp +++ b/renderdoc/replay/capture_options.cpp @@ -39,7 +39,7 @@ int RENDERDOC_CC SetCaptureOptionU32(RENDERDOC_CaptureOption opt, uint32_t val) case eRENDERDOC_Option_APIValidation: opts.apiValidation = (val != 0); break; case eRENDERDOC_Option_CaptureCallstacks: opts.captureCallstacks = (val != 0); break; case eRENDERDOC_Option_CaptureCallstacksOnlyDraws: - opts.captureCallstacksOnlyDraws = (val != 0); + opts.captureCallstacksOnlyActions = (val != 0); break; case eRENDERDOC_Option_DelayForDebugger: opts.delayForDebugger = val; break; case eRENDERDOC_Option_VerifyBufferAccess: opts.verifyBufferAccess = (val != 0); break; @@ -74,7 +74,7 @@ int RENDERDOC_CC SetCaptureOptionF32(RENDERDOC_CaptureOption opt, float val) case eRENDERDOC_Option_APIValidation: opts.apiValidation = (val != 0.0f); break; case eRENDERDOC_Option_CaptureCallstacks: opts.captureCallstacks = (val != 0.0f); break; case eRENDERDOC_Option_CaptureCallstacksOnlyDraws: - opts.captureCallstacksOnlyDraws = (val != 0.0f); + opts.captureCallstacksOnlyActions = (val != 0.0f); break; case eRENDERDOC_Option_DelayForDebugger: opts.delayForDebugger = (uint32_t)val; break; case eRENDERDOC_Option_VerifyBufferAccess: opts.verifyBufferAccess = (val != 0.0f); break; @@ -108,7 +108,7 @@ uint32_t RENDERDOC_CC GetCaptureOptionU32(RENDERDOC_CaptureOption opt) case eRENDERDOC_Option_CaptureCallstacks: return (RenderDoc::Inst().GetCaptureOptions().captureCallstacks ? 1 : 0); case eRENDERDOC_Option_CaptureCallstacksOnlyDraws: - return (RenderDoc::Inst().GetCaptureOptions().captureCallstacksOnlyDraws ? 1 : 0); + return (RenderDoc::Inst().GetCaptureOptions().captureCallstacksOnlyActions ? 1 : 0); case eRENDERDOC_Option_DelayForDebugger: return (RenderDoc::Inst().GetCaptureOptions().delayForDebugger); case eRENDERDOC_Option_VerifyBufferAccess: @@ -145,7 +145,7 @@ float RENDERDOC_CC GetCaptureOptionF32(RENDERDOC_CaptureOption opt) case eRENDERDOC_Option_CaptureCallstacks: return (RenderDoc::Inst().GetCaptureOptions().captureCallstacks ? 1.0f : 0.0f); case eRENDERDOC_Option_CaptureCallstacksOnlyDraws: - return (RenderDoc::Inst().GetCaptureOptions().captureCallstacksOnlyDraws ? 1.0f : 0.0f); + return (RenderDoc::Inst().GetCaptureOptions().captureCallstacksOnlyActions ? 1.0f : 0.0f); case eRENDERDOC_Option_DelayForDebugger: return (RenderDoc::Inst().GetCaptureOptions().delayForDebugger * 1.0f); case eRENDERDOC_Option_VerifyBufferAccess: @@ -177,7 +177,7 @@ CaptureOptions::CaptureOptions() allowFullscreen = true; apiValidation = false; captureCallstacks = false; - captureCallstacksOnlyDraws = false; + captureCallstacksOnlyActions = false; delayForDebugger = 0; verifyBufferAccess = false; hookIntoChildren = false; diff --git a/renderdoc/replay/renderdoc_serialise.inl b/renderdoc/replay/renderdoc_serialise.inl index 575a4b082..a166dcdfc 100644 --- a/renderdoc/replay/renderdoc_serialise.inl +++ b/renderdoc/replay/renderdoc_serialise.inl @@ -104,7 +104,7 @@ void DoSerialise(SerialiserType &ser, CaptureOptions &el) SERIALISE_MEMBER(allowFullscreen); SERIALISE_MEMBER(apiValidation); SERIALISE_MEMBER(captureCallstacks); - SERIALISE_MEMBER(captureCallstacksOnlyDraws); + SERIALISE_MEMBER(captureCallstacksOnlyActions); SERIALISE_MEMBER(delayForDebugger); SERIALISE_MEMBER(verifyBufferAccess); SERIALISE_MEMBER(hookIntoChildren); @@ -545,10 +545,10 @@ void DoSerialise(SerialiserType &ser, APIEvent &el) } template -void DoSerialise(SerialiserType &ser, DrawcallDescription &el) +void DoSerialise(SerialiserType &ser, ActionDescription &el) { SERIALISE_MEMBER(eventId); - SERIALISE_MEMBER(drawcallId); + SERIALISE_MEMBER(actionId); SERIALISE_MEMBER(name); @@ -782,7 +782,7 @@ template void DoSerialise(SerialiserType &ser, FrameRecord &el) { SERIALISE_MEMBER(frameInfo); - SERIALISE_MEMBER(drawcallList); + SERIALISE_MEMBER(actionList); SIZE_CHECK(528); } @@ -2356,7 +2356,7 @@ INSTANTIATE_SERIALISE_TYPE(APIProperties) INSTANTIATE_SERIALISE_TYPE(DriverInformation) INSTANTIATE_SERIALISE_TYPE(DebugMessage) INSTANTIATE_SERIALISE_TYPE(APIEvent) -INSTANTIATE_SERIALISE_TYPE(DrawcallDescription) +INSTANTIATE_SERIALISE_TYPE(ActionDescription) INSTANTIATE_SERIALISE_TYPE(ConstantBindStats) INSTANTIATE_SERIALISE_TYPE(SamplerBindStats) INSTANTIATE_SERIALISE_TYPE(ResourceBindStats) diff --git a/renderdoc/replay/replay_controller.cpp b/renderdoc/replay/replay_controller.cpp index f93af002a..a70b836f6 100644 --- a/renderdoc/replay/replay_controller.cpp +++ b/renderdoc/replay/replay_controller.cpp @@ -176,34 +176,34 @@ const SDFile &ReplayController::GetStructuredFile() return m_pDevice->GetStructuredFile(); } -DrawcallDescription *ReplayController::GetDrawcallByEID(uint32_t eventId) +ActionDescription *ReplayController::GetActionByEID(uint32_t eventId) { CHECK_REPLAY_THREAD(); - if(eventId >= m_Drawcalls.size()) + if(eventId >= m_Actions.size()) return NULL; - return m_Drawcalls[eventId]; + return m_Actions[eventId]; } -const rdcarray &ReplayController::GetDrawcalls() +const rdcarray &ReplayController::GetRootActions() { CHECK_REPLAY_THREAD(); - return m_FrameRecord.drawcallList; + return m_FrameRecord.actionList; } -bool ReplayController::ContainsMarker(const rdcarray &draws) +bool ReplayController::ContainsMarker(const rdcarray &actions) { CHECK_REPLAY_THREAD(); bool ret = false; - for(const DrawcallDescription &d : draws) + for(const ActionDescription &a : actions) { - ret |= (d.flags & DrawFlags::PushMarker) && - !(d.flags & (DrawFlags::CmdList | DrawFlags::MultiDraw)) && !d.children.empty(); - ret |= ContainsMarker(d.children); + ret |= (a.flags & ActionFlags::PushMarker) && + !(a.flags & (ActionFlags::CmdList | ActionFlags::MultiAction)) && !a.children.empty(); + ret |= ContainsMarker(a.children); if(ret) break; @@ -212,16 +212,16 @@ bool ReplayController::ContainsMarker(const rdcarray &draws return ret; } -bool ReplayController::PassEquivalent(const DrawcallDescription &a, const DrawcallDescription &b) +bool ReplayController::PassEquivalent(const ActionDescription &a, const ActionDescription &b) { CHECK_REPLAY_THREAD(); - // don't group draws and compute executes - if((a.flags & DrawFlags::Dispatch) != (b.flags & DrawFlags::Dispatch)) + // don't group actions and compute executes + if((a.flags & ActionFlags::Dispatch) != (b.flags & ActionFlags::Dispatch)) return false; // don't group present with anything - if((a.flags & DrawFlags::Present) != (b.flags & DrawFlags::Present)) + if((a.flags & ActionFlags::Present) != (b.flags & ActionFlags::Present)) return false; // don't group things with different depth outputs @@ -274,7 +274,7 @@ bool ReplayController::PassEquivalent(const DrawcallDescription &a, const Drawca // use a kind of heuristic to group together passes where the outputs are similar enough. // could be useful for example if you're rendering to a gbuffer and sometimes you render - // without one target, but the draws are still batched up. + // without one target, but the actions are still batched up. if(numSame > RDCMAX(numAOuts, numBOuts) / 2 && RDCMAX(numAOuts, numBOuts) > 1) return true; @@ -288,15 +288,15 @@ void ReplayController::AddFakeMarkers() { CHECK_REPLAY_THREAD(); - rdcarray &draws = m_FrameRecord.drawcallList; + rdcarray &actions = m_FrameRecord.actionList; - if(ContainsMarker(draws)) + if(ContainsMarker(actions)) return; - uint32_t newEventId = draws.back().events.back().eventId + 1; - uint32_t newDrawcallId = draws.back().drawcallId + 1; + uint32_t newEventId = actions.back().events.back().eventId + 1; + uint32_t newActionId = actions.back().actionId + 1; - rdcarray ret; + rdcarray ret; int depthpassID = 1; int copypassID = 1; @@ -304,34 +304,34 @@ void ReplayController::AddFakeMarkers() int passID = 1; int start = 0; - int refdraw = 0; + int refaction = 0; - DrawFlags drawFlags = - DrawFlags::Copy | DrawFlags::Resolve | DrawFlags::SetMarker | DrawFlags::CmdList; + ActionFlags actionFlags = + ActionFlags::Copy | ActionFlags::Resolve | ActionFlags::SetMarker | ActionFlags::CmdList; - for(int32_t i = 1; i < draws.count(); i++) + for(int32_t i = 1; i < actions.count(); i++) { - if(draws[refdraw].flags & drawFlags) + if(actions[refaction].flags & actionFlags) { - refdraw = i; + refaction = i; continue; } - if(draws[i].flags & drawFlags) + if(actions[i].flags & actionFlags) continue; - if(PassEquivalent(draws[i], draws[refdraw])) + if(PassEquivalent(actions[i], actions[refaction])) continue; int end = i - 1; - if(end - start < 2 || !draws[i].children.empty() || !draws[refdraw].children.empty()) + if(end - start < 2 || !actions[i].children.empty() || !actions[refaction].children.empty()) { for(int j = start; j <= end; j++) - ret.push_back(draws[j]); + ret.push_back(actions[j]); start = i; - refdraw = i; + refaction = i; continue; } @@ -343,33 +343,33 @@ void ReplayController::AddFakeMarkers() { int outCount = 0; - if(!(draws[j].flags & (DrawFlags::Copy | DrawFlags::Resolve | DrawFlags::Clear | - DrawFlags::PassBoundary | DrawFlags::SetMarker))) + if(!(actions[j].flags & (ActionFlags::Copy | ActionFlags::Resolve | ActionFlags::Clear | + ActionFlags::PassBoundary | ActionFlags::SetMarker))) copyOnly = false; - for(ResourceId o : draws[j].outputs) + for(ResourceId o : actions[j].outputs) if(o != ResourceId()) outCount++; minOutCount = RDCMIN(minOutCount, outCount); maxOutCount = RDCMAX(maxOutCount, outCount); } - DrawcallDescription mark; + ActionDescription mark; mark.eventId = newEventId++; - mark.drawcallId = newDrawcallId++; + mark.actionId = newActionId++; - mark.flags = DrawFlags::PushMarker; - mark.outputs = draws[end].outputs; - mark.depthOut = draws[end].depthOut; + mark.flags = ActionFlags::PushMarker; + mark.outputs = actions[end].outputs; + mark.depthOut = actions[end].depthOut; minOutCount = RDCMAX(1, minOutCount); - const char *targets = draws[end].depthOut == ResourceId() ? "Targets" : "Targets + Depth"; + const char *targets = actions[end].depthOut == ResourceId() ? "Targets" : "Targets + Depth"; if(copyOnly) mark.name = StringFormat::Fmt("Copy/Clear Pass #%d", copypassID++); - else if(draws[refdraw].flags & DrawFlags::Dispatch) + else if(actions[refaction].flags & ActionFlags::Dispatch) mark.name = StringFormat::Fmt("Compute Pass #%d", computepassID++); else if(maxOutCount == 0) mark.name = StringFormat::Fmt("Depth-only Pass #%d", depthpassID++); @@ -382,7 +382,7 @@ void ReplayController::AddFakeMarkers() mark.children.resize(end - start + 1); for(int j = start; j <= end; j++) - mark.children[j - start] = draws[j]; + mark.children[j - start] = actions[j]; APIEvent ev; ev.eventId = mark.eventId; @@ -397,20 +397,20 @@ void ReplayController::AddFakeMarkers() ret.push_back(mark); start = i; - refdraw = i; + refaction = i; } - if(start < draws.count()) + if(start < actions.count()) { - for(int j = start; j < draws.count(); j++) - ret.push_back(draws[j]); + for(int j = start; j < actions.count(); j++) + ret.push_back(actions[j]); } - m_FrameRecord.drawcallList = ret; + m_FrameRecord.actionList = ret; // re-configure the previous/next pointeres - m_Drawcalls.clear(); - SetupDrawcallPointers(m_Drawcalls, m_FrameRecord.drawcallList); + m_Actions.clear(); + SetupActionPointers(m_Actions, m_FrameRecord.actionList); } rdcarray ReplayController::FetchCounters(const rdcarray &counters) @@ -493,19 +493,19 @@ MeshFormat ReplayController::GetPostVSData(uint32_t instID, uint32_t viewID, Mes { CHECK_REPLAY_THREAD(); - DrawcallDescription *draw = GetDrawcallByEID(m_EventID); + ActionDescription *action = GetActionByEID(m_EventID); MeshFormat ret; RDCEraseEl(ret); - if(draw == NULL || !(draw->flags & DrawFlags::Drawcall)) + if(action == NULL || !(action->flags & ActionFlags::Drawcall)) return MeshFormat(); - instID = RDCMIN(instID, draw->numInstances - 1); + instID = RDCMIN(instID, action->numInstances - 1); - m_pDevice->InitPostVSBuffers(draw->eventId); + m_pDevice->InitPostVSBuffers(action->eventId); - return m_pDevice->GetPostVSBuffers(draw->eventId, instID, viewID, stage); + return m_pDevice->GetPostVSBuffers(action->eventId, instID, viewID, stage); } bytebuf ReplayController::GetBufferData(ResourceId buff, uint64_t offset, uint64_t len) @@ -2071,13 +2071,13 @@ ReplayStatus ReplayController::PostCreateInit(IReplayDriver *device, RDCFile *rd m_FrameRecord = m_pDevice->GetFrameRecord(); - if(m_FrameRecord.drawcallList.empty()) + if(m_FrameRecord.actionList.empty()) return ReplayStatus::APIReplayFailed; - m_Drawcalls.clear(); - SetupDrawcallPointers(m_Drawcalls, m_FrameRecord.drawcallList); + m_Actions.clear(); + SetupActionPointers(m_Actions, m_FrameRecord.actionList); - FetchPipelineState(m_Drawcalls.back()->eventId); + FetchPipelineState(m_Actions.back()->eventId); return ReplayStatus::Succeeded; } diff --git a/renderdoc/replay/replay_controller.h b/renderdoc/replay/replay_controller.h index b0614c1fd..b49119ac5 100644 --- a/renderdoc/replay/replay_controller.h +++ b/renderdoc/replay/replay_controller.h @@ -164,7 +164,7 @@ public: FrameDescription GetFrameInfo(); const SDFile &GetStructuredFile(); - const rdcarray &GetDrawcalls(); + const rdcarray &GetRootActions(); void AddFakeMarkers(); rdcarray FetchCounters(const rdcarray &counters); rdcarray EnumerateCounters(); @@ -224,13 +224,13 @@ private: void FetchPipelineState(uint32_t eventId); - DrawcallDescription *GetDrawcallByEID(uint32_t eventId); - bool ContainsMarker(const rdcarray &draws); - bool PassEquivalent(const DrawcallDescription &a, const DrawcallDescription &b); + ActionDescription *GetActionByEID(uint32_t eventId); + bool ContainsMarker(const rdcarray &actions); + bool PassEquivalent(const ActionDescription &a, const ActionDescription &b); IReplayDriver *GetDevice() { return m_pDevice; } FrameRecord m_FrameRecord; - rdcarray m_Drawcalls; + rdcarray m_Actions; uint64_t m_ThreadID; diff --git a/renderdoc/replay/replay_driver.cpp b/renderdoc/replay/replay_driver.cpp index afffdf25b..4167c612a 100644 --- a/renderdoc/replay/replay_driver.cpp +++ b/renderdoc/replay/replay_driver.cpp @@ -55,10 +55,10 @@ void DoSerialise(SerialiserType &ser, GetTextureDataParams &el) INSTANTIATE_SERIALISE_TYPE(GetTextureDataParams); -static bool PreviousNextExcludedMarker(DrawcallDescription *draw) +static bool PreviousNextExcludedMarker(ActionDescription *action) { - return bool(draw->flags & (DrawFlags::PushMarker | DrawFlags::PopMarker | DrawFlags::SetMarker | - DrawFlags::MultiDraw)); + return bool(action->flags & (ActionFlags::PushMarker | ActionFlags::PopMarker | + ActionFlags::SetMarker | ActionFlags::MultiAction)); } CompType BaseRemapType(CompType typeCast) @@ -75,115 +75,116 @@ CompType BaseRemapType(CompType typeCast) } } -static DrawcallDescription *SetupDrawcallPointers(rdcarray &drawcallTable, - rdcarray &draws, - DrawcallDescription *parent, - DrawcallDescription *&previous) +static ActionDescription *SetupActionPointers(rdcarray &actionTable, + rdcarray &actions, + ActionDescription *parent, ActionDescription *&previous) { - DrawcallDescription *ret = NULL; + ActionDescription *ret = NULL; - for(size_t i = 0; i < draws.size(); i++) + for(size_t i = 0; i < actions.size(); i++) { - DrawcallDescription *draw = &draws[i]; + ActionDescription *action = &actions[i]; - RDCASSERTMSG("All draws must have their own event as the final event", - !draw->events.empty() && draw->events.back().eventId == draw->eventId); + RDCASSERTMSG("All actions must have their own event as the final event", + !action->events.empty() && action->events.back().eventId == action->eventId); - draw->parent = parent; + action->parent = parent; - if(!draw->children.empty()) + if(!action->children.empty()) { { - RDCASSERT(drawcallTable.empty() || draw->eventId > drawcallTable.back()->eventId || - drawcallTable.back()->IsFakeMarker()); - drawcallTable.resize(RDCMAX(drawcallTable.size(), size_t(draw->eventId) + 1)); - drawcallTable[draw->eventId] = draw; + RDCASSERT(actionTable.empty() || action->eventId > actionTable.back()->eventId || + actionTable.back()->IsFakeMarker()); + actionTable.resize(RDCMAX(actionTable.size(), size_t(action->eventId) + 1)); + actionTable[action->eventId] = action; } - ret = SetupDrawcallPointers(drawcallTable, draw->children, draw, previous); + ret = SetupActionPointers(actionTable, action->children, action, previous); } - else if(PreviousNextExcludedMarker(draw)) + else if(PreviousNextExcludedMarker(action)) { // don't want to set up previous/next links for markers, but still add them to the table // Some markers like Present should have previous/next, but API Calls we also skip { // we also allow non-contiguous EIDs for fake markers that have high EIDs - RDCASSERT(drawcallTable.empty() || draw->eventId > drawcallTable.back()->eventId || - drawcallTable.back()->IsFakeMarker()); - drawcallTable.resize(RDCMAX(drawcallTable.size(), size_t(draw->eventId) + 1)); - drawcallTable[draw->eventId] = draw; + RDCASSERT(actionTable.empty() || action->eventId > actionTable.back()->eventId || + actionTable.back()->IsFakeMarker()); + actionTable.resize(RDCMAX(actionTable.size(), size_t(action->eventId) + 1)); + actionTable[action->eventId] = action; } } else { if(previous) - previous->next = draw; - draw->previous = previous; + previous->next = action; + action->previous = previous; { // we also allow non-contiguous EIDs for fake markers that have high EIDs - RDCASSERT(drawcallTable.empty() || draw->eventId > drawcallTable.back()->eventId || - drawcallTable.back()->IsFakeMarker()); - drawcallTable.resize(RDCMAX(drawcallTable.size(), size_t(draw->eventId) + 1)); - drawcallTable[draw->eventId] = draw; + RDCASSERT(actionTable.empty() || action->eventId > actionTable.back()->eventId || + actionTable.back()->IsFakeMarker()); + actionTable.resize(RDCMAX(actionTable.size(), size_t(action->eventId) + 1)); + actionTable[action->eventId] = action; } - ret = previous = draw; + ret = previous = action; } } return ret; } -void SetupDrawcallPointers(rdcarray &drawcallTable, - rdcarray &draws) +void SetupActionPointers(rdcarray &actionTable, + rdcarray &actions) { - DrawcallDescription *previous = NULL; - SetupDrawcallPointers(drawcallTable, draws, NULL, previous); + ActionDescription *previous = NULL; + SetupActionPointers(actionTable, actions, NULL, previous); // markers don't enter the previous/next chain, but we still want pointers for them that point to - // the next or previous actual draw (skipping any markers). This means that draw->next->previous - // != draw sometimes, but it's more useful than draw->next being NULL in the middle of the list. + // the next or previous actual action (skipping any markers). This means that + // action->next->previous + // != action sometimes, but it's more useful than action->next being NULL in the middle of the + // list. // This enables searching for a marker string and then being able to navigate from there and // joining the 'real' linked list after one step. previous = NULL; - rdcarray markers; + rdcarray markers; - for(DrawcallDescription *draw : drawcallTable) + for(ActionDescription *action : actionTable) { - if(!draw) + if(!action) continue; - bool marker = PreviousNextExcludedMarker(draw); + bool marker = PreviousNextExcludedMarker(action); if(marker) { - // point the previous pointer to the last non-marker draw we got. If we haven't hit one yet + // point the previous pointer to the last non-marker action we got. If we haven't hit one yet // because this is near the start, this will just be NULL. - draw->previous = previous; + action->previous = previous; // because there can be multiple markers consecutively we want to point all of their nexts to - // the next draw we encounter. Accumulate this list, though in most cases it will only be 1 + // the next action we encounter. Accumulate this list, though in most cases it will only be 1 // long as it's uncommon to have multiple markers one after the other - markers.push_back(draw); + markers.push_back(action); } else { // the next markers we encounter should point their previous to this. - previous = draw; + previous = action; // all previous markers point to this one - for(DrawcallDescription *m : markers) - m->next = draw; + for(ActionDescription *m : markers) + m->next = action; markers.clear(); } } } -void PatchLineStripIndexBuffer(const DrawcallDescription *draw, Topology topology, uint8_t *idx8, +void PatchLineStripIndexBuffer(const ActionDescription *action, Topology topology, uint8_t *idx8, uint16_t *idx16, uint32_t *idx32, rdcarray &patchedIndices) { const uint32_t restart = 0xffffffff; @@ -196,7 +197,7 @@ void PatchLineStripIndexBuffer(const DrawcallDescription *draw, Topology topolog { case Topology::TriangleList: { - for(uint32_t index = 0; index + 3 <= draw->numIndices; index += 3) + for(uint32_t index = 0; index + 3 <= action->numIndices; index += 3) { patchedIndices.push_back(IDX_VALUE(0)); patchedIndices.push_back(IDX_VALUE(1)); @@ -213,7 +214,7 @@ void PatchLineStripIndexBuffer(const DrawcallDescription *draw, Topology topolog // would need some more complex handling (you could two pairs of triangles in a single strip // by changing the winding, but then you'd need to restart and jump back, and handle a // trailing single triangle, etc). - for(uint32_t index = 0; index + 3 <= draw->numIndices; index++) + for(uint32_t index = 0; index + 3 <= action->numIndices; index++) { patchedIndices.push_back(IDX_VALUE(0)); patchedIndices.push_back(IDX_VALUE(1)); @@ -233,7 +234,7 @@ void PatchLineStripIndexBuffer(const DrawcallDescription *draw, Topology topolog // triangle then a base -> 2 for the last one. However I would be amazed if this code ever // runs except in an artificial test, so let's go with the simple and easy to understand // solution. - for(; index + 2 <= draw->numIndices; index++) + for(; index + 2 <= action->numIndices; index++) { patchedIndices.push_back(base); patchedIndices.push_back(IDX_VALUE(0)); @@ -246,7 +247,7 @@ void PatchLineStripIndexBuffer(const DrawcallDescription *draw, Topology topolog case Topology::TriangleList_Adj: { // skip the adjacency values - for(uint32_t index = 0; index + 6 <= draw->numIndices; index += 6) + for(uint32_t index = 0; index + 6 <= action->numIndices; index += 6) { patchedIndices.push_back(IDX_VALUE(0)); patchedIndices.push_back(IDX_VALUE(2)); @@ -259,7 +260,7 @@ void PatchLineStripIndexBuffer(const DrawcallDescription *draw, Topology topolog case Topology::TriangleStrip_Adj: { // skip the adjacency values - for(uint32_t index = 0; index + 6 <= draw->numIndices; index += 2) + for(uint32_t index = 0; index + 6 <= action->numIndices; index += 2) { patchedIndices.push_back(IDX_VALUE(0)); patchedIndices.push_back(IDX_VALUE(2)); diff --git a/renderdoc/replay/replay_driver.h b/renderdoc/replay/replay_driver.h index ceccd9c23..b8e8181f1 100644 --- a/renderdoc/replay/replay_driver.h +++ b/renderdoc/replay/replay_driver.h @@ -66,7 +66,7 @@ struct FrameRecord { FrameDescription frameInfo; - rdcarray drawcallList; + rdcarray actionList; }; DECLARE_REFLECTION_STRUCT(FrameRecord); @@ -299,12 +299,12 @@ struct IDeviceProtocolHandler : public IDeviceProtocolController }; // utility functions useful in any driver implementation -void SetupDrawcallPointers(rdcarray &drawcallTable, - rdcarray &draws); +void SetupActionPointers(rdcarray &actionTable, + rdcarray &actions); // for hardware/APIs that can't do line rasterization, manually expand any triangle input topology // to a linestrip with strip restart indices. -void PatchLineStripIndexBuffer(const DrawcallDescription *draw, Topology topology, uint8_t *idx8, +void PatchLineStripIndexBuffer(const ActionDescription *action, Topology topology, uint8_t *idx8, uint16_t *idx16, uint32_t *idx32, rdcarray &patchedIndices); void PatchTriangleFanRestartIndexBufer(rdcarray &patchedIndices, uint32_t restartIndex); diff --git a/renderdoc/replay/replay_output.cpp b/renderdoc/replay/replay_output.cpp index a526f9c7f..b86dded84 100644 --- a/renderdoc/replay/replay_output.cpp +++ b/renderdoc/replay/replay_output.cpp @@ -226,7 +226,7 @@ void ReplayOutput::RefreshOverlay() { CHECK_REPLAY_THREAD(); - DrawcallDescription *draw = m_pRenderer->GetDrawcallByEID(m_EventID); + ActionDescription *action = m_pRenderer->GetActionByEID(m_EventID); passEvents = m_pDevice->GetPassEvents(m_EventID); @@ -251,9 +251,9 @@ void ReplayOutput::RefreshOverlay() if(m_Type == ReplayOutputType::Mesh) m_OverlayDirty = false; - if(draw != NULL && (draw->flags & DrawFlags::Drawcall)) + if(action != NULL && (action->flags & ActionFlags::Drawcall)) { - m_pDevice->InitPostVSBuffers(draw->eventId); + m_pDevice->InitPostVSBuffers(action->eventId); if(postVSWholePass && !passEvents.empty()) { @@ -268,7 +268,7 @@ void ReplayOutput::RefreshOverlay() { ResourceId id = m_pDevice->GetLiveID(m_RenderData.texDisplay.resourceId); - if(draw && m_pDevice->IsRenderOutput(id)) + if(action && m_pDevice->IsRenderOutput(id)) { FloatVector f = m_RenderData.texDisplay.backgroundColor; @@ -387,15 +387,15 @@ rdcpair ReplayOutput::PickVertex(uint32_t x, uint32_t y) RENDERDOC_PROFILEFUNCTION(); - DrawcallDescription *draw = m_pRenderer->GetDrawcallByEID(m_EventID); + ActionDescription *action = m_pRenderer->GetActionByEID(m_EventID); const rdcpair errorReturn = {~0U, ~0U}; - if(!draw) + if(!action) return errorReturn; if(m_RenderData.meshDisplay.type == MeshDataStage::Unknown) return errorReturn; - if(!(draw->flags & DrawFlags::Drawcall)) + if(!(action->flags & ActionFlags::Drawcall)) return errorReturn; MeshDisplay cfg = m_RenderData.meshDisplay; @@ -410,7 +410,7 @@ rdcpair ReplayOutput::PickVertex(uint32_t x, uint32_t y) // input data either doesn't vary with instance, or is trivial (all verts the same for that // element), so only care about fetching the right instance for post-VS stages - if((draw->flags & DrawFlags::Instanced) && m_RenderData.meshDisplay.type != MeshDataStage::VSIn) + if((action->flags & ActionFlags::Instanced) && m_RenderData.meshDisplay.type != MeshDataStage::VSIn) { // if no special options are enabled, just look at the current instance uint32_t firstInst = m_RenderData.meshDisplay.curInstance; @@ -424,20 +424,20 @@ rdcpair ReplayOutput::PickVertex(uint32_t x, uint32_t y) if(m_RenderData.meshDisplay.showAllInstances) { firstInst = 0; - maxInst = RDCMAX(1U, draw->numInstances); + maxInst = RDCMAX(1U, action->numInstances); } // used for post-VS output, calculate the offset of the element we're using as position, // relative to 0 MeshFormat fmt = - m_pDevice->GetPostVSBuffers(draw->eventId, m_RenderData.meshDisplay.curInstance, + m_pDevice->GetPostVSBuffers(action->eventId, m_RenderData.meshDisplay.curInstance, m_RenderData.meshDisplay.curView, m_RenderData.meshDisplay.type); uint64_t elemOffset = cfg.position.vertexByteOffset - fmt.vertexByteOffset; for(uint32_t inst = firstInst; inst < maxInst; inst++) { // find the start of this buffer, and apply the element offset, then pick in that instance - fmt = m_pDevice->GetPostVSBuffers(draw->eventId, inst, m_RenderData.meshDisplay.curView, + fmt = m_pDevice->GetPostVSBuffers(action->eventId, inst, m_RenderData.meshDisplay.curView, m_RenderData.meshDisplay.type); if(fmt.vertexResourceId != ResourceId()) cfg.position.vertexByteOffset = fmt.vertexByteOffset + elemOffset; @@ -680,7 +680,7 @@ void ReplayOutput::DisplayTex() RENDERDOC_PROFILEFUNCTION(); - DrawcallDescription *draw = m_pRenderer->GetDrawcallByEID(m_EventID); + ActionDescription *action = m_pRenderer->GetActionByEID(m_EventID); if(m_MainOutput.outputID == 0) return; @@ -696,7 +696,7 @@ void ReplayOutput::DisplayTex() texDisplay.rawOutput = false; texDisplay.resourceId = m_pDevice->GetLiveID(texDisplay.resourceId); - if(m_RenderData.texDisplay.overlay != DebugOverlay::NoOverlay && draw) + if(m_RenderData.texDisplay.overlay != DebugOverlay::NoOverlay && action) { if(m_OverlayDirty) { @@ -742,7 +742,7 @@ void ReplayOutput::DisplayTex() ResourceId id = m_pDevice->GetLiveID(m_RenderData.texDisplay.resourceId); - if(m_RenderData.texDisplay.overlay != DebugOverlay::NoOverlay && draw && + if(m_RenderData.texDisplay.overlay != DebugOverlay::NoOverlay && action && m_pDevice->IsRenderOutput(id) && m_RenderData.texDisplay.overlay != DebugOverlay::NaN && m_RenderData.texDisplay.overlay != DebugOverlay::Clipping && m_OverlayResourceId != ResourceId()) { @@ -769,11 +769,11 @@ void ReplayOutput::DisplayMesh() RENDERDOC_PROFILEFUNCTION(); - DrawcallDescription *draw = m_pRenderer->GetDrawcallByEID(m_EventID); + ActionDescription *action = m_pRenderer->GetActionByEID(m_EventID); - if(draw == NULL || m_MainOutput.outputID == 0 || m_Width <= 0 || m_Height <= 0 || + if(action == NULL || m_MainOutput.outputID == 0 || m_Width <= 0 || m_Height <= 0 || (m_RenderData.meshDisplay.type == MeshDataStage::Unknown) || - !(draw->flags & DrawFlags::Drawcall)) + !(action->flags & ActionFlags::Drawcall)) { FloatVector color; m_pDevice->BindOutputWindow(m_MainOutput.outputID, false); @@ -809,7 +809,7 @@ void ReplayOutput::DisplayMesh() rdcarray secondaryDraws; // we choose a pallette here so that the colours stay consistent (i.e the - // current draw is always the same colour), but also to indicate somewhat + // current action is always the same colour), but also to indicate somewhat // the relationship - ie. instances are closer in colour than other draws // in the pass @@ -833,7 +833,7 @@ void ReplayOutput::DisplayMesh() { for(size_t i = 0; m_RenderData.meshDisplay.showWholePass && i < passEvents.size(); i++) { - DrawcallDescription *d = m_pRenderer->GetDrawcallByEID(passEvents[i]); + ActionDescription *d = m_pRenderer->GetActionByEID(passEvents[i]); if(d) { @@ -855,22 +855,22 @@ void ReplayOutput::DisplayMesh() } } - // draw previous instances in the current drawcall - if(draw->flags & DrawFlags::Instanced) + // action previous instances in the current action + if(action->flags & ActionFlags::Instanced) { uint32_t maxInst = 0; if(m_RenderData.meshDisplay.showPrevInstances) maxInst = RDCMAX(1U, m_RenderData.meshDisplay.curInstance); if(m_RenderData.meshDisplay.showAllInstances) - maxInst = RDCMAX(1U, draw->numInstances); + maxInst = RDCMAX(1U, action->numInstances); for(uint32_t inst = 0; inst < maxInst; inst++) { // get the 'most final' stage MeshFormat fmt = m_pDevice->GetPostVSBuffers( - draw->eventId, inst, m_RenderData.meshDisplay.curView, MeshDataStage::GSOut); + action->eventId, inst, m_RenderData.meshDisplay.curView, MeshDataStage::GSOut); if(fmt.vertexResourceId == ResourceId()) - fmt = m_pDevice->GetPostVSBuffers(draw->eventId, inst, m_RenderData.meshDisplay.curView, + fmt = m_pDevice->GetPostVSBuffers(action->eventId, inst, m_RenderData.meshDisplay.curView, MeshDataStage::VSOut); fmt.meshColor = otherInstances; diff --git a/renderdoc/serialise/serialiser.cpp b/renderdoc/serialise/serialiser.cpp index 56767843d..a48538834 100644 --- a/renderdoc/serialise/serialiser.cpp +++ b/renderdoc/serialise/serialiser.cpp @@ -365,8 +365,8 @@ uint32_t Serialiser::BeginChunk(uint32_t chunkID, uint6 { bool collect = RenderDoc::Inst().GetCaptureOptions().captureCallstacks; - if(RenderDoc::Inst().GetCaptureOptions().captureCallstacksOnlyDraws) - collect = collect && m_DrawChunk; + if(RenderDoc::Inst().GetCaptureOptions().captureCallstacksOnlyActions) + collect = collect && m_ActionChunk; if(collect) { @@ -461,7 +461,7 @@ uint32_t Serialiser::BeginChunk(uint32_t chunkID, uint6 template <> void Serialiser::EndChunk() { - m_DrawChunk = false; + m_ActionChunk = false; if(m_DataStreaming) { diff --git a/renderdoc/serialise/serialiser.h b/renderdoc/serialise/serialiser.h index cbf18448f..a66bb19e2 100644 --- a/renderdoc/serialise/serialiser.h +++ b/renderdoc/serialise/serialiser.h @@ -154,7 +154,7 @@ public: void SetStreamingMode(bool stream) { m_DataStreaming = stream; } SDFile &GetStructuredFile() { return *m_StructuredFile; } void WriteStructuredFile(const SDFile &file, RENDERDOC_ProgressCallback progress); - void SetDrawChunk() { m_DrawChunk = true; } + void SetActionChunk() { m_ActionChunk = true; } // the struct argument allows nested structs to pass a bit of data so a child struct can have // context from a parent struct if needed to serialise properly. Rarely used, primarily to be able // to flag if some context-sensitive members might be invalid @@ -1487,7 +1487,7 @@ private: // See SetStreamingMode bool m_DataStreaming = false; - bool m_DrawChunk = false; + bool m_ActionChunk = false; bool m_Structuriser = false; uint64_t m_LastChunkOffset = 0; diff --git a/renderdoccmd/renderdoccmd.cpp b/renderdoccmd/renderdoccmd.cpp index 558c38fd0..269399243 100644 --- a/renderdoccmd/renderdoccmd.cpp +++ b/renderdoccmd/renderdoccmd.cpp @@ -104,17 +104,17 @@ void DisplayRendererPreview(IReplayController *renderer, uint32_t width, uint32_ } } - rdcarray draws = renderer->GetDrawcalls(); + rdcarray actions = renderer->GetRootActions(); - DrawcallDescription *last = NULL; + ActionDescription *last = NULL; - if(!draws.empty()) - last = &draws.back(); + if(!actions.empty()) + last = &actions.back(); while(last && !last->children.empty()) last = &last->children.back(); - if(last && last->flags & DrawFlags::Present) + if(last && last->flags & ActionFlags::Present) { ResourceId id = last->copyDestination; if(id != ResourceId()) @@ -1614,8 +1614,8 @@ int renderdoccmd(GlobalEnvironment &env, std::vector &argv) "Capturing Option: Unmutes API debugging output from --opt-api-validation."); cmd.add("opt-capture-callstacks", 0, "Capturing Option: Capture CPU callstacks for API events."); - cmd.add("opt-capture-callstacks-only-draws", 0, - "Capturing Option: When capturing CPU callstacks, only capture them from drawcalls."); + cmd.add("opt-capture-callstacks-only-actions", 0, + "Capturing Option: When capturing CPU callstacks, only capture them from actions."); cmd.add("opt-delay-for-debugger", 0, "Capturing Option: Specify a delay in seconds to wait for a debugger to attach.", false, 0, cmdline::range(0, 10000)); @@ -1647,8 +1647,8 @@ int renderdoccmd(GlobalEnvironment &env, std::vector &argv) opts.debugOutputMute = false; if(cmd.exist("opt-capture-callstacks")) opts.captureCallstacks = true; - if(cmd.exist("opt-capture-callstacks-only-draws")) - opts.captureCallstacksOnlyDraws = true; + if(cmd.exist("opt-capture-callstacks-only-actions")) + opts.captureCallstacksOnlyActions = true; if(cmd.exist("opt-verify-buffer-access")) opts.verifyBufferAccess = true; if(cmd.exist("opt-hook-children")) diff --git a/util/test/rdtest/analyse.py b/util/test/rdtest/analyse.py index aca65b93b..d910cf8f6 100644 --- a/util/test/rdtest/analyse.py +++ b/util/test/rdtest/analyse.py @@ -55,7 +55,7 @@ def open_capture(filename="", cap: rd.CaptureFile=None, opts: rd.ReplayOptions=N return controller -def fetch_indices(controller: rd.ReplayController, draw: rd.DrawcallDescription, mesh: rd.MeshFormat, index_offset: int, first_index: int, num_indices: int): +def fetch_indices(controller: rd.ReplayController, action: rd.ActionDescription, mesh: rd.MeshFormat, index_offset: int, first_index: int, num_indices: int): pipe = controller.GetPipelineState() restart_idx = pipe.GetStripRestartIndex() & ((1 << (mesh.indexByteStride*8)) - 1) diff --git a/util/test/rdtest/shared/Buffer_Truncation.py b/util/test/rdtest/shared/Buffer_Truncation.py index 160f0cdb5..1bb474240 100644 --- a/util/test/rdtest/shared/Buffer_Truncation.py +++ b/util/test/rdtest/shared/Buffer_Truncation.py @@ -7,11 +7,11 @@ class Buffer_Truncation(rdtest.TestCase): internal = True def check_capture(self): - draw = self.find_draw("Draw") + action = self.find_action("Draw") - self.check(draw is not None) + self.check(action is not None) - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) vsin_ref = { 0: { @@ -52,9 +52,9 @@ class Buffer_Truncation(rdtest.TestCase): }, } - self.check_mesh_data(vsin_ref, self.get_vsin(draw)) + self.check_mesh_data(vsin_ref, self.get_vsin(action)) - postvs_data = self.get_postvs(draw, rd.MeshDataStage.VSOut, 0, draw.numIndices) + postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, action.numIndices) postvs_ref = { 0: { @@ -103,7 +103,7 @@ class Buffer_Truncation(rdtest.TestCase): cbuf: rd.BoundCBuffer = pipe.GetConstantBuffer(stage, 0, 0) - if self.find_draw('NoCBufferRange') == None: + if self.find_action('NoCBufferRange') == None: self.check(cbuf.byteSize == 256) variables = self.controller.GetCBufferVariableContents(pipe.GetGraphicsPipelineObject(), diff --git a/util/test/rdtest/shared/Discard_Zoo.py b/util/test/rdtest/shared/Discard_Zoo.py index a6de43a89..3908548d6 100644 --- a/util/test/rdtest/shared/Discard_Zoo.py +++ b/util/test/rdtest/shared/Discard_Zoo.py @@ -185,11 +185,11 @@ class Discard_Zoo(rdtest.TestCase): rdtest.log.success('{} is OK {} discarding'.format(name, "after" if discarded else "before")) def check_textures(self): - draw = self.find_draw("TestStart") + action = self.find_action("TestStart") - self.check(draw is not None) + self.check(action is not None) - self.controller.SetFrameEvent(draw.eventId, True) + self.controller.SetFrameEvent(action.eventId, True) for tex in self.controller.GetTextures(): tex: rd.TextureDescription @@ -198,11 +198,11 @@ class Discard_Zoo(rdtest.TestCase): if "Discard" in res.name: self.check_texture(tex.resourceId, False) - draw = self.find_draw("TestEnd") + action = self.find_action("TestEnd") - self.check(draw is not None) + self.check(action is not None) - self.controller.SetFrameEvent(draw.eventId, True) + self.controller.SetFrameEvent(action.eventId, True) for tex in self.controller.GetTextures(): tex: rd.TextureDescription diff --git a/util/test/rdtest/shared/Draw_Zoo.py b/util/test/rdtest/shared/Draw_Zoo.py index 297f80ae2..4d4ccb3a4 100644 --- a/util/test/rdtest/shared/Draw_Zoo.py +++ b/util/test/rdtest/shared/Draw_Zoo.py @@ -5,31 +5,31 @@ import rdtest class Draw_Zoo(rdtest.TestCase): internal = True - def vid(self, draw: rd.DrawcallDescription, val: int): + def vid(self, action: rd.ActionDescription, val: int): # For D3D, Vertex ID is either 0-based for non indexed calls, or the raw index. That means no baseVertex applied if rd.IsD3D(self.props.pipelineType): - if draw.flags & rd.DrawFlags.Indexed: - return float(val - draw.baseVertex) + if action.flags & rd.ActionFlags.Indexed: + return float(val - action.baseVertex) return float(val) # For GL and vulkan it includes all offsets - so for non-indexed that includes vertexOffset, and for indexed # that includes baseVertex - if draw.flags & rd.DrawFlags.Indexed: + if action.flags & rd.ActionFlags.Indexed: return float(val) - return float(val + draw.vertexOffset) + return float(val + action.vertexOffset) - def iid(self, draw: rd.DrawcallDescription, val: int): + def iid(self, action: rd.ActionDescription, val: int): # See above - similar for instance ID, but only vulkan includes the instanceOffset in instance ID - if (self.props.pipelineType == rd.GraphicsAPI.Vulkan) and draw.flags & rd.DrawFlags.Instanced: - return float(val + draw.instanceOffset) + if (self.props.pipelineType == rd.GraphicsAPI.Vulkan) and action.flags & rd.ActionFlags.Instanced: + return float(val + action.instanceOffset) return float(val) - def check_draw(self, draw: rd.DrawcallDescription, ref_data): - rdtest.log.print("Checking draw {}".format(draw.eventId)) + def check_action(self, action: rd.ActionDescription, ref_data): + rdtest.log.print("Checking action {}".format(action.eventId)) - self.controller.SetFrameEvent(draw.eventId, True) + self.controller.SetFrameEvent(action.eventId, True) self.pipe: rd.PipeState = self.controller.GetPipelineState() @@ -80,10 +80,10 @@ class Draw_Zoo(rdtest.TestCase): vsin_pos_name: ref_data['pos'][v], } - self.check_mesh_data(vsin_ref, self.get_vsin(draw)) + self.check_mesh_data(vsin_ref, self.get_vsin(action)) - num_instances = draw.numInstances - if not (draw.flags & rd.DrawFlags.Instanced): + num_instances = action.numInstances + if not (action.flags & rd.ActionFlags.Instanced): num_instances = 1 rdtest.log.success("Checked vertex in data") @@ -104,11 +104,11 @@ class Draw_Zoo(rdtest.TestCase): 'vtx': v, 'idx': ref_data['base']+v, vsout_pos_name: conv_out_pos(ref_data['pos'][v]), - 'VID': self.vid(draw, ref_data['base']+v), - 'IID': self.iid(draw, inst), + 'VID': self.vid(action, ref_data['base']+v), + 'IID': self.iid(action, inst), } - postvs = self.get_postvs(draw, rd.MeshDataStage.VSOut, instance=inst) + postvs = self.get_postvs(action, rd.MeshDataStage.VSOut, instance=inst) self.check_mesh_data(vsout_ref, postvs) @@ -128,13 +128,13 @@ class Draw_Zoo(rdtest.TestCase): for vert, coord in enumerate(ref_data['pixels'][inst]): if coord[0] == 0 and coord[1] == 0: continue - val = (self.vid(draw, ref_data['base'] + vert), self.iid(draw, inst), float(inst) * 0.5, + val = (self.vid(action, ref_data['base'] + vert), self.iid(action, inst), float(inst) * 0.5, postvs[vert]['COLOR'][1] + postvs[vert]['TEXCOORD'][0]) self.check_pixel_value(out_tex, coord[0], coord[1], val, eps=0.3) rdtest.log.success("Checked pixels in instance {}".format(inst)) - rdtest.log.success("Checked draw {}".format(draw.eventId)) + rdtest.log.success("Checked action {}".format(action.eventId)) def check_debug(self, vtx, idx, inst, postvs): trace: rd.ShaderDebugTrace = self.controller.DebugVertex(vtx, inst, idx, 0) @@ -174,9 +174,9 @@ class Draw_Zoo(rdtest.TestCase): def check_capture(self): self.props: rd.APIProperties = self.controller.GetAPIProperties() - test_marker: rd.DrawcallDescription = self.find_draw("Test") + test_marker: rd.ActionDescription = self.find_action("Test") - draw: rd.DrawcallDescription = test_marker.next + action: rd.ActionDescription = test_marker.next rdtest.log.begin_section("Non-indexed, non-instanced cases") @@ -187,34 +187,34 @@ class Draw_Zoo(rdtest.TestCase): 'pixels': [[(12, 12), (24, 34), (35, 12)]], } - self.check_draw(draw, ref) - self.check(draw.vertexOffset == 0) + self.check_action(action, ref) + self.check(action.vertexOffset == 0) self.check(self.pipe.GetVBuffers()[0].byteOffset == 0) - draw = draw.next + action = action.next - # Vertex offset in the draw + # Vertex offset in the action ref = { 'base': 0, 'pos': [[-0.5, -0.5, 0.0], [0.0, 0.5, 0.0], [0.5, -0.5, 0.0]], 'pixels': [[(60, 35), (72, 13), (83, 35)]], } - self.check_draw(draw, ref) - self.check(draw.vertexOffset > 0) + self.check_action(action, ref) + self.check(action.vertexOffset > 0) self.check(self.pipe.GetVBuffers()[0].byteOffset == 0) - draw = draw.next + action = action.next - # Vertex offset in draw and in vertex binding + # Vertex offset in action and in vertex binding ref = { 'base': 0, 'pos': [[-0.5, 0.0, 0.0], [0.0, -0.5, 0.0], [0.0, 0.5, 0.0]], 'pixels': [[(108, 23), (119, 35), (119, 13)]], } - self.check_draw(draw, ref) - self.check(draw.vertexOffset > 0) + self.check_action(action, ref) + self.check(action.vertexOffset > 0) self.check(self.pipe.GetVBuffers()[0].byteOffset > 0) - draw = draw.next + action = action.next rdtest.log.end_section("Non-indexed, non-instanced cases") @@ -227,75 +227,75 @@ class Draw_Zoo(rdtest.TestCase): 'pixels': [[(12, 60), (24, 82), (35, 60)]], } - self.check_draw(draw, ref) - self.check(draw.indexOffset == 0) - self.check(draw.baseVertex == 0) - self.check(draw.vertexOffset == 0) + self.check_action(action, ref) + self.check(action.indexOffset == 0) + self.check(action.baseVertex == 0) + self.check(action.vertexOffset == 0) self.check(self.pipe.GetVBuffers()[0].byteOffset == 0) self.check(self.pipe.GetIBuffer().byteOffset == 0) - draw = draw.next + action = action.next - # first index in the draw + # first index in the action ref = { 'base': 5, 'pos': [[-0.5, -0.5, 0.0], [0.0, 0.5, 0.0], [0.5, -0.5, 0.0]], 'pixels': [[(60, 83), (72, 61), (83, 83)]], } - self.check_draw(draw, ref) - self.check(draw.indexOffset > 0) - self.check(draw.baseVertex == 0) - self.check(draw.vertexOffset == 0) + self.check_action(action, ref) + self.check(action.indexOffset > 0) + self.check(action.baseVertex == 0) + self.check(action.vertexOffset == 0) self.check(self.pipe.GetVBuffers()[0].byteOffset == 0) self.check(self.pipe.GetIBuffer().byteOffset == 0) - draw = draw.next + action = action.next - # first index and base vertex in the draw + # first index and base vertex in the action ref = { 'base': 13, 'pos': [[-0.5, 0.0, 0.0], [0.0, -0.5, 0.0], [0.0, 0.5, 0.0]], 'pixels': [[(108, 71), (119, 83), (119, 61)]], } - self.check_draw(draw, ref) - self.check(draw.indexOffset > 0) - self.check(draw.baseVertex < 0) - self.check(draw.vertexOffset == 0) + self.check_action(action, ref) + self.check(action.indexOffset > 0) + self.check(action.baseVertex < 0) + self.check(action.vertexOffset == 0) self.check(self.pipe.GetVBuffers()[0].byteOffset == 0) self.check(self.pipe.GetIBuffer().byteOffset == 0) - draw = draw.next + action = action.next - # first index and base vertex in the draw, and vertex binding offset + # first index and base vertex in the action, and vertex binding offset ref = { 'base': 3, 'pos': [[-0.5, 0.0, 0.0], [0.0, -0.5, 0.0], [0.0, 0.5, 0.0]], 'pixels': [[(156, 71), (167, 83), (167, 61)]], } - self.check_draw(draw, ref) - self.check(draw.indexOffset > 0) - self.check(draw.baseVertex < 0) - self.check(draw.vertexOffset == 0) + self.check_action(action, ref) + self.check(action.indexOffset > 0) + self.check(action.baseVertex < 0) + self.check(action.vertexOffset == 0) self.check(self.pipe.GetVBuffers()[0].byteOffset > 0) self.check(self.pipe.GetIBuffer().byteOffset == 0) - draw = draw.next + action = action.next - # first index and base vertex in the draw, and vertex & index binding offset + # first index and base vertex in the action, and vertex & index binding offset ref = { 'base': 4, 'pos': [[0.0, -0.5, 0.0], [0.5, 0.0, 0.0], [0.0, 0.5, 0.0]], 'pixels': [[(216, 82), (226, 71), (216, 61)]], } - self.check_draw(draw, ref) - self.check(draw.indexOffset > 0) - self.check(draw.baseVertex < 0) - self.check(draw.vertexOffset == 0) + self.check_action(action, ref) + self.check(action.indexOffset > 0) + self.check(action.baseVertex < 0) + self.check(action.vertexOffset == 0) self.check(self.pipe.GetVBuffers()[0].byteOffset > 0) # OpenGL doesn't support offset on index buffer bindings if self.props.pipelineType != rd.GraphicsAPI.OpenGL: self.check(self.pipe.GetIBuffer().byteOffset > 0) - draw = draw.next + action = action.next # Skip indexed strips for now ref = { @@ -313,8 +313,8 @@ class Draw_Zoo(rdtest.TestCase): 'pixels': [[(252, 67), (252, 71), (256, 67)]], } - self.check_draw(draw, ref) - draw = draw.next + self.check_action(action, ref) + action = action.next ref = { 'base': 30, @@ -331,8 +331,8 @@ class Draw_Zoo(rdtest.TestCase): 'pixels': [[(300, 67), (300, 71), (304, 67)]], } - self.check_draw(draw, ref) - draw = draw.next + self.check_action(action, ref) + action = action.next rdtest.log.end_section("indexed, non-instanced") @@ -348,12 +348,12 @@ class Draw_Zoo(rdtest.TestCase): ], } - self.check_draw(draw, ref) - self.check(draw.instanceOffset == 0) + self.check_action(action, ref) + self.check(action.instanceOffset == 0) self.check(self.pipe.GetVBuffers()[1].byteOffset == 0) - draw = draw.next + action = action.next - # instance offset in the draw + # instance offset in the action ref = { 'base': 0, 'pos': [[-0.5, -0.5, 0.0], [0.0, 0.5, 0.0], [0.5, -0.5, 0.0]], @@ -363,12 +363,12 @@ class Draw_Zoo(rdtest.TestCase): ], } - self.check_draw(draw, ref) - self.check(draw.instanceOffset > 0) + self.check_action(action, ref) + self.check(action.instanceOffset > 0) self.check(self.pipe.GetVBuffers()[1].byteOffset == 0) - draw = draw.next + action = action.next - # instance offset in the draw and offset on the instanced VB + # instance offset in the action and offset on the instanced VB ref = { 'base': 0, 'pos': [[-0.5, 0.0, 0.0], [0.0, -0.5, 0.0], [0.0, 0.5, 0.0]], @@ -378,10 +378,10 @@ class Draw_Zoo(rdtest.TestCase): ], } - self.check_draw(draw, ref) - self.check(draw.instanceOffset > 0) + self.check_action(action, ref) + self.check(action.instanceOffset > 0) self.check(self.pipe.GetVBuffers()[1].byteOffset > 0) - draw = draw.next + action = action.next rdtest.log.end_section("non-indexed, instanced") @@ -397,12 +397,12 @@ class Draw_Zoo(rdtest.TestCase): ], } - self.check_draw(draw, ref) - self.check(draw.instanceOffset == 0) + self.check_action(action, ref) + self.check(action.instanceOffset == 0) self.check(self.pipe.GetVBuffers()[1].byteOffset == 0) - draw = draw.next + action = action.next - # instance offset in the draw + # instance offset in the action ref = { 'base': 13, 'pos': [[-0.5, 0.0, 0.0], [0.0, -0.5, 0.0], [0.0, 0.5, 0.0]], @@ -412,12 +412,12 @@ class Draw_Zoo(rdtest.TestCase): ], } - self.check_draw(draw, ref) - self.check(draw.instanceOffset > 0) + self.check_action(action, ref) + self.check(action.instanceOffset > 0) self.check(self.pipe.GetVBuffers()[1].byteOffset == 0) - draw = draw.next + action = action.next - # instance offset in the draw and offset on the instanced VB + # instance offset in the action and offset on the instanced VB ref = { 'base': 23, 'pos': [[0.0, -0.5, 0.0], [0.5, 0.0, 0.0], [0.0, 0.5, 0.0]], @@ -427,9 +427,9 @@ class Draw_Zoo(rdtest.TestCase): ], } - self.check_draw(draw, ref) - self.check(draw.instanceOffset > 0) + self.check_action(action, ref) + self.check(action.instanceOffset > 0) self.check(self.pipe.GetVBuffers()[1].byteOffset > 0) - draw = draw.next + action = action.next rdtest.log.end_section("indexed, instanced") diff --git a/util/test/rdtest/shared/Mesh_Zoo.py b/util/test/rdtest/shared/Mesh_Zoo.py index b7f05b50e..485f11fa1 100644 --- a/util/test/rdtest/shared/Mesh_Zoo.py +++ b/util/test/rdtest/shared/Mesh_Zoo.py @@ -20,18 +20,18 @@ class Mesh_Zoo(): rdtest.png_save(rdtest.get_tmp_path('output.png'), self.rows, dim, False) - def find_draw(self, name): - draw = None + def find_action(self, name): + action = None - for d in self.controller.GetDrawcalls(): + for d in self.controller.GetRootActions(): if name in d.name: - draw = d + action = d break - if draw is None: - raise rdtest.TestFailureException("Couldn't find '{}' draw".format(name)) + if action is None: + raise rdtest.TestFailureException("Couldn't find '{}' action".format(name)) - return draw + return action # To avoid needing to do image comparisons, we instead do quad region probes to see which colours are present. That # way we can programmatically check that the wireframe we expect to be there, is there @@ -69,7 +69,7 @@ class Mesh_Zoo(): def check_capture(self, capture_filename: str, controller: rd.ReplayController): self.controller = controller - self.controller.SetFrameEvent(self.find_draw("Quad").next.eventId, False) + self.controller.SetFrameEvent(self.find_action("Quad").next.eventId, False) self.out: rd.ReplayOutput = self.controller.CreateOutput(rd.CreateHeadlessWindowingData(200, 200), rd.ReplayOutputType.Mesh) @@ -277,7 +277,7 @@ class Mesh_Zoo(): self.check_region((125, 85, 135, 85), lambda x: x != []) self.check_region((105, 110, 105, 120), lambda x: x != []) - # But now an extra previous draw + # But now an extra previous action self.check_region((30, 105, 40, 105), lambda x: x != []) self.check_region((50, 80, 50, 90), lambda x: x != []) self.check_region((45, 130, 55, 130), lambda x: x != []) @@ -348,7 +348,7 @@ class Mesh_Zoo(): rdtest.log.success("Both instance picking is as expected") - self.controller.SetFrameEvent(self.find_draw("Points").next.eventId, False) + self.controller.SetFrameEvent(self.find_action("Points").next.eventId, False) # Only one instance, just check we can see the points self.cfg.curInstance = 0 @@ -369,7 +369,7 @@ class Mesh_Zoo(): rdtest.log.success("Point picking is as expected") - self.controller.SetFrameEvent(self.find_draw("Stride 0").next.eventId, False) + self.controller.SetFrameEvent(self.find_action("Stride 0").next.eventId, False) self.cfg.position = self.controller.GetPostVSData(0, 0, self.cfg.type) self.cfg.position.nearPlane = 1.0 diff --git a/util/test/rdtest/shared/Overlay_Test.py b/util/test/rdtest/shared/Overlay_Test.py index 6d872f37a..7a64ca50b 100644 --- a/util/test/rdtest/shared/Overlay_Test.py +++ b/util/test/rdtest/shared/Overlay_Test.py @@ -17,9 +17,9 @@ class Overlay_Test(rdtest.TestCase): for is_msaa in [False, True]: if is_msaa: - test_marker: rd.DrawcallDescription = self.find_draw("MSAA Test") + test_marker: rd.ActionDescription = self.find_action("MSAA Test") else: - test_marker: rd.DrawcallDescription = self.find_draw("Normal Test") + test_marker: rd.ActionDescription = self.find_action("Normal Test") self.controller.SetFrameEvent(test_marker.next.eventId, True) @@ -69,7 +69,7 @@ class Overlay_Test(rdtest.TestCase): if overlay == rd.DebugOverlay.ClearBeforeDraw or overlay == rd.DebugOverlay.ClearBeforePass: continue - rdtest.log.print("Checking overlay {} in {} main draw".format("MSAA" if is_msaa else "normal", str(overlay))) + rdtest.log.print("Checking overlay {} in {} main action".format("MSAA" if is_msaa else "normal", str(overlay))) tex.overlay = overlay out.SetTextureDisplay(tex) @@ -251,10 +251,10 @@ class Overlay_Test(rdtest.TestCase): self.check_pixel_value(overlay_id, 40, 0, [1.0, 1.0, 1.0, 1.0], eps=eps) self.check_pixel_value(overlay_id, 60, 0, [0.0, 0.0, 0.0, 1.0], eps=eps) self.check_pixel_value(overlay_id, 60, 0, [0.0, 0.0, 0.0, 1.0], eps=eps) - elif overlay == rd.DebugOverlay.QuadOverdrawDraw: + elif overlay == rd.DebugOverlay.QuadOveractionDraw: # This would require extreme command buffer patching to de-MSAA the framebuffer and renderpass if api == rd.GraphicsAPI.Vulkan and is_msaa: - rdtest.log.print("Quad overdraw not currently supported on MSAA on Vulkan") + rdtest.log.print("Quad overaction not currently supported on MSAA on Vulkan") continue self.check_pixel_value(overlay_id, 150, 90, [1.0, 1.0, 1.0, 1.0], eps=eps) @@ -282,23 +282,23 @@ class Overlay_Test(rdtest.TestCase): self.check_pixel_value(overlay_id, 200, 65, [1.0, 1.0, 1.0, 1.0], eps=eps) self.check_pixel_value(overlay_id, 200, 79, [1.0, 1.0, 1.0, 1.0], eps=eps) self.check_pixel_value(overlay_id, 200, 93, [1.0, 1.0, 1.0, 1.0], eps=eps) - elif overlay == rd.DebugOverlay.QuadOverdrawPass: + elif overlay == rd.DebugOverlay.QuadOveractionPass: # This would require extreme command buffer patching to de-MSAA the framebuffer and renderpass if api == rd.GraphicsAPI.Vulkan and is_msaa: - rdtest.log.print("Quad overdraw not currently supported on MSAA on Vulkan") + rdtest.log.print("Quad overaction not currently supported on MSAA on Vulkan") continue self.check_pixel_value(overlay_id, 150, 90, [1.0, 1.0, 1.0, 1.0], eps=eps) # Do an extra tap here where we overlap with the extreme-background largest triangle, to show that - # overdraw + # overaction self.check_pixel_value(overlay_id, 150, 100, [2.0, 2.0, 2.0, 2.0], eps=eps) self.check_pixel_value(overlay_id, 150, 130, [1.0, 1.0, 1.0, 1.0], eps=eps) self.check_pixel_value(overlay_id, 150, 160, [1.0, 1.0, 1.0, 1.0], eps=eps) self.check_pixel_value(overlay_id, 150, 200, [2.0, 2.0, 2.0, 2.0], eps=eps) - # Two of these have overdraw from the pass due to the large background triangle + # Two of these have overaction from the pass due to the large background triangle self.check_pixel_value(overlay_id, 125, 60, [0.0, 0.0, 0.0, 0.0], eps=eps) self.check_pixel_value(overlay_id, 125, 250, [1.0, 1.0, 1.0, 1.0], eps=eps) self.check_pixel_value(overlay_id, 250, 60, [0.0, 0.0, 0.0, 0.0], eps=eps) @@ -388,7 +388,7 @@ class Overlay_Test(rdtest.TestCase): rdtest.log.success("All normal overlays are as expected") # Check the viewport overlay especially - view_marker: rd.DrawcallDescription = self.find_draw("Viewport Test") + view_marker: rd.ActionDescription = self.find_action("Viewport Test") self.controller.SetFrameEvent(view_marker.next.eventId, True) @@ -408,7 +408,7 @@ class Overlay_Test(rdtest.TestCase): if overlay == rd.DebugOverlay.ClearBeforeDraw or overlay == rd.DebugOverlay.ClearBeforePass: continue - rdtest.log.print("Checking overlay {} in viewport draw".format(str(overlay))) + rdtest.log.print("Checking overlay {} in viewport action".format(str(overlay))) tex.resourceId = col_tex tex.overlay = overlay @@ -427,7 +427,7 @@ class Overlay_Test(rdtest.TestCase): self.controller.SaveTexture(save_data, rdtest.get_tmp_path('overlay.png')) if overlay == rd.DebugOverlay.Drawcall: - # The drawcall overlay will show up outside the scissor region + # The action overlay will show up outside the scissor region self.check_pixel_value(overlay_id, 50, 85, [0.8, 0.1, 0.8, 1.0], eps=eps) self.check_pixel_value(overlay_id, 50, 50, [0.8, 0.1, 0.8, 1.0], eps=eps) self.check_pixel_value(overlay_id, 50, 10, [0.8, 0.1, 0.8, 1.0], eps=eps) @@ -479,10 +479,10 @@ class Overlay_Test(rdtest.TestCase): # Inside viewport and outside scissor self.check_pixel_value(overlay_id, 50, 80, [1.0 * 0.6 + 0.2 * 0.4, 0.2 * 0.4, 0.9 * 0.4, 1.0 * 0.6 + 0.4 * 0.4], eps=eps) - elif overlay == rd.DebugOverlay.QuadOverdrawDraw: + elif overlay == rd.DebugOverlay.QuadOveractionDraw: self.check_pixel_value(overlay_id, 50, 50, [1.0, 1.0, 1.0, 1.0], eps=eps) self.check_pixel_value(overlay_id, 50, 15, [0.0, 0.0, 0.0, 0.0], eps=eps) - elif overlay == rd.DebugOverlay.QuadOverdrawPass: + elif overlay == rd.DebugOverlay.QuadOveractionPass: self.check_pixel_value(overlay_id, 50, 50, [1.0, 1.0, 1.0, 1.0], eps=eps) self.check_pixel_value(overlay_id, 50, 15, [0.0, 0.0, 0.0, 0.0], eps=eps) @@ -506,7 +506,7 @@ class Overlay_Test(rdtest.TestCase): rdtest.log.success("Overlays are as expected around viewport/scissor behaviour") - test_marker: rd.DrawcallDescription = self.find_draw("Normal Test") + test_marker: rd.ActionDescription = self.find_action("Normal Test") # Now check clear-before-X by hand, for colour and for depth self.controller.SetFrameEvent(test_marker.next.eventId, True) @@ -569,7 +569,7 @@ class Overlay_Test(rdtest.TestCase): rdtest.log.success("Clear before pass colour and depth values as expected") - # Check clear before draw + # Check clear before action tex.resourceId = col_tex tex.overlay = rd.DebugOverlay.ClearBeforeDraw out.SetTextureDisplay(tex) @@ -604,13 +604,13 @@ class Overlay_Test(rdtest.TestCase): self.check_pixel_value(depth_tex, 250, 250, [1.0, 0.0/255.0, 0.0, 1.0], eps=eps) self.check_pixel_value(depth_tex, 50, 50, [1.0, 0.0/255.0, 0.0, 1.0], eps=eps) - rdtest.log.success("Clear before draw colour and depth values as expected") + rdtest.log.success("Clear before action colour and depth values as expected") - rdtest.log.success("All overlays as expected for main draw") + rdtest.log.success("All overlays as expected for main action") # Now test overlays on a render-to-slice/mip case for mip in [2, 3]: - sub_marker: rd.DrawcallDescription = self.find_draw("Subresources mip {}".format(mip)) + sub_marker: rd.ActionDescription = self.find_action("Subresources mip {}".format(mip)) self.controller.SetFrameEvent(sub_marker.next.eventId, True) @@ -705,7 +705,7 @@ class Overlay_Test(rdtest.TestCase): self.check_pixel_value(overlay_id, 0, 0, [1.0, 1.0, 1.0, 1.0], sub=sub) self.check_pixel_value(overlay_id, 20, 0, [0.0, 0.0, 0.0, 1.0], sub=sub) self.check_pixel_value(overlay_id, 40, 0, [1.0, 1.0, 1.0, 1.0], sub=sub) - elif overlay == rd.DebugOverlay.QuadOverdrawDraw or overlay == rd.DebugOverlay.QuadOverdrawPass: + elif overlay == rd.DebugOverlay.QuadOveractionDraw or overlay == rd.DebugOverlay.QuadOveractionPass: self.check_pixel_value(overlay_id, 50 >> shift, 36 >> shift, [1.0, 1.0, 1.0, 1.0], sub=sub) self.check_pixel_value(overlay_id, 30 >> shift, 36 >> shift, [0.0, 0.0, 0.0, 0.0], sub=sub) self.check_pixel_value(overlay_id, 70 >> shift, 20 >> shift, [0.0, 0.0, 0.0, 0.0], sub=sub) diff --git a/util/test/rdtest/shared/Texture_Zoo.py b/util/test/rdtest/shared/Texture_Zoo.py index 5af0cbae0..1822e4d79 100644 --- a/util/test/rdtest/shared/Texture_Zoo.py +++ b/util/test/rdtest/shared/Texture_Zoo.py @@ -492,7 +492,7 @@ class Texture_Zoo(): self.out: rd.ReplayOutput = self.controller.CreateOutput(rd.CreateHeadlessWindowingData(100, 100), rd.ReplayOutputType.Texture) - for d in self.controller.GetDrawcalls(): + for d in self.controller.GetRootActions(): if 'slice tests' in d.name: for sub in d.children: @@ -552,21 +552,21 @@ class Texture_Zoo(): continue # Check each region for the tests within - if d.flags & rd.DrawFlags.PushMarker: + if d.flags & rd.ActionFlags.PushMarker: name = '' tests_run = 0 failed = False - # Iterate over drawcalls in this region + # Iterate over actions in this region for sub in d.children: - sub: rd.DrawcallDescription + sub: rd.ActionDescription - if sub.flags & rd.DrawFlags.SetMarker: + if sub.flags & rd.ActionFlags.SetMarker: name = sub.name - # Check this draw - if sub.flags & rd.DrawFlags.Drawcall: + # Check this action + if sub.flags & rd.ActionFlags.Drawcall: tests_run = tests_run + 1 try: # Set this event as current @@ -690,7 +690,7 @@ class Texture_Zoo(): [a, b] = file.name.replace('.dds', ' (DDS)').replace('.png', ' (PNG)').split('@') - self.controller.SetFrameEvent(self.controller.GetDrawcalls()[0].eventId, True) + self.controller.SetFrameEvent(self.controller.GetRootActions()[0].eventId, True) try: self.opengl_mode = False diff --git a/util/test/rdtest/testcase.py b/util/test/rdtest/testcase.py index 25c5505c2..7af28834e 100644 --- a/util/test/rdtest/testcase.py +++ b/util/test/rdtest/testcase.py @@ -223,17 +223,17 @@ class TestCase: raise NotImplementedError("If run() is not implemented in a test, then" "get_capture() and check_capture() must be.") - def _find_draw(self, name: str, start_event: int, draw_list): - draw: rd.DrawcallDescription - for draw in draw_list: - # If this draw matches, return it - if draw.eventId >= start_event and (name == '' or name in draw.name): - return draw + def _find_action(self, name: str, start_event: int, action_list): + action: rd.ActionDescription + for action in action_list: + # If this action matches, return it + if action.eventId >= start_event and (name == '' or name in action.name): + return action # Recurse to children - depth-first search - ret: rd.DrawcallDescription = self._find_draw(name, start_event, draw.children) + ret: rd.ActionDescription = self._find_action(name, start_event, action.children) - # If we found our draw, return + # If we found our action, return if ret is not None: return ret @@ -242,63 +242,63 @@ class TestCase: # If we didn't find anything, return None return None - def find_draw(self, name: str, start_event: int = 0): + def find_action(self, name: str, start_event: int = 0): """ - Finds the first drawcall matching given criteria + Finds the first action matching given criteria - :param name: The name to search for within the drawcalls + :param name: The name to search for within the actions :param start_event: The first eventId to search from. :return: """ - return self._find_draw(name, start_event, self.controller.GetDrawcalls()) + return self._find_action(name, start_event, self.controller.GetRootActions()) - def get_draw(self, event: int = 0): + def get_action(self, event: int = 0): """ - Finds the drawcall for the given event + Finds the action for the given event :param event: The eventId to search for. :return: """ - return self._find_draw('', event, self.controller.GetDrawcalls()) + return self._find_action('', event, self.controller.GetRootActions()) - def get_vsin(self, draw: rd.DrawcallDescription, first_index: int=0, num_indices: int=0, instance: int=0, view: int=0): + def get_vsin(self, action: rd.ActionDescription, first_index: int=0, num_indices: int=0, instance: int=0, view: int=0): ib: rd.BoundVBuffer = self.controller.GetPipelineState().GetIBuffer() if num_indices == 0: - num_indices = draw.numIndices + num_indices = action.numIndices else: - num_indices = min(num_indices, draw.numIndices) + num_indices = min(num_indices, action.numIndices) - ioffs = draw.indexOffset * ib.byteStride + ioffs = action.indexOffset * ib.byteStride mesh = rd.MeshFormat() mesh.numIndices = num_indices mesh.indexByteOffset = ib.byteOffset + ioffs mesh.indexByteStride = ib.byteStride mesh.indexResourceId = ib.resourceId - mesh.baseVertex = draw.baseVertex + mesh.baseVertex = action.baseVertex if ib.byteSize > ioffs: mesh.indexByteSize = ib.byteSize - ioffs else: mesh.indexByteSize = 0 - if not (draw.flags & rd.DrawFlags.Indexed): + if not (action.flags & rd.ActionFlags.Indexed): mesh.indexByteOffset = 0 mesh.indexByteStride = 0 mesh.indexResourceId = rd.ResourceId.Null() - attrs = analyse.get_vsin_attrs(self.controller, draw.vertexOffset, mesh) + attrs = analyse.get_vsin_attrs(self.controller, action.vertexOffset, mesh) - first_index = min(first_index, draw.numIndices-1) + first_index = min(first_index, action.numIndices-1) - indices = analyse.fetch_indices(self.controller, draw, mesh, 0, first_index, num_indices) + indices = analyse.fetch_indices(self.controller, action, mesh, 0, first_index, num_indices) return analyse.decode_mesh_data(self.controller, indices, indices, attrs, 0, 0) - def get_postvs(self, draw: rd.DrawcallDescription, data_stage: rd.MeshDataStage, first_index: int = 0, + def get_postvs(self, action: rd.ActionDescription, data_stage: rd.MeshDataStage, first_index: int = 0, num_indices: int = 0, instance: int = 0, view: int = 0): mesh: rd.MeshFormat = self.controller.GetPostVSData(instance, view, data_stage) @@ -314,27 +314,27 @@ class TestCase: ib: rd.BoundVBuffer = self.controller.GetPipelineState().GetIBuffer() - ioffs = draw.indexOffset * ib.byteStride + ioffs = action.indexOffset * ib.byteStride in_mesh = rd.MeshFormat() in_mesh.numIndices = num_indices in_mesh.indexByteOffset = ib.byteOffset + ioffs in_mesh.indexByteStride = ib.byteStride in_mesh.indexResourceId = ib.resourceId - in_mesh.baseVertex = draw.baseVertex + in_mesh.baseVertex = action.baseVertex if ib.byteSize > ioffs: in_mesh.indexByteSize = ib.byteSize - ioffs else: in_mesh.indexByteSize = 0 - if not (draw.flags & rd.DrawFlags.Indexed): + if not (action.flags & rd.ActionFlags.Indexed): in_mesh.indexByteOffset = 0 in_mesh.indexByteStride = 0 in_mesh.indexResourceId = rd.ResourceId.Null() - indices = analyse.fetch_indices(self.controller, draw, mesh, 0, first_index, num_indices) - in_indices = analyse.fetch_indices(self.controller, draw, in_mesh, 0, first_index, num_indices) + indices = analyse.fetch_indices(self.controller, action, mesh, 0, first_index, num_indices) + in_indices = analyse.fetch_indices(self.controller, action, in_mesh, 0, first_index, num_indices) attrs = analyse.get_postvs_attrs(self.controller, mesh, data_stage) @@ -414,7 +414,7 @@ class TestCase: def check_triangle(self, out = None, back = None, fore = None, vp = None): pipe: rd.PipeState = self.controller.GetPipelineState() - # if no output is specified, check the current colour output at this draw + # if no output is specified, check the current colour output at this action if out is None: out = pipe.GetOutputTargets()[0].resourceId @@ -463,13 +463,13 @@ class TestCase: log.print("Test ran in {}".format(duration)) self.debugMode = debugMode - def get_first_draw(self): - first_draw: rd.DrawcallDescription = self.controller.GetDrawcalls()[0] + def get_first_action(self): + first_action: rd.ActionDescription = self.controller.GetRootActions()[0] - while len(first_draw.children) > 0: - first_draw = first_draw.children[0] + while len(first_action.children) > 0: + first_action = first_action.children[0] - return first_draw + return first_action def get_texture(self, id: rd.ResourceId): texs = self.controller.GetTextures() @@ -501,24 +501,24 @@ class TestCase: return None - def get_last_draw(self): - last_draw: rd.DrawcallDescription = self.controller.GetDrawcalls()[-1] + def get_last_action(self): + last_action: rd.ActionDescription = self.controller.GetRootActions()[-1] - while len(last_draw.children) > 0: - last_draw = last_draw.children[-1] + while len(last_action.children) > 0: + last_action = last_action.children[-1] - return last_draw + return last_action def check_final_backbuffer(self): img_path = util.get_tmp_path('backbuffer.png') ref_path = self.get_ref_path('backbuffer.png') - last_draw: rd.DrawcallDescription = self.get_last_draw() + last_action: rd.ActionDescription = self.get_last_action() - self.controller.SetFrameEvent(last_draw.eventId, True) + self.controller.SetFrameEvent(last_action.eventId, True) save_data = rd.TextureSave() - save_data.resourceId = last_draw.copyDestination + save_data.resourceId = last_action.copyDestination save_data.destType = rd.FileType.PNG self.controller.SaveTexture(save_data, img_path) diff --git a/util/test/tests/D3D11/D3D11_AMD_Shader_Extensions.py b/util/test/tests/D3D11/D3D11_AMD_Shader_Extensions.py index e7a3be17a..6a8d0282c 100644 --- a/util/test/tests/D3D11/D3D11_AMD_Shader_Extensions.py +++ b/util/test/tests/D3D11/D3D11_AMD_Shader_Extensions.py @@ -7,21 +7,21 @@ class D3D11_AMD_Shader_Extensions(rdtest.TestCase): demos_test_name = 'D3D11_AMD_Shader_Extensions' def check_capture(self): - draw = self.get_last_draw() + action = self.get_last_action() - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) # Should have barycentrics showing the closest vertex for each pixel in the triangle # Without relying on barycentric order, ensure that the three pixels are red, green, and blue pixels = [] - picked: rd.PixelValue = self.controller.PickPixel(draw.copyDestination, 125, 215, rd.Subresource(), + picked: rd.PixelValue = self.controller.PickPixel(action.copyDestination, 125, 215, rd.Subresource(), rd.CompType.UNorm) pixels.append(picked.floatValue[0:4]) - picked: rd.PixelValue = self.controller.PickPixel(draw.copyDestination, 200, 85, rd.Subresource(), + picked: rd.PixelValue = self.controller.PickPixel(action.copyDestination, 200, 85, rd.Subresource(), rd.CompType.UNorm) pixels.append(picked.floatValue[0:4]) - picked: rd.PixelValue = self.controller.PickPixel(draw.copyDestination, 285, 215, rd.Subresource(), + picked: rd.PixelValue = self.controller.PickPixel(action.copyDestination, 285, 215, rd.Subresource(), rd.CompType.UNorm) pixels.append(picked.floatValue[0:4]) @@ -31,9 +31,9 @@ class D3D11_AMD_Shader_Extensions(rdtest.TestCase): rdtest.log.success("Picked barycentric values are as expected") - # find the cpuMax and gpuMax draws - cpuMax = self.find_draw("cpuMax") - gpuMax = self.find_draw("gpuMax") + # find the cpuMax and gpuMax actions + cpuMax = self.find_action("cpuMax") + gpuMax = self.find_action("gpuMax") # The values should be identical cpuMax = int(cpuMax.name[8:]) @@ -75,7 +75,7 @@ class D3D11_AMD_Shader_Extensions(rdtest.TestCase): rdtest.log.success("compute shader disassembly is as expected") if refl.debugInfo.debuggable: - self.controller.SetFrameEvent(self.find_draw("Dispatch").eventId, False) + self.controller.SetFrameEvent(self.find_action("Dispatch").eventId, False) trace: rd.ShaderDebugTrace = self.controller.DebugThread((0, 0, 0), (0, 0, 0)) diff --git a/util/test/tests/D3D11/D3D11_CBuffer_Zoo.py b/util/test/tests/D3D11/D3D11_CBuffer_Zoo.py index 92932cc39..6adaf69c4 100644 --- a/util/test/tests/D3D11/D3D11_CBuffer_Zoo.py +++ b/util/test/tests/D3D11/D3D11_CBuffer_Zoo.py @@ -6,11 +6,11 @@ class D3D11_CBuffer_Zoo(rdtest.TestCase): demos_test_name = 'D3D11_CBuffer_Zoo' def check_capture(self): - draw = self.find_draw("Draw") + action = self.find_action("Draw") - self.check(draw is not None) + self.check(action is not None) - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() diff --git a/util/test/tests/D3D11/D3D11_Deferred_Map.py b/util/test/tests/D3D11/D3D11_Deferred_Map.py index 80c405fd7..586e60c14 100644 --- a/util/test/tests/D3D11/D3D11_Deferred_Map.py +++ b/util/test/tests/D3D11/D3D11_Deferred_Map.py @@ -6,10 +6,10 @@ class D3D11_Deferred_Map(rdtest.TestCase): demos_test_name = 'D3D11_Deferred_Map' def check_capture(self): - # Check at the last draw - draw = self.get_last_draw() + # Check at the last action + action = self.get_last_action() - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() diff --git a/util/test/tests/D3D11/D3D11_Discard_Zoo.py b/util/test/tests/D3D11/D3D11_Discard_Zoo.py index d73794461..7ae2909aa 100644 --- a/util/test/tests/D3D11/D3D11_Discard_Zoo.py +++ b/util/test/tests/D3D11/D3D11_Discard_Zoo.py @@ -13,11 +13,11 @@ class D3D11_Discard_Zoo(rdtest.Discard_Zoo): def check_capture(self): self.check_textures() - draw = self.find_draw("TestStart") + action = self.find_action("TestStart") - self.check(draw is not None) + self.check(action is not None) - self.controller.SetFrameEvent(draw.eventId, True) + self.controller.SetFrameEvent(action.eventId, True) # Check the buffer for res in self.controller.GetResources(): @@ -26,11 +26,11 @@ class D3D11_Discard_Zoo(rdtest.Discard_Zoo): self.check(all([b == 0x88 for b in data])) - draw = self.find_draw("TestEnd") + action = self.find_action("TestEnd") - self.check(draw is not None) + self.check(action is not None) - self.controller.SetFrameEvent(draw.eventId, True) + self.controller.SetFrameEvent(action.eventId, True) # Check the buffers for res in self.controller.GetResources(): diff --git a/util/test/tests/D3D11/D3D11_Empty_Capture.py b/util/test/tests/D3D11/D3D11_Empty_Capture.py index 113408173..11ed9524c 100644 --- a/util/test/tests/D3D11/D3D11_Empty_Capture.py +++ b/util/test/tests/D3D11/D3D11_Empty_Capture.py @@ -7,8 +7,8 @@ class D3D11_Empty_Capture(rdtest.TestCase): demos_frame_cap = 100 def check_capture(self): - draws = self.controller.GetDrawcalls() + actions = self.controller.GetRootActions() - self.check(len(draws) == 1) - self.check('End' in draws[0].name) - self.check(draws[0].eventId == 1) \ No newline at end of file + self.check(len(actions) == 1) + self.check('End' in actions[0].name) + self.check(actions[0].eventId == 1) \ No newline at end of file diff --git a/util/test/tests/D3D11/D3D11_Feature_Level_9.py b/util/test/tests/D3D11/D3D11_Feature_Level_9.py index 5e83e3835..ed46fb350 100644 --- a/util/test/tests/D3D11/D3D11_Feature_Level_9.py +++ b/util/test/tests/D3D11/D3D11_Feature_Level_9.py @@ -6,17 +6,17 @@ class D3D11_Feature_Level_9(rdtest.TestCase): demos_test_name = 'D3D11_Feature_Level_9' def check_capture(self): - last_draw: rd.DrawcallDescription = self.get_last_draw() + last_action: rd.ActionDescription = self.get_last_action() - self.controller.SetFrameEvent(last_draw.eventId, True) + self.controller.SetFrameEvent(last_action.eventId, True) - self.check_triangle(out=last_draw.copyDestination) + self.check_triangle(out=last_action.copyDestination) - draw = self.find_draw("Draw") + action = self.find_action("Draw") - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) - postvs_data = self.get_postvs(draw, rd.MeshDataStage.VSOut, 0, draw.numIndices) + postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, action.numIndices) postvs_ref = { 0: { diff --git a/util/test/tests/D3D11/D3D11_Large_Buffer.py b/util/test/tests/D3D11/D3D11_Large_Buffer.py index 2422a493f..d52d66cee 100644 --- a/util/test/tests/D3D11/D3D11_Large_Buffer.py +++ b/util/test/tests/D3D11/D3D11_Large_Buffer.py @@ -6,9 +6,9 @@ class D3D11_Large_Buffer(rdtest.TestCase): demos_test_name = 'D3D11_Large_Buffer' def check_capture(self): - draw = self.find_draw("Draw") + action = self.find_action("Draw") - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) vsin_ref = { 0: { @@ -34,9 +34,9 @@ class D3D11_Large_Buffer(rdtest.TestCase): }, } - self.check_mesh_data(vsin_ref, self.get_vsin(draw)) + self.check_mesh_data(vsin_ref, self.get_vsin(action)) - postvs_data = self.get_postvs(draw, rd.MeshDataStage.VSOut, 0, draw.numIndices) + postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, action.numIndices) postvs_ref = { 0: { diff --git a/util/test/tests/D3D11/D3D11_Parameter_Zoo.py b/util/test/tests/D3D11/D3D11_Parameter_Zoo.py index a83141c88..71fd7e70e 100644 --- a/util/test/tests/D3D11/D3D11_Parameter_Zoo.py +++ b/util/test/tests/D3D11/D3D11_Parameter_Zoo.py @@ -10,9 +10,9 @@ class D3D11_Parameter_Zoo(rdtest.TestCase): def check_capture(self): rdtest.log.success("Got {} captures as expected".format(self.demos_frame_count)) - draw = self.find_draw("Draw") - self.check(draw is not None) - self.controller.SetFrameEvent(draw.eventId, False) + action = self.find_action("Draw") + self.check(action is not None) + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() diff --git a/util/test/tests/D3D11/D3D11_Pixel_History_Zoo.py b/util/test/tests/D3D11/D3D11_Pixel_History_Zoo.py index 268a5789d..86da1430a 100644 --- a/util/test/tests/D3D11/D3D11_Pixel_History_Zoo.py +++ b/util/test/tests/D3D11/D3D11_Pixel_History_Zoo.py @@ -8,14 +8,14 @@ class D3D11_Pixel_History_Zoo(rdtest.TestCase): demos_test_name = 'D3D11_Pixel_History_Zoo' def check_capture(self): - draws = self.controller.GetDrawcalls() + actions = self.controller.GetRootActions() - for d in self.controller.GetDrawcalls(): - # Only process test draws + for d in self.controller.GetRootActions(): + # Only process test actions if not d.name.startswith('Test'): continue - # Go to the last child draw + # Go to the last child action self.controller.SetFrameEvent(d.children[-1].eventId, True) if any(['UInt tex' in d.name for d in d.children]): @@ -47,7 +47,7 @@ class D3D11_Pixel_History_Zoo(rdtest.TestCase): modifs: List[rd.PixelModification] = self.controller.PixelHistory(tex, x, y, sub, rt.typeCast) - # Should be at least two modifications in every test - clear and draw + # Should be at least two modifications in every test - clear and action self.check(len(modifs) >= 2) # Check that the modifications are self consistent - postmod of each should match premod of the next @@ -59,7 +59,7 @@ class D3D11_Pixel_History_Zoo(rdtest.TestCase): modifs[i + 1].eventId, value_selector(modifs[i].preMod.col))) - if self.get_draw(modifs[i].eventId).flags & rd.DrawFlags.Drawcall: + if self.get_action(modifs[i].eventId).flags & rd.ActionFlags.Drawcall: if not rdtest.value_compare(value_selector(modifs[i].shaderOut.col), shader_out): raise rdtest.TestFailureException( "Shader output {} isn't as expected {}".format(value_selector(modifs[i].shaderOut.col), diff --git a/util/test/tests/D3D11/D3D11_PrimitiveID.py b/util/test/tests/D3D11/D3D11_PrimitiveID.py index 457251779..039612b55 100644 --- a/util/test/tests/D3D11/D3D11_PrimitiveID.py +++ b/util/test/tests/D3D11/D3D11_PrimitiveID.py @@ -6,8 +6,8 @@ import rdtest class D3D11_PrimitiveID(rdtest.TestCase): demos_test_name = 'D3D11_PrimitiveID' - def test_draw(self, draw: rd.DrawcallDescription, x, y, prim, expected_prim, expected_output): - self.controller.SetFrameEvent(draw.eventId, True) + def test_action(self, action: rd.ActionDescription, x, y, prim, expected_prim, expected_output): + self.controller.SetFrameEvent(action.eventId, True) pipe: rd.PipeState = self.controller.GetPipelineState() trace: rd.ShaderDebugTrace = self.controller.DebugPixel(x, y, rd.ReplayController.NoPreference, prim) @@ -33,7 +33,7 @@ class D3D11_PrimitiveID(rdtest.TestCase): return False # Compare shader debug output against an expected value instead of the RT's output, - # since we're testing overlapping primitives in a single draw + # since we're testing overlapping primitives in a single action if expected_output is not None: output = self.find_output_source_var(trace, rd.ShaderBuiltin.ColorOutput, 0) debugged = self.evaluate_source_var(output, variables) @@ -50,27 +50,27 @@ class D3D11_PrimitiveID(rdtest.TestCase): def check_capture(self): success = True - # Jump to the draw - test_marker: rd.DrawcallDescription = self.find_draw("Test") + # Jump to the action + test_marker: rd.ActionDescription = self.find_action("Test") # Draw 1: No GS, PS without prim - draw = test_marker.next - success &= self.test_draw(draw, 100, 80, rd.ReplayController.NoPreference, [0], [0, 1, 0, 1]) + action = test_marker.next + success &= self.test_action(action, 100, 80, rd.ReplayController.NoPreference, [0], [0, 1, 0, 1]) # Draw 2: No GS, PS with prim - draw = draw.next - success &= self.test_draw(draw, 300, 80, rd.ReplayController.NoPreference, [0], [0, 1, 0, 1]) + action = action.next + success &= self.test_action(action, 300, 80, rd.ReplayController.NoPreference, [0], [0, 1, 0, 1]) # Draw 3: GS, PS without prim - draw = draw.next - success &= self.test_draw(draw, 125, 250, rd.ReplayController.NoPreference, [0], [0, 1, 0, 1]) + action = action.next + success &= self.test_action(action, 125, 250, rd.ReplayController.NoPreference, [0], [0, 1, 0, 1]) # Draw 4: GS, PS with prim - draw = draw.next - success &= self.test_draw(draw, 325, 250, 2, [2], [0.5, 1, 0, 1]) - success &= self.test_draw(draw, 325, 250, 3, [3], [0.75, 1, 0, 1]) + action = action.next + success &= self.test_action(action, 325, 250, 2, [2], [0.5, 1, 0, 1]) + success &= self.test_action(action, 325, 250, 3, [3], [0.75, 1, 0, 1]) # No expected output here, since it's nondeterministic which primitive gets selected - success &= self.test_draw(draw, 325, 250, rd.ReplayController.NoPreference, [2, 3], None) + success &= self.test_action(action, 325, 250, rd.ReplayController.NoPreference, [2, 3], None) if not success: raise rdtest.TestFailureException("Some tests were not as expected") diff --git a/util/test/tests/D3D11/D3D11_Primitive_Restart.py b/util/test/tests/D3D11/D3D11_Primitive_Restart.py index 73cfc1952..17f413456 100644 --- a/util/test/tests/D3D11/D3D11_Primitive_Restart.py +++ b/util/test/tests/D3D11/D3D11_Primitive_Restart.py @@ -6,15 +6,15 @@ class D3D11_Primitive_Restart(rdtest.TestCase): demos_test_name = 'D3D11_Primitive_Restart' def check_capture(self): - draw = self.find_draw("Draw") + action = self.find_action("Draw") - self.check(draw is not None) + self.check(action is not None) - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() - postvs_data = self.get_postvs(draw, rd.MeshDataStage.VSOut, 0, draw.numIndices) + postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, action.numIndices) ib = pipe.GetIBuffer() @@ -51,14 +51,14 @@ class D3D11_Primitive_Restart(rdtest.TestCase): self.check_mesh_data(postvs_ref, postvs_data) - # Now check the draw with a vertex offset - draw = self.find_draw("Draw", draw.eventId+1) + # Now check the action with a vertex offset + action = self.find_action("Draw", action.eventId+1) - self.check(draw is not None) + self.check(action is not None) - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) - postvs_data = self.get_postvs(draw, rd.MeshDataStage.VSOut, 0, draw.numIndices) + postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, action.numIndices) # Data should be identical diff --git a/util/test/tests/D3D11/D3D11_Refcount_Check.py b/util/test/tests/D3D11/D3D11_Refcount_Check.py index 381057b0f..2eb0ac87d 100644 --- a/util/test/tests/D3D11/D3D11_Refcount_Check.py +++ b/util/test/tests/D3D11/D3D11_Refcount_Check.py @@ -18,13 +18,13 @@ class D3D11_Refcount_Check(rdtest.TestCase): def check_capture(self): - draw = self.find_draw("Color Draw") + action = self.find_action("Color Draw") - self.check(draw is not None) + self.check(action is not None) - draw = draw.next + action = action.next - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() diff --git a/util/test/tests/D3D11/D3D11_Resource_Lifetimes.py b/util/test/tests/D3D11/D3D11_Resource_Lifetimes.py index 99e315223..d78b14290 100644 --- a/util/test/tests/D3D11/D3D11_Resource_Lifetimes.py +++ b/util/test/tests/D3D11/D3D11_Resource_Lifetimes.py @@ -7,11 +7,11 @@ class D3D11_Resource_Lifetimes(rdtest.TestCase): demos_frame_cap = 200 def check_capture(self): - last_draw: rd.DrawcallDescription = self.get_last_draw() + last_action: rd.ActionDescription = self.get_last_action() - self.controller.SetFrameEvent(last_draw.eventId, True) + self.controller.SetFrameEvent(last_action.eventId, True) - tex = last_draw.copyDestination + tex = last_action.copyDestination # green background around first triangle, blue around second self.check_pixel_value(tex, 10, 10, [0.0, 1.0, 0.0, 1.0]) diff --git a/util/test/tests/D3D11/D3D11_Shader_Debug_Zoo.py b/util/test/tests/D3D11/D3D11_Shader_Debug_Zoo.py index 4221ee58e..75707f1a0 100644 --- a/util/test/tests/D3D11/D3D11_Shader_Debug_Zoo.py +++ b/util/test/tests/D3D11/D3D11_Shader_Debug_Zoo.py @@ -7,10 +7,10 @@ class D3D11_Shader_Debug_Zoo(rdtest.TestCase): demos_test_name = 'D3D11_Shader_Debug_Zoo' def check_capture(self): - # Jump to the draw - draw = self.find_draw("Draw") + # Jump to the action + action = self.find_action("Draw") - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() @@ -18,7 +18,7 @@ class D3D11_Shader_Debug_Zoo(rdtest.TestCase): # Loop over every test rdtest.log.begin_section("General tests") - for test in range(draw.numInstances): + for test in range(action.numInstances): # Debug the shader trace: rd.ShaderDebugTrace = self.controller.DebugPixel(4 * test, 0, rd.ReplayController.NoPreference, rd.ReplayController.NoPreference) @@ -42,8 +42,8 @@ class D3D11_Shader_Debug_Zoo(rdtest.TestCase): rdtest.log.end_section("General tests") rdtest.log.begin_section("MSAA tests") - draw = draw.next - self.controller.SetFrameEvent(draw.eventId, False) + action = action.next + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() for test in range(4): # Debug the shader diff --git a/util/test/tests/D3D11/D3D11_Shader_Editing.py b/util/test/tests/D3D11/D3D11_Shader_Editing.py index 5b1f0e948..c63980360 100644 --- a/util/test/tests/D3D11/D3D11_Shader_Editing.py +++ b/util/test/tests/D3D11/D3D11_Shader_Editing.py @@ -8,14 +8,14 @@ class D3D11_Shader_Editing(rdtest.TestCase): demos_test_name = 'D3D11_Shader_Editing' def check_capture(self): - eid = self.find_draw("Draw 1").next.eventId + eid = self.find_action("Draw 1").next.eventId self.controller.SetFrameEvent(eid, False) pipe: rd.PipeState = self.controller.GetPipelineState() psrefl1: rd.ShaderReflection = pipe.GetShaderReflection(rd.ShaderStage.Pixel) - eid = self.find_draw("Draw 2").next.eventId + eid = self.find_action("Draw 2").next.eventId self.controller.SetFrameEvent(eid, False) pipe: rd.PipeState = self.controller.GetPipelineState() diff --git a/util/test/tests/D3D11/D3D11_Shader_ISA.py b/util/test/tests/D3D11/D3D11_Shader_ISA.py index 14208056c..bb888bc0d 100644 --- a/util/test/tests/D3D11/D3D11_Shader_ISA.py +++ b/util/test/tests/D3D11/D3D11_Shader_ISA.py @@ -7,13 +7,13 @@ class D3D11_Shader_ISA(rdtest.TestCase): demos_test_name = 'D3D11_Shader_ISA' def check_capture(self): - draw = self.find_draw("GPU=") + action = self.find_action("GPU=") - self.check(draw is not None) + self.check(action is not None) - is_amd = 'AMD' in draw.name + is_amd = 'AMD' in action.name - self.controller.SetFrameEvent(draw.next.eventId, False) + self.controller.SetFrameEvent(action.next.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() diff --git a/util/test/tests/D3D11/D3D11_Shader_Linkage_Zoo.py b/util/test/tests/D3D11/D3D11_Shader_Linkage_Zoo.py index 1058044e7..0fd1b3753 100644 --- a/util/test/tests/D3D11/D3D11_Shader_Linkage_Zoo.py +++ b/util/test/tests/D3D11/D3D11_Shader_Linkage_Zoo.py @@ -9,13 +9,13 @@ class D3D11_Shader_Linkage_Zoo(rdtest.TestCase): def check_capture(self): failed = False - test_marker: rd.DrawcallDescription = self.find_draw("draw") + test_marker: rd.ActionDescription = self.find_action("action") while test_marker is not None: - drawcall = test_marker.next + action = test_marker.next event_name = test_marker.name - test_marker: rd.DrawcallDescription = self.find_draw("draw", drawcall.eventId) + test_marker: rd.ActionDescription = self.find_action("action", action.eventId) - self.controller.SetFrameEvent(drawcall.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() # Debug the shader diff --git a/util/test/tests/D3D11/D3D11_Simple_Triangle.py b/util/test/tests/D3D11/D3D11_Simple_Triangle.py index d5f8e8d5c..cab3fa061 100644 --- a/util/test/tests/D3D11/D3D11_Simple_Triangle.py +++ b/util/test/tests/D3D11/D3D11_Simple_Triangle.py @@ -6,19 +6,19 @@ class D3D11_Simple_Triangle(rdtest.TestCase): demos_test_name = 'D3D11_Simple_Triangle' def check_capture(self): - last_draw: rd.DrawcallDescription = self.get_last_draw() + last_action: rd.ActionDescription = self.get_last_action() - self.controller.SetFrameEvent(last_draw.eventId, True) + self.controller.SetFrameEvent(last_action.eventId, True) - self.check_triangle(out=last_draw.copyDestination) + self.check_triangle(out=last_action.copyDestination) self.check_export(self.capture_filename) - draw = self.find_draw("Draw") + action = self.find_action("Draw") - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) - postvs_data = self.get_postvs(draw, rd.MeshDataStage.VSOut, 0, draw.numIndices) + postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, action.numIndices) postvs_ref = { 0: { diff --git a/util/test/tests/D3D11/D3D11_Stream_Out.py b/util/test/tests/D3D11/D3D11_Stream_Out.py index f67c60f9c..b00c1e437 100644 --- a/util/test/tests/D3D11/D3D11_Stream_Out.py +++ b/util/test/tests/D3D11/D3D11_Stream_Out.py @@ -7,19 +7,19 @@ class D3D11_Stream_Out(rdtest.TestCase): demos_test_name = 'D3D11_Stream_Out' def check_capture(self): - draw = self.find_draw("Draw") + action = self.find_action("Draw") - self.check(draw is not None) + self.check(action is not None) - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() # Get the input data as our reference - # First draw should have data at offset 0. First buffer has positions, second has colors (with doubled stride) + # First action should have data at offset 0. First buffer has positions, second has colors (with doubled stride) - vsin = self.get_vsin(draw) + vsin = self.get_vsin(action) pos = [(*v['POSITION'], 1.0) for v in vsin] col = [v['COLOR'] for v in vsin] @@ -41,18 +41,18 @@ class D3D11_Stream_Out(rdtest.TestCase): if not rdtest.value_compare(c, so_c): raise rdtest.TestFailureException("Streamed-out color {} doesn't match expected {}".format(so_c, c)) - draw_auto = self.find_draw("DrawAuto", draw.eventId) + action_auto = self.find_action("DrawAuto", action.eventId) - # First draw should be 3 vertices - if not rdtest.value_compare(draw_auto.numIndices, 3): - raise rdtest.TestFailureException("First DrawAuto() draws {} vertices".format(draw_auto.numIndices)) + # First action should be 3 vertices + if not rdtest.value_compare(action_auto.numIndices, 3): + raise rdtest.TestFailureException("First DrawAuto() actions {} vertices".format(action_auto.numIndices)) - draw_auto = self.find_draw("DrawAuto", draw_auto.eventId+1) + action_auto = self.find_action("DrawAuto", action_auto.eventId+1) - # Second draw should be 6 vertices (3 vertices, instanced twice - if not rdtest.value_compare(draw_auto.numIndices, 6): - raise rdtest.TestFailureException("Second DrawAuto() draws {} vertices".format(draw_auto.numIndices)) - if not rdtest.value_compare(draw_auto.numInstances, 1): - raise rdtest.TestFailureException("Second DrawAuto() draws {} instances".format(draw_auto.numInstances)) + # Second action should be 6 vertices (3 vertices, instanced twice + if not rdtest.value_compare(action_auto.numIndices, 6): + raise rdtest.TestFailureException("Second DrawAuto() actions {} vertices".format(action_auto.numIndices)) + if not rdtest.value_compare(action_auto.numInstances, 1): + raise rdtest.TestFailureException("Second DrawAuto() actions {} instances".format(action_auto.numInstances)) - rdtest.log.success("First draw stream-out data is correct") + rdtest.log.success("First action stream-out data is correct") diff --git a/util/test/tests/D3D11/D3D11_Swapchain_Zoo.py b/util/test/tests/D3D11/D3D11_Swapchain_Zoo.py index 3b15ada1f..d5c6fa553 100644 --- a/util/test/tests/D3D11/D3D11_Swapchain_Zoo.py +++ b/util/test/tests/D3D11/D3D11_Swapchain_Zoo.py @@ -10,13 +10,13 @@ class D3D11_Swapchain_Zoo(rdtest.TestCase): demos_captures_expected = 1 def check_capture(self): - draw = self.find_draw("DrawIndexed") + action = self.find_action("DrawIndexed") - while draw is not None: - self.controller.SetFrameEvent(draw.eventId, False) + while action is not None: + self.controller.SetFrameEvent(action.eventId, False) self.check_triangle(back=[0.0, 0.0, 0.0, 1.0]) - rdtest.log.success("OK at {}".format(draw.previous.name)) + rdtest.log.success("OK at {}".format(action.previous.name)) - draw = self.find_draw("DrawIndexed", draw.eventId+1) \ No newline at end of file + action = self.find_action("DrawIndexed", action.eventId+1) \ No newline at end of file diff --git a/util/test/tests/D3D11/D3D11_Untyped_Backbuffer_Descriptor.py b/util/test/tests/D3D11/D3D11_Untyped_Backbuffer_Descriptor.py index 1ed7a4477..3aaf061a0 100644 --- a/util/test/tests/D3D11/D3D11_Untyped_Backbuffer_Descriptor.py +++ b/util/test/tests/D3D11/D3D11_Untyped_Backbuffer_Descriptor.py @@ -6,24 +6,24 @@ class D3D11_Untyped_Backbuffer_Descriptor(rdtest.TestCase): demos_test_name = 'D3D11_Untyped_Backbuffer_Descriptor' def check_capture(self): - # find the first draw - draw = self.find_draw("Draw") + # find the first action + action = self.find_action("Draw") - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() self.check_pixel_value(pipe.GetOutputTargets()[0].resourceId, 0.25, 0.5, [1.0, 1.0, 1.0, 1.0]) - rdtest.log.success("Picked value for first draw is as expected") + rdtest.log.success("Picked value for first action is as expected") - # find the second draw - draw = self.find_draw("Draw", draw.eventId+1) + # find the second action + action = self.find_action("Draw", action.eventId+1) - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() self.check_pixel_value(pipe.GetOutputTargets()[0].resourceId, 0.75, 0.5, [1.0, 1.0, 1.0, 1.0]) - rdtest.log.success("Picked value for second draw is as expected") + rdtest.log.success("Picked value for second action is as expected") diff --git a/util/test/tests/D3D11/D3D11_Vertex_Attr_Zoo.py b/util/test/tests/D3D11/D3D11_Vertex_Attr_Zoo.py index 55241f6b7..e7758cf46 100644 --- a/util/test/tests/D3D11/D3D11_Vertex_Attr_Zoo.py +++ b/util/test/tests/D3D11/D3D11_Vertex_Attr_Zoo.py @@ -7,11 +7,11 @@ class D3D11_Vertex_Attr_Zoo(rdtest.TestCase): demos_test_name = 'D3D11_Vertex_Attr_Zoo' def check_capture(self): - draw = self.find_draw("Draw") + action = self.find_action("Draw") - self.check(draw is not None) + self.check(action is not None) - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) ref = { 0: { @@ -59,14 +59,14 @@ class D3D11_Vertex_Attr_Zoo(rdtest.TestCase): vsout_ref[2]['SV_Position'] = [0.5, 0.5, 0.0, 1.0] gsout_ref[2]['SV_Position'] = [0.5, 0.5, 0.4, 1.2] - self.check_mesh_data(in_ref, self.get_vsin(draw)) + self.check_mesh_data(in_ref, self.get_vsin(action)) rdtest.log.success("Vertex input data is as expected") - self.check_mesh_data(vsout_ref, self.get_postvs(draw, rd.MeshDataStage.VSOut)) + self.check_mesh_data(vsout_ref, self.get_postvs(action, rd.MeshDataStage.VSOut)) rdtest.log.success("Vertex output data is as expected") - self.check_mesh_data(gsout_ref, self.get_postvs(draw, rd.MeshDataStage.GSOut)) + self.check_mesh_data(gsout_ref, self.get_postvs(action, rd.MeshDataStage.GSOut)) rdtest.log.success("Geometry output data is as expected") diff --git a/util/test/tests/D3D12/D3D12_AMD_Shader_Extensions.py b/util/test/tests/D3D12/D3D12_AMD_Shader_Extensions.py index 04e6b6504..473e50712 100644 --- a/util/test/tests/D3D12/D3D12_AMD_Shader_Extensions.py +++ b/util/test/tests/D3D12/D3D12_AMD_Shader_Extensions.py @@ -8,10 +8,10 @@ class D3D12_AMD_Shader_Extensions(rdtest.TestCase): def check_capture(self): for pass_type in ["SM50", "SM51", "SM60"]: - draw = self.find_draw(pass_type + " Draw") + action = self.find_action(pass_type + " Draw") - if draw is not None: - self.controller.SetFrameEvent(draw.next.eventId, False) + if action is not None: + self.controller.SetFrameEvent(action.next.eventId, False) pipe = self.controller.GetPipelineState() tex = pipe.GetOutputTargets()[0].resourceId @@ -37,13 +37,13 @@ class D3D12_AMD_Shader_Extensions(rdtest.TestCase): rdtest.log.success("Picked barycentric values are as expected") - draw = self.find_draw(pass_type + " Dispatch") + action = self.find_action(pass_type + " Dispatch") - self.controller.SetFrameEvent(draw.next.eventId, False) + self.controller.SetFrameEvent(action.next.eventId, False) - # find the cpuMax and gpuMax draws - cpuMax = self.find_draw(pass_type + " cpuMax") - gpuMax = self.find_draw(pass_type + " gpuMax") + # find the cpuMax and gpuMax actions + cpuMax = self.find_action(pass_type + " cpuMax") + gpuMax = self.find_action(pass_type + " gpuMax") # The values should be identical cpuMax = int(cpuMax.name.split(': ')[1]) @@ -68,7 +68,7 @@ class D3D12_AMD_Shader_Extensions(rdtest.TestCase): rdtest.log.success("replayed gpuMax is as expected") # We should get everything except maybe DXIL elif pass_type != "SM60": - raise rdtest.TestFailureException("Didn't find test draw for {}".format(pass_type)) + raise rdtest.TestFailureException("Didn't find test action for {}".format(pass_type)) # We always check the CS pipe to ensure the reflection is OK cs_pipe = self.get_resource_by_name("cspipe" + pass_type) @@ -107,7 +107,7 @@ class D3D12_AMD_Shader_Extensions(rdtest.TestCase): rdtest.log.success("compute shader disassembly is as expected") if refl.debugInfo.debuggable: - self.controller.SetFrameEvent(self.find_draw("Dispatch").eventId, False) + self.controller.SetFrameEvent(self.find_action("Dispatch").eventId, False) trace: rd.ShaderDebugTrace = self.controller.DebugThread((0, 0, 0), (0, 0, 0)) diff --git a/util/test/tests/D3D12/D3D12_CBuffer_Zoo.py b/util/test/tests/D3D12/D3D12_CBuffer_Zoo.py index 13286e089..033c7ab90 100644 --- a/util/test/tests/D3D12/D3D12_CBuffer_Zoo.py +++ b/util/test/tests/D3D12/D3D12_CBuffer_Zoo.py @@ -5,17 +5,17 @@ class D3D12_CBuffer_Zoo(rdtest.TestCase): demos_test_name = 'D3D12_CBuffer_Zoo' def check_capture(self): - draw = self.find_draw("DXBC Draw") + action = self.find_action("DXBC Draw") - self.check(draw is not None) + self.check(action is not None) - self.controller.SetFrameEvent(draw.next.eventId, False) + self.controller.SetFrameEvent(action.next.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() stage = rd.ShaderStage.Pixel - # Verify that the DXBC draw is first + # Verify that the DXBC action is first disasm = self.controller.DisassembleShader(pipe.GetGraphicsPipelineObject(), pipe.GetShaderReflection(stage), '') @@ -23,16 +23,16 @@ class D3D12_CBuffer_Zoo(rdtest.TestCase): self.check_event() - rdtest.log.success("DXBC draw is as expected") + rdtest.log.success("DXBC action is as expected") - # Move to the DXIL draw - draw = self.find_draw("DXIL Draw") + # Move to the DXIL action + action = self.find_action("DXIL Draw") - if draw is None: - rdtest.log.print("No DXIL draw to test") + if action is None: + rdtest.log.print("No DXIL action to test") return - self.controller.SetFrameEvent(draw.next.eventId, False) + self.controller.SetFrameEvent(action.next.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() @@ -43,7 +43,7 @@ class D3D12_CBuffer_Zoo(rdtest.TestCase): self.check_event() - rdtest.log.success("DXIL draw is as expected") + rdtest.log.success("DXIL action is as expected") def check_event(self): pipe: rd.PipeState = self.controller.GetPipelineState() diff --git a/util/test/tests/D3D12/D3D12_Discard_Zoo.py b/util/test/tests/D3D12/D3D12_Discard_Zoo.py index 507ba6f5b..6844c374d 100644 --- a/util/test/tests/D3D12/D3D12_Discard_Zoo.py +++ b/util/test/tests/D3D12/D3D12_Discard_Zoo.py @@ -13,11 +13,11 @@ class D3D12_Discard_Zoo(rdtest.Discard_Zoo): def check_capture(self): self.check_textures() - draw = self.find_draw("TestStart") + action = self.find_action("TestStart") - self.check(draw is not None) + self.check(action is not None) - self.controller.SetFrameEvent(draw.eventId, True) + self.controller.SetFrameEvent(action.eventId, True) # Check the buffer for res in self.controller.GetResources(): @@ -26,11 +26,11 @@ class D3D12_Discard_Zoo(rdtest.Discard_Zoo): self.check(all([b == 0x88 for b in data])) - draw = self.find_draw("TestEnd") + action = self.find_action("TestEnd") - self.check(draw is not None) + self.check(action is not None) - self.controller.SetFrameEvent(draw.eventId, True) + self.controller.SetFrameEvent(action.eventId, True) # Check the buffer for res in self.controller.GetResources(): diff --git a/util/test/tests/D3D12/D3D12_Empty_Capture.py b/util/test/tests/D3D12/D3D12_Empty_Capture.py index 743b4a175..1cc088e69 100644 --- a/util/test/tests/D3D12/D3D12_Empty_Capture.py +++ b/util/test/tests/D3D12/D3D12_Empty_Capture.py @@ -7,8 +7,8 @@ class D3D12_Empty_Capture(rdtest.TestCase): demos_frame_cap = 100 def check_capture(self): - draws = self.controller.GetDrawcalls() + actions = self.controller.GetRootActions() - self.check(len(draws) == 1) - self.check('End' in draws[0].name) - self.check(draws[0].eventId == 1) \ No newline at end of file + self.check(len(actions) == 1) + self.check('End' in actions[0].name) + self.check(actions[0].eventId == 1) \ No newline at end of file diff --git a/util/test/tests/D3D12/D3D12_Execute_Indirect.py b/util/test/tests/D3D12/D3D12_Execute_Indirect.py index 6212df069..57f60332a 100644 --- a/util/test/tests/D3D12/D3D12_Execute_Indirect.py +++ b/util/test/tests/D3D12/D3D12_Execute_Indirect.py @@ -6,9 +6,9 @@ class D3D12_Execute_Indirect(rdtest.TestCase): demos_test_name = 'D3D12_Execute_Indirect' def check_capture(self): - draw = self.find_draw("IndirectDraw") + action = self.find_action("IndirectDraw") - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) # Should be a green triangle in the centre of the screen on a red background self.check_triangle(back=[1.0, 0.0, 0.0, 1.0]) \ No newline at end of file diff --git a/util/test/tests/D3D12/D3D12_Existing_Heap.py b/util/test/tests/D3D12/D3D12_Existing_Heap.py index c5422158f..8b702a14a 100644 --- a/util/test/tests/D3D12/D3D12_Existing_Heap.py +++ b/util/test/tests/D3D12/D3D12_Existing_Heap.py @@ -6,17 +6,17 @@ class D3D12_Existing_Heap(rdtest.TestCase): demos_test_name = 'D3D12_Existing_Heap' def check_capture(self): - last_draw: rd.DrawcallDescription = self.get_last_draw() + last_action: rd.ActionDescription = self.get_last_action() - self.controller.SetFrameEvent(last_draw.eventId, True) + self.controller.SetFrameEvent(last_action.eventId, True) - self.check_triangle(out=last_draw.copyDestination) + self.check_triangle(out=last_action.copyDestination) - draw = self.find_draw("Draw") + action = self.find_action("Draw") - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) - postvs_data = self.get_postvs(draw, rd.MeshDataStage.VSOut, 0, draw.numIndices) + postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, action.numIndices) postvs_ref = { 0: { diff --git a/util/test/tests/D3D12/D3D12_Large_Buffer.py b/util/test/tests/D3D12/D3D12_Large_Buffer.py index 6a54a96c4..1dc42d360 100644 --- a/util/test/tests/D3D12/D3D12_Large_Buffer.py +++ b/util/test/tests/D3D12/D3D12_Large_Buffer.py @@ -6,9 +6,9 @@ class D3D12_Large_Buffer(rdtest.TestCase): demos_test_name = 'D3D12_Large_Buffer' def check_capture(self): - draw = self.find_draw("Draw") + action = self.find_action("Draw") - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) vsin_ref = { 0: { @@ -34,9 +34,9 @@ class D3D12_Large_Buffer(rdtest.TestCase): }, } - self.check_mesh_data(vsin_ref, self.get_vsin(draw)) + self.check_mesh_data(vsin_ref, self.get_vsin(action)) - postvs_data = self.get_postvs(draw, rd.MeshDataStage.VSOut, 0, draw.numIndices) + postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, action.numIndices) postvs_ref = { 0: { diff --git a/util/test/tests/D3D12/D3D12_List_Alloc_Tests.py b/util/test/tests/D3D12/D3D12_List_Alloc_Tests.py index 35dcb80b3..dea84dba8 100644 --- a/util/test/tests/D3D12/D3D12_List_Alloc_Tests.py +++ b/util/test/tests/D3D12/D3D12_List_Alloc_Tests.py @@ -9,13 +9,13 @@ class D3D12_List_Alloc_Tests(rdtest.TestCase): demos_frame_cap = 40 def check_capture(self): - draw = self.find_draw("Draw") + action = self.find_action("Draw") - self.check(draw is not None) + self.check(action is not None) - draw = draw.next + action = action.next - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() diff --git a/util/test/tests/D3D12/D3D12_List_Types.py b/util/test/tests/D3D12/D3D12_List_Types.py index 483fac844..c775aa6b6 100644 --- a/util/test/tests/D3D12/D3D12_List_Types.py +++ b/util/test/tests/D3D12/D3D12_List_Types.py @@ -6,13 +6,13 @@ class D3D12_List_Types(rdtest.TestCase): demos_test_name = 'D3D12_List_Types' def check_capture(self): - draw = self.find_draw("Draw") + action = self.find_action("Draw") - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) - self.check_triangle(out=draw.outputs[0], fore=[0.0, 1.0, 1.0, 1.0]) + self.check_triangle(out=action.outputs[0], fore=[0.0, 1.0, 1.0, 1.0]) - postvs_data = self.get_postvs(draw, rd.MeshDataStage.VSOut, 0, draw.numIndices) + postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, action.numIndices) postvs_ref = { 0: { diff --git a/util/test/tests/D3D12/D3D12_Overlay_Test.py b/util/test/tests/D3D12/D3D12_Overlay_Test.py index 7de3210e4..b17a136cd 100644 --- a/util/test/tests/D3D12/D3D12_Overlay_Test.py +++ b/util/test/tests/D3D12/D3D12_Overlay_Test.py @@ -12,7 +12,7 @@ class D3D12_Overlay_Test(rdtest.Overlay_Test): out: rd.ReplayOutput = self.controller.CreateOutput(rd.CreateHeadlessWindowingData(100, 100), rd.ReplayOutputType.Texture) # Don't check any pixel values, but ensure all overlays at least work with no viewport/scissor bound - sub_marker: rd.DrawcallDescription = self.find_draw("NoView draw") + sub_marker: rd.ActionDescription = self.find_action("NoView action") self.controller.SetFrameEvent(sub_marker.next.eventId, True) pipe: rd.PipeState = self.controller.GetPipelineState() diff --git a/util/test/tests/D3D12/D3D12_Parameter_Zoo.py b/util/test/tests/D3D12/D3D12_Parameter_Zoo.py index 5690dc94c..38c65a66a 100644 --- a/util/test/tests/D3D12/D3D12_Parameter_Zoo.py +++ b/util/test/tests/D3D12/D3D12_Parameter_Zoo.py @@ -8,13 +8,13 @@ class D3D12_Parameter_Zoo(rdtest.TestCase): demos_test_name = 'D3D12_Parameter_Zoo' def check_capture(self): - draw = self.find_draw("Color Draw") + action = self.find_action("Color Draw") - self.check(draw is not None) + self.check(action is not None) - draw = draw.next + action = action.next - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() @@ -22,7 +22,7 @@ class D3D12_Parameter_Zoo(rdtest.TestCase): rdtest.log.success("Captured loaded with color as expected") - postvs_data = self.get_postvs(draw, rd.MeshDataStage.VSOut, 0, draw.numIndices) + postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, action.numIndices) postvs_ref = { 0: { diff --git a/util/test/tests/D3D12/D3D12_PrimitiveID.py b/util/test/tests/D3D12/D3D12_PrimitiveID.py index 11bc81667..37f412137 100644 --- a/util/test/tests/D3D12/D3D12_PrimitiveID.py +++ b/util/test/tests/D3D12/D3D12_PrimitiveID.py @@ -6,12 +6,12 @@ import rdtest class D3D12_PrimitiveID(rdtest.TestCase): demos_test_name = 'D3D12_PrimitiveID' - def test_draw(self, draw: rd.DrawcallDescription, x, y, prim, expected_prim, expected_output): - self.controller.SetFrameEvent(draw.eventId, True) + def test_action(self, action: rd.ActionDescription, x, y, prim, expected_prim, expected_output): + self.controller.SetFrameEvent(action.eventId, True) pipe: rd.PipeState = self.controller.GetPipelineState() if not pipe.GetShaderReflection(rd.ShaderStage.Pixel).debugInfo.debuggable: - rdtest.log.print("Skipping undebuggable shader at {}.".format(draw.name)) + rdtest.log.print("Skipping undebuggable shader at {}.".format(action.name)) return trace: rd.ShaderDebugTrace = self.controller.DebugPixel(x, y, rd.ReplayController.NoPreference, prim) @@ -36,7 +36,7 @@ class D3D12_PrimitiveID(rdtest.TestCase): return False # Compare shader debug output against an expected value instead of the RT's output, - # since we're testing overlapping primitives in a single draw + # since we're testing overlapping primitives in a single action if expected_output is not None: output = self.find_output_source_var(trace, rd.ShaderBuiltin.ColorOutput, 0) debugged = self.evaluate_source_var(output, variables) @@ -57,27 +57,27 @@ class D3D12_PrimitiveID(rdtest.TestCase): success = True - # Jump to the draw - test_marker: rd.DrawcallDescription = self.find_draw("Test") + # Jump to the action + test_marker: rd.ActionDescription = self.find_action("Test") # Draw 1: No GS, PS without prim - draw = test_marker.next - success &= self.test_draw(draw, 100, 80, rd.ReplayController.NoPreference, [0], [0, 1, 0, 1]) + action = test_marker.next + success &= self.test_action(action, 100, 80, rd.ReplayController.NoPreference, [0], [0, 1, 0, 1]) # Draw 2: No GS, PS with prim - draw = draw.next - success &= self.test_draw(draw, 300, 80, rd.ReplayController.NoPreference, [0], [0, 1, 0, 1]) + action = action.next + success &= self.test_action(action, 300, 80, rd.ReplayController.NoPreference, [0], [0, 1, 0, 1]) # Draw 3: GS, PS without prim - draw = draw.next - success &= self.test_draw(draw, 125, 250, rd.ReplayController.NoPreference, [0], [0, 1, 0, 1]) + action = action.next + success &= self.test_action(action, 125, 250, rd.ReplayController.NoPreference, [0], [0, 1, 0, 1]) # Draw 4: GS, PS with prim - draw = draw.next - success &= self.test_draw(draw, 325, 250, 2, [2], [0.5, 1, 0, 1]) - success &= self.test_draw(draw, 325, 250, 3, [3], [0.75, 1, 0, 1]) + action = action.next + success &= self.test_action(action, 325, 250, 2, [2], [0.5, 1, 0, 1]) + success &= self.test_action(action, 325, 250, 3, [3], [0.75, 1, 0, 1]) # No expected output here, since it's nondeterministic which primitive gets selected - success &= self.test_draw(draw, 325, 250, rd.ReplayController.NoPreference, [2, 3], None) + success &= self.test_action(action, 325, 250, rd.ReplayController.NoPreference, [2, 3], None) if not success: raise rdtest.TestFailureException("Some tests were not as expected") diff --git a/util/test/tests/D3D12/D3D12_Reflection_Zoo.py b/util/test/tests/D3D12/D3D12_Reflection_Zoo.py index 28bd6af57..e4879b97b 100644 --- a/util/test/tests/D3D12/D3D12_Reflection_Zoo.py +++ b/util/test/tests/D3D12/D3D12_Reflection_Zoo.py @@ -6,17 +6,17 @@ class D3D12_Reflection_Zoo(rdtest.TestCase): demos_test_name = 'D3D12_Reflection_Zoo' def check_capture(self): - draw = self.find_draw("DXBC") + action = self.find_action("DXBC") - self.check(draw is not None) + self.check(action is not None) - self.controller.SetFrameEvent(draw.next.eventId, False) + self.controller.SetFrameEvent(action.next.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() stage = rd.ShaderStage.Pixel - # Verify that the DXBC draw is first + # Verify that the DXBC action is first disasm = self.controller.DisassembleShader(pipe.GetGraphicsPipelineObject(), pipe.GetShaderReflection(stage), '') @@ -24,16 +24,16 @@ class D3D12_Reflection_Zoo(rdtest.TestCase): self.check_event() - rdtest.log.success("DXBC draw is as expected") + rdtest.log.success("DXBC action is as expected") - # Move to the DXIL draw - draw = self.find_draw("DXIL") + # Move to the DXIL action + action = self.find_action("DXIL") - if draw is None: - rdtest.log.print("No DXIL draw to test") + if action is None: + rdtest.log.print("No DXIL action to test") return - self.controller.SetFrameEvent(draw.next.eventId, False) + self.controller.SetFrameEvent(action.next.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() @@ -44,7 +44,7 @@ class D3D12_Reflection_Zoo(rdtest.TestCase): self.check_event() - rdtest.log.success("DXIL draw is as expected") + rdtest.log.success("DXIL action is as expected") def check_event(self): pipe: rd.PipeState = self.controller.GetPipelineState() diff --git a/util/test/tests/D3D12/D3D12_RenderTarget_Binds.py b/util/test/tests/D3D12/D3D12_RenderTarget_Binds.py index 939aa200d..4ab8fb430 100644 --- a/util/test/tests/D3D12/D3D12_RenderTarget_Binds.py +++ b/util/test/tests/D3D12/D3D12_RenderTarget_Binds.py @@ -7,21 +7,21 @@ class D3D12_RenderTarget_Binds(rdtest.TestCase): def check_capture(self): # find the clear - draw = self.find_draw("ClearRenderTargetView") + action = self.find_action("ClearRenderTargetView") - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() - self.check_pixel_value(draw.copyDestination, 0.5, 0.5, [1.0, 0.0, 1.0, 1.0]) + self.check_pixel_value(action.copyDestination, 0.5, 0.5, [1.0, 0.0, 1.0, 1.0]) - self.check('Swapchain' in self.get_resource(draw.copyDestination).name) + self.check('Swapchain' in self.get_resource(action.copyDestination).name) rdtest.log.success("Picked value for clear is as expected") - draw = draw.next + action = action.next - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() @@ -33,11 +33,11 @@ class D3D12_RenderTarget_Binds(rdtest.TestCase): self.check(self.get_resource(rtvs[0].resourceId).name == 'TextureA') self.check(self.get_resource(rtvs[1].resourceId).name == 'TextureB') - rdtest.log.success("RTVs at first draw are as expected") + rdtest.log.success("RTVs at first action are as expected") - draw = draw.next + action = action.next - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() @@ -49,11 +49,11 @@ class D3D12_RenderTarget_Binds(rdtest.TestCase): self.check(self.get_resource(rtvs[0].resourceId).name == 'TextureC') self.check(self.get_resource(rtvs[1].resourceId).name == 'TextureD') - rdtest.log.success("RTVs at second draw are as expected") + rdtest.log.success("RTVs at second action are as expected") - draw = draw.next + action = action.next - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() @@ -65,11 +65,11 @@ class D3D12_RenderTarget_Binds(rdtest.TestCase): self.check(self.get_resource(rtvs[0].resourceId).name == 'TextureE') self.check(self.get_resource(rtvs[1].resourceId).name == 'TextureF') - rdtest.log.success("RTVs at third draw are as expected") + rdtest.log.success("RTVs at third action are as expected") - draw = draw.next + action = action.next - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() @@ -81,4 +81,4 @@ class D3D12_RenderTarget_Binds(rdtest.TestCase): self.check(self.get_resource(rtvs[0].resourceId).name == 'TextureG') self.check(self.get_resource(rtvs[1].resourceId).name == 'TextureH') - rdtest.log.success("RTVs at fourth draw are as expected") + rdtest.log.success("RTVs at fourth action are as expected") diff --git a/util/test/tests/D3D12/D3D12_Render_Pass.py b/util/test/tests/D3D12/D3D12_Render_Pass.py index a8ee5b733..75d001fd0 100644 --- a/util/test/tests/D3D12/D3D12_Render_Pass.py +++ b/util/test/tests/D3D12/D3D12_Render_Pass.py @@ -6,29 +6,29 @@ class D3D12_Render_Pass(rdtest.TestCase): demos_test_name = 'D3D12_Render_Pass' def check_capture(self): - rp1 = self.find_draw("RP 1") - rp2 = self.find_draw("RP 2") + rp1 = self.find_action("RP 1") + rp2 = self.find_action("RP 2") - draw = next(d for d in rp1.children if 'Draw' in d.name) + action = next(d for d in rp1.children if 'Draw' in d.name) - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) self.check_triangle(back=[0.0, 0.0, 1.0, 1.0]) - draw = next(d for d in rp2.children if 'Draw' in d.name) + action = next(d for d in rp2.children if 'Draw' in d.name) - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) self.check_triangle(back=[1.0, 0.0, 1.0, 1.0]) - draw = self.get_last_draw() + action = self.get_last_action() - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) - self.check_pixel_value(draw.copyDestination, 0.45, 0.45, [0.0, 0.0, 1.0, 1.0]) - self.check_pixel_value(draw.copyDestination, 0.55, 0.55, [1.0, 0.0, 1.0, 1.0]) - self.check_pixel_value(draw.copyDestination, 0.25, 0.25, [0.0, 1.0, 0.0, 1.0]) - self.check_pixel_value(draw.copyDestination, 0.75, 0.75, [0.0, 1.0, 0.0, 1.0]) + self.check_pixel_value(action.copyDestination, 0.45, 0.45, [0.0, 0.0, 1.0, 1.0]) + self.check_pixel_value(action.copyDestination, 0.55, 0.55, [1.0, 0.0, 1.0, 1.0]) + self.check_pixel_value(action.copyDestination, 0.25, 0.25, [0.0, 1.0, 0.0, 1.0]) + self.check_pixel_value(action.copyDestination, 0.75, 0.75, [0.0, 1.0, 0.0, 1.0]) - self.check_pixel_value(draw.copyDestination, 0.75, 0.25, [0.0, 0.0, 0.0, 1.0]) - self.check_pixel_value(draw.copyDestination, 0.25, 0.75, [0.0, 0.0, 0.0, 1.0]) + self.check_pixel_value(action.copyDestination, 0.75, 0.25, [0.0, 0.0, 0.0, 1.0]) + self.check_pixel_value(action.copyDestination, 0.25, 0.75, [0.0, 0.0, 0.0, 1.0]) diff --git a/util/test/tests/D3D12/D3D12_Resource_Lifetimes.py b/util/test/tests/D3D12/D3D12_Resource_Lifetimes.py index 043eb399d..2ca30148a 100644 --- a/util/test/tests/D3D12/D3D12_Resource_Lifetimes.py +++ b/util/test/tests/D3D12/D3D12_Resource_Lifetimes.py @@ -7,11 +7,11 @@ class D3D12_Resource_Lifetimes(rdtest.TestCase): demos_frame_cap = 200 def check_capture(self): - last_draw: rd.DrawcallDescription = self.get_last_draw() + last_action: rd.ActionDescription = self.get_last_action() - self.controller.SetFrameEvent(last_draw.eventId, True) + self.controller.SetFrameEvent(last_action.eventId, True) - tex = last_draw.copyDestination + tex = last_action.copyDestination # green background around first triangle, blue around second self.check_pixel_value(tex, 10, 10, [0.0, 1.0, 0.0, 1.0]) diff --git a/util/test/tests/D3D12/D3D12_Resource_Mapping_Zoo.py b/util/test/tests/D3D12/D3D12_Resource_Mapping_Zoo.py index 92c969d27..dc63ac99b 100644 --- a/util/test/tests/D3D12/D3D12_Resource_Mapping_Zoo.py +++ b/util/test/tests/D3D12/D3D12_Resource_Mapping_Zoo.py @@ -41,20 +41,20 @@ class D3D12_Resource_Mapping_Zoo(rdtest.TestCase): failed = False - test_marker: rd.DrawcallDescription = self.find_draw("sm_5_0") - draw = test_marker.next - self.controller.SetFrameEvent(draw.eventId, False) + test_marker: rd.ActionDescription = self.find_action("sm_5_0") + action = test_marker.next + self.controller.SetFrameEvent(action.eventId, False) failed = not self.test_debug_pixel(200, 200, "sm_5_0") or failed - test_marker: rd.DrawcallDescription = self.find_draw("sm_5_1") - draw = test_marker.next - self.controller.SetFrameEvent(draw.eventId, False) + test_marker: rd.ActionDescription = self.find_action("sm_5_1") + action = test_marker.next + self.controller.SetFrameEvent(action.eventId, False) failed = not self.test_debug_pixel(200, 200, "sm_5_1") or failed rdtest.log.begin_section("Resource array tests") - test_marker: rd.DrawcallDescription = self.find_draw("ResArray") - draw = test_marker.next - self.controller.SetFrameEvent(draw.eventId, False) + test_marker: rd.ActionDescription = self.find_action("ResArray") + action = test_marker.next + self.controller.SetFrameEvent(action.eventId, False) for y in range(4): for x in range(4): @@ -63,9 +63,9 @@ class D3D12_Resource_Mapping_Zoo(rdtest.TestCase): rdtest.log.end_section("Resource array tests") rdtest.log.begin_section("Bindless tests") - test_marker: rd.DrawcallDescription = self.find_draw("Bindless") - draw = test_marker.next - self.controller.SetFrameEvent(draw.eventId, False) + test_marker: rd.ActionDescription = self.find_action("Bindless") + action = test_marker.next + self.controller.SetFrameEvent(action.eventId, False) for y in range(4): for x in range(4): diff --git a/util/test/tests/D3D12/D3D12_Shader_Debug_Zoo.py b/util/test/tests/D3D12/D3D12_Shader_Debug_Zoo.py index cfbcbe7b8..eb832f08e 100644 --- a/util/test/tests/D3D12/D3D12_Shader_Debug_Zoo.py +++ b/util/test/tests/D3D12/D3D12_Shader_Debug_Zoo.py @@ -17,19 +17,19 @@ class D3D12_Shader_Debug_Zoo(rdtest.TestCase): for sm in range(len(shaderModels)): rdtest.log.begin_section(shaderModels[sm] + " tests") - # Jump to the draw - test_marker: rd.DrawcallDescription = self.find_draw(shaderModels[sm]) - draw = test_marker.next - self.controller.SetFrameEvent(draw.eventId, False) + # Jump to the action + test_marker: rd.ActionDescription = self.find_action(shaderModels[sm]) + action = test_marker.next + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() if not pipe.GetShaderReflection(rd.ShaderStage.Pixel).debugInfo.debuggable: - rdtest.log.print("Skipping undebuggable shader at {}.".format(draw.name)) + rdtest.log.print("Skipping undebuggable shader at {}.".format(action.name)) return # Loop over every test - for test in range(draw.numInstances): + for test in range(action.numInstances): # Debug the shader trace: rd.ShaderDebugTrace = self.controller.DebugPixel(4 * test, 0, rd.ReplayController.NoPreference, rd.ReplayController.NoPreference) @@ -54,9 +54,9 @@ class D3D12_Shader_Debug_Zoo(rdtest.TestCase): rdtest.log.end_section(shaderModels[sm] + " tests") rdtest.log.begin_section("MSAA tests") - test_marker: rd.DrawcallDescription = self.find_draw("MSAA") - draw = test_marker.next - self.controller.SetFrameEvent(draw.eventId, False) + test_marker: rd.ActionDescription = self.find_action("MSAA") + action = test_marker.next + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() for test in range(4): # Debug the shader @@ -85,9 +85,9 @@ class D3D12_Shader_Debug_Zoo(rdtest.TestCase): rdtest.log.end_section("MSAA tests") - test_marker: rd.DrawcallDescription = self.find_draw("VertexSample") - draw = test_marker.next - self.controller.SetFrameEvent(draw.eventId, False) + test_marker: rd.ActionDescription = self.find_action("VertexSample") + action = test_marker.next + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() # Debug the vertex shader diff --git a/util/test/tests/D3D12/D3D12_Shader_Editing.py b/util/test/tests/D3D12/D3D12_Shader_Editing.py index bab2c430e..6b2c43de4 100644 --- a/util/test/tests/D3D12/D3D12_Shader_Editing.py +++ b/util/test/tests/D3D12/D3D12_Shader_Editing.py @@ -8,14 +8,14 @@ class D3D12_Shader_Editing(rdtest.TestCase): demos_test_name = 'D3D12_Shader_Editing' def check_capture(self): - eid = self.find_draw("Draw 1").next.eventId + eid = self.find_action("Draw 1").next.eventId self.controller.SetFrameEvent(eid, False) pipe: rd.PipeState = self.controller.GetPipelineState() psrefl1: rd.ShaderReflection = pipe.GetShaderReflection(rd.ShaderStage.Pixel) - eid = self.find_draw("Draw 2").next.eventId + eid = self.find_action("Draw 2").next.eventId self.controller.SetFrameEvent(eid, False) pipe: rd.PipeState = self.controller.GetPipelineState() diff --git a/util/test/tests/D3D12/D3D12_Shader_ISA.py b/util/test/tests/D3D12/D3D12_Shader_ISA.py index e50241f11..9971ad391 100644 --- a/util/test/tests/D3D12/D3D12_Shader_ISA.py +++ b/util/test/tests/D3D12/D3D12_Shader_ISA.py @@ -7,13 +7,13 @@ class D3D12_Shader_ISA(rdtest.TestCase): demos_test_name = 'D3D12_Shader_ISA' def check_capture(self): - draw = self.find_draw("GPU=") + action = self.find_action("GPU=") - self.check(draw is not None) + self.check(action is not None) - is_amd = 'AMD' in draw.name + is_amd = 'AMD' in action.name - self.controller.SetFrameEvent(draw.next.eventId, False) + self.controller.SetFrameEvent(action.next.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() diff --git a/util/test/tests/D3D12/D3D12_Shader_Linkage_Zoo.py b/util/test/tests/D3D12/D3D12_Shader_Linkage_Zoo.py index 81f8c119b..b2fa40dc0 100644 --- a/util/test/tests/D3D12/D3D12_Shader_Linkage_Zoo.py +++ b/util/test/tests/D3D12/D3D12_Shader_Linkage_Zoo.py @@ -13,13 +13,13 @@ class D3D12_Shader_Linkage_Zoo(rdtest.TestCase): failed = False - test_marker: rd.DrawcallDescription = self.find_draw("draw") + test_marker: rd.ActionDescription = self.find_action("action") while test_marker is not None: - drawcall = test_marker.next + action = test_marker.next event_name = test_marker.name - test_marker: rd.DrawcallDescription = self.find_draw("draw", drawcall.eventId) + test_marker: rd.ActionDescription = self.find_action("action", action.eventId) - self.controller.SetFrameEvent(drawcall.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() if not pipe.GetShaderReflection(rd.ShaderStage.Pixel).debugInfo.debuggable: diff --git a/util/test/tests/D3D12/D3D12_Sharing.py b/util/test/tests/D3D12/D3D12_Sharing.py index bdcd11389..447c1e16f 100644 --- a/util/test/tests/D3D12/D3D12_Sharing.py +++ b/util/test/tests/D3D12/D3D12_Sharing.py @@ -6,29 +6,29 @@ class D3D12_Sharing(rdtest.TestCase): demos_test_name = 'D3D12_Sharing' def check_capture(self): - draw = self.find_draw("Copy") + action = self.find_action("Copy") - draw: rd.DrawcallDescription = draw.next + action: rd.ActionDescription = action.next - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() # Should be white in the top left, green in the bottom right, and red elsewhere - self.check_pixel_value(draw.copyDestination, 0.2, 0.2, [1.0, 1.0, 1.0, 1.0]) - self.check_pixel_value(draw.copyDestination, 0.3, 0.3, [1.0, 1.0, 1.0, 1.0]) - self.check_pixel_value(draw.copyDestination, 0.4, 0.4, [1.0, 1.0, 1.0, 1.0]) + self.check_pixel_value(action.copyDestination, 0.2, 0.2, [1.0, 1.0, 1.0, 1.0]) + self.check_pixel_value(action.copyDestination, 0.3, 0.3, [1.0, 1.0, 1.0, 1.0]) + self.check_pixel_value(action.copyDestination, 0.4, 0.4, [1.0, 1.0, 1.0, 1.0]) - self.check_pixel_value(draw.copyDestination, 0.6, 0.6, [0.0, 1.0, 0.0, 1.0]) - self.check_pixel_value(draw.copyDestination, 0.7, 0.7, [0.0, 1.0, 0.0, 1.0]) - self.check_pixel_value(draw.copyDestination, 0.8, 0.8, [0.0, 1.0, 0.0, 1.0]) + self.check_pixel_value(action.copyDestination, 0.6, 0.6, [0.0, 1.0, 0.0, 1.0]) + self.check_pixel_value(action.copyDestination, 0.7, 0.7, [0.0, 1.0, 0.0, 1.0]) + self.check_pixel_value(action.copyDestination, 0.8, 0.8, [0.0, 1.0, 0.0, 1.0]) - self.check_pixel_value(draw.copyDestination, 0.1, 0.6, [1.0, 0.0, 0.0, 1.0]) - self.check_pixel_value(draw.copyDestination, 0.1, 0.7, [1.0, 0.0, 0.0, 1.0]) - self.check_pixel_value(draw.copyDestination, 0.1, 0.8, [1.0, 0.0, 0.0, 1.0]) + self.check_pixel_value(action.copyDestination, 0.1, 0.6, [1.0, 0.0, 0.0, 1.0]) + self.check_pixel_value(action.copyDestination, 0.1, 0.7, [1.0, 0.0, 0.0, 1.0]) + self.check_pixel_value(action.copyDestination, 0.1, 0.8, [1.0, 0.0, 0.0, 1.0]) - self.check_pixel_value(draw.copyDestination, 0.6, 0.1, [1.0, 0.0, 0.0, 1.0]) - self.check_pixel_value(draw.copyDestination, 0.7, 0.1, [1.0, 0.0, 0.0, 1.0]) - self.check_pixel_value(draw.copyDestination, 0.8, 0.1, [1.0, 0.0, 0.0, 1.0]) + self.check_pixel_value(action.copyDestination, 0.6, 0.1, [1.0, 0.0, 0.0, 1.0]) + self.check_pixel_value(action.copyDestination, 0.7, 0.1, [1.0, 0.0, 0.0, 1.0]) + self.check_pixel_value(action.copyDestination, 0.8, 0.1, [1.0, 0.0, 0.0, 1.0]) rdtest.log.success("Picked values are as expected") \ No newline at end of file diff --git a/util/test/tests/D3D12/D3D12_Simple_Triangle.py b/util/test/tests/D3D12/D3D12_Simple_Triangle.py index f38dd650b..cbe966c71 100644 --- a/util/test/tests/D3D12/D3D12_Simple_Triangle.py +++ b/util/test/tests/D3D12/D3D12_Simple_Triangle.py @@ -6,19 +6,19 @@ class D3D12_Simple_Triangle(rdtest.TestCase): demos_test_name = 'D3D12_Simple_Triangle' def check_capture(self): - last_draw: rd.DrawcallDescription = self.get_last_draw() + last_action: rd.ActionDescription = self.get_last_action() - self.controller.SetFrameEvent(last_draw.eventId, True) + self.controller.SetFrameEvent(last_action.eventId, True) - self.check_triangle(out=last_draw.copyDestination) + self.check_triangle(out=last_action.copyDestination) self.check_export(self.capture_filename) - draw = self.find_draw("Draw") + action = self.find_action("Draw") - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) - postvs_data = self.get_postvs(draw, rd.MeshDataStage.VSOut, 0, draw.numIndices) + postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, action.numIndices) postvs_ref = { 0: { diff --git a/util/test/tests/D3D12/D3D12_Swapchain_Zoo.py b/util/test/tests/D3D12/D3D12_Swapchain_Zoo.py index fd7993ecc..31a8f07c1 100644 --- a/util/test/tests/D3D12/D3D12_Swapchain_Zoo.py +++ b/util/test/tests/D3D12/D3D12_Swapchain_Zoo.py @@ -6,17 +6,17 @@ class D3D12_Swapchain_Zoo(rdtest.TestCase): demos_test_name = 'D3D12_Swapchain_Zoo' def check_capture(self): - draw1 = self.find_draw("Draw 1") - draw2 = self.find_draw("Draw 2") + action1 = self.find_action("Draw 1") + action2 = self.find_action("Draw 2") - self.controller.SetFrameEvent(draw1.next.eventId, False) + self.controller.SetFrameEvent(action1.next.eventId, False) self.check_triangle(back=[0.0, 0.0, 0.0, 1.0]) - rdtest.log.success("Triangle in first draw (on first window) is OK") + rdtest.log.success("Triangle in first action (on first window) is OK") - self.controller.SetFrameEvent(draw2.next.eventId, False) + self.controller.SetFrameEvent(action2.next.eventId, False) self.check_triangle(back=[0.0, 0.0, 0.0, 1.0]) - rdtest.log.success("Triangle in second draw (on second window) is OK") \ No newline at end of file + rdtest.log.success("Triangle in second action (on second window) is OK") \ No newline at end of file diff --git a/util/test/tests/D3D12/D3D12_Untyped_Backbuffer_Descriptor.py b/util/test/tests/D3D12/D3D12_Untyped_Backbuffer_Descriptor.py index 1c2ba2dff..23e81d43d 100644 --- a/util/test/tests/D3D12/D3D12_Untyped_Backbuffer_Descriptor.py +++ b/util/test/tests/D3D12/D3D12_Untyped_Backbuffer_Descriptor.py @@ -6,24 +6,24 @@ class D3D12_Untyped_Backbuffer_Descriptor(rdtest.TestCase): demos_test_name = 'D3D12_Untyped_Backbuffer_Descriptor' def check_capture(self): - # find the first draw - draw = self.find_draw("Draw") + # find the first action + action = self.find_action("Draw") - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() self.check_pixel_value(pipe.GetOutputTargets()[0].resourceId, 0.25, 0.5, [1.0, 1.0, 1.0, 1.0]) - rdtest.log.success("Picked value for first draw is as expected") + rdtest.log.success("Picked value for first action is as expected") - # find the second draw - draw = self.find_draw("Draw", draw.eventId+1) + # find the second action + action = self.find_action("Draw", action.eventId+1) - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() self.check_pixel_value(pipe.GetOutputTargets()[0].resourceId, 0.75, 0.5, [1.0, 1.0, 1.0, 1.0]) - rdtest.log.success("Picked value for second draw is as expected") + rdtest.log.success("Picked value for second action is as expected") diff --git a/util/test/tests/D3D12/D3D12_VRS.py b/util/test/tests/D3D12/D3D12_VRS.py index 814d0c6ab..7b5b17ecb 100644 --- a/util/test/tests/D3D12/D3D12_VRS.py +++ b/util/test/tests/D3D12/D3D12_VRS.py @@ -41,63 +41,63 @@ class D3D12_VRS(rdtest.TestCase): return "?x?" def check_capture(self): - # we do two passes, first when we're selecting the actual draws and second when we're in a second command buffer - # going over the same viewports but with dummy draws. To ensure the results are the same whether or not we're + # we do two passes, first when we're selecting the actual actions and second when we're in a second command buffer + # going over the same viewports but with dummy actions. To ensure the results are the same whether or not we're # in the VRS command buffer for pass_name in ["First", "Second"]: - pass_draw = self.find_draw(pass_name) + pass_action = self.find_action(pass_name) - draw = self.find_draw("Default", pass_draw.eventId) - self.check(draw is not None) - self.controller.SetFrameEvent(draw.next.eventId, False) + action = self.find_action("Default", pass_action.eventId) + self.check(action is not None) + self.controller.SetFrameEvent(action.next.eventId, False) num_checks = 0 self.check(self.get_shading_rates() == ("1x1", "1x1"), - "{} shading rates unexpected: {}".format(draw.name, self.get_shading_rates())) + "{} shading rates unexpected: {}".format(action.name, self.get_shading_rates())) num_checks += 1 - draw = self.find_draw("Base", pass_draw.eventId) - self.controller.SetFrameEvent(draw.next.eventId, False) + action = self.find_action("Base", pass_action.eventId) + self.controller.SetFrameEvent(action.next.eventId, False) self.check(self.get_shading_rates() == ("2x2", "2x2"), - "{} shading rates unexpected: {}".format(draw.name, self.get_shading_rates())) + "{} shading rates unexpected: {}".format(action.name, self.get_shading_rates())) num_checks += 1 - draw = self.find_draw("Vertex", pass_draw.eventId) - if draw is not None: - self.controller.SetFrameEvent(draw.next.eventId, False) + action = self.find_action("Vertex", pass_action.eventId) + if action is not None: + self.controller.SetFrameEvent(action.next.eventId, False) self.check(self.get_shading_rates() == ("1x1", "2x2"), - "{} shading rates unexpected: {}".format(draw.name, self.get_shading_rates())) + "{} shading rates unexpected: {}".format(action.name, self.get_shading_rates())) num_checks += 1 rdtest.log.success("Shading rates were as expected in per-vertex case") - draw = self.find_draw("Image", pass_draw.eventId) - if draw is not None: - self.controller.SetFrameEvent(draw.next.eventId, False) + action = self.find_action("Image", pass_action.eventId) + if action is not None: + self.controller.SetFrameEvent(action.next.eventId, False) self.check(self.get_shading_rates() == ("2x2", "1x1"), - "{} shading rates unexpected: {}".format(draw.name, self.get_shading_rates())) + "{} shading rates unexpected: {}".format(action.name, self.get_shading_rates())) num_checks += 1 rdtest.log.success("Shading rates were as expected in image-based case") - draw = self.find_draw("Base + Vertex", pass_draw.eventId) - if draw is not None: - self.controller.SetFrameEvent(draw.next.eventId, False) + action = self.find_action("Base + Vertex", pass_action.eventId) + if action is not None: + self.controller.SetFrameEvent(action.next.eventId, False) self.check(self.get_shading_rates() == ("2x2", "2x2"), - "{} shading rates unexpected: {}".format(draw.name, self.get_shading_rates())) + "{} shading rates unexpected: {}".format(action.name, self.get_shading_rates())) num_checks += 1 - draw = self.find_draw("Base + Image", pass_draw.eventId) - if draw is not None: - self.controller.SetFrameEvent(draw.next.eventId, False) + action = self.find_action("Base + Image", pass_action.eventId) + if action is not None: + self.controller.SetFrameEvent(action.next.eventId, False) self.check(self.get_shading_rates() == ("2x2", "2x2"), - "{} shading rates unexpected: {}".format(draw.name, self.get_shading_rates())) + "{} shading rates unexpected: {}".format(action.name, self.get_shading_rates())) num_checks += 1 - draw = self.find_draw("Vertex + Image", pass_draw.eventId) - if draw is not None: - self.controller.SetFrameEvent(draw.next.eventId, False) + action = self.find_action("Vertex + Image", pass_action.eventId) + if action is not None: + self.controller.SetFrameEvent(action.next.eventId, False) self.check(self.get_shading_rates() == ("2x2", "2x2"), - "{} shading rates unexpected: {}".format(draw.name, self.get_shading_rates())) + "{} shading rates unexpected: {}".format(action.name, self.get_shading_rates())) num_checks += 1 rdtest.log.success("{}pass: Shading rates were as expected in {} test cases".format(pass_name, num_checks)) \ No newline at end of file diff --git a/util/test/tests/D3D12/D3D12_Vertex_Attr_Zoo.py b/util/test/tests/D3D12/D3D12_Vertex_Attr_Zoo.py index b8178ebb9..e9d60f86d 100644 --- a/util/test/tests/D3D12/D3D12_Vertex_Attr_Zoo.py +++ b/util/test/tests/D3D12/D3D12_Vertex_Attr_Zoo.py @@ -7,11 +7,11 @@ class D3D12_Vertex_Attr_Zoo(rdtest.TestCase): demos_test_name = 'D3D12_Vertex_Attr_Zoo' def check_capture(self): - draw = self.find_draw("Draw") + action = self.find_action("Draw") - self.check(draw is not None) + self.check(action is not None) - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) ref = { 0: { @@ -59,14 +59,14 @@ class D3D12_Vertex_Attr_Zoo(rdtest.TestCase): vsout_ref[2]['SV_Position'] = [0.5, 0.5, 0.0, 1.0] gsout_ref[2]['SV_Position'] = [0.5, 0.5, 0.4, 1.2] - self.check_mesh_data(in_ref, self.get_vsin(draw)) + self.check_mesh_data(in_ref, self.get_vsin(action)) rdtest.log.success("Vertex input data is as expected") - self.check_mesh_data(vsout_ref, self.get_postvs(draw, rd.MeshDataStage.VSOut)) + self.check_mesh_data(vsout_ref, self.get_postvs(action, rd.MeshDataStage.VSOut)) rdtest.log.success("Vertex output data is as expected") - self.check_mesh_data(gsout_ref, self.get_postvs(draw, rd.MeshDataStage.GSOut)) + self.check_mesh_data(gsout_ref, self.get_postvs(action, rd.MeshDataStage.GSOut)) rdtest.log.success("Geometry output data is as expected") diff --git a/util/test/tests/D3D12/D3D12_Write_Subresource.py b/util/test/tests/D3D12/D3D12_Write_Subresource.py index fc84458bd..061195960 100644 --- a/util/test/tests/D3D12/D3D12_Write_Subresource.py +++ b/util/test/tests/D3D12/D3D12_Write_Subresource.py @@ -6,9 +6,9 @@ class D3D12_Write_Subresource(rdtest.TestCase): demos_test_name = 'D3D12_Write_Subresource' def check_capture(self): - draw = self.find_draw("Draw") + action = self.find_action("Draw") - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() diff --git a/util/test/tests/GL/GL_Buffer_Resizing.py b/util/test/tests/GL/GL_Buffer_Resizing.py index 6fb259171..ef252ba10 100644 --- a/util/test/tests/GL/GL_Buffer_Resizing.py +++ b/util/test/tests/GL/GL_Buffer_Resizing.py @@ -34,23 +34,23 @@ class GL_Buffer_Resizing(rdtest.TestCase): }, } - draw = self.get_first_draw() + action = self.get_first_action() idx = 0 while True: - draw: rd.DrawcallDescription = self.find_draw('glDraw', draw.eventId+1) + action: rd.ActionDescription = self.find_action('glDraw', action.eventId+1) - if draw is None: + if action is None: break - self.controller.SetFrameEvent(draw.eventId, True) + self.controller.SetFrameEvent(action.eventId, True) - self.check_triangle(out=draw.outputs[0]) + self.check_triangle(out=action.outputs[0]) - postvs_data = self.get_postvs(draw, rd.MeshDataStage.VSOut, 0, draw.numIndices) + postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, action.numIndices) self.check_mesh_data(postvs_ref, postvs_data) idx = idx + 1 - rdtest.log.success('Draw {} at {} is correct'.format(idx, draw.eventId)) + rdtest.log.success('Draw {} at {} is correct'.format(idx, action.eventId)) diff --git a/util/test/tests/GL/GL_Buffer_Spam.py b/util/test/tests/GL/GL_Buffer_Spam.py index 37cee5b33..14e5cd2f5 100644 --- a/util/test/tests/GL/GL_Buffer_Spam.py +++ b/util/test/tests/GL/GL_Buffer_Spam.py @@ -9,9 +9,9 @@ class GL_Buffer_Spam(rdtest.TestCase): # Check that export works self.check_export(self.capture_filename) - draw = self.find_draw("Draw") + action = self.find_action("Draw") - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) # Check that we get green in the centre of the screen, indicating that the # triangle's buffer serialised with the right data and rendered diff --git a/util/test/tests/GL/GL_Buffer_Updates.py b/util/test/tests/GL/GL_Buffer_Updates.py index a0c7f8190..debfad954 100644 --- a/util/test/tests/GL/GL_Buffer_Updates.py +++ b/util/test/tests/GL/GL_Buffer_Updates.py @@ -8,12 +8,12 @@ class GL_Buffer_Updates(rdtest.TestCase): def check_capture(self): tex = rd.TextureDisplay() - # At each draw, the centre pixel of the viewport should be green - draw = self.get_first_draw() - while draw is not None: - self.controller.SetFrameEvent(draw.eventId, False) + # At each action, the centre pixel of the viewport should be green + action = self.get_first_action() + while action is not None: + self.controller.SetFrameEvent(action.eventId, False) - if draw.flags & rd.DrawFlags.Drawcall: + if action.flags & rd.ActionFlags.Drawcall: pipe = self.controller.GetPipelineState() tex = self.controller.GetPipelineState().GetOutputTargets()[0].resourceId @@ -26,7 +26,7 @@ class GL_Buffer_Updates(rdtest.TestCase): self.check_pixel_value(tex, x, y, [0.0, 1.0, 0.0, 1.0]) - draw = draw.next + action = action.next rdtest.log.success("Draws are all green") diff --git a/util/test/tests/GL/GL_CBuffer_Zoo.py b/util/test/tests/GL/GL_CBuffer_Zoo.py index 063a1809e..5652b8702 100644 --- a/util/test/tests/GL/GL_CBuffer_Zoo.py +++ b/util/test/tests/GL/GL_CBuffer_Zoo.py @@ -6,11 +6,11 @@ class GL_CBuffer_Zoo(rdtest.TestCase): demos_test_name = 'GL_CBuffer_Zoo' def check_capture(self): - draw = self.find_draw("Draw") + action = self.find_action("Draw") - self.check(draw is not None) + self.check(action is not None) - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() diff --git a/util/test/tests/GL/GL_Callstacks.py b/util/test/tests/GL/GL_Callstacks.py index a256a2a02..e78a82b85 100644 --- a/util/test/tests/GL/GL_Callstacks.py +++ b/util/test/tests/GL/GL_Callstacks.py @@ -37,9 +37,9 @@ class GL_Callstacks(rdtest.TestCase): if not cap.InitResolver(False, resolve_progress): raise rdtest.TestFailureException("Failed to initialise callstack resolver") - draw = self.find_draw("Draw") + action = self.find_action("Draw") - event: rd.APIEvent = draw.events[-1] + event: rd.APIEvent = action.events[-1] expected_funcs = [ "GL_Callstacks::testFunction", diff --git a/util/test/tests/GL/GL_DX_Interop.py b/util/test/tests/GL/GL_DX_Interop.py index 8496e2615..970c9930f 100644 --- a/util/test/tests/GL/GL_DX_Interop.py +++ b/util/test/tests/GL/GL_DX_Interop.py @@ -7,11 +7,11 @@ class GL_DX_Interop(rdtest.TestCase): demos_frame_cap = 4 def check_capture(self): - last_draw: rd.DrawcallDescription = self.get_last_draw() + last_action: rd.ActionDescription = self.get_last_action() - self.controller.SetFrameEvent(last_draw.eventId, True) + self.controller.SetFrameEvent(last_action.eventId, True) - out = last_draw.copyDestination + out = last_action.copyDestination # There should be N+1 rings of green/red with the base colour in the middle x,y = 1.0, 1.0 diff --git a/util/test/tests/GL/GL_Discard_Zoo.py b/util/test/tests/GL/GL_Discard_Zoo.py index ee874c365..7ce47281c 100644 --- a/util/test/tests/GL/GL_Discard_Zoo.py +++ b/util/test/tests/GL/GL_Discard_Zoo.py @@ -13,11 +13,11 @@ class GL_Discard_Zoo(rdtest.Discard_Zoo): def check_capture(self): self.check_textures() - draw = self.find_draw("TestStart") + action = self.find_action("TestStart") - self.check(draw is not None) + self.check(action is not None) - self.controller.SetFrameEvent(draw.eventId, True) + self.controller.SetFrameEvent(action.eventId, True) # Check the buffer for res in self.controller.GetResources(): @@ -26,11 +26,11 @@ class GL_Discard_Zoo(rdtest.Discard_Zoo): self.check(all([b == 0x88 for b in data])) - draw = self.find_draw("TestEnd") + action = self.find_action("TestEnd") - self.check(draw is not None) + self.check(action is not None) - self.controller.SetFrameEvent(draw.eventId, True) + self.controller.SetFrameEvent(action.eventId, True) # Check the buffer for res in self.controller.GetResources(): diff --git a/util/test/tests/GL/GL_Draw_Zoo.py b/util/test/tests/GL/GL_Draw_Zoo.py index 9dea647ec..f25cb0db0 100644 --- a/util/test/tests/GL/GL_Draw_Zoo.py +++ b/util/test/tests/GL/GL_Draw_Zoo.py @@ -9,13 +9,13 @@ class GL_Draw_Zoo(rdtest.Draw_Zoo): def check_capture(self): rdtest.Draw_Zoo.check_capture(self) - draw = self.find_draw("GL_PRIMITIVE_RESTART") + action = self.find_action("GL_PRIMITIVE_RESTART") - self.check(draw is not None) + self.check(action is not None) - draw = draw.next + action = action.next - self.controller.SetFrameEvent(draw.eventId, True) + self.controller.SetFrameEvent(action.eventId, True) pipe = self.controller.GetPipelineState() @@ -25,13 +25,13 @@ class GL_Draw_Zoo(rdtest.Draw_Zoo): self.check(pipe.IsStripRestartEnabled()) self.check((pipe.GetStripRestartIndex() & ((1 << (ib.byteStride*8)) - 1)) == 0xffff) - draw = self.find_draw("GL_PRIMITIVE_RESTART_FIXED_INDEX") + action = self.find_action("GL_PRIMITIVE_RESTART_FIXED_INDEX") - self.check(draw is not None) + self.check(action is not None) - draw = draw.next + action = action.next - self.controller.SetFrameEvent(draw.eventId, True) + self.controller.SetFrameEvent(action.eventId, True) pipe = self.controller.GetPipelineState() diff --git a/util/test/tests/GL/GL_Empty_Capture.py b/util/test/tests/GL/GL_Empty_Capture.py index ffe80bef9..815af2391 100644 --- a/util/test/tests/GL/GL_Empty_Capture.py +++ b/util/test/tests/GL/GL_Empty_Capture.py @@ -7,9 +7,9 @@ class GL_Empty_Capture(rdtest.TestCase): demos_frame_cap = 100 def check_capture(self): - draws = self.controller.GetDrawcalls() + actions = self.controller.GetRootActions() - self.check(len(draws) == 1) - self.check('End' in draws[0].name) + self.check(len(actions) == 1) + self.check('End' in actions[0].name) # EID 1 is the implicit context activation - self.check(draws[0].eventId == 2) \ No newline at end of file + self.check(actions[0].eventId == 2) \ No newline at end of file diff --git a/util/test/tests/GL/GL_Entry_Points.py b/util/test/tests/GL/GL_Entry_Points.py index 258d44a9a..87ab2d06c 100644 --- a/util/test/tests/GL/GL_Entry_Points.py +++ b/util/test/tests/GL/GL_Entry_Points.py @@ -16,15 +16,15 @@ class GL_Entry_Points(rdtest.TestCase): } for test in expected.keys(): - marker: rd.DrawcallDescription = self.find_draw(test) + marker: rd.ActionDescription = self.find_action(test) if marker is None: - raise rdtest.TestFailureException('Failed to find draw {}'.format(test)) - draw: rd.DrawcallDescription = marker.next + raise rdtest.TestFailureException('Failed to find action {}'.format(test)) + action: rd.ActionDescription = marker.next calls = [] ev: rd.APIEvent - for ev in draw.events: + for ev in action.events: # skip any events up to and including the marker itself if ev.eventId <= marker.eventId: continue diff --git a/util/test/tests/GL/GL_Large_Buffer.py b/util/test/tests/GL/GL_Large_Buffer.py index 8ed31e343..13e7c0ab9 100644 --- a/util/test/tests/GL/GL_Large_Buffer.py +++ b/util/test/tests/GL/GL_Large_Buffer.py @@ -6,9 +6,9 @@ class GL_Large_Buffer(rdtest.TestCase): demos_test_name = 'GL_Large_Buffer' def check_capture(self): - draw = self.find_draw("Draw") + action = self.find_action("Draw") - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) vsin_ref = { 0: { @@ -35,9 +35,9 @@ class GL_Large_Buffer(rdtest.TestCase): }, } - self.check_mesh_data(vsin_ref, self.get_vsin(draw)) + self.check_mesh_data(vsin_ref, self.get_vsin(action)) - postvs_data = self.get_postvs(draw, rd.MeshDataStage.VSOut, 0, draw.numIndices) + postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, action.numIndices) postvs_ref = { 0: { diff --git a/util/test/tests/GL/GL_Marker_Test.py b/util/test/tests/GL/GL_Marker_Test.py index 5769f93cf..9992d1c28 100644 --- a/util/test/tests/GL/GL_Marker_Test.py +++ b/util/test/tests/GL/GL_Marker_Test.py @@ -6,9 +6,9 @@ class GL_Marker_Test(rdtest.TestCase): demos_test_name = 'GL_Marker_Test' def check_capture(self): - draws = self.controller.GetDrawcalls() + actions = self.controller.GetRootActions() - d = draws[1] + d = actions[1] names = [ 'EXT marker 1', diff --git a/util/test/tests/GL/GL_Mesh_Zoo.py b/util/test/tests/GL/GL_Mesh_Zoo.py index 4c0f5051b..067dd5f5d 100644 --- a/util/test/tests/GL/GL_Mesh_Zoo.py +++ b/util/test/tests/GL/GL_Mesh_Zoo.py @@ -13,8 +13,8 @@ class GL_Mesh_Zoo(rdtest.TestCase): self.zoo_helper.check_capture(self.capture_filename, self.controller) # Test GL-only thing with geometry shader only and completely no-op vertex shader - draw = self.zoo_helper.find_draw("Geom Only").next - self.controller.SetFrameEvent(draw.eventId, False) + action = self.zoo_helper.find_action("Geom Only").next + self.controller.SetFrameEvent(action.eventId, False) pos: rd.MeshFormat = self.controller.GetPostVSData(0, 0, rd.MeshDataStage.VSOut) @@ -38,19 +38,19 @@ class GL_Mesh_Zoo(rdtest.TestCase): }, } - self.check_mesh_data(gsout_ref, self.get_postvs(draw, rd.MeshDataStage.GSOut)) + self.check_mesh_data(gsout_ref, self.get_postvs(action, rd.MeshDataStage.GSOut)) # Test GL-only thing with geometry shader only and completely no-op vertex shader - multibase = self.zoo_helper.find_draw("Multi Draw").next.parent + multibase = self.zoo_helper.find_action("Multi Draw").next.parent self.controller.SetFrameEvent(multibase.children[-1].eventId, False) baseVertex = [10, 11] baseInstance = [20, 22] - for d, draw in enumerate(multibase.children): - draw: rd.DrawcallDescription + for d, action in enumerate(multibase.children): + action: rd.ActionDescription - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() @@ -65,31 +65,31 @@ class GL_Mesh_Zoo(rdtest.TestCase): bv = baseVertex[d] bi = baseInstance[d] - for inst in range(draw.numInstances): + for inst in range(action.numInstances): multi_ref = { 0: { 'basevtx': bv, 'baseinst': bi, 'inst': inst, - 'draw': d, + 'action': d, 'vert': bv + 0, }, 1: { 'basevtx': bv, 'baseinst': bi, 'inst': inst, - 'draw': d, + 'action': d, 'vert': bv + 1, }, 2: { 'basevtx': bv, 'baseinst': bi, 'inst': inst, - 'draw': d, + 'action': d, 'vert': bv + 2, }, } - self.check_mesh_data(multi_ref, self.get_postvs(draw, rd.MeshDataStage.VSOut, instance=inst)) + self.check_mesh_data(multi_ref, self.get_postvs(action, rd.MeshDataStage.VSOut, instance=inst)) - rdtest.log.success("Multi-draw pass is as expected") + rdtest.log.success("Multi-action pass is as expected") diff --git a/util/test/tests/GL/GL_Multithread_Rendering.py b/util/test/tests/GL/GL_Multithread_Rendering.py index 7a7e50ce1..8b552ef5e 100644 --- a/util/test/tests/GL/GL_Multithread_Rendering.py +++ b/util/test/tests/GL/GL_Multithread_Rendering.py @@ -6,9 +6,9 @@ class GL_Multithread_Rendering(rdtest.TestCase): demos_test_name = 'GL_Multithread_Rendering' def check_capture(self): - draw = self.get_last_draw() + action = self.get_last_action() - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() diff --git a/util/test/tests/GL/GL_Parameter_Zoo.py b/util/test/tests/GL/GL_Parameter_Zoo.py index 7efad7b69..5cad376d3 100644 --- a/util/test/tests/GL/GL_Parameter_Zoo.py +++ b/util/test/tests/GL/GL_Parameter_Zoo.py @@ -9,11 +9,11 @@ class GL_Parameter_Zoo(rdtest.TestCase): demos_frame_cap = 6 def check_capture(self): - id = self.get_last_draw().copyDestination + id = self.get_last_action().copyDestination tex_details = self.get_texture(id) - self.controller.SetFrameEvent(self.get_last_draw().eventId, True) + self.controller.SetFrameEvent(self.get_last_action().eventId, True) data = self.controller.GetTextureData(id, rd.Subresource(0, 0, 0)) first_pixel = struct.unpack_from("BBBB", data, 0) @@ -33,7 +33,7 @@ class GL_Parameter_Zoo(rdtest.TestCase): img_path = rdtest.get_tmp_path('preserved_alpha.png') - self.controller.SetFrameEvent(self.get_last_draw().eventId, True) + self.controller.SetFrameEvent(self.get_last_action().eventId, True) save_data = rd.TextureSave() save_data.resourceId = id @@ -50,11 +50,11 @@ class GL_Parameter_Zoo(rdtest.TestCase): if not rdtest.value_compare(magic_pixel, val) or magic_pixel[3] not in [127, 128]: raise rdtest.TestFailureException("Pixel @ 320,50 should be blue: {}, not {}".format(val, magic_pixel)) - draw = self.find_draw("Draw") + action = self.find_action("Draw") - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) - postvs_data = self.get_postvs(draw, rd.MeshDataStage.VSOut, 0, draw.numIndices) + postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, action.numIndices) postvs_ref = { 0: { @@ -81,7 +81,7 @@ class GL_Parameter_Zoo(rdtest.TestCase): results = self.controller.FetchCounters([rd.GPUCounter.RasterizedPrimitives, rd.GPUCounter.VSInvocations, rd.GPUCounter.FSInvocations]) - results = [r for r in results if r.eventId == draw.eventId] + results = [r for r in results if r.eventId == action.eventId] if len(results) != 3: raise rdtest.TestFailureException("Expected 3 results, got {} results".format(len(results))) @@ -109,10 +109,10 @@ class GL_Parameter_Zoo(rdtest.TestCase): rdtest.log.success("Counter data retrieved successfully") - draw = self.find_draw("NoScissor") + action = self.find_action("NoScissor") - self.check(draw is not None) - draw = draw.next + self.check(action is not None) + action = action.next pipe: rd.PipeState = self.controller.GetPipelineState() tex = rd.TextureDisplay() diff --git a/util/test/tests/GL/GL_Per_Type_Tex_Units.py b/util/test/tests/GL/GL_Per_Type_Tex_Units.py index dc7d45e87..5e0c67fa3 100644 --- a/util/test/tests/GL/GL_Per_Type_Tex_Units.py +++ b/util/test/tests/GL/GL_Per_Type_Tex_Units.py @@ -8,9 +8,9 @@ class GL_Per_Type_Tex_Units(rdtest.TestCase): demos_test_name = 'GL_Per_Type_Tex_Units' def check_capture(self): - draw = self.find_draw("Draw") + action = self.find_action("Draw") - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() diff --git a/util/test/tests/GL/GL_Queries_In_Use.py b/util/test/tests/GL/GL_Queries_In_Use.py index 9e956fd7b..a6087ba4a 100644 --- a/util/test/tests/GL/GL_Queries_In_Use.py +++ b/util/test/tests/GL/GL_Queries_In_Use.py @@ -6,17 +6,17 @@ class GL_Queries_In_Use(rdtest.TestCase): demos_test_name = 'GL_Queries_In_Use' def check_capture(self): - last_draw: rd.DrawcallDescription = self.get_last_draw() + last_action: rd.ActionDescription = self.get_last_action() - self.controller.SetFrameEvent(last_draw.eventId, True) + self.controller.SetFrameEvent(last_action.eventId, True) - tex_details = self.get_texture(last_draw.copyDestination) + tex_details = self.get_texture(last_action.copyDestination) - draw = self.find_draw("XFB Draw").next + action = self.find_action("XFB Draw").next - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) - postvs_data = self.get_postvs(draw, rd.MeshDataStage.VSOut, 0, draw.numIndices) + postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, action.numIndices) postvs_ref = { 0: { @@ -49,9 +49,9 @@ class GL_Queries_In_Use(rdtest.TestCase): results = self.controller.FetchCounters([rd.GPUCounter.RasterizedPrimitives, rd.GPUCounter.VSInvocations, rd.GPUCounter.FSInvocations]) - draw = self.find_draw("Counters Draw").next + action = self.find_action("Counters Draw").next - results = [r for r in results if r.eventId == draw.eventId] + results = [r for r in results if r.eventId == action.eventId] if len(results) != 3: raise rdtest.TestFailureException("Expected 3 results, got {} results".format(len(results))) diff --git a/util/test/tests/GL/GL_Renderbuffer_Zoo.py b/util/test/tests/GL/GL_Renderbuffer_Zoo.py index 0e599c435..515537278 100644 --- a/util/test/tests/GL/GL_Renderbuffer_Zoo.py +++ b/util/test/tests/GL/GL_Renderbuffer_Zoo.py @@ -6,10 +6,10 @@ class GL_Renderbuffer_Zoo(rdtest.TestCase): demos_test_name = 'GL_Renderbuffer_Zoo' def check_capture(self): - draw: rd.DrawcallDescription = self.find_draw('glDraw') + action: rd.ActionDescription = self.find_action('glDraw') - while draw is not None: - self.controller.SetFrameEvent(draw.eventId, True) + while action is not None: + self.controller.SetFrameEvent(action.eventId, True) self.check_triangle(fore=[0.2, 0.75, 0.2, 1.0]) @@ -36,7 +36,7 @@ class GL_Renderbuffer_Zoo(rdtest.TestCase): raise rdtest.TestFailureException( "Green histogram didn't return expected values, values should have landed in first or last bucket") - rdtest.log.success('Color Renderbuffer at draw {} is working as expected'.format(draw.eventId)) + rdtest.log.success('Color Renderbuffer at action {} is working as expected'.format(action.eventId)) if depth.resourceId != rd.ResourceId(): val = self.controller.PickPixel(depth.resourceId, int(0.5 * vp.width), int(0.5 * vp.height), @@ -62,7 +62,7 @@ class GL_Renderbuffer_Zoo(rdtest.TestCase): raise rdtest.TestFailureException( "Depth histogram didn't return expected values, values should have landed in first or last bucket") - rdtest.log.success('Depth Renderbuffer at draw {} is working as expected'.format(draw.eventId)) + rdtest.log.success('Depth Renderbuffer at action {} is working as expected'.format(action.eventId)) tex_details = self.get_texture(id) @@ -93,6 +93,6 @@ class GL_Renderbuffer_Zoo(rdtest.TestCase): raise rdtest.TestFailureException("Two MSAA samples returned the same data", img_path0, img_path1) - draw: rd.DrawcallDescription = self.find_draw('glDraw', draw.eventId+1) + action: rd.ActionDescription = self.find_action('glDraw', action.eventId+1) rdtest.log.success('All renderbuffers checked and rendered correctly') diff --git a/util/test/tests/GL/GL_Resource_Lifetimes.py b/util/test/tests/GL/GL_Resource_Lifetimes.py index bb9ac0fbf..8849475ba 100644 --- a/util/test/tests/GL/GL_Resource_Lifetimes.py +++ b/util/test/tests/GL/GL_Resource_Lifetimes.py @@ -7,9 +7,9 @@ class GL_Resource_Lifetimes(rdtest.TestCase): demos_frame_cap = 200 def check_capture(self): - draw: rd.DrawcallDescription = self.find_draw("glDraw") + action: rd.ActionDescription = self.find_action("glDraw") - self.controller.SetFrameEvent(draw.eventId, True) + self.controller.SetFrameEvent(action.eventId, True) mapping: rd.ShaderBindpointMapping = self.controller.GetPipelineState().GetBindpointMapping(rd.ShaderStage.Vertex) self.check(mapping.readWriteResources[0].bind == 3) @@ -17,9 +17,9 @@ class GL_Resource_Lifetimes(rdtest.TestCase): mapping: rd.ShaderBindpointMapping = self.controller.GetPipelineState().GetBindpointMapping(rd.ShaderStage.Pixel) self.check(mapping.readWriteResources[0].bind == 3) - draw: rd.DrawcallDescription = self.find_draw("glDraw", draw.eventId+1) + action: rd.ActionDescription = self.find_action("glDraw", action.eventId+1) - self.controller.SetFrameEvent(draw.eventId, True) + self.controller.SetFrameEvent(action.eventId, True) mapping: rd.ShaderBindpointMapping = self.controller.GetPipelineState().GetBindpointMapping(rd.ShaderStage.Vertex) self.check(mapping.readWriteResources[0].bind == 3) @@ -27,11 +27,11 @@ class GL_Resource_Lifetimes(rdtest.TestCase): mapping: rd.ShaderBindpointMapping = self.controller.GetPipelineState().GetBindpointMapping(rd.ShaderStage.Pixel) self.check(mapping.readWriteResources[0].bind == 3) - last_draw: rd.DrawcallDescription = self.get_last_draw() + last_action: rd.ActionDescription = self.get_last_action() - self.controller.SetFrameEvent(last_draw.eventId, True) + self.controller.SetFrameEvent(last_action.eventId, True) - tex = last_draw.copyDestination + tex = last_action.copyDestination # green background around first triangle, blue around second self.check_pixel_value(tex, 10, 10, [0.0, 1.0, 0.0, 1.0]) diff --git a/util/test/tests/GL/GL_Separable_Geometry_Shaders.py b/util/test/tests/GL/GL_Separable_Geometry_Shaders.py index de011ce6b..9a1908c2d 100644 --- a/util/test/tests/GL/GL_Separable_Geometry_Shaders.py +++ b/util/test/tests/GL/GL_Separable_Geometry_Shaders.py @@ -6,11 +6,11 @@ class GL_Separable_Geometry_Shaders(rdtest.TestCase): demos_test_name = 'GL_Separable_Geometry_Shaders' def check_capture(self): - draw = self.find_draw("Draw") + action = self.find_action("Draw") - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) - postvs_data = self.get_postvs(draw, rd.MeshDataStage.VSOut, 0, draw.numIndices) + postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, action.numIndices) postvs_ref = { 0: { @@ -38,7 +38,7 @@ class GL_Separable_Geometry_Shaders(rdtest.TestCase): self.check_mesh_data(postvs_ref, postvs_data) - postgs_data = self.get_postvs(draw, rd.MeshDataStage.GSOut, 0, draw.numIndices*3) + postgs_data = self.get_postvs(action, rd.MeshDataStage.GSOut, 0, action.numIndices*3) postgs_ref = { 0: { diff --git a/util/test/tests/GL/GL_Shader_Editing.py b/util/test/tests/GL/GL_Shader_Editing.py index 79f537128..1b2d905e6 100644 --- a/util/test/tests/GL/GL_Shader_Editing.py +++ b/util/test/tests/GL/GL_Shader_Editing.py @@ -8,14 +8,14 @@ class GL_Shader_Editing(rdtest.TestCase): demos_test_name = 'GL_Shader_Editing' def check_capture(self): - eid = self.find_draw("fixedprog").eventId + eid = self.find_action("fixedprog").eventId self.controller.SetFrameEvent(eid, False) pipe: rd.PipeState = self.controller.GetPipelineState() fixedrefl: rd.ShaderReflection = pipe.GetShaderReflection(rd.ShaderStage.Fragment) - eid = self.find_draw("dynamicprog").eventId + eid = self.find_action("dynamicprog").eventId self.controller.SetFrameEvent(eid, False) pipe: rd.PipeState = self.controller.GetPipelineState() @@ -23,14 +23,14 @@ class GL_Shader_Editing(rdtest.TestCase): dynamicrefl: rd.ShaderReflection = pipe.GetShaderReflection(rd.ShaderStage.Fragment) vsrefl: rd.ShaderReflection = pipe.GetShaderReflection(rd.ShaderStage.Vertex) - eid = self.find_draw("sepprog").eventId + eid = self.find_action("sepprog").eventId self.controller.SetFrameEvent(eid, False) vsseprefl: rd.ShaderReflection = pipe.GetShaderReflection(rd.ShaderStage.Vertex) fsseprefl: rd.ShaderReflection = pipe.GetShaderReflection(rd.ShaderStage.Fragment) - # Work at the last draw, where the uniforms have been trashed - self.controller.SetFrameEvent(self.get_last_draw().eventId, False) + # Work at the last action, where the uniforms have been trashed + self.controller.SetFrameEvent(self.get_last_action().eventId, False) tex: rd.ResourceId = pipe.GetOutputTargets()[0].resourceId @@ -119,7 +119,7 @@ class GL_Shader_Editing(rdtest.TestCase): self.controller.ReplaceResource(dynamicrefl.resourceId, dynamicFS) # Refresh the replay if it didn't happen already - self.controller.SetFrameEvent(self.get_last_draw().eventId, True) + self.controller.SetFrameEvent(self.get_last_action().eventId, True) # Triangles have green propagated across to the blue channel self.check_pixel_value(tex, 0.25, 0.25, [0.0, 1.0, 1.0, 1.0]) @@ -130,7 +130,7 @@ class GL_Shader_Editing(rdtest.TestCase): # Now "edit" the VS but don't change it. We should still get the same values self.controller.ReplaceResource(vsrefl.resourceId, nochangeVS) - self.controller.SetFrameEvent(self.get_last_draw().eventId, True) + self.controller.SetFrameEvent(self.get_last_action().eventId, True) # Triangles have green propagated across to the blue channel self.check_pixel_value(tex, 0.25, 0.25, [0.0, 1.0, 1.0, 1.0]) @@ -141,7 +141,7 @@ class GL_Shader_Editing(rdtest.TestCase): # Change the VS to one that has offset the triangles off-centre self.controller.ReplaceResource(vsrefl.resourceId, offsetVS) - self.controller.SetFrameEvent(self.get_last_draw().eventId, True) + self.controller.SetFrameEvent(self.get_last_action().eventId, True) # Original sample positions are now the clear color self.check_pixel_value(tex, 0.25, 0.25, [0.2, 0.2, 0.2, 1.0]) @@ -157,7 +157,7 @@ class GL_Shader_Editing(rdtest.TestCase): # Now undo the first FS edit self.controller.RemoveReplacement(fixedrefl.resourceId) - self.controller.SetFrameEvent(self.get_last_draw().eventId, True) + self.controller.SetFrameEvent(self.get_last_action().eventId, True) # Original sample positions are still the clear color self.check_pixel_value(tex, 0.25, 0.25, [0.2, 0.2, 0.2, 1.0]) @@ -173,7 +173,7 @@ class GL_Shader_Editing(rdtest.TestCase): # Now undo the first VS edit self.controller.RemoveReplacement(vsrefl.resourceId) - self.controller.SetFrameEvent(self.get_last_draw().eventId, True) + self.controller.SetFrameEvent(self.get_last_action().eventId, True) # Only the lower triangle is the edited colour, but they are back in the original positions self.check_pixel_value(tex, 0.25, 0.25, [0.0, 1.0, 0.0, 1.0]) @@ -184,7 +184,7 @@ class GL_Shader_Editing(rdtest.TestCase): # finally undo the second FS edit self.controller.RemoveReplacement(dynamicrefl.resourceId) - self.controller.SetFrameEvent(self.get_last_draw().eventId, True) + self.controller.SetFrameEvent(self.get_last_action().eventId, True) # We should be back to where we started self.check_pixel_value(tex, 0.25, 0.25, [0.0, 1.0, 0.0, 1.0]) @@ -201,27 +201,27 @@ class GL_Shader_Editing(rdtest.TestCase): self.check_pixel_value(tex, 0.75, 0.75, [0.0, 1.0, 0.0, 1.0]) self.controller.ReplaceResource(fsseprefl.resourceId, sepFS) - self.controller.SetFrameEvent(self.get_last_draw().eventId, True) + self.controller.SetFrameEvent(self.get_last_action().eventId, True) # Now it should be green-blue self.check_pixel_value(tex, 0.75, 0.75, [0.0, 1.0, 1.0, 1.0]) self.controller.ReplaceResource(vsseprefl.resourceId, sepVS) - self.controller.SetFrameEvent(self.get_last_draw().eventId, True) + self.controller.SetFrameEvent(self.get_last_action().eventId, True) # Now it should be green-blue and offset self.check_pixel_value(tex, 0.75, 0.75, [0.2, 0.2, 0.2, 1.0]) self.check_pixel_value(tex, 0.95, 0.55, [0.0, 1.0, 1.0, 1.0]) self.controller.RemoveReplacement(fsseprefl.resourceId) - self.controller.SetFrameEvent(self.get_last_draw().eventId, True) + self.controller.SetFrameEvent(self.get_last_action().eventId, True) # Now it should be back to green and offset self.check_pixel_value(tex, 0.75, 0.75, [0.2, 0.2, 0.2, 1.0]) self.check_pixel_value(tex, 0.95, 0.55, [0.0, 1.0, 0.0, 1.0]) self.controller.RemoveReplacement(vsseprefl.resourceId) - self.controller.SetFrameEvent(self.get_last_draw().eventId, True) + self.controller.SetFrameEvent(self.get_last_action().eventId, True) # We should be back to where we started self.check_pixel_value(tex, 0.75, 0.75, [0.0, 1.0, 0.0, 1.0]) diff --git a/util/test/tests/GL/GL_Shader_ISA.py b/util/test/tests/GL/GL_Shader_ISA.py index d8a58a97d..c697e3c80 100644 --- a/util/test/tests/GL/GL_Shader_ISA.py +++ b/util/test/tests/GL/GL_Shader_ISA.py @@ -7,13 +7,13 @@ class GL_Shader_ISA(rdtest.TestCase): demos_test_name = 'GL_Shader_ISA' def check_capture(self): - draw = self.find_draw("GPU=") + action = self.find_action("GPU=") - self.check(draw is not None) + self.check(action is not None) - is_amd = 'AMD' in draw.name + is_amd = 'AMD' in action.name - self.controller.SetFrameEvent(draw.next.eventId, False) + self.controller.SetFrameEvent(action.next.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() diff --git a/util/test/tests/GL/GL_Simple_Triangle.py b/util/test/tests/GL/GL_Simple_Triangle.py index d7ac3f72c..be3b5ff4a 100644 --- a/util/test/tests/GL/GL_Simple_Triangle.py +++ b/util/test/tests/GL/GL_Simple_Triangle.py @@ -6,19 +6,19 @@ class GL_Simple_Triangle(rdtest.TestCase): demos_test_name = 'GL_Simple_Triangle' def check_capture(self): - last_draw: rd.DrawcallDescription = self.get_last_draw() + last_action: rd.ActionDescription = self.get_last_action() - self.controller.SetFrameEvent(last_draw.eventId, True) + self.controller.SetFrameEvent(last_action.eventId, True) - self.check_triangle(out=last_draw.copyDestination) + self.check_triangle(out=last_action.copyDestination) self.check_export(self.capture_filename) - draw = self.find_draw("Draw") + action = self.find_action("Draw") - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) - postvs_data = self.get_postvs(draw, rd.MeshDataStage.VSOut, 0, draw.numIndices) + postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, action.numIndices) postvs_ref = { 0: { diff --git a/util/test/tests/GL/GL_State_Trashing.py b/util/test/tests/GL/GL_State_Trashing.py index c5b6af78f..822d985cf 100644 --- a/util/test/tests/GL/GL_State_Trashing.py +++ b/util/test/tests/GL/GL_State_Trashing.py @@ -6,17 +6,17 @@ class GL_State_Trashing(rdtest.TestCase): demos_test_name = 'GL_State_Trashing' def check_capture(self): - last_draw: rd.DrawcallDescription = self.get_last_draw() + last_action: rd.ActionDescription = self.get_last_action() - self.controller.SetFrameEvent(last_draw.eventId, True) + self.controller.SetFrameEvent(last_action.eventId, True) - self.check_triangle(out=last_draw.copyDestination) + self.check_triangle(out=last_action.copyDestination) - draw = self.find_draw("Draw") + action = self.find_action("Draw") - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) - postvs_data = self.get_postvs(draw, rd.MeshDataStage.VSOut, 0, draw.numIndices) + postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, action.numIndices) postvs_ref = { 0: { diff --git a/util/test/tests/GL/GL_Unshared_Context.py b/util/test/tests/GL/GL_Unshared_Context.py index e42883440..ac3703700 100644 --- a/util/test/tests/GL/GL_Unshared_Context.py +++ b/util/test/tests/GL/GL_Unshared_Context.py @@ -7,9 +7,9 @@ class GL_Unshared_Context(rdtest.TestCase): def check_capture(self): - draw = self.find_draw("Draw") + action = self.find_action("Draw") - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() diff --git a/util/test/tests/GL/GL_VAO_0.py b/util/test/tests/GL/GL_VAO_0.py index 45223e3bd..0209215aa 100644 --- a/util/test/tests/GL/GL_VAO_0.py +++ b/util/test/tests/GL/GL_VAO_0.py @@ -6,20 +6,20 @@ class GL_VAO_0(rdtest.TestCase): demos_test_name = 'GL_VAO_0' def check_capture(self): - draw = self.find_draw("Draw") + action = self.find_action("Draw") - # There are 4 draws with variations on client-memory VBs or IBs + # There are 4 actions with variations on client-memory VBs or IBs for i in range(0, 4): - self.check(draw is not None) + self.check(action is not None) - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() vp: rd.Viewport = pipe.GetViewport(0) self.check_triangle(vp=(vp.x, vp.y, vp.width, vp.height)) - postvs_data = self.get_postvs(draw, rd.MeshDataStage.VSOut, 0, draw.numIndices) + postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, action.numIndices) postvs_ref = { 0: { @@ -50,17 +50,17 @@ class GL_VAO_0(rdtest.TestCase): self.check_mesh_data(postvs_ref, postvs_data) - draw = draw.next + action = action.next - draw = self.find_draw("Instanced") + action = self.find_action("Instanced") - self.check(draw is not None) + self.check(action is not None) - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) # Each instance should have color output of 0.5 * instance in blue - for i in range(0, draw.numInstances): - postvs_data = self.get_postvs(draw, rd.MeshDataStage.VSOut, 0, draw.numIndices, i) + for i in range(0, action.numInstances): + postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, action.numIndices, i) postvs_ref = { 0: { diff --git a/util/test/tests/GL/GL_Vertex_Attr_Zoo.py b/util/test/tests/GL/GL_Vertex_Attr_Zoo.py index c4376c980..cfef07e61 100644 --- a/util/test/tests/GL/GL_Vertex_Attr_Zoo.py +++ b/util/test/tests/GL/GL_Vertex_Attr_Zoo.py @@ -7,11 +7,11 @@ class GL_Vertex_Attr_Zoo(rdtest.TestCase): demos_test_name = 'GL_Vertex_Attr_Zoo' def check_capture(self): - draw = self.find_draw("Draw") + action = self.find_action("Draw") - self.check(draw is not None) + self.check(action is not None) - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) ref = { 0: { @@ -75,14 +75,14 @@ class GL_Vertex_Attr_Zoo(rdtest.TestCase): vsout_ref[2]['gl_Position'] = [0.5, 0.5, 0.0, 1.0] gsout_ref[2]['gl_Position'] = [0.5, 0.5, 0.4, 1.2] - self.check_mesh_data(in_ref, self.get_vsin(draw)) + self.check_mesh_data(in_ref, self.get_vsin(action)) rdtest.log.success("Vertex input data is as expected") - self.check_mesh_data(vsout_ref, self.get_postvs(draw, rd.MeshDataStage.VSOut)) + self.check_mesh_data(vsout_ref, self.get_postvs(action, rd.MeshDataStage.VSOut)) rdtest.log.success("Vertex output data is as expected") - self.check_mesh_data(gsout_ref, self.get_postvs(draw, rd.MeshDataStage.GSOut)) + self.check_mesh_data(gsout_ref, self.get_postvs(action, rd.MeshDataStage.GSOut)) rdtest.log.success("Geometry output data is as expected") diff --git a/util/test/tests/Iter_Test.py b/util/test/tests/Iter_Test.py index 384bbf8a4..b6dd6d6cb 100644 --- a/util/test/tests/Iter_Test.py +++ b/util/test/tests/Iter_Test.py @@ -33,7 +33,7 @@ class Iter_Test(rdtest.TestCase): texsave.destType = rd.FileType.DDS self.controller.SaveTexture(texsave, filename + ".dds") - def image_save(self, draw: rd.DrawcallDescription): + def image_save(self, action: rd.ActionDescription): pipe: rd.PipeState = self.controller.GetPipelineState() texsave = rd.TextureSave() @@ -48,46 +48,46 @@ class Iter_Test(rdtest.TestCase): texsave.mip = depth.firstMip self.save_texture(texsave) - rdtest.log.success('Successfully saved images at {}: {}'.format(draw.eventId, draw.name)) + rdtest.log.success('Successfully saved images at {}: {}'.format(action.eventId, action.name)) - def vert_debug(self, draw: rd.DrawcallDescription): + def vert_debug(self, action: rd.ActionDescription): pipe: rd.PipeState = self.controller.GetPipelineState() refl: rd.ShaderReflection = pipe.GetShaderReflection(rd.ShaderStage.Vertex) if pipe.GetShader(rd.ShaderStage.Vertex) == rd.ResourceId.Null(): - rdtest.log.print("No vertex shader bound at {}: {}".format(draw.eventId, draw.name)) + rdtest.log.print("No vertex shader bound at {}: {}".format(action.eventId, action.name)) return - if not (draw.flags & rd.DrawFlags.Drawcall): - rdtest.log.print("{}: {} is not a debuggable drawcall".format(draw.eventId, draw.name)) + if not (action.flags & rd.ActionFlags.Drawcall): + rdtest.log.print("{}: {} is not a debuggable action".format(action.eventId, action.name)) return - vtx = int(random.random()*draw.numIndices) + vtx = int(random.random()*action.numIndices) inst = 0 idx = vtx - if draw.numIndices == 0: - rdtest.log.print("Empty drawcall (0 vertices), skipping") + if action.numIndices == 0: + rdtest.log.print("Empty action (0 vertices), skipping") return - if draw.flags & rd.DrawFlags.Instanced: - inst = int(random.random()*draw.numInstances) - if draw.numInstances == 0: - rdtest.log.print("Empty drawcall (0 instances), skipping") + if action.flags & rd.ActionFlags.Instanced: + inst = int(random.random()*action.numInstances) + if action.numInstances == 0: + rdtest.log.print("Empty action (0 instances), skipping") return - if draw.flags & rd.DrawFlags.Indexed: + if action.flags & rd.ActionFlags.Indexed: ib = pipe.GetIBuffer() mesh = rd.MeshFormat() mesh.indexResourceId = ib.resourceId mesh.indexByteStride = ib.byteStride - mesh.indexByteOffset = ib.byteOffset + draw.indexOffset * ib.byteStride + mesh.indexByteOffset = ib.byteOffset + action.indexOffset * ib.byteStride mesh.indexByteSize = ib.byteSize - mesh.baseVertex = draw.baseVertex + mesh.baseVertex = action.baseVertex - indices = rdtest.fetch_indices(self.controller, draw, mesh, 0, vtx, 1) + indices = rdtest.fetch_indices(self.controller, action, mesh, 0, vtx, 1) if len(indices) < 1: rdtest.log.print("No index buffer, skipping") @@ -102,7 +102,7 @@ class Iter_Test(rdtest.TestCase): rdtest.log.print("Debugging vtx %d idx %d (inst %d)" % (vtx, idx, inst)) - postvs = self.get_postvs(draw, rd.MeshDataStage.VSOut, first_index=vtx, num_indices=1, instance=inst) + postvs = self.get_postvs(action, rd.MeshDataStage.VSOut, first_index=vtx, num_indices=1, instance=inst) trace: rd.ShaderDebugTrace = self.controller.DebugVertex(vtx, inst, idx, 0) @@ -130,7 +130,7 @@ class Iter_Test(rdtest.TestCase): if len(expect) != value.columns: raise rdtest.TestFailureException( "Output {} at EID {} has different size ({} values) to expectation ({} values)" - .format(name, draw.eventId, value.columns, len(expect))) + .format(name, action.eventId, value.columns, len(expect))) compType = rd.VarTypeCompType(value.type) if compType == rd.CompType.UInt: @@ -153,7 +153,7 @@ class Iter_Test(rdtest.TestCase): if not is_eq: rdtest.log.error( "Debugged value {} at EID {} vert {} (idx {}) instance {}: {} difference. {} doesn't exactly match postvs output {}".format( - name, draw.eventId, vtx, idx, inst, diff_amt, debugged, expect)) + name, action.eventId, vtx, idx, inst, diff_amt, debugged, expect)) outputs = outputs + 1 @@ -162,24 +162,24 @@ class Iter_Test(rdtest.TestCase): self.controller.FreeTrace(trace) - def pixel_debug(self, draw: rd.DrawcallDescription): + def pixel_debug(self, action: rd.ActionDescription): pipe: rd.PipeState = self.controller.GetPipelineState() if pipe.GetShader(rd.ShaderStage.Pixel) == rd.ResourceId.Null(): - rdtest.log.print("No pixel shader bound at {}: {}".format(draw.eventId, draw.name)) + rdtest.log.print("No pixel shader bound at {}: {}".format(action.eventId, action.name)) return if len(pipe.GetOutputTargets()) == 0 and pipe.GetDepthTarget().resourceId == rd.ResourceId.Null(): - rdtest.log.print("No render targets bound at {}: {}".format(draw.eventId, draw.name)) + rdtest.log.print("No render targets bound at {}: {}".format(action.eventId, action.name)) return - if not (draw.flags & rd.DrawFlags.Drawcall): - rdtest.log.print("{}: {} is not a debuggable drawcall".format(draw.eventId, draw.name)) + if not (action.flags & rd.ActionFlags.Drawcall): + rdtest.log.print("{}: {} is not a debuggable action".format(action.eventId, action.name)) return viewport = pipe.GetViewport(0) - # TODO, query for some pixel this drawcall actually touched. + # TODO, query for some pixel this action actually touched. x = int(random.random()*viewport.width + viewport.x) y = int(random.random()*viewport.height + viewport.y) @@ -187,7 +187,7 @@ class Iter_Test(rdtest.TestCase): if len(pipe.GetOutputTargets()) > 0: valid_targets = [o.resourceId for o in pipe.GetOutputTargets() if o.resourceId != rd.ResourceId.Null()] - rdtest.log.print("Valid targets at {} are {}".format(draw.eventId, valid_targets)) + rdtest.log.print("Valid targets at {} are {}".format(action.eventId, valid_targets)) if len(valid_targets) > 0: target = valid_targets[int(random.random()*len(valid_targets))] @@ -195,7 +195,7 @@ class Iter_Test(rdtest.TestCase): target = pipe.GetDepthTarget().resourceId if target == rd.ResourceId.Null(): - rdtest.log.print("No targets bound! Can't fetch history at {}".format(draw.eventId)) + rdtest.log.print("No targets bound! Can't fetch history at {}".format(action.eventId)) return rdtest.log.print("Fetching history for %d,%d on target %s" % (x, y, str(target))) @@ -208,16 +208,16 @@ class Iter_Test(rdtest.TestCase): for i in reversed(range(len(history))): mod = history[i] - draw = self.find_draw('', mod.eventId) + action = self.find_action('', mod.eventId) - if draw is None or not (draw.flags & rd.DrawFlags.Drawcall): + if action is None or not (action.flags & rd.ActionFlags.Drawcall): continue - rdtest.log.print(" hit %d at %d is %s (%s)" % (i, mod.eventId, draw.name, str(draw.flags))) + rdtest.log.print(" hit %d at %d is %s (%s)" % (i, mod.eventId, action.name, str(action.flags))) lastmod = history[i] - rdtest.log.print("Got a hit on a drawcall at event %d" % lastmod.eventId) + rdtest.log.print("Got a hit on a action at event %d" % lastmod.eventId) if mod.sampleMasked or mod.backfaceCulled or mod.depthClipped or mod.viewClipped or mod.scissorClipped or mod.shaderDiscarded or mod.depthTestFailed or mod.stencilTestFailed: rdtest.log.print("This hit failed, looking for one that passed....") @@ -253,10 +253,10 @@ class Iter_Test(rdtest.TestCase): output_index = [o.resourceId for o in pipe.GetOutputTargets()].index(target) - if draw.outputs[0] == rd.ResourceId.Null(): + if action.outputs[0] == rd.ResourceId.Null(): rdtest.log.success('Successfully debugged pixel in {} cycles, skipping result check due to no output'.format(cycles)) self.controller.FreeTrace(trace) - elif (draw.flags & rd.DrawFlags.Instanced) and draw.numInstances > 1: + elif (action.flags & rd.ActionFlags.Instanced) and action.numInstances > 1: rdtest.log.success('Successfully debugged pixel in {} cycles, skipping result check due to instancing'.format(cycles)) self.controller.FreeTrace(trace) elif pipe.GetColorBlends()[output_index].writeMask == 0: @@ -294,7 +294,7 @@ class Iter_Test(rdtest.TestCase): # This could be an application error - undefined but seen in the wild rdtest.log.error("At EID {} No output variable declared for index {}".format(lastmod.eventId, output_index)) - self.controller.SetFrameEvent(draw.eventId, True) + self.controller.SetFrameEvent(action.eventId, True) def iter_test(self): # Handy tweaks when running locally to disable certain things @@ -318,13 +318,13 @@ class Iter_Test(rdtest.TestCase): for action in actions: choice_max += actions[action]['chance'] - draw = self.get_first_draw() - last_draw = self.get_last_draw() + action = self.get_first_action() + last_action = self.get_last_action() - while draw: - rdtest.log.print("{}/{} - {}".format(draw.eventId, last_draw.eventId, draw.name)) + while action: + rdtest.log.print("{}/{} - {}".format(action.eventId, last_action.eventId, action.name)) - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) rdtest.log.print("Set event") @@ -336,12 +336,12 @@ class Iter_Test(rdtest.TestCase): chance = actions[action]['chance'] if c < chance: rdtest.log.print("Performing action '{}'".format(action)) - actions[action]['func'](draw) + actions[action]['func'](action) break else: c -= chance - draw = draw.next + action = action.next def run(self): dir_path = self.get_ref_path('', extra=True) diff --git a/util/test/tests/Vulkan/VK_Adv_CBuffer_Zoo.py b/util/test/tests/Vulkan/VK_Adv_CBuffer_Zoo.py index dae111476..40dbdf927 100644 --- a/util/test/tests/Vulkan/VK_Adv_CBuffer_Zoo.py +++ b/util/test/tests/Vulkan/VK_Adv_CBuffer_Zoo.py @@ -6,11 +6,11 @@ class VK_Adv_CBuffer_Zoo(rdtest.TestCase): demos_test_name = 'VK_Adv_CBuffer_Zoo' def check_capture(self): - draw = self.find_draw("Draw") + action = self.find_action("Draw") - self.check(draw is not None) + self.check(action is not None) - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() diff --git a/util/test/tests/Vulkan/VK_CBuffer_Zoo.py b/util/test/tests/Vulkan/VK_CBuffer_Zoo.py index 264974c6f..18cf8558d 100644 --- a/util/test/tests/Vulkan/VK_CBuffer_Zoo.py +++ b/util/test/tests/Vulkan/VK_CBuffer_Zoo.py @@ -6,11 +6,11 @@ class VK_CBuffer_Zoo(rdtest.TestCase): demos_test_name = 'VK_CBuffer_Zoo' def check_capture(self): - draw = self.find_draw("Draw") + action = self.find_action("Draw") - self.check(draw is not None) + self.check(action is not None) - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) props: rd.APIProperties = self.controller.GetAPIProperties() @@ -18,7 +18,7 @@ class VK_CBuffer_Zoo(rdtest.TestCase): stage = rd.ShaderStage.Pixel - # Verify that the GLSL draw is first + # Verify that the GLSL action is first disasm = self.controller.DisassembleShader(pipe.GetGraphicsPipelineObject(), pipe.GetShaderReflection(stage), '') @@ -77,16 +77,16 @@ class VK_CBuffer_Zoo(rdtest.TestCase): rdtest.log.success("Specialization constants are as expected") - # Move to the HLSL draw - draw = draw.next + # Move to the HLSL action + action = action.next - self.check(draw is not None) + self.check(action is not None) - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() - # Verify that this is the HLSL draw + # Verify that this is the HLSL action disasm = self.controller.DisassembleShader(pipe.GetGraphicsPipelineObject(), pipe.GetShaderReflection(stage), '') diff --git a/util/test/tests/Vulkan/VK_Dedicated_Allocation.py b/util/test/tests/Vulkan/VK_Dedicated_Allocation.py index 9793abf06..c06da5455 100644 --- a/util/test/tests/Vulkan/VK_Dedicated_Allocation.py +++ b/util/test/tests/Vulkan/VK_Dedicated_Allocation.py @@ -6,11 +6,11 @@ class VK_Dedicated_Allocation(rdtest.TestCase): demos_test_name = 'VK_Dedicated_Allocation' def check_capture(self): - draw = self.find_draw("Draw") + action = self.find_action("Draw") - self.controller.SetFrameEvent(draw.eventId, True) + self.controller.SetFrameEvent(action.eventId, True) - postvs_data = self.get_postvs(draw, rd.MeshDataStage.VSOut, 0, draw.numIndices) + postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, action.numIndices) postvs_ref = { 0: { diff --git a/util/test/tests/Vulkan/VK_Descriptor_Indexing.py b/util/test/tests/Vulkan/VK_Descriptor_Indexing.py index 5b1dca2d1..c6d59d1a6 100644 --- a/util/test/tests/Vulkan/VK_Descriptor_Indexing.py +++ b/util/test/tests/Vulkan/VK_Descriptor_Indexing.py @@ -7,9 +7,9 @@ class VK_Descriptor_Indexing(rdtest.TestCase): def check_capture(self): - draw = self.find_draw("Dispatch") - self.check(draw is not None) - self.controller.SetFrameEvent(draw.eventId, False) + action = self.find_action("Dispatch") + self.check(action is not None) + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.VKState = self.controller.GetVulkanPipelineState() @@ -26,9 +26,9 @@ class VK_Descriptor_Indexing(rdtest.TestCase): if not binding.binds[15].dynamicallyUsed: raise rdtest.TestFailureException("Compute bind 0[15] isn't dynamically used") - draw = self.find_draw("Draw") - self.check(draw is not None) - self.controller.SetFrameEvent(draw.eventId, False) + action = self.find_action("Draw") + self.check(action is not None) + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.VKState = self.controller.GetVulkanPipelineState() diff --git a/util/test/tests/Vulkan/VK_Descriptor_Reuse.py b/util/test/tests/Vulkan/VK_Descriptor_Reuse.py index 61d773111..b2eb8cdc8 100644 --- a/util/test/tests/Vulkan/VK_Descriptor_Reuse.py +++ b/util/test/tests/Vulkan/VK_Descriptor_Reuse.py @@ -8,13 +8,13 @@ class VK_Descriptor_Reuse(rdtest.TestCase): demos_frame_cap = 100 def check_capture(self): - last_draw: rd.DrawcallDescription = self.get_last_draw() + last_action: rd.ActionDescription = self.get_last_action() - self.controller.SetFrameEvent(last_draw.eventId, True) + self.controller.SetFrameEvent(last_action.eventId, True) - draw: rd.DrawcallDescription = self.find_draw('Duration') + action: rd.ActionDescription = self.find_action('Duration') - min_duration = float(draw.name.split(' = ')[1]) + min_duration = float(action.name.split(' = ')[1]) if rd.IsReleaseBuild(): if min_duration >= 15.0: diff --git a/util/test/tests/Vulkan/VK_Descriptor_Variable_Count.py b/util/test/tests/Vulkan/VK_Descriptor_Variable_Count.py index 591593966..e8374f5b1 100644 --- a/util/test/tests/Vulkan/VK_Descriptor_Variable_Count.py +++ b/util/test/tests/Vulkan/VK_Descriptor_Variable_Count.py @@ -6,8 +6,8 @@ class VK_Descriptor_Variable_Count(rdtest.TestCase): demos_test_name = 'VK_Descriptor_Variable_Count' def check_capture(self): - last_draw: rd.DrawcallDescription = self.get_last_draw() + last_action: rd.ActionDescription = self.get_last_action() - self.controller.SetFrameEvent(last_draw.eventId, True) + self.controller.SetFrameEvent(last_action.eventId, True) - self.check_triangle(out=last_draw.copyDestination) + self.check_triangle(out=last_action.copyDestination) diff --git a/util/test/tests/Vulkan/VK_Discard_Zoo.py b/util/test/tests/Vulkan/VK_Discard_Zoo.py index b33665d2b..5e10398bf 100644 --- a/util/test/tests/Vulkan/VK_Discard_Zoo.py +++ b/util/test/tests/Vulkan/VK_Discard_Zoo.py @@ -14,16 +14,16 @@ class VK_Discard_Zoo(rdtest.Discard_Zoo): self.check_textures() # Test render pass attachments - draw = self.find_draw("TestStart") + action = self.find_action("TestStart") rpcol: rd.TextureDescription = self.get_texture( [res for res in self.controller.GetResources() if "RPCol" in res.name][0].resourceId) rpdepth: rd.TextureDescription = self.get_texture( [res for res in self.controller.GetResources() if "RPDepth" in res.name][0].resourceId) - self.check(draw is not None) + self.check(action is not None) - self.controller.SetFrameEvent(draw.next.eventId, True) + self.controller.SetFrameEvent(action.next.eventId, True) # At the start they should be cleared @@ -34,9 +34,9 @@ class VK_Discard_Zoo(rdtest.Discard_Zoo): rdtest.log.success("Values are correct before the renderpass") - draw = self.find_draw("TestMiddle") + action = self.find_action("TestMiddle") - self.controller.SetFrameEvent(draw.next.eventId, True) + self.controller.SetFrameEvent(action.next.eventId, True) for y in range(0, rpcol.height-1, 17): for x in range(0, rpcol.width-1, 17): @@ -66,9 +66,9 @@ class VK_Discard_Zoo(rdtest.Discard_Zoo): rdtest.log.success("Values are correct in the middle of the renderpass") - draw = self.find_draw("TestEnd") + action = self.find_action("TestEnd") - self.controller.SetFrameEvent(draw.next.eventId, True) + self.controller.SetFrameEvent(action.next.eventId, True) for y in range(0, rpcol.height-1, 17): for x in range(0, rpcol.width-1, 17): @@ -101,9 +101,9 @@ class VK_Discard_Zoo(rdtest.Discard_Zoo): self.check(middle_col_bytes != end_col_bytes) self.check(middle_depth_bytes != end_depth_bytes) - draw = self.find_draw("UndefinedLoad_Before") + action = self.find_action("UndefinedLoad_Before") - self.controller.SetFrameEvent(draw.next.eventId, True) + self.controller.SetFrameEvent(action.next.eventId, True) # check that they are cleared again for y in range(0, rpcol.height-1, 17): @@ -113,9 +113,9 @@ class VK_Discard_Zoo(rdtest.Discard_Zoo): rdtest.log.success("Values are correct before the UNDEFINED initial layout renderpass") - draw = self.find_draw("UndefinedLoad_After") + action = self.find_action("UndefinedLoad_After") - self.controller.SetFrameEvent(draw.next.eventId, True) + self.controller.SetFrameEvent(action.next.eventId, True) # check that they are all undefined pattern - initial layout affects the whole resource for y in range(0, rpcol.height-1, 17): diff --git a/util/test/tests/Vulkan/VK_Empty_Capture.py b/util/test/tests/Vulkan/VK_Empty_Capture.py index 1fe687110..fd7b21b6e 100644 --- a/util/test/tests/Vulkan/VK_Empty_Capture.py +++ b/util/test/tests/Vulkan/VK_Empty_Capture.py @@ -7,8 +7,8 @@ class VK_Empty_Capture(rdtest.TestCase): demos_frame_cap = 100 def check_capture(self): - draws = self.controller.GetDrawcalls() + actions = self.controller.GetRootActions() - self.check(len(draws) == 1) - self.check('End' in draws[0].name) - self.check(draws[0].eventId == 1) \ No newline at end of file + self.check(len(actions) == 1) + self.check('End' in actions[0].name) + self.check(actions[0].eventId == 1) \ No newline at end of file diff --git a/util/test/tests/Vulkan/VK_Extended_Dynamic_State.py b/util/test/tests/Vulkan/VK_Extended_Dynamic_State.py index 945225ed2..c7f426cc1 100644 --- a/util/test/tests/Vulkan/VK_Extended_Dynamic_State.py +++ b/util/test/tests/Vulkan/VK_Extended_Dynamic_State.py @@ -6,9 +6,9 @@ class VK_Extended_Dynamic_State(rdtest.TestCase): demos_test_name = 'VK_Extended_Dynamic_State' def check_capture(self): - draw: rd.DrawcallDescription = self.find_draw("Draw") + action: rd.ActionDescription = self.find_action("Draw") - self.controller.SetFrameEvent(draw.eventId, True) + self.controller.SetFrameEvent(action.eventId, True) vsin_ref = { 0: { @@ -41,9 +41,9 @@ class VK_Extended_Dynamic_State(rdtest.TestCase): }, } - self.check_mesh_data(vsin_ref, self.get_vsin(draw)) + self.check_mesh_data(vsin_ref, self.get_vsin(action)) - postvs_data = self.get_postvs(draw, rd.MeshDataStage.VSOut, 0, draw.numIndices) + postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, action.numIndices) postvs_ref = { 0: { diff --git a/util/test/tests/Vulkan/VK_Image_Layouts.py b/util/test/tests/Vulkan/VK_Image_Layouts.py index 8c6aea9fa..97e4e3356 100644 --- a/util/test/tests/Vulkan/VK_Image_Layouts.py +++ b/util/test/tests/Vulkan/VK_Image_Layouts.py @@ -32,11 +32,11 @@ class VK_Image_Layouts(rdtest.TestCase): if img.layouts[0].name != "VK_IMAGE_LAYOUT_PRESENT_SRC_KHR": raise rdtest.TestFailureException("Swapchain image is in {} layout".format(img.layouts[0].name)) - draw = self.find_draw("Before Transition") + action = self.find_action("Before Transition") - self.check(draw is not None) + self.check(action is not None) - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.VKState = self.controller.GetVulkanPipelineState() @@ -54,11 +54,11 @@ class VK_Image_Layouts(rdtest.TestCase): if img.layouts[0].name != "VK_IMAGE_LAYOUT_PRESENT_SRC_KHR": raise rdtest.TestFailureException("Swapchain image is in {} layout".format(img.layouts[0].name)) - draw = self.find_draw("vkCmdDraw") + action = self.find_action("vkCmdDraw") - self.check(draw is not None) + self.check(action is not None) - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.VKState = self.controller.GetVulkanPipelineState() diff --git a/util/test/tests/Vulkan/VK_Imageless_Framebuffer.py b/util/test/tests/Vulkan/VK_Imageless_Framebuffer.py index 7e15519e7..491af1f32 100644 --- a/util/test/tests/Vulkan/VK_Imageless_Framebuffer.py +++ b/util/test/tests/Vulkan/VK_Imageless_Framebuffer.py @@ -6,11 +6,11 @@ class VK_Imageless_Framebuffer(rdtest.TestCase): demos_test_name = 'VK_Imageless_Framebuffer' def check_capture(self): - draw = self.find_draw("Draw") + action = self.find_action("Draw") - self.check(draw is not None) + self.check(action is not None) - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() diff --git a/util/test/tests/Vulkan/VK_Indirect.py b/util/test/tests/Vulkan/VK_Indirect.py index eff37f836..75aac59c5 100644 --- a/util/test/tests/Vulkan/VK_Indirect.py +++ b/util/test/tests/Vulkan/VK_Indirect.py @@ -71,7 +71,7 @@ class VK_Indirect(rdtest.TestCase): # Every sample that isn't passing should be off off_alpha = 0.5 - # If the overlay isn't even for a draw, it will be cleared to black + # If the overlay isn't even for a action, it will be cleared to black if no_overlay: off_alpha = 0.0 self.check(len(pass_samples) == 0) @@ -83,7 +83,7 @@ class VK_Indirect(rdtest.TestCase): self.check_pixel_value(overlay_id, s[0], s[1], [0.8, 0.1, 0.8, 1.0], eps=1.0/256.0) def check_capture(self): - fill = self.find_draw("vkCmdFillBuffer") + fill = self.find_action("vkCmdFillBuffer") self.check(fill is not None) @@ -96,14 +96,14 @@ class VK_Indirect(rdtest.TestCase): buffer_usage[usage.eventId].append(usage.usage) # The texture is the backbuffer - tex = self.get_last_draw().copyDestination + tex = self.get_last_action().copyDestination for level in ["Primary", "Secondary"]: rdtest.log.print("Checking {} indirect calls".format(level)) - final = self.find_draw("{}: Final".format(level)) + final = self.find_action("{}: Final".format(level)) - indirect_count_root = self.find_draw("{}: KHR_draw_indirect_count".format(level)) + indirect_count_root = self.find_action("{}: KHR_action_indirect_count".format(level)) self.controller.SetFrameEvent(final.eventId, False) @@ -124,25 +124,25 @@ class VK_Indirect(rdtest.TestCase): self.check_pixel_value(tex, 340, 115, [1.0, 0.5, 0.5, 1.0]) self.check_pixel_value(tex, 340, 190, [1.0, 0.0, 0.5, 1.0]) - dispatches = self.find_draw("{}: Dispatches".format(level)) + dispatches = self.find_action("{}: Dispatches".format(level)) - # Set up a ReplayOutput and TextureSave for quickly testing the drawcall highlight overlay + # Set up a ReplayOutput and TextureSave for quickly testing the action highlight overlay self.out: rd.ReplayOutput = self.controller.CreateOutput(rd.CreateHeadlessWindowingData(100, 100), rd.ReplayOutputType.Texture) self.check(self.out is not None) # Rewind to the start of the capture - draw: rd.DrawcallDescription = dispatches.children[0] - while draw.previous is not None: - draw = draw.previous + action: rd.ActionDescription = dispatches.children[0] + while action.previous is not None: + action = action.previous - # Ensure we can select all draws - while draw is not None: - self.controller.SetFrameEvent(draw.eventId, False) - draw = draw.next + # Ensure we can select all actions + while action is not None: + self.controller.SetFrameEvent(action.eventId, False) + action = action.next - rdtest.log.success("Selected all {} draws".format(level)) + rdtest.log.success("Selected all {} actions".format(level)) self.check(dispatches and len(dispatches.children) == 3) @@ -174,45 +174,45 @@ class VK_Indirect(rdtest.TestCase): rdtest.log.success("Dispatched buffer contents are as expected for {}".format(level)) - empties = self.find_draw("{}: Empty draws".format(level)) + empties = self.find_action("{}: Empty actions".format(level)) self.check(empties and len(empties.children) == 2) - draw: rd.DrawcallDescription - for draw in empties.children: - self.check(draw.numIndices == 0) - self.check(draw.numInstances == 0) + action: rd.ActionDescription + for action in empties.children: + self.check(action.numIndices == 0) + self.check(action.numInstances == 0) - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) # Check that we have empty PostVS - postvs_data = self.get_postvs(draw, rd.MeshDataStage.VSOut, 0, 1) + postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, 1) self.check(len(postvs_data) == 0) # No samples should be passing in the empties self.check_overlay([]) - rdtest.log.success("{} empty draws are empty".format(level)) + rdtest.log.success("{} empty actions are empty".format(level)) - indirects = self.find_draw("{}: Indirect draws".format(level)) + indirects = self.find_action("{}: Indirect actions".format(level)) self.check('vkCmdDrawIndirect' in indirects.children[0].name) self.check('vkCmdDrawIndexedIndirect' in indirects.children[1].name) self.check(len(indirects.children[1].children) == 2) - rdtest.log.success("Correct number of {} indirect draws".format(level)) + rdtest.log.success("Correct number of {} indirect actions".format(level)) # vkCmdDrawIndirect(...) - draw = indirects.children[0] - self.check(draw.numIndices == 3) - self.check(draw.numInstances == 2) + action = indirects.children[0] + self.check(action.numIndices == 3) + self.check(action.numInstances == 2) - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) - self.check(rd.ResourceUsage.Indirect in buffer_usage[draw.eventId]) + self.check(rd.ResourceUsage.Indirect in buffer_usage[action.eventId]) # Check that we have PostVS as expected - postvs_data = self.get_postvs(draw, rd.MeshDataStage.VSOut) + postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut) postvs_ref = { 0: {'vtx': 0, 'idx': 0, 'gl_PerVertex_var.gl_Position': [-0.8, -0.5, 0.0, 1.0]}, @@ -225,19 +225,19 @@ class VK_Indirect(rdtest.TestCase): self.check_overlay([(60, 40)]) - rdtest.log.success("{} {} is as expected".format(level, draw.name)) + rdtest.log.success("{} {} is as expected".format(level, action.name)) self.check(rd.ResourceUsage.Indirect in buffer_usage[indirects.children[1].eventId]) # vkCmdDrawIndexedIndirect[0](...) - draw = indirects.children[1].children[0] - self.check(draw.numIndices == 3) - self.check(draw.numInstances == 3) + action = indirects.children[1].children[0] + self.check(action.numIndices == 3) + self.check(action.numInstances == 3) - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) # Check that we have PostVS as expected - postvs_data = self.get_postvs(draw, rd.MeshDataStage.VSOut) + postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut) # These indices are the *output* indices, which have been rebased/remapped, so are not the same as the input # indices @@ -252,17 +252,17 @@ class VK_Indirect(rdtest.TestCase): self.check_overlay([(100, 40)]) - rdtest.log.success("{} {} is as expected".format(level, draw.name)) + rdtest.log.success("{} {} is as expected".format(level, action.name)) # vkCmdDrawIndexedIndirect[1](...) - draw = indirects.children[1].children[1] - self.check(draw.numIndices == 6) - self.check(draw.numInstances == 2) + action = indirects.children[1].children[1] + self.check(action.numIndices == 6) + self.check(action.numInstances == 2) - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) # Check that we have PostVS as expected - postvs_data = self.get_postvs(draw, rd.MeshDataStage.VSOut) + postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut) postvs_ref = { 0: {'vtx': 0, 'idx': 9, 'gl_PerVertex_var.gl_Position': [-0.4, -0.5, 0.0, 1.0]}, @@ -279,46 +279,46 @@ class VK_Indirect(rdtest.TestCase): self.check_overlay([(140, 40), (200, 40)]) - rdtest.log.success("{} {} is as expected".format(level, draw.name)) + rdtest.log.success("{} {} is as expected".format(level, action.name)) if indirect_count_root is not None: - self.check(indirect_count_root.children[0].name == '{}: Empty count draws'.format(level)) - self.check(indirect_count_root.children[1].name == '{}: Indirect count draws'.format(level)) + self.check(indirect_count_root.children[0].name == '{}: Empty count actions'.format(level)) + self.check(indirect_count_root.children[1].name == '{}: Indirect count actions'.format(level)) empties = indirect_count_root.children[0] self.check(empties and len(empties.children) == 3) - draw: rd.DrawcallDescription - for draw in empties.children: - self.check(draw.numIndices == 0) - self.check(draw.numInstances == 0) + action: rd.ActionDescription + for action in empties.children: + self.check(action.numIndices == 0) + self.check(action.numInstances == 0) - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) # Check that we have empty PostVS - postvs_data = self.get_postvs(draw, rd.MeshDataStage.VSOut, 0, 1) + postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, 1) self.check(len(postvs_data) == 0) self.check_overlay([], no_overlay=True) # vkCmdDrawIndirectCountKHR - draw_indirect = indirect_count_root.children[1].children[0] + action_indirect = indirect_count_root.children[1].children[0] - self.check(rd.ResourceUsage.Indirect in buffer_usage[draw_indirect.eventId]) + self.check(rd.ResourceUsage.Indirect in buffer_usage[action_indirect.eventId]) - self.check(draw_indirect and len(draw_indirect.children) == 1) + self.check(action_indirect and len(action_indirect.children) == 1) # vkCmdDrawIndirectCountKHR[0] - draw = draw_indirect.children[0] + action = action_indirect.children[0] - self.check(draw.numIndices == 3) - self.check(draw.numInstances == 4) + self.check(action.numIndices == 3) + self.check(action.numInstances == 4) - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) # Check that we have PostVS as expected - postvs_data = self.get_postvs(draw, rd.MeshDataStage.VSOut) + postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut) # These indices are the *output* indices, which have been rebased/remapped, so are not the same as the input # indices @@ -333,22 +333,22 @@ class VK_Indirect(rdtest.TestCase): self.check_overlay([(60, 190)]) - rdtest.log.success("{} {} is as expected".format(level, draw.name)) + rdtest.log.success("{} {} is as expected".format(level, action.name)) # vkCmdDrawIndexedIndirectCountKHR - draw_indirect = indirect_count_root.children[1].children[1] + action_indirect = indirect_count_root.children[1].children[1] - self.check(draw_indirect and len(draw_indirect.children) == 3) + self.check(action_indirect and len(action_indirect.children) == 3) # vkCmdDrawIndirectCountKHR[0] - draw = draw_indirect.children[0] - self.check(draw.numIndices == 3) - self.check(draw.numInstances == 1) + action = action_indirect.children[0] + self.check(action.numIndices == 3) + self.check(action.numInstances == 1) - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) # Check that we have PostVS as expected - postvs_data = self.get_postvs(draw, rd.MeshDataStage.VSOut) + postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut) # These indices are the *output* indices, which have been rebased/remapped, so are not the same as the input # indices @@ -363,32 +363,32 @@ class VK_Indirect(rdtest.TestCase): self.check_overlay([(100, 190)]) - rdtest.log.success("{} {} is as expected".format(level, draw.name)) + rdtest.log.success("{} {} is as expected".format(level, action.name)) # vkCmdDrawIndirectCountKHR[1] - draw = draw_indirect.children[1] - self.check(draw.numIndices == 0) - self.check(draw.numInstances == 0) + action = action_indirect.children[1] + self.check(action.numIndices == 0) + self.check(action.numInstances == 0) - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) - postvs_data = self.get_postvs(draw, rd.MeshDataStage.VSOut) + postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut) self.check(len(postvs_data) == 0) self.check_overlay([]) - rdtest.log.success("{} {} is as expected".format(level, draw.name)) + rdtest.log.success("{} {} is as expected".format(level, action.name)) # vkCmdDrawIndirectCountKHR[2] - draw = draw_indirect.children[2] - self.check(draw.numIndices == 6) - self.check(draw.numInstances == 2) + action = action_indirect.children[2] + self.check(action.numIndices == 6) + self.check(action.numInstances == 2) - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) # Check that we have PostVS as expected - postvs_data = self.get_postvs(draw, rd.MeshDataStage.VSOut) + postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut) # These indices are the *output* indices, which have been rebased/remapped, so are not the same as the input # indices @@ -407,14 +407,14 @@ class VK_Indirect(rdtest.TestCase): self.check_overlay([(140, 190), (200, 190)]) - rdtest.log.success("{} {} is as expected".format(level, draw.name)) + rdtest.log.success("{} {} is as expected".format(level, action.name)) - # Now check that the draws post-count are correctly highlighted - self.controller.SetFrameEvent(self.find_draw("{}: Post-count 1".format(level)).children[0].eventId, False) + # Now check that the actions post-count are correctly highlighted + self.controller.SetFrameEvent(self.find_action("{}: Post-count 1".format(level)).children[0].eventId, False) self.check_overlay([(340, 40)]) - self.controller.SetFrameEvent(self.find_draw("{}: Post-count 2".format(level)).children[0].eventId, False) + self.controller.SetFrameEvent(self.find_action("{}: Post-count 2".format(level)).children[0].eventId, False) self.check_overlay([(340, 190)]) - self.controller.SetFrameEvent(self.find_draw("{}: Post-count 3".format(level)).children[0].eventId, False) + self.controller.SetFrameEvent(self.find_action("{}: Post-count 3".format(level)).children[0].eventId, False) self.check_overlay([(340, 115)]) else: - rdtest.log.print("KHR_draw_indirect_count not tested") + rdtest.log.print("KHR_action_indirect_count not tested") diff --git a/util/test/tests/Vulkan/VK_Int8_IBuffer.py b/util/test/tests/Vulkan/VK_Int8_IBuffer.py index 3625f0d57..2ae06c707 100644 --- a/util/test/tests/Vulkan/VK_Int8_IBuffer.py +++ b/util/test/tests/Vulkan/VK_Int8_IBuffer.py @@ -6,15 +6,15 @@ class VK_Int8_IBuffer(rdtest.TestCase): demos_test_name = 'VK_Int8_IBuffer' def check_capture(self): - draw = self.find_draw("Draw") + action = self.find_action("Draw") - self.check(draw is not None) + self.check(action is not None) - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() - postvs_data = self.get_postvs(draw, rd.MeshDataStage.VSOut, 0, draw.numIndices) + postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, action.numIndices) ib = pipe.GetIBuffer() diff --git a/util/test/tests/Vulkan/VK_Large_Buffer.py b/util/test/tests/Vulkan/VK_Large_Buffer.py index 3eadc831b..0f867b12e 100644 --- a/util/test/tests/Vulkan/VK_Large_Buffer.py +++ b/util/test/tests/Vulkan/VK_Large_Buffer.py @@ -6,9 +6,9 @@ class VK_Large_Buffer(rdtest.TestCase): demos_test_name = 'VK_Large_Buffer' def check_capture(self): - draw = self.find_draw("Draw") + action = self.find_action("Draw") - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) vsin_ref = { 0: { @@ -34,9 +34,9 @@ class VK_Large_Buffer(rdtest.TestCase): }, } - self.check_mesh_data(vsin_ref, self.get_vsin(draw)) + self.check_mesh_data(vsin_ref, self.get_vsin(action)) - postvs_data = self.get_postvs(draw, rd.MeshDataStage.VSOut, 0, draw.numIndices) + postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, action.numIndices) postvs_ref = { 0: { diff --git a/util/test/tests/Vulkan/VK_Line_Raster.py b/util/test/tests/Vulkan/VK_Line_Raster.py index bd9cfd341..f1eafddf9 100644 --- a/util/test/tests/Vulkan/VK_Line_Raster.py +++ b/util/test/tests/Vulkan/VK_Line_Raster.py @@ -26,13 +26,13 @@ class VK_Line_Raster(rdtest.TestCase): return ret def check_capture(self): - draw = self.find_draw("vkCmdEndRenderPass") + action = self.find_action("vkCmdEndRenderPass") - self.check(draw is not None) + self.check(action is not None) - draw = draw.previous + action = action.previous - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() diff --git a/util/test/tests/Vulkan/VK_Misaligned_Dirty.py b/util/test/tests/Vulkan/VK_Misaligned_Dirty.py index c3c8900d4..fbd88a290 100644 --- a/util/test/tests/Vulkan/VK_Misaligned_Dirty.py +++ b/util/test/tests/Vulkan/VK_Misaligned_Dirty.py @@ -19,11 +19,11 @@ class VK_Misaligned_Dirty(rdtest.TestCase): return opts def check_capture(self): - draw = self.find_draw("Draw") + action = self.find_action("Draw") - self.check(draw is not None) + self.check(action is not None) - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) self.check(len(self.controller.GetFrameInfo().debugMessages) == 0) self.check(len(self.controller.GetDebugMessages()) == 0) @@ -32,7 +32,7 @@ class VK_Misaligned_Dirty(rdtest.TestCase): pipe: rd.PipeState = self.controller.GetPipelineState() - postvs_data = self.get_postvs(draw, rd.MeshDataStage.VSOut, 0, draw.numIndices) + postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, action.numIndices) val = 2.0 / 3.0 @@ -76,9 +76,9 @@ class VK_Misaligned_Dirty(rdtest.TestCase): rdtest.log.success("picked values are as expected") - checkpoint1 = self.find_draw("First Submit") - checkpoint2 = self.find_draw("Second Submit") - checkpoint3 = self.find_draw("Third Submit") + checkpoint1 = self.find_action("First Submit") + checkpoint2 = self.find_action("Second Submit") + checkpoint3 = self.find_action("Third Submit") self.check(checkpoint1 is not None) self.check(checkpoint2 is not None) diff --git a/util/test/tests/Vulkan/VK_Overlay_Test.py b/util/test/tests/Vulkan/VK_Overlay_Test.py index 4c667eed5..3350651c0 100644 --- a/util/test/tests/Vulkan/VK_Overlay_Test.py +++ b/util/test/tests/Vulkan/VK_Overlay_Test.py @@ -7,10 +7,10 @@ class VK_Overlay_Test(rdtest.Overlay_Test): internal = False def check_capture(self): - # Check clear-before-draw when first selecting a draw, to ensure that bindless feedback doesn't interfere + # Check clear-before-action when first selecting a action, to ensure that bindless feedback doesn't interfere out = self.controller.CreateOutput(rd.CreateHeadlessWindowingData(100, 100), rd.ReplayOutputType.Texture) - setup_marker = self.find_draw("Setup") + setup_marker = self.find_action("Setup") self.controller.SetFrameEvent(setup_marker.next.eventId, True) pipe = self.controller.GetPipelineState() @@ -23,11 +23,11 @@ class VK_Overlay_Test(rdtest.Overlay_Test): out.Display() - # Select the next setup draw + # Select the next setup action self.controller.SetFrameEvent(setup_marker.next.eventId, True) - # Select the real draw for the first time - self.controller.SetFrameEvent(self.find_draw("Normal Test").next.eventId, True) + # Select the real action for the first time + self.controller.SetFrameEvent(self.find_action("Normal Test").next.eventId, True) self.check_pixel_value(tex.resourceId, 180, 150, [0.0, 0.0, 0.0, 0.0]) self.check_pixel_value(tex.resourceId, 50, 50, [0.0, 0.0, 0.0, 0.0]) @@ -43,7 +43,7 @@ class VK_Overlay_Test(rdtest.Overlay_Test): # Don't check any pixel values, but ensure all overlays at least work with rasterizer discard and no # viewport/scissor bound - sub_marker = self.find_draw("Discard Test") + sub_marker = self.find_action("Discard Test") self.controller.SetFrameEvent(sub_marker.next.eventId, True) pipe = self.controller.GetPipelineState() diff --git a/util/test/tests/Vulkan/VK_Parameter_Zoo.py b/util/test/tests/Vulkan/VK_Parameter_Zoo.py index a99faa721..1cae07413 100644 --- a/util/test/tests/Vulkan/VK_Parameter_Zoo.py +++ b/util/test/tests/Vulkan/VK_Parameter_Zoo.py @@ -6,27 +6,27 @@ class VK_Parameter_Zoo(rdtest.TestCase): demos_test_name = 'VK_Parameter_Zoo' def check_capture(self): - draw = self.find_draw("Color Draw") + action = self.find_action("Color Draw") - self.check(draw is not None) + self.check(action is not None) - draw = draw.next + action = action.next - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() self.check_pixel_value(pipe.GetOutputTargets()[0].resourceId, 0.5, 0.5, [0.0, 1.0, 0.0, 1.0]) # Readback reported extension support - descriptor_update_template = self.find_draw("KHR_descriptor_update_template") is not None - push_descriptor = self.find_draw("KHR_push_descriptor") is not None + descriptor_update_template = self.find_action("KHR_descriptor_update_template") is not None + push_descriptor = self.find_action("KHR_push_descriptor") is not None - # Find the draw that contains resource references - draw = self.find_draw("References") - self.check(draw is not None) - draw = draw.next - self.controller.SetFrameEvent(draw.eventId, False) + # Find the action that contains resource references + action = self.find_action("References") + self.check(action is not None) + action = action.next + self.controller.SetFrameEvent(action.eventId, False) vkpipe: rd.VKState = self.controller.GetVulkanPipelineState() @@ -81,12 +81,12 @@ class VK_Parameter_Zoo(rdtest.TestCase): setidx = setidx + 1 - # Since we can only have one push descriptor set we have a second draw for push AND template updates + # Since we can only have one push descriptor set we have a second action for push AND template updates if descriptor_update_template and push_descriptor: - draw = self.find_draw("PushTemplReferences") - self.check(draw is not None) - draw = draw.next - self.controller.SetFrameEvent(draw.eventId, False) + action = self.find_action("PushTemplReferences") + self.check(action is not None) + action = action.next + self.controller.SetFrameEvent(action.eventId, False) vkpipe: rd.VKState = self.controller.GetVulkanPipelineState() @@ -116,20 +116,20 @@ class VK_Parameter_Zoo(rdtest.TestCase): rdtest.log.success("All resources were found as expected") - draw = self.find_draw("Tools available") + action = self.find_action("Tools available") - self.check(len(draw.children) > 1) - self.check(any([d.name == 'RenderDoc' for d in draw.children])) + self.check(len(action.children) > 1) + self.check(any([d.name == 'RenderDoc' for d in action.children])) rdtest.log.success("RenderDoc tool was listed as available") - draw = self.find_draw("ASM Draw") + action = self.find_action("ASM Draw") - self.check(draw is not None) + self.check(action is not None) - draw = draw.next + action = action.next - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) vkpipe: rd.VKState = self.controller.GetVulkanPipelineState() @@ -148,7 +148,7 @@ class VK_Parameter_Zoo(rdtest.TestCase): self.check(len(vkpipe.viewportScissor.viewportScissors) == 0) - postvs_data = self.get_postvs(draw, rd.MeshDataStage.VSOut, 0, draw.numIndices) + postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, action.numIndices) postvs_ref = { 0: { @@ -177,13 +177,13 @@ class VK_Parameter_Zoo(rdtest.TestCase): rdtest.log.success("ASM Draw is as expected") - draw = self.find_draw("Immutable Draw") + action = self.find_action("Immutable Draw") - self.check(draw is not None) + self.check(action is not None) - draw = draw.next + action = action.next - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) vkpipe: rd.VKState = self.controller.GetVulkanPipelineState() @@ -191,11 +191,11 @@ class VK_Parameter_Zoo(rdtest.TestCase): if desc_set.bindings[0].binds[0].filter.minify != rd.FilterMode.Linear: raise rdtest.TestFailureException( - "Expected linear sampler at binding slot 0 in immutable draw") + "Expected linear sampler at binding slot 0 in immutable action") if self.get_resource(desc_set.bindings[0].binds[0].samplerResourceId).name != "validSampler": raise rdtest.TestFailureException( - "Expected validSampler to be at binding slot 0 in immutable draw") + "Expected validSampler to be at binding slot 0 in immutable action") # Check for resource leaks if len(self.controller.GetStructuredFile().chunks) > 500: diff --git a/util/test/tests/Vulkan/VK_Pixel_History.py b/util/test/tests/Vulkan/VK_Pixel_History.py index 0da53071b..f47d1fdef 100644 --- a/util/test/tests/Vulkan/VK_Pixel_History.py +++ b/util/test/tests/Vulkan/VK_Pixel_History.py @@ -43,7 +43,7 @@ class VK_Pixel_History(rdtest.TestCase): self.multisampled_image_test() def primary_test(self): - test_marker: rd.DrawcallDescription = self.find_draw("Test Begin") + test_marker: rd.ActionDescription = self.find_action("Test Begin") self.controller.SetFrameEvent(test_marker.next.eventId, True) pipe: rd.PipeState = self.controller.GetPipelineState() @@ -59,20 +59,20 @@ class VK_Pixel_History(rdtest.TestCase): if tex_details.mips > 1: sub.mip = rt.firstMip - begin_renderpass_eid = self.find_draw("Begin RenderPass").next.eventId - depth_write_eid = self.find_draw("Depth Write").next.eventId - stencil_write_eid = self.find_draw("Stencil Write").next.eventId - unbound_fs_eid = self.find_draw("Unbound Fragment Shader").next.eventId - background_eid = self.find_draw("Background").next.eventId - cull_eid = self.find_draw("Cull Front").next.eventId - test_eid = self.find_draw("Test Begin").next.eventId - fixed_scissor_fail_eid = self.find_draw("Fixed Scissor Fail").next.eventId - fixed_scissor_pass_eid = self.find_draw("Fixed Scissor Pass").next.eventId - dynamic_stencil_ref_eid = self.find_draw("Dynamic Stencil Ref").next.eventId - dynamic_stencil_mask_eid = self.find_draw("Dynamic Stencil Mask").next.eventId - depth_test_eid = self.find_draw("Depth Test").next.eventId - depth_bounds_prep_eid = self.find_draw("Depth Bounds Prep").next.eventId - depth_bounds_clip_eid = self.find_draw("Depth Bounds Clip").next.eventId + begin_renderpass_eid = self.find_action("Begin RenderPass").next.eventId + depth_write_eid = self.find_action("Depth Write").next.eventId + stencil_write_eid = self.find_action("Stencil Write").next.eventId + unbound_fs_eid = self.find_action("Unbound Fragment Shader").next.eventId + background_eid = self.find_action("Background").next.eventId + cull_eid = self.find_action("Cull Front").next.eventId + test_eid = self.find_action("Test Begin").next.eventId + fixed_scissor_fail_eid = self.find_action("Fixed Scissor Fail").next.eventId + fixed_scissor_pass_eid = self.find_action("Fixed Scissor Pass").next.eventId + dynamic_stencil_ref_eid = self.find_action("Dynamic Stencil Ref").next.eventId + dynamic_stencil_mask_eid = self.find_action("Dynamic Stencil Mask").next.eventId + depth_test_eid = self.find_action("Depth Test").next.eventId + depth_bounds_prep_eid = self.find_action("Depth Bounds Prep").next.eventId + depth_bounds_clip_eid = self.find_action("Depth Bounds Clip").next.eventId # For pixel 190, 149 inside the red triangle x, y = 190, 149 @@ -224,9 +224,9 @@ class VK_Pixel_History(rdtest.TestCase): self.check_pixel_value(tex, x, y, value_selector(modifs[-1].postMod.col), sub=sub, cast=rt.typeCast) def multisampled_image_test(self): - test_marker: rd.DrawcallDescription = self.find_draw("Multisampled: test") - draw_eid = test_marker.next.eventId - self.controller.SetFrameEvent(draw_eid, True) + test_marker: rd.ActionDescription = self.find_action("Multisampled: test") + action_eid = test_marker.next.eventId + self.controller.SetFrameEvent(action_eid, True) pipe: rd.PipeState = self.controller.GetPipelineState() rt: rd.BoundResource = pipe.GetOutputTargets()[0] @@ -240,7 +240,7 @@ class VK_Pixel_History(rdtest.TestCase): if tex_details.arraysize > 1: sub.slice = rt.firstSlice - beg_renderpass_eid = self.find_draw("Multisampled: begin renderpass").next.eventId + beg_renderpass_eid = self.find_action("Multisampled: begin renderpass").next.eventId x, y = 140, 130 sub.sample = 1 @@ -249,9 +249,9 @@ class VK_Pixel_History(rdtest.TestCase): events = [ [[event_id, beg_renderpass_eid], [passed, True], [post_mod_depth, 0.0]], - [[event_id, draw_eid], [passed, True], [primitive_id, 0], [pre_mod_depth, 0.0], [shader_out_depth, 0.9], + [[event_id, action_eid], [passed, True], [primitive_id, 0], [pre_mod_depth, 0.0], [shader_out_depth, 0.9], [post_mod_depth, 0.9]], - [[event_id, draw_eid], [passed, True], [primitive_id, 1], [shader_out_depth, 0.95], [post_mod_depth, 0.95]], + [[event_id, action_eid], [passed, True], [primitive_id, 1], [shader_out_depth, 0.95], [post_mod_depth, 0.95]], ] if not self.is_depth: @@ -271,9 +271,9 @@ class VK_Pixel_History(rdtest.TestCase): modifs: List[rd.PixelModification] = self.controller.PixelHistory(tex, x, y, sub, rt.typeCast) events = [ [[event_id, beg_renderpass_eid], [passed, True], [post_mod_depth, 0.0]], - [[event_id, draw_eid], [passed, True], [primitive_id, 0], [pre_mod_depth, 0.0], [shader_out_depth, 0.9], + [[event_id, action_eid], [passed, True], [primitive_id, 0], [pre_mod_depth, 0.0], [shader_out_depth, 0.9], [post_mod_depth, 0.9]], - [[event_id, draw_eid], [passed, True], [primitive_id, 1], [shader_out_depth, 0.95], [post_mod_depth, 0.95]], + [[event_id, action_eid], [passed, True], [primitive_id, 1], [shader_out_depth, 0.95], [post_mod_depth, 0.95]], ] if not self.is_depth: @@ -291,7 +291,7 @@ class VK_Pixel_History(rdtest.TestCase): self.check_pixel_value(tex, x, y, value_selector(modifs[-1].postMod.col), sub=sub, cast=rt.typeCast) def secondary_cmd_test(self): - secondary_marker: rd.DrawcallDescription = self.find_draw("Secondary: red and blue") + secondary_marker: rd.ActionDescription = self.find_action("Secondary: red and blue") self.controller.SetFrameEvent(secondary_marker.next.eventId, True) pipe: rd.PipeState = self.controller.GetPipelineState() @@ -304,10 +304,10 @@ class VK_Pixel_History(rdtest.TestCase): if tex_details.mips > 1: sub.mip = rt.firstMip - sec_beg_renderpass_eid = self.find_draw("Begin RenderPass Secondary").next.eventId - background_eid = self.find_draw("Secondary: background").next.eventId - culled_eid = self.find_draw("Secondary: culled").next.eventId - sec_red_and_blue = self.find_draw("Secondary: red and blue").next.eventId + sec_beg_renderpass_eid = self.find_action("Begin RenderPass Secondary").next.eventId + background_eid = self.find_action("Secondary: background").next.eventId + culled_eid = self.find_action("Secondary: culled").next.eventId + sec_red_and_blue = self.find_action("Secondary: red and blue").next.eventId # Test culling x, y = 70, 40 @@ -347,7 +347,7 @@ class VK_Pixel_History(rdtest.TestCase): self.check_pixel_value(tex, x, y, value_selector(modifs[-1].postMod.col), sub=sub, cast=rt.typeCast) def depth_target_test(self): - test_marker: rd.DrawcallDescription = self.find_draw("Test Begin") + test_marker: rd.ActionDescription = self.find_action("Test Begin") self.controller.SetFrameEvent(test_marker.next.eventId, True) pipe: rd.PipeState = self.controller.GetPipelineState() @@ -363,9 +363,9 @@ class VK_Pixel_History(rdtest.TestCase): if tex_details.mips > 1: sub.mip = rt.firstMip - begin_renderpass_eid = self.find_draw("Begin RenderPass").next.eventId - background_eid = self.find_draw("Background").next.eventId - test_eid = self.find_draw("Test Begin").next.eventId + begin_renderpass_eid = self.find_action("Begin RenderPass").next.eventId + background_eid = self.find_action("Background").next.eventId + test_eid = self.find_action("Test Begin").next.eventId x, y = 200, 190 rdtest.log.print("Testing pixel {}, {}".format(x, y)) diff --git a/util/test/tests/Vulkan/VK_Query_Pool.py b/util/test/tests/Vulkan/VK_Query_Pool.py index e0f403912..2a44784ad 100644 --- a/util/test/tests/Vulkan/VK_Query_Pool.py +++ b/util/test/tests/Vulkan/VK_Query_Pool.py @@ -6,8 +6,8 @@ class VK_Query_Pool(rdtest.TestCase): demos_test_name = 'VK_Query_Pool' def check_capture(self): - last_draw: rd.DrawcallDescription = self.get_last_draw() + last_action: rd.ActionDescription = self.get_last_action() - self.controller.SetFrameEvent(last_draw.eventId, True) + self.controller.SetFrameEvent(last_action.eventId, True) - self.check_triangle(out=last_draw.copyDestination) + self.check_triangle(out=last_action.copyDestination) diff --git a/util/test/tests/Vulkan/VK_Resource_Lifetimes.py b/util/test/tests/Vulkan/VK_Resource_Lifetimes.py index 7db2cae12..08fa24e96 100644 --- a/util/test/tests/Vulkan/VK_Resource_Lifetimes.py +++ b/util/test/tests/Vulkan/VK_Resource_Lifetimes.py @@ -7,11 +7,11 @@ class VK_Resource_Lifetimes(rdtest.TestCase): demos_frame_cap = 200 def check_capture(self): - last_draw: rd.DrawcallDescription = self.get_last_draw() + last_action: rd.ActionDescription = self.get_last_action() - self.controller.SetFrameEvent(last_draw.eventId, True) + self.controller.SetFrameEvent(last_action.eventId, True) - tex = last_draw.copyDestination + tex = last_action.copyDestination # green background around first triangle, blue around second self.check_pixel_value(tex, 10, 10, [0.0, 1.0, 0.0, 1.0]) diff --git a/util/test/tests/Vulkan/VK_Robustness2.py b/util/test/tests/Vulkan/VK_Robustness2.py index 3bb28425f..62ac37d22 100644 --- a/util/test/tests/Vulkan/VK_Robustness2.py +++ b/util/test/tests/Vulkan/VK_Robustness2.py @@ -6,9 +6,9 @@ class VK_Robustness2(rdtest.TestCase): demos_test_name = 'VK_Robustness2' def check_capture(self): - draw: rd.DrawcallDescription = self.find_draw('vkCmdDraw') + action: rd.ActionDescription = self.find_action('vkCmdDraw') - self.controller.SetFrameEvent(draw.eventId, True) + self.controller.SetFrameEvent(action.eventId, True) self.check_triangle() @@ -38,11 +38,11 @@ class VK_Robustness2(rdtest.TestCase): }, } - self.check_mesh_data(vsin_ref, self.get_vsin(draw)) + self.check_mesh_data(vsin_ref, self.get_vsin(action)) rdtest.log.success('Mesh input data is correct, including unbound VB') - postvs_data = self.get_postvs(draw, rd.MeshDataStage.VSOut, 0, draw.numIndices) + postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, action.numIndices) postvs_ref = { 0: { @@ -91,9 +91,9 @@ class VK_Robustness2(rdtest.TestCase): var_check.check('data').type(rd.VarType.Float).rows(1).cols(4).value([0.0, 0.0, 0.0, 0.0]) else: val = [0, 0, 0, 0] - if self.find_draw('robustBufferAccess2') is not None: + if self.find_action('robustBufferAccess2') is not None: val[2] = 1000000 - if self.find_draw('robustImageAccess2') is not None: + if self.find_action('robustImageAccess2') is not None: val[0] = val[1] = 1000000 var_check.check('coord').type(rd.VarType.SInt).rows(1).cols(4).value(val) diff --git a/util/test/tests/Vulkan/VK_SPIRV_13_Shaders.py b/util/test/tests/Vulkan/VK_SPIRV_13_Shaders.py index 93d097928..ebfc75967 100644 --- a/util/test/tests/Vulkan/VK_SPIRV_13_Shaders.py +++ b/util/test/tests/Vulkan/VK_SPIRV_13_Shaders.py @@ -6,11 +6,11 @@ class VK_SPIRV_13_Shaders(rdtest.TestCase): demos_test_name = 'VK_SPIRV_13_Shaders' def check_capture(self): - draw = self.find_draw("Draw") + action = self.find_action("Draw") - self.check(draw is not None) + self.check(action is not None) - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() @@ -48,7 +48,7 @@ class VK_SPIRV_13_Shaders(rdtest.TestCase): rdtest.log.success("shader reflection and disassembly as expected") - postvs_data = self.get_postvs(draw, rd.MeshDataStage.VSOut, 0, draw.numIndices) + postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, action.numIndices) postvs_ref = { 0: { diff --git a/util/test/tests/Vulkan/VK_Sample_Locations.py b/util/test/tests/Vulkan/VK_Sample_Locations.py index 5d9040d6b..7c0583ee9 100644 --- a/util/test/tests/Vulkan/VK_Sample_Locations.py +++ b/util/test/tests/Vulkan/VK_Sample_Locations.py @@ -6,8 +6,8 @@ class VK_Sample_Locations(rdtest.TestCase): demos_test_name = 'VK_Sample_Locations' def check_capture(self): - draw: rd.DrawcallDescription = self.find_draw("Degenerate") - self.controller.SetFrameEvent(draw.next.eventId, True) + action: rd.ActionDescription = self.find_action("Degenerate") + self.controller.SetFrameEvent(action.next.eventId, True) pipe: rd.VKState = self.controller.GetVulkanPipelineState() if pipe.multisample.rasterSamples != 4: @@ -33,8 +33,8 @@ class VK_Sample_Locations(rdtest.TestCase): raise rdtest.TestFailureException("In degenerate case, sample locations [1] and [2] DO match: {} vs {}" .format(sampleLoc.customLocations[1], sampleLoc.customLocations[2])) - draw: rd.DrawcallDescription = self.find_draw("Rotated") - self.controller.SetFrameEvent(draw.next.eventId, True) + action: rd.ActionDescription = self.find_action("Rotated") + self.controller.SetFrameEvent(action.next.eventId, True) pipe: rd.VKState = self.controller.GetVulkanPipelineState() if pipe.multisample.rasterSamples != 4: @@ -88,13 +88,13 @@ class VK_Sample_Locations(rdtest.TestCase): stride = fmt.compByteWidth * fmt.compCount * dim[0] - last_draw: rd.DrawcallDescription = self.get_last_draw() + last_action: rd.ActionDescription = self.get_last_action() - self.controller.SetFrameEvent(last_draw.eventId, True) + self.controller.SetFrameEvent(last_action.eventId, True) # Due to the variability of rasterization between implementations or even drivers, # we don't want to check against a 'known good'. - # So instead we verify that at the first degenerate draw each pair of two sample's images are identical and that + # So instead we verify that at the first degenerate action each pair of two sample's images are identical and that # in the rotated grid case each sample's image is distinct. # In future we could also check that the degenerate case 'stretches' the triangle up, as with the way the # geometry is defined the second sample image should be a superset (i.e. strictly more samples covered). diff --git a/util/test/tests/Vulkan/VK_Secondary_CmdBuf.py b/util/test/tests/Vulkan/VK_Secondary_CmdBuf.py index 410d56043..ffd2cc381 100644 --- a/util/test/tests/Vulkan/VK_Secondary_CmdBuf.py +++ b/util/test/tests/Vulkan/VK_Secondary_CmdBuf.py @@ -6,30 +6,30 @@ class VK_Secondary_CmdBuf(rdtest.TestCase): demos_test_name = 'VK_Secondary_CmdBuf' def check_capture(self): - last_draw: rd.DrawcallDescription = self.get_last_draw() + last_action: rd.ActionDescription = self.get_last_action() - self.controller.SetFrameEvent(last_draw.eventId, True) + self.controller.SetFrameEvent(last_action.eventId, True) - tex = self.get_texture(last_draw.copyDestination) + tex = self.get_texture(last_action.copyDestination) # Green triangle on the left, blue on the right - self.check_triangle(out=last_draw.copyDestination, fore=[0.0, 1.0, 0.0, 1.0], + self.check_triangle(out=last_action.copyDestination, fore=[0.0, 1.0, 0.0, 1.0], vp=(0, 0, tex.width / 2, tex.height)) - self.check_triangle(out=last_draw.copyDestination, fore=[0.0, 0.0, 1.0, 1.0], + self.check_triangle(out=last_action.copyDestination, fore=[0.0, 0.0, 1.0, 1.0], vp=(tex.width / 2, 0, tex.width/2, tex.height)) - draw = self.find_draw("Primary") + action = self.find_action("Primary") resources = self.controller.GetResources() - self.check(draw is not None and draw.next is not None) + self.check(action is not None and action.next is not None) - self.controller.SetFrameEvent(draw.next.eventId, False) + self.controller.SetFrameEvent(action.next.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() self.check(pipe.GetVBuffers()[0].byteOffset == 0) - rdtest.log.success("Primary draw has correct byte offset") + rdtest.log.success("Primary action has correct byte offset") pipeline: rd.ResourceId = self.controller.GetVulkanPipelineState().graphics.pipelineResourceId @@ -43,18 +43,18 @@ class VK_Secondary_CmdBuf(rdtest.TestCase): if not checked: raise rdtest.TestFailureException("Couldn't find resource description for pipeline {}".format(pipeline)) - rdtest.log.success("Primary draw has correct pipeline bound") + rdtest.log.success("Primary action has correct pipeline bound") - draw = self.find_draw("Secondary") + action = self.find_action("Secondary") - self.check(draw is not None and draw.next is not None) + self.check(action is not None and action.next is not None) - self.controller.SetFrameEvent(draw.next.eventId, False) + self.controller.SetFrameEvent(action.next.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() self.check(pipe.GetVBuffers()[0].byteOffset == 108) - rdtest.log.success("Secondary draw has correct byte offset") + rdtest.log.success("Secondary action has correct byte offset") pipeline: rd.ResourceId = self.controller.GetVulkanPipelineState().graphics.pipelineResourceId @@ -68,4 +68,4 @@ class VK_Secondary_CmdBuf(rdtest.TestCase): if not checked: raise rdtest.TestFailureException("Couldn't find resource description for pipeline {}".format(pipeline)) - rdtest.log.success("Secondary draw has correct pipeline bound") + rdtest.log.success("Secondary action has correct pipeline bound") diff --git a/util/test/tests/Vulkan/VK_Shader_Debug_Zoo.py b/util/test/tests/Vulkan/VK_Shader_Debug_Zoo.py index ad4a64a68..76fbfb9b1 100644 --- a/util/test/tests/Vulkan/VK_Shader_Debug_Zoo.py +++ b/util/test/tests/Vulkan/VK_Shader_Debug_Zoo.py @@ -15,9 +15,9 @@ class VK_Shader_Debug_Zoo(rdtest.TestCase): for test_name in ["GLSL1 tests", "GLSL2 tests", "ASM tests"]: rdtest.log.begin_section(test_name) - draw = self.find_draw(test_name) - for child in range(len(draw.children)): - section = draw.children[child] + action = self.find_action(test_name) + for child in range(len(action.children)): + section = action.children[child] self.controller.SetFrameEvent(section.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() diff --git a/util/test/tests/Vulkan/VK_Shader_Editing.py b/util/test/tests/Vulkan/VK_Shader_Editing.py index 9fc7d00e7..8764734aa 100644 --- a/util/test/tests/Vulkan/VK_Shader_Editing.py +++ b/util/test/tests/Vulkan/VK_Shader_Editing.py @@ -8,14 +8,14 @@ class VK_Shader_Editing(rdtest.TestCase): demos_test_name = 'VK_Shader_Editing' def check_capture(self): - eid = self.find_draw("Draw 1").next.eventId + eid = self.find_action("Draw 1").next.eventId self.controller.SetFrameEvent(eid, False) pipe: rd.PipeState = self.controller.GetPipelineState() fsrefl1: rd.ShaderReflection = pipe.GetShaderReflection(rd.ShaderStage.Fragment) - eid = self.find_draw("Draw 2").next.eventId + eid = self.find_action("Draw 2").next.eventId self.controller.SetFrameEvent(eid, False) pipe: rd.PipeState = self.controller.GetPipelineState() diff --git a/util/test/tests/Vulkan/VK_Shader_ISA.py b/util/test/tests/Vulkan/VK_Shader_ISA.py index f8c894dfc..8bb4d8195 100644 --- a/util/test/tests/Vulkan/VK_Shader_ISA.py +++ b/util/test/tests/Vulkan/VK_Shader_ISA.py @@ -7,13 +7,13 @@ class VK_Shader_ISA(rdtest.TestCase): demos_test_name = 'VK_Shader_ISA' def check_capture(self): - draw = self.find_draw("GPU=") + action = self.find_action("GPU=") - self.check(draw is not None) + self.check(action is not None) - is_amd = 'AMD' in draw.name + is_amd = 'AMD' in action.name - self.controller.SetFrameEvent(draw.next.eventId, False) + self.controller.SetFrameEvent(action.next.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() diff --git a/util/test/tests/Vulkan/VK_Simple_Triangle.py b/util/test/tests/Vulkan/VK_Simple_Triangle.py index 645552c96..a3941d3b1 100644 --- a/util/test/tests/Vulkan/VK_Simple_Triangle.py +++ b/util/test/tests/Vulkan/VK_Simple_Triangle.py @@ -6,19 +6,19 @@ class VK_Simple_Triangle(rdtest.TestCase): demos_test_name = 'VK_Simple_Triangle' def check_capture(self): - last_draw: rd.DrawcallDescription = self.get_last_draw() + last_action: rd.ActionDescription = self.get_last_action() - self.controller.SetFrameEvent(last_draw.eventId, True) + self.controller.SetFrameEvent(last_action.eventId, True) - self.check_triangle(out=last_draw.copyDestination) + self.check_triangle(out=last_action.copyDestination) self.check_export(self.capture_filename) - draw = self.find_draw("Draw") + action = self.find_action("Draw") - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) - postvs_data = self.get_postvs(draw, rd.MeshDataStage.VSOut, 0, draw.numIndices) + postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, action.numIndices) postvs_ref = { 0: { diff --git a/util/test/tests/Vulkan/VK_Spec_Constants.py b/util/test/tests/Vulkan/VK_Spec_Constants.py index ffbb8c3af..60b023510 100644 --- a/util/test/tests/Vulkan/VK_Spec_Constants.py +++ b/util/test/tests/Vulkan/VK_Spec_Constants.py @@ -6,14 +6,14 @@ class VK_Spec_Constants(rdtest.TestCase): demos_test_name = 'VK_Spec_Constants' def check_capture(self): - # find the first draw - draw = self.find_draw("Draw") + # find the first action + action = self.find_action("Draw") - # We should have 4 draws, with spec constant values 0, 1, 2, 3 + # We should have 4 actions, with spec constant values 0, 1, 2, 3 for num_colors in range(4): - self.check(draw is not None) + self.check(action is not None) - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() @@ -80,4 +80,4 @@ class VK_Spec_Constants(rdtest.TestCase): rdtest.log.success("Draw with {} colors picked value is as expected".format(num_colors)) - draw = draw.next + action = action.next diff --git a/util/test/tests/Vulkan/VK_Synchronization_2.py b/util/test/tests/Vulkan/VK_Synchronization_2.py index 94a6a9a34..b4ce34cc6 100644 --- a/util/test/tests/Vulkan/VK_Synchronization_2.py +++ b/util/test/tests/Vulkan/VK_Synchronization_2.py @@ -32,11 +32,11 @@ class VK_Synchronization_2(rdtest.TestCase): if img.layouts[0].name != "VK_IMAGE_LAYOUT_PRESENT_SRC_KHR": raise rdtest.TestFailureException("Swapchain image is in {} layout".format(img.layouts[0].name)) - draw = self.find_draw("Before Transition") + action = self.find_action("Before Transition") - self.check(draw is not None) + self.check(action is not None) - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.VKState = self.controller.GetVulkanPipelineState() @@ -59,14 +59,14 @@ class VK_Synchronization_2(rdtest.TestCase): if img.layouts[0].name != "VK_IMAGE_LAYOUT_PRESENT_SRC_KHR": raise rdtest.TestFailureException("Swapchain image is in {} layout".format(img.layouts[0].name)) - draw = self.find_draw("vkCmdDraw") + action = self.find_action("vkCmdDraw") - self.check(draw is not None) + self.check(action is not None) - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) # Check that the backbuffer didn't get discarded - self.check_triangle(out=draw.outputs[0]) + self.check_triangle(out=action.outputs[0]) col = [float(0x40) / 255.0] * 4 diff --git a/util/test/tests/Vulkan/VK_VS_Max_Desc_Set.py b/util/test/tests/Vulkan/VK_VS_Max_Desc_Set.py index 8035196a0..61fe357a8 100644 --- a/util/test/tests/Vulkan/VK_VS_Max_Desc_Set.py +++ b/util/test/tests/Vulkan/VK_VS_Max_Desc_Set.py @@ -7,17 +7,17 @@ class VK_VS_Max_Desc_Set(rdtest.TestCase): def check_capture(self): - draw = self.find_draw("Draw") + action = self.find_action("Draw") - self.check(draw is not None) + self.check(action is not None) - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() # We only need to check the color output for the first vertex - if we got that, the test succeeded. # We're not testing VS out fetch in general here, just that it works when there's no spare descriptor set - postvs_data = self.get_postvs(draw, rd.MeshDataStage.VSOut, 0, 1) + postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, 1) postvs_ref = { 0: { diff --git a/util/test/tests/Vulkan/VK_Validation_Use.py b/util/test/tests/Vulkan/VK_Validation_Use.py index 6e0db0d7a..8722f2064 100644 --- a/util/test/tests/Vulkan/VK_Validation_Use.py +++ b/util/test/tests/Vulkan/VK_Validation_Use.py @@ -6,8 +6,8 @@ class VK_Validation_Use(rdtest.TestCase): demos_test_name = 'VK_Validation_Use' def check_capture(self): - last_draw: rd.DrawcallDescription = self.get_last_draw() + last_action: rd.ActionDescription = self.get_last_action() - self.controller.SetFrameEvent(last_draw.eventId, True) + self.controller.SetFrameEvent(last_action.eventId, True) - self.check_triangle(out=last_draw.copyDestination) + self.check_triangle(out=last_action.copyDestination) diff --git a/util/test/tests/Vulkan/VK_Vertex_Attr_Zoo.py b/util/test/tests/Vulkan/VK_Vertex_Attr_Zoo.py index 69382e0bf..b28fc77e3 100644 --- a/util/test/tests/Vulkan/VK_Vertex_Attr_Zoo.py +++ b/util/test/tests/Vulkan/VK_Vertex_Attr_Zoo.py @@ -7,11 +7,11 @@ class VK_Vertex_Attr_Zoo(rdtest.TestCase): demos_test_name = 'VK_Vertex_Attr_Zoo' def check_capture(self): - draw = self.find_draw("Draw") + action = self.find_action("Draw") - self.check(draw is not None) + self.check(action is not None) - self.controller.SetFrameEvent(draw.eventId, False) + self.controller.SetFrameEvent(action.eventId, False) ref = { 0: { @@ -55,7 +55,7 @@ class VK_Vertex_Attr_Zoo(rdtest.TestCase): }, } - doubles = self.find_draw('DoublesEnabled') is not None + doubles = self.find_action('DoublesEnabled') is not None # Copy the ref values and prepend 'In' in_ref = {} @@ -91,15 +91,15 @@ class VK_Vertex_Attr_Zoo(rdtest.TestCase): vsout_ref[2]['gl_PerVertex_var.gl_Position'] = [0.5, 0.5, 0.0, 1.0] gsout_ref[2]['gl_PerVertex_var.gl_Position'] = [0.5, 0.5, 0.4, 1.2] - self.check_mesh_data(in_ref, self.get_vsin(draw)) + self.check_mesh_data(in_ref, self.get_vsin(action)) rdtest.log.success("Vertex input data is as expected") - self.check_mesh_data(vsout_ref, self.get_postvs(draw, rd.MeshDataStage.VSOut)) + self.check_mesh_data(vsout_ref, self.get_postvs(action, rd.MeshDataStage.VSOut)) rdtest.log.success("Vertex output data is as expected") # This is optional to account for drivers without XFB - postgs_data = self.get_postvs(draw, rd.MeshDataStage.GSOut) + postgs_data = self.get_postvs(action, rd.MeshDataStage.GSOut) if len(postgs_data) > 0: self.check_mesh_data(gsout_ref, postgs_data) @@ -113,8 +113,8 @@ class VK_Vertex_Attr_Zoo(rdtest.TestCase): rdtest.log.success("Triangle picked value is as expected") - # Step to the next draw with awkward struct/array outputs - self.controller.SetFrameEvent(draw.next.eventId, False) + # Step to the next action with awkward struct/array outputs + self.controller.SetFrameEvent(action.next.eventId, False) ref = { 0: { @@ -132,7 +132,7 @@ class VK_Vertex_Attr_Zoo(rdtest.TestCase): }, } - self.check_mesh_data(ref, self.get_postvs(draw, rd.MeshDataStage.VSOut)) + self.check_mesh_data(ref, self.get_postvs(action, rd.MeshDataStage.VSOut)) rdtest.log.success("Nested vertex output data is as expected") @@ -147,6 +147,6 @@ class VK_Vertex_Attr_Zoo(rdtest.TestCase): del ref[0]['outData.outStruct.d[0].foo'] del ref[0]['outData.outStruct.d[1].foo'] - self.check_mesh_data(ref, self.get_postvs(draw, rd.MeshDataStage.GSOut)) + self.check_mesh_data(ref, self.get_postvs(action, rd.MeshDataStage.GSOut)) rdtest.log.success("Nested geometry output data is as expected")
    EID: The dispatch's EID.
    drawId: The dispatch's draw ID, starting from 1 and numbering each draw-type event.
    actionId: The dispatch's action ID, starting from 1 and numbering each action.
    x: The number of groups in the X dimension of the dispatch.
    y: The number of groups in the Y dimension of the dispatch.
    z: The number of groups in the Z dimension of the dispatch.