nxdk_pgraph_tests
A collection of tests for the Xbox nv2a graphics processor
 
Loading...
Searching...
No Matches
blend_tests.h
1#ifndef NXDK_PGRAPH_TESTS_BLEND_TESTS_H
2#define NXDK_PGRAPH_TESTS_BLEND_TESTS_H
3
4#include <functional>
5#include <memory>
6#include <string>
7
8#include "test_host.h"
9#include "test_suite.h"
10
57class BlendTests : public TestSuite {
58 public:
59 struct Instruction {
60 const char *name;
61 const char *mask;
62 const char *swizzle;
63 const uint32_t instruction[4];
64 };
65
66 public:
67 BlendTests(TestHost &host, std::string output_dir, const Config &config);
68
69 void Initialize() override;
70
71 private:
73 void TestDetailed(const std::string &name, uint32_t blend_function, uint32_t src_factor, uint32_t dst_factor);
74
77 void TestSpot(const std::string &name, uint32_t blend_function, uint32_t src_factor);
78
80 void DrawAlphaStack(uint32_t blend_function, uint32_t src_factor, uint32_t dst_factor, float left = 0.f,
81 float top = 0.f, float quad_size = 256.f, float increment = 24.f);
82
84 void DrawColorStack(uint32_t blend_function, uint32_t src_factor, uint32_t dst_factor, float left = 0.f,
85 float top = 0.f, float color_swatch_size = 64.f);
86
88 void DrawColorAndAlphaStack(uint32_t blend_function, uint32_t src_factor, uint32_t dst_factor, float left = 0.f,
89 float top = 0.f, float color_swatch_size = 64.f);
90
91 void DrawCheckerboardBackground(bool use_small_checkers = false) const;
92
95 void DrawQuad(float left, float top, float right, float bottom, uint32_t color, uint32_t func, uint32_t sfactor,
96 uint32_t dfactor, bool blend_rgb, bool blend_alpha) const;
97
98 void RenderToTextureStart(uint32_t stage, uint32_t texture_pitch) const;
99 void RenderToTextureEnd() const;
100};
101
102#endif // NXDK_PGRAPH_TESTS_BLEND_TESTS_H
Definition blend_tests.h:57
void Initialize() override
Called to initialize the test suite.
Definition blend_tests.cpp:106
Definition test_host.h:33
Definition test_suite.h:21
Definition blend_tests.h:59
Runtime configuration for TestSuites.
Definition test_suite.h:24