nxdk_pgraph_tests
A collection of tests for the Xbox nv2a graphics processor
 
Loading...
Searching...
No Matches
PixelShaderTests Class Reference

#include <pixel_shader_tests.h>

Inheritance diagram for PixelShaderTests:
Collaboration diagram for PixelShaderTests:

Public Member Functions

 PixelShaderTests (TestHost &host, std::string output_dir, const Config &config)
 
void Initialize () override
 Called to initialize the test suite.
 
- Public Member Functions inherited from TestSuite
 TestSuite (TestHost &host, std::string output_dir, std::string suite_name, const Config &config, bool interactive_only=false)
 
const std::string & Name () const
 
virtual void Deinitialize ()
 Called to tear down the test suite.
 
virtual void SetupTest ()
 Called before running an individual test within this suite.
 
virtual void TearDownTest ()
 Called after running an individual test within this suite.
 
void DisableTests (const std::set< std::string > &tests_to_skip)
 
std::vector< std::string > TestNames () const
 
bool HasEnabledTests () const
 
void Run (const std::string &test_name)
 
void RunAll ()
 
bool IsInteractiveOnly () const
 
void SetSavingAllowed (bool enable=true)
 

Additional Inherited Members

- Static Public Member Functions inherited from TestSuite
static void TagNV2ATrace (uint32_t num_nops)
 Inserts a pattern of NV097_NO_OPERATION's into the pushbuffer to allow identification when viewing nv2a traces.
 
- Protected Member Functions inherited from TestSuite
void SetDefaultTextureFormat () const
 
- Protected Attributes inherited from TestSuite
TestHosthost_
 
std::string output_dir_
 
std::string suite_name_
 
bool interactive_only_
 
bool allow_saving_ {true}
 
std::map< std::string, std::function< void()> > tests_ {}
 
PGRAPHDiffToken pgraph_diff_
 
bool enable_progress_log_
 
bool enable_pgraph_region_diff_
 
uint32_t delay_milliseconds_between_tests_
 
std::shared_ptr< FTPLoggerftp_logger_
 

Detailed Description

Constructor & Destructor Documentation

◆ PixelShaderTests()

PixelShaderTests::PixelShaderTests ( TestHost host,
std::string  output_dir,
const Config config 
)

Initializes the test suite and creates test cases.

Remarks
Passthru Demonstrates behavior of PS_TEXTUREMODES_PASSTHRU, which simply utilizes texture coordinates as colors.
ClipPlane Demonstrates behavior of PS_TEXTUREMODES_CLIPPLANE. Various mock values for clipping planes are assigned to texture coordinates for stages 0 (red), 1 (green), and 2 (blue). The values of the coordinates are summarized in the image, with "1" used to indicate a positive value and "-" to indicate a negative one. The comparator function is set for each quad in the image with a similar shorthand indicating whether results < 0 are clipped ("-") or >= 0 ("0").
BumpEnvMap Demonstrates behavior of PS_TEXTUREMODES_BUMPENVMAP with various values for the NV097_SET_TEXTURE_SET_BUMP_ENV_MAT matrix. Values are {-1.f, 0.f, 1.f, 0.f}, {1.f, 1.f, 1.f, 1.f}, {0.f, 0.2f, 0.f, 0.75f}, {0.5f, -0.5f, 0.5f, -0.5f}, {0.3f, 0.5f, 0.7f, 1.f}, {0.f, 1.f, -1.f, 0.f}, {0.f, 0.f, 1.f, 1.f}, {0.5f, 0.8f, 0.f, 0.f},
BumpEnvMapLuminance Demonstrates behavior of PS_TEXTUREMODES_BUMPENVMAP_LUM with various values for NV097_SET_TEXTURE_SET_BUMP_ENV_SCALE and NV097_SET_TEXTURE_SET_BUMP_ENV_OFFSET. Outputs are grouped by the env bump matrix (the value of each element is identical and printed in row 1). Columns are divided up by the scale factor, whose value is printed in row 2. Rows are defined by the offset value: {0, 0.25, 0.75, 1.0}.
DotST Renders a quad using PS_TEXTUREMODES_DOT_ST. Texture stage 0 is set to a bump map, stage 2 to an image with diagonal lines. Texture coordinates 1 are set to a normalized vector from the eye coordinate to each vertex (technically to a virtual position rather than the actual vertex position) and coordinate 2 is set to a normalized vector from the vertex to a virtual light. See https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/texm3x2tex&mdash;ps
DotZW Renders a quad using PS_TEXTUREMODES_DOT_ZW. Texture stage 0 is set to a bump map. Tex coords for stages 1 and 2 define a 3x2 matrix multiplied against the texture 0 sampler to determine the Z and W components of the fragment's depth (z = tex1.uvw * tex0.rgb, w = tex2.uvw * tex0.rgb, final depth = z/w). See https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/texm3x2depth&mdash;ps
StageDependentAlphaRed Renders a quad using PS_TEXTUREMODES_DPNDNT_AR. Texture stage 0 is set to a gradient textured. The sampled alpha and red channels from this texture are used as UV coordinates into the texture at stage 2.
StageDependentGreenBlue Renders a quad using PS_TEXTUREMODES_DPNDNT_GB. Texture stage 0 is set to a gradient textured. The sampled green and blue channels from this texture are used as UV coordinates into the texture at stage 2.

Member Function Documentation

◆ Initialize()

void PixelShaderTests::Initialize ( )
overridevirtual

Called to initialize the test suite.

Reimplemented from TestSuite.


The documentation for this class was generated from the following files: