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

#include <surface_format_tests.h>

Inheritance diagram for SurfaceFormatTests:
Collaboration diagram for SurfaceFormatTests:

Classes

struct  ClipRect
 

Public Member Functions

 SurfaceFormatTests (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)
 
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 ()
 
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 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

Tests behavior of NV097_SET_SURFACE_FORMAT_COLOR. Tests render two quads into a render target with the surface color format under test. The left quad consists of 4 color gradient patches (red, yellow, cyan, blue) with alpha forced to fully opaque. The second quad uses the same color gradients but has alpha set in a radial pattern such that it is 0 at the corners and fully opaque in the center.

The resultant surface is then rendered to an RGBA framebuffer twice, once at the top of the screen with the alpha channel preserved, and again at the bottom of the screen with alpha forced to fully opaque.

Constructor & Destructor Documentation

◆ SurfaceFormatTests()

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

Initializes the test suite and creates test cases.

Remarks
Fmt_A8R8G8B8 Tests the A8R8G8B8 surface format. Quads appear the same as if they were rendered directly into the framebuffer.
Fmt_B8 Tests the B8 surface format. Quads appear as alpha+luma ramps and are distorted and repeated due to the difference in bytes per pixel.
Fmt_G8B8 Tests the G8B8 surface format. Quads set the red channel equal to the blue channel and alpha equal to the green channel. Quads are once again repeated due to the difference in bytes per pixel.
Fmt_R5G6B5 Tests the R5G6B5 surface format.
Fmt_X1A7R8G8B8_O1A7R8G8B8 Tests the X1A7R8G8B8_O1A7R8G8B8 surface format. Quads appear similar to A8R8G8B8, but the high bit of the alpha is set to 1, causing all quads to be less translucent.
Fmt_X1A7R8G8B8_Z1A7R8G8B8 Tests the X1A7R8G8B8_Z1A7R8G8B8 surface format. Quads appear similar to A8R8G8B8, but the high bit of the alpha is set to 0, causing all quads to be translucent.
Fmt_X1R5G5B5_O1R5G5B5 Tests the X1R5G5B5_O1R5G5B5 surface format.
Fmt_X1R5G5B5_Z1R5G5B5 Tests the X1R5G5B5_Z1R5G5B5 surface format.
Fmt_X8R8G8B8_O8R8G8B8 Tests the X8R8G8B8_O8R8G8B8 surface format. Quads appear similar to A8R8G8B8, but the alpha is set to fully opaque.
Fmt_X8R8G8B8_Z8R8G8B8 Tests the X8R8G8B8_Z8R8G8B8 surface format. Quads appear similar to A8R8G8B8, but the alpha is set to fully transparent (no quads should appear in the top half of the image).

Member Function Documentation

◆ Initialize()

void SurfaceFormatTests::Initialize ( )
overridevirtual

Called to initialize the test suite.

Reimplemented from TestSuite.


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