summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Subv2018-06-08 17:04:41 -0500
committerGravatar Subv2018-06-08 17:04:41 -0500
commitc712dafaeee1a6deff1a6bb80650d14109c89fb9 (patch)
tree041a88a5663cc2da368c8ff10179af933c3718ff /src
parentMerge pull request #547 from Subv/compressed_alignment (diff)
downloadyuzu-c712dafaeee1a6deff1a6bb80650d14109c89fb9.tar.gz
yuzu-c712dafaeee1a6deff1a6bb80650d14109c89fb9.tar.xz
yuzu-c712dafaeee1a6deff1a6bb80650d14109c89fb9.zip
GPU: Added registers for normal and independent blending.
Diffstat (limited to 'src')
-rw-r--r--src/video_core/engines/maxwell_3d.h31
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp27
2 files changed, 27 insertions, 31 deletions
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h
index 56b837372..2dc251205 100644
--- a/src/video_core/engines/maxwell_3d.h
+++ b/src/video_core/engines/maxwell_3d.h
@@ -318,6 +318,7 @@ public:
318 Equation equation_a; 318 Equation equation_a;
319 Factor factor_source_a; 319 Factor factor_source_a;
320 Factor factor_dest_a; 320 Factor factor_dest_a;
321 INSERT_PADDING_WORDS(1);
321 }; 322 };
322 323
323 union { 324 union {
@@ -432,7 +433,27 @@ public:
432 }; 433 };
433 } rt_control; 434 } rt_control;
434 435
435 INSERT_PADDING_WORDS(0xCF); 436 INSERT_PADDING_WORDS(0x31);
437
438 u32 independent_blend_enable;
439
440 INSERT_PADDING_WORDS(0x15);
441
442 struct {
443 u32 separate_alpha;
444 Blend::Equation equation_rgb;
445 Blend::Factor factor_source_rgb;
446 Blend::Factor factor_dest_rgb;
447 Blend::Equation equation_a;
448 Blend::Factor factor_source_a;
449 INSERT_PADDING_WORDS(1);
450 Blend::Factor factor_dest_a;
451
452 u32 enable_common;
453 u32 enable[NumRenderTargets];
454 } blend;
455
456 INSERT_PADDING_WORDS(0x77);
436 457
437 struct { 458 struct {
438 u32 tsc_address_high; 459 u32 tsc_address_high;
@@ -557,9 +578,7 @@ public:
557 578
558 } vertex_array[NumVertexArrays]; 579 } vertex_array[NumVertexArrays];
559 580
560 Blend blend; 581 Blend independent_blend[NumRenderTargets];
561
562 INSERT_PADDING_WORDS(0x39);
563 582
564 struct { 583 struct {
565 u32 limit_high; 584 u32 limit_high;
@@ -722,6 +741,8 @@ ASSERT_REG_POSITION(vertex_buffer, 0x35D);
722ASSERT_REG_POSITION(zeta, 0x3F8); 741ASSERT_REG_POSITION(zeta, 0x3F8);
723ASSERT_REG_POSITION(vertex_attrib_format[0], 0x458); 742ASSERT_REG_POSITION(vertex_attrib_format[0], 0x458);
724ASSERT_REG_POSITION(rt_control, 0x487); 743ASSERT_REG_POSITION(rt_control, 0x487);
744ASSERT_REG_POSITION(independent_blend_enable, 0x4B9);
745ASSERT_REG_POSITION(blend, 0x4CF);
725ASSERT_REG_POSITION(tsc, 0x557); 746ASSERT_REG_POSITION(tsc, 0x557);
726ASSERT_REG_POSITION(tic, 0x55D); 747ASSERT_REG_POSITION(tic, 0x55D);
727ASSERT_REG_POSITION(code_address, 0x582); 748ASSERT_REG_POSITION(code_address, 0x582);
@@ -729,7 +750,7 @@ ASSERT_REG_POSITION(draw, 0x585);
729ASSERT_REG_POSITION(index_array, 0x5F2); 750ASSERT_REG_POSITION(index_array, 0x5F2);
730ASSERT_REG_POSITION(query, 0x6C0); 751ASSERT_REG_POSITION(query, 0x6C0);
731ASSERT_REG_POSITION(vertex_array[0], 0x700); 752ASSERT_REG_POSITION(vertex_array[0], 0x700);
732ASSERT_REG_POSITION(blend, 0x780); 753ASSERT_REG_POSITION(independent_blend, 0x780);
733ASSERT_REG_POSITION(vertex_array_limit[0], 0x7C0); 754ASSERT_REG_POSITION(vertex_array_limit[0], 0x7C0);
734ASSERT_REG_POSITION(shader_config[0], 0x800); 755ASSERT_REG_POSITION(shader_config[0], 0x800);
735ASSERT_REG_POSITION(const_buffer, 0x8E0); 756ASSERT_REG_POSITION(const_buffer, 0x8E0);
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index 59761c6b1..6bc0dbd38 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -455,32 +455,7 @@ void RasterizerOpenGL::DrawArrays() {
455 } 455 }
456} 456}
457 457
458void RasterizerOpenGL::NotifyMaxwellRegisterChanged(u32 method) { 458void RasterizerOpenGL::NotifyMaxwellRegisterChanged(u32 method) {}
459 const auto& regs = Core::System().GetInstance().GPU().Maxwell3D().regs;
460 switch (method) {
461 case MAXWELL3D_REG_INDEX(blend.separate_alpha):
462 ASSERT_MSG(false, "unimplemented");
463 break;
464 case MAXWELL3D_REG_INDEX(blend.equation_rgb):
465 state.blend.rgb_equation = MaxwellToGL::BlendEquation(regs.blend.equation_rgb);
466 break;
467 case MAXWELL3D_REG_INDEX(blend.factor_source_rgb):
468 state.blend.src_rgb_func = MaxwellToGL::BlendFunc(regs.blend.factor_source_rgb);
469 break;
470 case MAXWELL3D_REG_INDEX(blend.factor_dest_rgb):
471 state.blend.dst_rgb_func = MaxwellToGL::BlendFunc(regs.blend.factor_dest_rgb);
472 break;
473 case MAXWELL3D_REG_INDEX(blend.equation_a):
474 state.blend.a_equation = MaxwellToGL::BlendEquation(regs.blend.equation_a);
475 break;
476 case MAXWELL3D_REG_INDEX(blend.factor_source_a):
477 state.blend.src_a_func = MaxwellToGL::BlendFunc(regs.blend.factor_source_a);
478 break;
479 case MAXWELL3D_REG_INDEX(blend.factor_dest_a):
480 state.blend.dst_a_func = MaxwellToGL::BlendFunc(regs.blend.factor_dest_a);
481 break;
482 }
483}
484 459
485void RasterizerOpenGL::FlushAll() { 460void RasterizerOpenGL::FlushAll() {
486 MICROPROFILE_SCOPE(OpenGL_CacheManagement); 461 MICROPROFILE_SCOPE(OpenGL_CacheManagement);