Change DebugPixel() to take a DebugShaderInputs struct

DebugShaderInputs struct contains existing the parameters:

sample
primitive

and a new parameter

view

Default constructor for DebugShaderInputs sets the parameters to NoPreference (~0U).
This commit is contained in:
Jake Turner
2024-03-13 07:58:48 +00:00
parent 5516f67227
commit 7934d1d16e
39 changed files with 151 additions and 85 deletions
+20
View File
@@ -2235,3 +2235,23 @@ struct Thumbnail
};
DECLARE_REFLECTION_STRUCT(Thumbnail);
DOCUMENT(
"Contains the properties used to select which fragment to debug, used as an input to "
"DebugPixel.");
struct DebugPixelInputs
{
DOCUMENT("");
DebugPixelInputs() : sample(~0U), primitive(~0U), view(~0U) {}
DebugPixelInputs(const DebugPixelInputs &) = default;
DebugPixelInputs &operator=(const DebugPixelInputs &) = default;
DOCUMENT("The multi-sampled sample.");
uint32_t sample;
DOCUMENT("The primitive index.");
uint32_t primitive;
DOCUMENT("The layered or multiview rendering view index.");
uint32_t view;
};
DECLARE_REFLECTION_STRUCT(DebugPixelInputs);
+7 -6
View File
@@ -967,15 +967,16 @@ bucket when the pixel values are divided between ``minval`` and ``maxval``.
:param int x: The x co-ordinate.
: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
:param DebugPixelInputs inputs: Specific properties to select which fragment to debug e.g.
sample: The multi-sampled sample. Ignored if non-multisampled texture.
primitive: Debug the pixel from this primitive if there's ambiguity. If set to
:data:`NoPreference` then a random fragment writing to the given co-ordinate is debugged.
:return: The resulting trace resulting from debugging. Destroy with
:meth:`FreeTrace`.
view: Debug the fragment writing to this view for layered or multiview rendering,
ignored if set to :data:`NoPreference`.
:return: The resulting trace resulting from debugging. Destroy with :meth:`FreeTrace`.
:rtype: ShaderDebugTrace
)");
virtual ShaderDebugTrace *DebugPixel(uint32_t x, uint32_t y, uint32_t sample,
uint32_t primitive) = 0;
virtual ShaderDebugTrace *DebugPixel(uint32_t x, uint32_t y, const DebugPixelInputs &inputs) = 0;
DOCUMENT(R"(Retrieve a debugging trace from running a compute thread.