nxdk_pgraph_tests
A collection of tests for the Xbox nv2a graphics processor
 
Loading...
Searching...
No Matches
attribute_explicit_setter_tests.h
1#ifndef NXDK_PGRAPH_TESTS_ATTRIBUTE_EXPLICIT_SETTER_TESTS_H
2#define NXDK_PGRAPH_TESTS_ATTRIBUTE_EXPLICIT_SETTER_TESTS_H
3
4#include <memory>
5#include <vector>
6
7#include "test_host.h"
8#include "test_suite.h"
9
10class VertexBuffer;
11
12// Tests behavior when vertex attributes are not provided but are used by shaders.
14 public:
15 // Keep in sync with attribute_carryover_test.vs.cg
16 enum Attribute {
17 ATTR_WEIGHT = 0,
18 ATTR_NORMAL = 1,
19 ATTR_DIFFUSE = 2,
20 ATTR_SPECULAR = 3,
21 ATTR_FOG_COORD = 4,
22 ATTR_POINT_SIZE = 5,
23 ATTR_BACK_DIFFUSE = 6,
24 ATTR_BACK_SPECULAR = 7,
25 ATTR_TEX0 = 8,
26 ATTR_TEX1 = 9,
27 ATTR_TEX2 = 10,
28 ATTR_TEX3 = 11,
29 };
30
31 struct TestConfig {
32 const char* test_name;
33 bool force_blend_alpha;
34 };
35
36 public:
37 AttributeExplicitSetterTests(TestHost& host, std::string output_dir, const Config& config);
38
39 void Initialize() override;
40
41 private:
42 void CreateGeometry();
43 void Test(const TestConfig& config);
44 void Draw(float x, float y, const std::function<void(int)>& attribute_setter, Attribute test_attribute,
45 int mask = 0xF, float bias = 0.0f, float multiplier = 1.0f);
46
47 private:
48 float test_triangle_width{0.0f};
49 float test_triangle_height{0.0f};
50};
51
52#endif // NXDK_PGRAPH_TESTS_ATTRIBUTE_EXPLICIT_SETTER_TESTS_H
Definition attribute_explicit_setter_tests.h:13
void Initialize() override
Called to initialize the test suite.
Definition attribute_explicit_setter_tests.cpp:31
Definition test_host.h:47
Definition test_suite.h:20
Definition vertex_buffer.h:204
Definition attribute_explicit_setter_tests.h:31
Runtime configuration for TestSuites.
Definition test_suite.h:23