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