summaryrefslogtreecommitdiff
path: root/src/video_core/vertex_shader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core/vertex_shader.cpp')
-rw-r--r--src/video_core/vertex_shader.cpp27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/video_core/vertex_shader.cpp b/src/video_core/vertex_shader.cpp
index bed5081a0..ff825e2e1 100644
--- a/src/video_core/vertex_shader.cpp
+++ b/src/video_core/vertex_shader.cpp
@@ -30,6 +30,8 @@ static struct {
30 Math::Vec4<float24> f[96]; 30 Math::Vec4<float24> f[96];
31 31
32 std::array<bool,16> b; 32 std::array<bool,16> b;
33
34 std::array<Math::Vec4<u8>,4> i;
33} shader_uniforms; 35} shader_uniforms;
34 36
35// TODO: Not sure where the shader binary and swizzle patterns are supposed to be loaded to! 37// TODO: Not sure where the shader binary and swizzle patterns are supposed to be loaded to!
@@ -37,33 +39,31 @@ static struct {
37static std::array<u32, 1024> shader_memory; 39static std::array<u32, 1024> shader_memory;
38static std::array<u32, 1024> swizzle_data; 40static std::array<u32, 1024> swizzle_data;
39 41
40void SubmitShaderMemoryChange(u32 addr, u32 value) 42void SubmitShaderMemoryChange(u32 addr, u32 value) {
41{
42 shader_memory[addr] = value; 43 shader_memory[addr] = value;
43} 44}
44 45
45void SubmitSwizzleDataChange(u32 addr, u32 value) 46void SubmitSwizzleDataChange(u32 addr, u32 value) {
46{
47 swizzle_data[addr] = value; 47 swizzle_data[addr] = value;
48} 48}
49 49
50Math::Vec4<float24>& GetFloatUniform(u32 index) 50Math::Vec4<float24>& GetFloatUniform(u32 index) {
51{
52 return shader_uniforms.f[index]; 51 return shader_uniforms.f[index];
53} 52}
54 53
55bool& GetBoolUniform(u32 index) 54bool& GetBoolUniform(u32 index) {
56{
57 return shader_uniforms.b[index]; 55 return shader_uniforms.b[index];
58} 56}
59 57
60const std::array<u32, 1024>& GetShaderBinary() 58Math::Vec4<u8>& GetIntUniform(u32 index) {
61{ 59 return shader_uniforms.i[index];
60}
61
62const std::array<u32, 1024>& GetShaderBinary() {
62 return shader_memory; 63 return shader_memory;
63} 64}
64 65
65const std::array<u32, 1024>& GetSwizzlePatterns() 66const std::array<u32, 1024>& GetSwizzlePatterns() {
66{
67 return swizzle_data; 67 return swizzle_data;
68} 68}
69 69
@@ -437,8 +437,7 @@ static void ProcessShaderCode(VertexShaderState& state) {
437 } 437 }
438} 438}
439 439
440OutputVertex RunShader(const InputVertex& input, int num_attributes) 440OutputVertex RunShader(const InputVertex& input, int num_attributes) {
441{
442 VertexShaderState state; 441 VertexShaderState state;
443 442
444 const u32* main = &shader_memory[registers.vs_main_offset]; 443 const u32* main = &shader_memory[registers.vs_main_offset];