nxdk_pgraph_tests
A collection of tests for the Xbox nv2a graphics processor
 
Loading...
Searching...
No Matches
attribute_carryover_tests.h
1#ifndef NXDK_PGRAPH_TESTS_ATTRIBUTE_CARRYOVER_TESTS_H
2#define NXDK_PGRAPH_TESTS_ATTRIBUTE_CARRYOVER_TESTS_H
3
4#include <memory>
5#include <vector>
6
7#include "test_host.h"
8#include "test_suite.h"
9
10namespace PBKitPlusPlus {
11class VertexBuffer;
12}
13
36 public:
37 enum DrawMode {
38 DRAW_ARRAYS,
39 DRAW_INLINE_BUFFERS,
40 DRAW_INLINE_ARRAYS,
41 DRAW_INLINE_ELEMENTS,
42 };
43
44 enum Attribute {
45 ATTR_WEIGHT = 0,
46 ATTR_NORMAL = 1,
47 ATTR_DIFFUSE = 2,
48 ATTR_SPECULAR = 3,
49 ATTR_FOG_COORD = 4,
50 ATTR_POINT_SIZE = 5,
51 ATTR_BACK_DIFFUSE = 6,
52 ATTR_BACK_SPECULAR = 7,
53 ATTR_TEX0 = 8,
54 ATTR_TEX1 = 9,
55 ATTR_TEX2 = 10,
56 ATTR_TEX3 = 11,
57 };
58
59 struct TestConfig {
60 DrawMode draw_mode;
61 float attribute_value[4];
62 };
63
64 public:
65 AttributeCarryoverTests(TestHost &host, std::string output_dir, const Config &config);
66
67 void Initialize() override;
68 void Deinitialize() override;
69
70 private:
71 void CreateGeometry(TestHost::DrawPrimitive primitive);
72 void Test(TestHost::DrawPrimitive primitive, Attribute test_attribute, const TestConfig &config);
73
74 static std::string MakeTestName(TestHost::DrawPrimitive primitive, Attribute test_attribute,
75 const TestConfig &config);
76
77 static std::string DrawModeLabel(DrawMode mode);
78
79 private:
80 // Buffer containing vertices that set the attribute(s) under test.
81 std::shared_ptr<VertexBuffer> bleed_buffer_;
82 // Buffer omitting the attributes under test.
83 std::shared_ptr<VertexBuffer> test_buffer_;
84
85 std::vector<uint32_t> index_buffer_;
86};
87
88#endif // NXDK_PGRAPH_TESTS_ATTRIBUTE_CARRYOVER_TESTS_H
Definition attribute_carryover_tests.h:35
void Initialize() override
Called to initialize the test suite.
Definition attribute_carryover_tests.cpp:444
void Deinitialize() override
Called to tear down the test suite.
Definition attribute_carryover_tests.cpp:468
Definition test_host.h:33
Definition test_suite.h:20
Definition attribute_carryover_tests.h:59
Runtime configuration for TestSuites.
Definition test_suite.h:23