summaryrefslogtreecommitdiff
path: root/src/video_core
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2015-05-29 15:09:26 -0700
committerGravatar Yuri Kunde Schlesner2015-05-29 15:09:26 -0700
commita489a846563fc64f236c7ede69ce0eb34af3521a (patch)
tree706e345043532d90cd8ca5c41af67fc31dfa7d2e /src/video_core
parentMerge pull request #817 from linkmauve/citra.ico (diff)
parentTravis: Add a check for trailing whitespace before any actual compilation. (diff)
downloadyuzu-a489a846563fc64f236c7ede69ce0eb34af3521a.tar.gz
yuzu-a489a846563fc64f236c7ede69ce0eb34af3521a.tar.xz
yuzu-a489a846563fc64f236c7ede69ce0eb34af3521a.zip
Merge pull request #818 from linkmauve/no-trailing-whitespace
Ban trailing whitespace from the entire project, forever
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/command_processor.cpp8
-rw-r--r--src/video_core/debug_utils/debug_utils.cpp2
-rw-r--r--src/video_core/math.h2
-rw-r--r--src/video_core/pica.h8
-rw-r--r--src/video_core/rasterizer.cpp2
-rw-r--r--src/video_core/renderer_opengl/generated/gl_3_2_core.c16
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp2
-rw-r--r--src/video_core/renderer_opengl/gl_state.cpp2
-rw-r--r--src/video_core/renderer_opengl/gl_state.h2
-rw-r--r--src/video_core/renderer_opengl/renderer_opengl.cpp2
-rw-r--r--src/video_core/vertex_shader.cpp4
11 files changed, 25 insertions, 25 deletions
diff --git a/src/video_core/command_processor.cpp b/src/video_core/command_processor.cpp
index 100d8c7c1..29ba6b769 100644
--- a/src/video_core/command_processor.cpp
+++ b/src/video_core/command_processor.cpp
@@ -136,7 +136,7 @@ static inline void WritePicaReg(u32 id, u32 value, u32 mask) {
136 input.attr[i][0].ToFloat32(), input.attr[i][1].ToFloat32(), 136 input.attr[i][0].ToFloat32(), input.attr[i][1].ToFloat32(),
137 input.attr[i][2].ToFloat32(), input.attr[i][3].ToFloat32()); 137 input.attr[i][2].ToFloat32(), input.attr[i][3].ToFloat32());
138 } 138 }
139 139
140 // Load per-vertex data from the loader arrays 140 // Load per-vertex data from the loader arrays
141 for (unsigned int comp = 0; comp < vertex_attribute_elements[i]; ++comp) { 141 for (unsigned int comp = 0; comp < vertex_attribute_elements[i]; ++comp) {
142 const u8* srcdata = Memory::GetPhysicalPointer(vertex_attribute_sources[i] + vertex_attribute_strides[i] * vertex + comp * vertex_attribute_element_size[i]); 142 const u8* srcdata = Memory::GetPhysicalPointer(vertex_attribute_sources[i] + vertex_attribute_strides[i] * vertex + comp * vertex_attribute_element_size[i]);
@@ -193,7 +193,7 @@ static inline void WritePicaReg(u32 id, u32 value, u32 mask) {
193 const Pica::VertexShader::OutputVertex& v2) { 193 const Pica::VertexShader::OutputVertex& v2) {
194 VideoCore::g_renderer->hw_rasterizer->AddTriangle(v0, v1, v2); 194 VideoCore::g_renderer->hw_rasterizer->AddTriangle(v0, v1, v2);
195 }; 195 };
196 196
197 primitive_assembler.SubmitVertex(output, AddHWTriangle); 197 primitive_assembler.SubmitVertex(output, AddHWTriangle);
198 } else { 198 } else {
199 // Send to triangle clipper 199 // Send to triangle clipper
@@ -282,7 +282,7 @@ static inline void WritePicaReg(u32 id, u32 value, u32 mask) {
282 } 282 }
283 break; 283 break;
284 } 284 }
285 285
286 // Load default vertex input attributes 286 // Load default vertex input attributes
287 case PICA_REG_INDEX_WORKAROUND(vs_default_attributes_setup.set_value[0], 0x233): 287 case PICA_REG_INDEX_WORKAROUND(vs_default_attributes_setup.set_value[0], 0x233):
288 case PICA_REG_INDEX_WORKAROUND(vs_default_attributes_setup.set_value[1], 0x234): 288 case PICA_REG_INDEX_WORKAROUND(vs_default_attributes_setup.set_value[1], 0x234):
@@ -306,7 +306,7 @@ static inline void WritePicaReg(u32 id, u32 value, u32 mask) {
306 } 306 }
307 307
308 Math::Vec4<float24>& attribute = g_state.vs.default_attributes[setup.index]; 308 Math::Vec4<float24>& attribute = g_state.vs.default_attributes[setup.index];
309 309
310 // NOTE: The destination component order indeed is "backwards" 310 // NOTE: The destination component order indeed is "backwards"
311 attribute.w = float24::FromRawFloat24(default_attr_write_buffer[0] >> 8); 311 attribute.w = float24::FromRawFloat24(default_attr_write_buffer[0] >> 8);
312 attribute.z = float24::FromRawFloat24(((default_attr_write_buffer[0] & 0xFF) << 16) | ((default_attr_write_buffer[1] >> 16) & 0xFFFF)); 312 attribute.z = float24::FromRawFloat24(((default_attr_write_buffer[0] & 0xFF) << 16) | ((default_attr_write_buffer[1] >> 16) & 0xFFFF));
diff --git a/src/video_core/debug_utils/debug_utils.cpp b/src/video_core/debug_utils/debug_utils.cpp
index 7987b922c..b92cd1a7e 100644
--- a/src/video_core/debug_utils/debug_utils.cpp
+++ b/src/video_core/debug_utils/debug_utils.cpp
@@ -319,7 +319,7 @@ const Math::Vec4<u8> LookupTexture(const u8* source, int x, int y, const Texture
319 // TODO(neobrain): Fix code design to unify vertical block offsets! 319 // TODO(neobrain): Fix code design to unify vertical block offsets!
320 source += coarse_y * info.stride; 320 source += coarse_y * info.stride;
321 } 321 }
322 322
323 // TODO: Assert that width/height are multiples of block dimensions 323 // TODO: Assert that width/height are multiples of block dimensions
324 324
325 switch (info.format) { 325 switch (info.format) {
diff --git a/src/video_core/math.h b/src/video_core/math.h
index f9a822658..4928c9bf2 100644
--- a/src/video_core/math.h
+++ b/src/video_core/math.h
@@ -461,7 +461,7 @@ public:
461 // e.g. Vec2 uv() { return Vec2(x,y); } 461 // e.g. Vec2 uv() { return Vec2(x,y); }
462 462
463 // _DEFINE_SWIZZLER2 defines a single such function 463 // _DEFINE_SWIZZLER2 defines a single such function
464 // DEFINE_SWIZZLER2_COMP1 defines one-component functions for all component names (x<->r) 464 // DEFINE_SWIZZLER2_COMP1 defines one-component functions for all component names (x<->r)
465 // DEFINE_SWIZZLER2_COMP2 defines two component functions for all component names (x<->r) and permutations (xy<->yx) 465 // DEFINE_SWIZZLER2_COMP2 defines two component functions for all component names (x<->r) and permutations (xy<->yx)
466#define _DEFINE_SWIZZLER2(a, b, name) const Vec2<T> name() const { return Vec2<T>(a, b); } 466#define _DEFINE_SWIZZLER2(a, b, name) const Vec2<T> name() const { return Vec2<T>(a, b); }
467#define DEFINE_SWIZZLER2_COMP1(a, a2) \ 467#define DEFINE_SWIZZLER2_COMP1(a, a2) \
diff --git a/src/video_core/pica.h b/src/video_core/pica.h
index b67dce1a9..6ebeb08f7 100644
--- a/src/video_core/pica.h
+++ b/src/video_core/pica.h
@@ -16,7 +16,7 @@
16#include "common/common_types.h" 16#include "common/common_types.h"
17#include "common/logging/log.h" 17#include "common/logging/log.h"
18 18
19#include "math.h" 19#include "math.h"
20 20
21namespace Pica { 21namespace Pica {
22 22
@@ -337,7 +337,7 @@ struct Regs {
337 return (stage_index < 4) && (update_mask_a & (1 << stage_index)); 337 return (stage_index < 4) && (update_mask_a & (1 << stage_index));
338 } 338 }
339 } tev_combiner_buffer_input; 339 } tev_combiner_buffer_input;
340 340
341 INSERT_PADDING_WORDS(0xf); 341 INSERT_PADDING_WORDS(0xf);
342 TevStageConfig tev_stage4; 342 TevStageConfig tev_stage4;
343 INSERT_PADDING_WORDS(0x3); 343 INSERT_PADDING_WORDS(0x3);
@@ -703,11 +703,11 @@ struct Regs {
703 struct { 703 struct {
704 // Index of the current default attribute 704 // Index of the current default attribute
705 u32 index; 705 u32 index;
706 706
707 // Writing to these registers sets the "current" default attribute. 707 // Writing to these registers sets the "current" default attribute.
708 u32 set_value[3]; 708 u32 set_value[3];
709 } vs_default_attributes_setup; 709 } vs_default_attributes_setup;
710 710
711 INSERT_PADDING_WORDS(0x28); 711 INSERT_PADDING_WORDS(0x28);
712 712
713 enum class TriangleTopology : u32 { 713 enum class TriangleTopology : u32 {
diff --git a/src/video_core/rasterizer.cpp b/src/video_core/rasterizer.cpp
index 767ff4205..6df3a74f2 100644
--- a/src/video_core/rasterizer.cpp
+++ b/src/video_core/rasterizer.cpp
@@ -104,7 +104,7 @@ static u32 GetDepth(int x, int y) {
104 u8* depth_buffer = Memory::GetPhysicalPointer(addr); 104 u8* depth_buffer = Memory::GetPhysicalPointer(addr);
105 105
106 y = framebuffer.height - y; 106 y = framebuffer.height - y;
107 107
108 const u32 coarse_y = y & ~7; 108 const u32 coarse_y = y & ~7;
109 u32 bytes_per_pixel = Regs::BytesPerDepthPixel(framebuffer.depth_format); 109 u32 bytes_per_pixel = Regs::BytesPerDepthPixel(framebuffer.depth_format);
110 u32 stride = framebuffer.width * bytes_per_pixel; 110 u32 stride = framebuffer.width * bytes_per_pixel;
diff --git a/src/video_core/renderer_opengl/generated/gl_3_2_core.c b/src/video_core/renderer_opengl/generated/gl_3_2_core.c
index ef29972d7..95fd29c0a 100644
--- a/src/video_core/renderer_opengl/generated/gl_3_2_core.c
+++ b/src/video_core/renderer_opengl/generated/gl_3_2_core.c
@@ -62,9 +62,9 @@ static int TestPointer(const PROC pTest)
62 ptrdiff_t iTest; 62 ptrdiff_t iTest;
63 if(!pTest) return 0; 63 if(!pTest) return 0;
64 iTest = (ptrdiff_t)pTest; 64 iTest = (ptrdiff_t)pTest;
65 65
66 if(iTest == 1 || iTest == 2 || iTest == 3 || iTest == -1) return 0; 66 if(iTest == 1 || iTest == 2 || iTest == 3 || iTest == -1) return 0;
67 67
68 return 1; 68 return 1;
69} 69}
70 70
@@ -79,7 +79,7 @@ static PROC WinGetProcAddress(const char *name)
79 glMod = GetModuleHandleA("OpenGL32.dll"); 79 glMod = GetModuleHandleA("OpenGL32.dll");
80 return (PROC)GetProcAddress(glMod, (LPCSTR)name); 80 return (PROC)GetProcAddress(glMod, (LPCSTR)name);
81} 81}
82 82
83#define IntGetProcAddress(name) WinGetProcAddress(name) 83#define IntGetProcAddress(name) WinGetProcAddress(name)
84#else 84#else
85 #if defined(__APPLE__) 85 #if defined(__APPLE__)
@@ -1083,7 +1083,7 @@ static ogl_StrToExtMap *FindExtEntry(const char *extensionName)
1083 if(strcmp(extensionName, currLoc->extensionName) == 0) 1083 if(strcmp(extensionName, currLoc->extensionName) == 0)
1084 return currLoc; 1084 return currLoc;
1085 } 1085 }
1086 1086
1087 return NULL; 1087 return NULL;
1088} 1088}
1089 1089
@@ -1135,15 +1135,15 @@ int ogl_LoadFunctions()
1135{ 1135{
1136 int numFailed = 0; 1136 int numFailed = 0;
1137 ClearExtensionVars(); 1137 ClearExtensionVars();
1138 1138
1139 _ptrc_glGetIntegerv = (void (CODEGEN_FUNCPTR *)(GLenum, GLint *))IntGetProcAddress("glGetIntegerv"); 1139 _ptrc_glGetIntegerv = (void (CODEGEN_FUNCPTR *)(GLenum, GLint *))IntGetProcAddress("glGetIntegerv");
1140 if(!_ptrc_glGetIntegerv) return ogl_LOAD_FAILED; 1140 if(!_ptrc_glGetIntegerv) return ogl_LOAD_FAILED;
1141 _ptrc_glGetStringi = (const GLubyte * (CODEGEN_FUNCPTR *)(GLenum, GLuint))IntGetProcAddress("glGetStringi"); 1141 _ptrc_glGetStringi = (const GLubyte * (CODEGEN_FUNCPTR *)(GLenum, GLuint))IntGetProcAddress("glGetStringi");
1142 if(!_ptrc_glGetStringi) return ogl_LOAD_FAILED; 1142 if(!_ptrc_glGetStringi) return ogl_LOAD_FAILED;
1143 1143
1144 ProcExtsFromExtList(); 1144 ProcExtsFromExtList();
1145 numFailed = Load_Version_3_2(); 1145 numFailed = Load_Version_3_2();
1146 1146
1147 if(numFailed == 0) 1147 if(numFailed == 0)
1148 return ogl_LOAD_SUCCEEDED; 1148 return ogl_LOAD_SUCCEEDED;
1149 else 1149 else
@@ -1177,7 +1177,7 @@ int ogl_IsVersionGEQ(int majorVersion, int minorVersion)
1177{ 1177{
1178 if(g_major_version == 0) 1178 if(g_major_version == 0)
1179 GetGLVersion(); 1179 GetGLVersion();
1180 1180
1181 if(majorVersion > g_major_version) return 1; 1181 if(majorVersion > g_major_version) return 1;
1182 if(majorVersion < g_major_version) return 0; 1182 if(majorVersion < g_major_version) return 0;
1183 if(minorVersion >= g_minor_version) return 1; 1183 if(minorVersion >= g_minor_version) return 1;
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index 4b7d099a5..bacdb7172 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -350,7 +350,7 @@ void RasterizerOpenGL::NotifyPicaRegisterChanged(u32 id) {
350 case PICA_REG_INDEX(tev_stage5.color_scale): 350 case PICA_REG_INDEX(tev_stage5.color_scale):
351 SyncTevMultipliers(5, regs.tev_stage5); 351 SyncTevMultipliers(5, regs.tev_stage5);
352 break; 352 break;
353 353
354 // TEV combiner buffer color 354 // TEV combiner buffer color
355 case PICA_REG_INDEX(tev_combiner_buffer_color): 355 case PICA_REG_INDEX(tev_combiner_buffer_color):
356 SyncCombinerColor(); 356 SyncCombinerColor();
diff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cpp
index 1afa58c99..0d7ba1983 100644
--- a/src/video_core/renderer_opengl/gl_state.cpp
+++ b/src/video_core/renderer_opengl/gl_state.cpp
@@ -82,7 +82,7 @@ void OpenGLState::Apply() {
82 } else { 82 } else {
83 glDisable(GL_STENCIL_TEST); 83 glDisable(GL_STENCIL_TEST);
84 } 84 }
85 } 85 }
86 86
87 if (stencil.test_func != cur_state.stencil.test_func || 87 if (stencil.test_func != cur_state.stencil.test_func ||
88 stencil.test_ref != cur_state.stencil.test_ref || 88 stencil.test_ref != cur_state.stencil.test_ref ||
diff --git a/src/video_core/renderer_opengl/gl_state.h b/src/video_core/renderer_opengl/gl_state.h
index 281b7cad5..63dba2761 100644
--- a/src/video_core/renderer_opengl/gl_state.h
+++ b/src/video_core/renderer_opengl/gl_state.h
@@ -61,7 +61,7 @@ public:
61 static const OpenGLState& GetCurState() { 61 static const OpenGLState& GetCurState() {
62 return cur_state; 62 return cur_state;
63 } 63 }
64 64
65 /// Apply this state as the current OpenGL state 65 /// Apply this state as the current OpenGL state
66 void Apply(); 66 void Apply();
67 67
diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp
index 16cf92e20..382aeaa05 100644
--- a/src/video_core/renderer_opengl/renderer_opengl.cpp
+++ b/src/video_core/renderer_opengl/renderer_opengl.cpp
@@ -157,7 +157,7 @@ void RendererOpenGL::LoadFBToActiveGLTexture(const GPU::Regs::FramebufferConfig&
157 state.texture_units[0].enabled_2d = true; 157 state.texture_units[0].enabled_2d = true;
158 state.texture_units[0].texture_2d = texture.handle; 158 state.texture_units[0].texture_2d = texture.handle;
159 state.Apply(); 159 state.Apply();
160 160
161 glActiveTexture(GL_TEXTURE0); 161 glActiveTexture(GL_TEXTURE0);
162 glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint)pixel_stride); 162 glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint)pixel_stride);
163 163
diff --git a/src/video_core/vertex_shader.cpp b/src/video_core/vertex_shader.cpp
index 7d68998f1..4ebb42429 100644
--- a/src/video_core/vertex_shader.cpp
+++ b/src/video_core/vertex_shader.cpp
@@ -330,7 +330,7 @@ static void ProcessShaderCode(VertexShaderState& state) {
330 330
331 case OpCode::Type::MultiplyAdd: 331 case OpCode::Type::MultiplyAdd:
332 { 332 {
333 if ((instr.opcode.Value().EffectiveOpCode() == OpCode::Id::MAD) || 333 if ((instr.opcode.Value().EffectiveOpCode() == OpCode::Id::MAD) ||
334 (instr.opcode.Value().EffectiveOpCode() == OpCode::Id::MADI)) { 334 (instr.opcode.Value().EffectiveOpCode() == OpCode::Id::MADI)) {
335 const SwizzlePattern& swizzle = *(SwizzlePattern*)&swizzle_data[instr.mad.operand_desc_id]; 335 const SwizzlePattern& swizzle = *(SwizzlePattern*)&swizzle_data[instr.mad.operand_desc_id];
336 336
@@ -547,7 +547,7 @@ OutputVertex RunShader(const InputVertex& input, int num_attributes) {
547 const auto& attribute_register_map = regs.vs_input_register_map; 547 const auto& attribute_register_map = regs.vs_input_register_map;
548 float24 dummy_register; 548 float24 dummy_register;
549 boost::fill(state.input_register_table, &dummy_register); 549 boost::fill(state.input_register_table, &dummy_register);
550 550
551 if (num_attributes > 0) state.input_register_table[attribute_register_map.attribute0_register] = &input.attr[0].x; 551 if (num_attributes > 0) state.input_register_table[attribute_register_map.attribute0_register] = &input.attr[0].x;
552 if (num_attributes > 1) state.input_register_table[attribute_register_map.attribute1_register] = &input.attr[1].x; 552 if (num_attributes > 1) state.input_register_table[attribute_register_map.attribute1_register] = &input.attr[1].x;
553 if (num_attributes > 2) state.input_register_table[attribute_register_map.attribute2_register] = &input.attr[2].x; 553 if (num_attributes > 2) state.input_register_table[attribute_register_map.attribute2_register] = &input.attr[2].x;