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