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

Tests sampling of NV2A texture formats, verifying color conversion, swizzling, and alpha channel handling. More...

#include <texture_format_tests.h>

Inheritance diagram for TextureFormatTests:
Collaboration diagram for TextureFormatTests:

Public Member Functions

 TextureFormatTests (TestHost &host, std::string output_dir, const Config &config)
 Constructs the TextureFormatTests test suite and creates test cases.
 
void Initialize () override
 Called to initialize the test suite.
 
void Deinitialize () override
 Called to tear down 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 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, uint32_t test_index=0, uint32_t total_tests=0)
 
void RunAll (bool include_interactive)
 
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
 
void FinishDraw (const std::string &name, bool save_zbuffer=false)
 
void FinishDrawNoSave (const std::string &name, bool save_zbuffer=false)
 
- Protected Attributes inherited from TestSuite
TestHost & host_
 
std::string output_dir_
 
std::string suite_name_
 
bool interactive_only_
 
bool allow_saving_ {true}
 
std::map< std::string, std::function< void()> > tests_ {}
 
std::set< std::string > interactive_only_tests_ {}
 
PGRAPHDiffToken pgraph_diff_
 
bool enable_progress_log_
 
bool enable_pgraph_region_diff_
 
uint32_t delay_milliseconds_between_tests_
 
std::shared_ptr< FTPLogger > ftp_logger_
 

Detailed Description

Tests sampling of NV2A texture formats, verifying color conversion, swizzling, and alpha channel handling.

Exercises rendering a textured quad using various NV2A hardware texture formats. A color gradient is generated and converted to the target format (applying swizzling if swizzled), then sampled via the projective 2D shader stage with the final combiner set to output the sampled texture color. Also tests 8-bit palettized textures across various palette sizes and verifies alpha channel behavior for formats containing dummy "X" alpha components.

Constructor & Destructor Documentation

◆ TextureFormatTests()

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

Constructs the TextureFormatTests test suite and creates test cases.

Remarks
TexFmt_A1R5G5B5 Samples a 2D color gradient texture in A1R5G5B5 swizzled format.
TexFmt_A1R5G5B5_L Samples a 2D color gradient texture in A1R5G5B5 linear format.
TexFmt_A4R4G4B4 Samples a 2D color gradient texture in A4R4G4B4 swizzled format.
TexFmt_A4R4G4B4_L Samples a 2D color gradient texture in A4R4G4B4 linear format.
TexFmt_A4V6YB6A4U6YA6_L Samples a 2D color gradient texture in A4V6YB6A4U6YA6 (LC_IMAGE_A4V6YB6A4U6YA6) linear YUV format with alpha.
TexFmt_A8 Samples a 2D color gradient texture in A8 swizzled format.
TexFmt_A8_L Samples a 2D color gradient texture in A8 linear format.
TexFmt_A8B8G8R8 Samples a 2D color gradient texture in A8B8G8R8 swizzled format.
TexFmt_A8B8G8R8_L Samples a 2D color gradient texture in A8B8G8R8 linear format.
TexFmt_A8R8G8B8 Samples a 2D color gradient texture in A8R8G8B8 swizzled format.
TexFmt_A8R8G8B8_L Samples a 2D color gradient texture in A8R8G8B8 linear format.
TexFmt_A8Y8 Samples a 2D color gradient texture in A8Y8 swizzled format.
TexFmt_A8Y8_L Samples a 2D color gradient texture in A8Y8 linear format (NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_A8Y8).
TexFmt_AY8 Samples a 2D color gradient texture in AY8 swizzled format.
TexFmt_AY8_L Samples a 2D color gradient texture in AY8 linear format.
TexFmt_B8G8R8A8 Samples a 2D color gradient texture in B8G8R8A8 swizzled format.
TexFmt_B8G8R8A8_L Samples a 2D color gradient texture in B8G8R8A8 linear format.
DepthFmt_D_X8Y24_FIXED Samples a 2D depth texture in 24-bit fixed-point depth swizzled format (NV097_SET_TEXTURE_FORMAT_COLOR_SZ_DEPTH_X8_Y24_FIXED) using 3D projective shadow comparison against a constant reference depth across 6 shadow compare functions, saving the backbuffer.
DepthFmt_D_X8Y24_FIXED_L Samples a 2D depth texture in 24-bit fixed-point depth linear format (NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_DEPTH_X8_Y24_FIXED) using 3D projective shadow comparison against a constant reference depth across 6 shadow compare functions, saving the backbuffer.
DepthFmt_D_X8Y24_FLOAT Samples a 2D depth texture in 24-bit floating-point depth swizzled format (NV097_SET_TEXTURE_FORMAT_COLOR_SZ_DEPTH_X8_Y24_FLOAT) using 3D projective shadow comparison against a constant reference depth across 6 shadow compare functions, saving the backbuffer.
DepthFmt_D_Y16_FIXED Samples a 2D depth texture in 16-bit fixed-point depth swizzled format (NV097_SET_TEXTURE_FORMAT_COLOR_SZ_DEPTH_Y16_FIXED) using 3D projective shadow comparison against a constant reference depth across 6 shadow compare functions, saving the backbuffer.
DepthFmt_D_Y16_FIXED_L Samples a 2D depth texture in 16-bit fixed-point depth linear format (NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_DEPTH_Y16_FIXED) using 3D projective shadow comparison against a constant reference depth across 6 shadow compare functions, saving the backbuffer.
DepthFmt_D_Y16_FLOAT Samples a 2D depth texture in 16-bit floating-point depth swizzled format (NV097_SET_TEXTURE_FORMAT_COLOR_SZ_DEPTH_Y16_FLOAT) using 3D projective shadow comparison against a constant reference depth across 6 shadow compare functions, saving the backbuffer.
DepthFmt_D_Y16_FLOAT_L Samples a 2D depth texture in 16-bit floating-point depth linear format (NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_DEPTH_Y16_FLOAT) using 3D projective shadow comparison against a constant reference depth across 6 shadow compare functions, saving the backbuffer.
TexFmt_DXT1 Samples a 2D color gradient texture in DXT1 compressed format.
TexFmt_G8B8 Samples a 2D color gradient texture in G8B8 swizzled format.
TexFmt_G8B8_L Samples a 2D color gradient texture in G8B8 linear format.
TexFmt_R16B16 Samples a 2D color gradient texture in R16B16 swizzled format (NV097_SET_TEXTURE_FORMAT_COLOR_SZ_YB_16_YA_16).
TexFmt_R16B16_L Samples a 2D color gradient texture in R16B16 linear format (NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_YB16YA16).
TexFmt_R5G6B5 Samples a 2D color gradient texture in R5G6B5 swizzled format.
TexFmt_R5G6B5_L Samples a 2D color gradient texture in R5G6B5 linear format.
TexFmt_R6G5B5 Samples a 2D color gradient texture in R6G5B5 swizzled format.
TexFmt_R8B8 Samples a 2D color gradient texture in R8B8 swizzled format.
TexFmt_R8G8B8A8 Samples a 2D color gradient texture in R8G8B8A8 swizzled format.
TexFmt_R8G8B8A8_L Samples a 2D color gradient texture in R8G8B8A8 linear format.
TexFmt_SZ_Index8_p32 Samples an 8-bit palettized texture (SZ_I8_A8R8G8B8) configured with a 32-entry color palette.
TexFmt_SZ_Index8_p64 Samples an 8-bit palettized texture (SZ_I8_A8R8G8B8) configured with a 64-entry color palette.
TexFmt_SZ_Index8_p128 Samples an 8-bit palettized texture (SZ_I8_A8R8G8B8) configured with a 128-entry color palette.
TexFmt_SZ_Index8_p256 Samples an 8-bit palettized texture (SZ_I8_A8R8G8B8) configured with a 256-entry color palette.
TexFmt_UYVY_L Samples a 2D color gradient texture in UYVY (LC_IMAGE_YB8CR8YA8CB8) linear YUV format.
TexFmt_X1R5G5B5 Samples a 2D color gradient texture in X1R5G5B5 swizzled format.
TexFmt_X1R5G5B5_L Samples a 2D color gradient texture in X1R5G5B5 linear format.
TexFmt_X8R8G8B8 Samples a 2D color gradient texture in X8R8G8B8 swizzled format.
TexFmt_X8R8G8B8_L Samples a 2D color gradient texture in X8R8G8B8 linear format.
TexFmt_Y16 Samples a 2D color gradient texture in Y16 swizzled format (NV097_SET_TEXTURE_FORMAT_COLOR_SZ_Y16, format 0x32).
TexFmt_Y16_L Samples a 2D color gradient texture in Y16 linear format (NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_Y16, format 0x35).
TexFmt_Y8 Samples a 2D color gradient texture in Y8 swizzled format.
TexFmt_Y8_L Samples a 2D color gradient texture in Y8 linear format.
TexFmt_YUY2_L Samples a 2D color gradient texture in YUY2 (LC_IMAGE_CR8YB8CB8YA8) linear YUV format.
XAlpha_A8R8G8B8_L Baseline test verifying alpha channel sampling and blending behavior with an actual alpha channel (A8R8G8B8 linear).
XAlpha_X1R5G5B5 Tests that the unused X bit in X1R5G5B5 swizzled textures is treated as 1.0 (opaque) during sampling and blending.
XAlpha_X1R5G5B5_L Tests that the unused X bit in X1R5G5B5 linear textures is treated as 1.0 (opaque) during sampling and blending.
XAlpha_X8R8G8B8 Tests that the unused X byte in X8R8G8B8 swizzled textures is treated as 0xFF (opaque) during sampling and blending.
XAlpha_X8R8G8B8_L Tests that the unused X byte in X8R8G8B8 linear textures is treated as 0xFF (opaque) during sampling and blending.

Member Function Documentation

◆ Deinitialize()

void TextureFormatTests::Deinitialize ( )
overridevirtual

Called to tear down the test suite.

Reimplemented from TestSuite.

◆ Initialize()

void TextureFormatTests::Initialize ( )
overridevirtual

Called to initialize the test suite.

Reimplemented from TestSuite.


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