diff options
| author | 2018-06-08 17:04:41 -0500 | |
|---|---|---|
| committer | 2018-06-08 17:04:41 -0500 | |
| commit | c712dafaeee1a6deff1a6bb80650d14109c89fb9 (patch) | |
| tree | 041a88a5663cc2da368c8ff10179af933c3718ff /src | |
| parent | Merge pull request #547 from Subv/compressed_alignment (diff) | |
| download | yuzu-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.h | 31 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 27 |
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); | |||
| 722 | ASSERT_REG_POSITION(zeta, 0x3F8); | 741 | ASSERT_REG_POSITION(zeta, 0x3F8); |
| 723 | ASSERT_REG_POSITION(vertex_attrib_format[0], 0x458); | 742 | ASSERT_REG_POSITION(vertex_attrib_format[0], 0x458); |
| 724 | ASSERT_REG_POSITION(rt_control, 0x487); | 743 | ASSERT_REG_POSITION(rt_control, 0x487); |
| 744 | ASSERT_REG_POSITION(independent_blend_enable, 0x4B9); | ||
| 745 | ASSERT_REG_POSITION(blend, 0x4CF); | ||
| 725 | ASSERT_REG_POSITION(tsc, 0x557); | 746 | ASSERT_REG_POSITION(tsc, 0x557); |
| 726 | ASSERT_REG_POSITION(tic, 0x55D); | 747 | ASSERT_REG_POSITION(tic, 0x55D); |
| 727 | ASSERT_REG_POSITION(code_address, 0x582); | 748 | ASSERT_REG_POSITION(code_address, 0x582); |
| @@ -729,7 +750,7 @@ ASSERT_REG_POSITION(draw, 0x585); | |||
| 729 | ASSERT_REG_POSITION(index_array, 0x5F2); | 750 | ASSERT_REG_POSITION(index_array, 0x5F2); |
| 730 | ASSERT_REG_POSITION(query, 0x6C0); | 751 | ASSERT_REG_POSITION(query, 0x6C0); |
| 731 | ASSERT_REG_POSITION(vertex_array[0], 0x700); | 752 | ASSERT_REG_POSITION(vertex_array[0], 0x700); |
| 732 | ASSERT_REG_POSITION(blend, 0x780); | 753 | ASSERT_REG_POSITION(independent_blend, 0x780); |
| 733 | ASSERT_REG_POSITION(vertex_array_limit[0], 0x7C0); | 754 | ASSERT_REG_POSITION(vertex_array_limit[0], 0x7C0); |
| 734 | ASSERT_REG_POSITION(shader_config[0], 0x800); | 755 | ASSERT_REG_POSITION(shader_config[0], 0x800); |
| 735 | ASSERT_REG_POSITION(const_buffer, 0x8E0); | 756 | ASSERT_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 | ||
| 458 | void RasterizerOpenGL::NotifyMaxwellRegisterChanged(u32 method) { | 458 | void 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 | ||
| 485 | void RasterizerOpenGL::FlushAll() { | 460 | void RasterizerOpenGL::FlushAll() { |
| 486 | MICROPROFILE_SCOPE(OpenGL_CacheManagement); | 461 | MICROPROFILE_SCOPE(OpenGL_CacheManagement); |