diff --git a/qrenderdoc/Windows/Dialogs/RemoteManager.cpp b/qrenderdoc/Windows/Dialogs/RemoteManager.cpp index 12140cde7..7ca9b31c6 100644 --- a/qrenderdoc/Windows/Dialogs/RemoteManager.cpp +++ b/qrenderdoc/Windows/Dialogs/RemoteManager.cpp @@ -232,7 +232,7 @@ void RemoteManager::refreshHost(QTreeWidgetItem *node) nextIdent = RENDERDOC_EnumerateRemoteTargets(hostnameBytes.data(), nextIdent); - if(nextIdent == ~0U || prevIdent >= nextIdent) + if(nextIdent == 0 || prevIdent >= nextIdent) break; ITargetControl *conn = diff --git a/renderdoc/api/replay/control_types.h b/renderdoc/api/replay/control_types.h index 0f8472ba9..cae2ec6ca 100644 --- a/renderdoc/api/replay/control_types.h +++ b/renderdoc/api/replay/control_types.h @@ -109,6 +109,10 @@ class Camera; DOCUMENT(R"( Describes how to render a mesh preview of one or more meshes. Describes the camera configuration as well as what options to use when rendering both the current mesh, and any other auxilliary meshes. + +.. data:: NoHighlight + + Value for :data:`highlightVert` if no vertex should be highlighted. )"); struct MeshDisplay { @@ -139,7 +143,7 @@ struct MeshDisplay DOCUMENT("The index of the currently selected instance in the drawcall."); uint32_t curInstance; - DOCUMENT("The index of the vertex to highlight, or ``0xffffffff`` to select no vertex."); + DOCUMENT("The index of the vertex to highlight, or :data:`NoHighlight` to select no vertex."); uint32_t highlightVert; DOCUMENT("The :class:`MeshFormat` of the position data for the mesh."); MeshFormat position; @@ -158,6 +162,8 @@ struct MeshDisplay SolidShade solidShadeMode; DOCUMENT("``True`` if the wireframe of the mesh should be rendered as well as solid shading."); bool32 wireframeDraw; + + static const uint32_t NoHighlight = ~0U; }; DECLARE_REFLECTION_STRUCT(MeshDisplay); @@ -166,6 +172,10 @@ DOCUMENT(R"( Describes how to render a texture preview of an image. Describes the zoom and pan settings for the texture when rendering on a particular output, as well as the modification and selection of a particular subresource (such as array slice, mip or multi-sampled sample). + +.. data:: ResolveSamples + + Value for :data:`sampleIdx` if the samples should be averaged. )"); struct TextureDisplay { @@ -239,7 +249,8 @@ See :meth:`ReplayRenderer.BuildCustomShader` for creating an appropriate custom DOCUMENT(R"(Select the sample of the texture to display if it's a multi-sampled texture. -If this is set to ``0xffffffff`` then a default resolve will be performed averaging all samples. +If this is set to :data:`ResolveSamples` then a default resolve will be performed that averages all +samples. )"); uint32_t sampleIdx; @@ -263,6 +274,8 @@ the input texture in cases where it isn't easy to directly fetch the input textu DOCUMENT("Selects a :class:`DebugOverlay` to draw over the top of the texture."); DebugOverlay overlay; + + static const uint32_t ResolveSamples = ~0U; }; DECLARE_REFLECTION_STRUCT(TextureDisplay); @@ -279,7 +292,12 @@ struct TextureComponentMapping DECLARE_REFLECTION_STRUCT(TextureComponentMapping); -DOCUMENT("How to map multisampled textures for saving to non-multisampled file formats."); +DOCUMENT(R"(How to map multisampled textures for saving to non-multisampled file formats. + +.. data:: ResolveSamples + + Value for :data:`sampleIndex` if the samples should be averaged. +)"); struct TextureSampleMapping { DOCUMENT(R"( @@ -293,9 +311,11 @@ is ignored. DOCUMENT(R"( If :data:`mapToArray` is ``False`` this selects which sample should be extracted to treat as a -normal 2D image. If set to ``0xffffffff`` then instead there's a default average resolve. +normal 2D image. If set to :data:`ResolveSamples` then instead there's a default average resolve. )"); uint32_t sampleIndex; + + static const uint32_t ResolveSamples = ~0U; }; DECLARE_REFLECTION_STRUCT(TextureSampleMapping); diff --git a/renderdoc/api/replay/d3d11_pipestate.h b/renderdoc/api/replay/d3d11_pipestate.h index 82672f668..1193c0577 100644 --- a/renderdoc/api/replay/d3d11_pipestate.h +++ b/renderdoc/api/replay/d3d11_pipestate.h @@ -29,7 +29,12 @@ namespace D3D11Pipe { -DOCUMENT("Describes a single D3D11 input layout element for one vertex input."); +DOCUMENT(R"(Describes a single D3D11 input layout element for one vertex input. + +.. data:: TightlyPacked + + Value for :data:`ByteOffset` that indicates this element is tightly packed. +)"); struct Layout { DOCUMENT("The semantic name for this input."); @@ -47,7 +52,7 @@ struct Layout DOCUMENT(R"(The byte offset from the start of the vertex data in the vertex buffer from :data:`InputSlot`. -If the value is ``0xffffffff`` then the element is packed tightly after the previous element, or 0 +If the value is :data:`TightlyPacked` then the element is packed tightly after the previous element, or 0 if this is the first element. )"); uint32_t ByteOffset = 0; @@ -62,6 +67,9 @@ E.g. if this value is two, then two instances will be drawn with the first insta with the next instance data. )"); uint32_t InstanceDataStepRate = 0; + + // D3D11_APPEND_ALIGNED_ELEMENT + static const uint32_t TightlyPacked = ~0U; }; DOCUMENT("Describes a single D3D11 vertex buffer binding.") diff --git a/renderdoc/api/replay/d3d12_pipestate.h b/renderdoc/api/replay/d3d12_pipestate.h index 44e140557..78d5867a7 100644 --- a/renderdoc/api/replay/d3d12_pipestate.h +++ b/renderdoc/api/replay/d3d12_pipestate.h @@ -28,7 +28,12 @@ namespace D3D12Pipe { -DOCUMENT("Describes a single D3D12 input layout element for one vertex input."); +DOCUMENT(R"(Describes a single D3D12 input layout element for one vertex input. + +.. data:: TightlyPacked + + Value for :data:`ByteOffset` that indicates this element is tightly packed. +)"); struct Layout { DOCUMENT("The semantic name for this input."); @@ -46,7 +51,7 @@ struct Layout DOCUMENT(R"(The byte offset from the start of the vertex data in the vertex buffer from :data:`InputSlot`. -If the value is ``0xffffffff`` then the element is packed tightly after the previous element, or 0 +If the value is :data:`TightlyPacked` then the element is packed tightly after the previous element, or 0 if this is the first element. )"); uint32_t ByteOffset = 0; @@ -61,6 +66,9 @@ E.g. if this value is two, then two instances will be drawn with the first insta with the next instance data. )"); uint32_t InstanceDataStepRate = 0; + + // D3D12_APPEND_ALIGNED_ELEMENT + static const uint32_t TightlyPacked = ~0U; }; DOCUMENT("Describes a single D3D12 vertex buffer binding.") diff --git a/renderdoc/api/replay/renderdoc_replay.h b/renderdoc/api/replay/renderdoc_replay.h index 567556f1f..5e49eb8e8 100644 --- a/renderdoc/api/replay/renderdoc_replay.h +++ b/renderdoc/api/replay/renderdoc_replay.h @@ -236,6 +236,10 @@ of the capture. This allows multiple outputs to run independently without interf other. The different types are enumerated in :class:`ReplayOutputType`. + +.. data:: NoResult + + No result was found in e.g. :meth:`PickVertex`. )"); struct IReplayOutput { @@ -363,11 +367,13 @@ Should only be called for mesh outputs. :param int x: The x co-ordinate to pick from. :param int y: The y co-ordinate to pick from. :return: A tuple with the first value being the vertex index in the mesh, and the second value being - the instance index. The values are set to ``0xffffffff`` if no vertex was found, + the instance index. The values are set to :data:`NoResult` if no vertex was found, :rtype: ``tuple`` of ``int`` and ``int`` )"); virtual rdctype::pair PickVertex(uint32_t eventID, uint32_t x, uint32_t y) = 0; + static const uint32_t NoResult = ~0U; + protected: IReplayOutput() = default; ~IReplayOutput() = default; @@ -375,6 +381,10 @@ protected: DOCUMENT(R"(The primary interface to access a capture's information and control the replay and analysis functionality available. + +.. data:: NoPreference + + No preference for a particular value, see :meth:`DebugPixel`. )"); struct IReplayRenderer { @@ -664,7 +674,7 @@ newly generated messages will be returned after that. :param int y: The y co-ordinate. :param int sample: The multi-sampled sample. Ignored if non-multisampled texture. :param int primitive: Debug the pixel from this primitive if there's ambiguity. If set to - ``0xffffffff`` then a random fragment writing to the given co-ordinate is debugged. + :data:`NoPreference` then a random fragment writing to the given co-ordinate is debugged. :return: The resulting trace resulting from debugging. :rtype: ShaderDebugTrace )"); @@ -749,6 +759,8 @@ sample 0, etc. )"); virtual rdctype::array GetTextureData(ResourceId tex, uint32_t arrayIdx, uint32_t mip) = 0; + static const uint32_t NoPreference = ~0U; + protected: IReplayRenderer() = default; ~IReplayRenderer() = default; @@ -854,6 +866,10 @@ DOCUMENT(R"(A connection to a running remote RenderDoc server on another machine transfer of captures to and from the local machine, as well as remotely replaying a capture with a local proxy renderer, so that captures that are not supported locally can still be debugged with as much work as possible happening on the local machine. + +.. data:: NoPreference + + No preference for a particular value, see :meth:`DebugPixel`. )"); struct IRemoteServer { @@ -976,7 +992,7 @@ or an error has occurred. :meth:`ReplayRenderer.Shutdown`. :param int proxyid: The index in the array returned by :meth:`LocalProxies` to use as a local proxy, - or ``0xffffffff`` to indicate no preference for any proxy. + or :data:`NoPreference` to indicate no preference for any proxy. :param str logfile: The path on the remote system where the file is. If the file is only available locally you can use :meth:`CopyCaptureToRemote` to transfer it over the remote connection. :param float progress: A reference to a ``float`` value that will be updated as the copy happens @@ -995,6 +1011,8 @@ or an error has occurred. )"); virtual void CloseCapture(IReplayRenderer *rend) = 0; + static const uint32_t NoPreference = ~0U; + protected: IRemoteServer() = default; ~IRemoteServer() = default; @@ -1137,7 +1155,7 @@ This function will block for a variable timeout depending on how many targets ar :param str host: The hostname to connect to. If blank, the local machine is used. :param int nextIdent: The next ident to scan. -:return: The ident of the next active target, or ``0xffffffff`` if no other targets exist. +:return: The ident of the next active target, or ``0`` if no other targets exist. :rtype: ``int`` )"); extern "C" RENDERDOC_API uint32_t RENDERDOC_CC RENDERDOC_EnumerateRemoteTargets(const char *host, diff --git a/renderdoc/api/replay/shader_types.h b/renderdoc/api/replay/shader_types.h index 0031a89ff..2a98ab05f 100644 --- a/renderdoc/api/replay/shader_types.h +++ b/renderdoc/api/replay/shader_types.h @@ -243,6 +243,10 @@ DECLARE_REFLECTION_STRUCT(ShaderDebugTrace); DOCUMENT(R"(The information describing an input or output signature element describing the interface between shader stages. + +.. data:: NoIndex + + Value for an index that means it is invalid or not applicable for this parameter. )"); struct SigParameter { @@ -274,7 +278,7 @@ struct SigParameter DOCUMENT(R"(The index of the shader register/binding used to store this signature element. -This may be ``0xffffffff`` if the element is system-generated and not consumed by another shader +This may be :data:`NoIndex` if the element is system-generated and not consumed by another shader stage. See :data:`systemValue`. )"); uint32_t regIndex; @@ -299,8 +303,10 @@ shader itself, for APIs that pack signatures together. "Selects a stream for APIs that provide multiple output streams for the same named output."); uint32_t stream; - DOCUMENT("If this element is part of an array, indicates the index, or ``0xffffffff`` if not."); + DOCUMENT("If this element is part of an array, indicates the index, or :data:`NoIndex` if not."); uint32_t arrayIndex; + + static const uint32_t NoIndex = ~0U; }; DECLARE_REFLECTION_STRUCT(SigParameter); diff --git a/renderdoc/replay/entry_points.cpp b/renderdoc/replay/entry_points.cpp index fb10bb6fb..ff4d14631 100644 --- a/renderdoc/replay/entry_points.cpp +++ b/renderdoc/replay/entry_points.cpp @@ -615,7 +615,7 @@ extern "C" RENDERDOC_API uint32_t RENDERDOC_CC RENDERDOC_EnumerateRemoteTargets( } // tried all idents remaining and found nothing - return ~0U; + return 0; } extern "C" RENDERDOC_API uint32_t RENDERDOC_CC RENDERDOC_GetDefaultRemoteServerPort() diff --git a/renderdocui/Interop/StaticExports.cs b/renderdocui/Interop/StaticExports.cs index eb8800b6c..4e237c586 100644 --- a/renderdocui/Interop/StaticExports.cs +++ b/renderdocui/Interop/StaticExports.cs @@ -280,7 +280,7 @@ namespace renderdoc nextIdent = RENDERDOC_EnumerateRemoteTargets(host_mem, nextIdent); - if (nextIdent == UInt32.MaxValue || prevIdent >= nextIdent) + if (nextIdent == 0 || prevIdent >= nextIdent) break; callback(nextIdent);