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