diff options
| author | 2018-08-11 22:39:02 -0400 | |
|---|---|---|
| committer | 2018-08-11 22:39:02 -0400 | |
| commit | f2c7b5dcd69fc27fd1710e61e8a96133fe160792 (patch) | |
| tree | 19aa99cdf7a2f9cd4736fa62d44269f66b02bed6 /src | |
| parent | Merge pull request #1023 from Subv/invalid_attribs (diff) | |
| parent | GPU/Maxwell3D: Implemented an alternative set of blend factors. (diff) | |
| download | yuzu-f2c7b5dcd69fc27fd1710e61e8a96133fe160792.tar.gz yuzu-f2c7b5dcd69fc27fd1710e61e8a96133fe160792.tar.xz yuzu-f2c7b5dcd69fc27fd1710e61e8a96133fe160792.zip | |
Merge pull request #1024 from Subv/blend_gl
GPU/Maxwell3D: Implemented an alternative set of blend factors.
Diffstat (limited to '')
| -rw-r--r-- | src/video_core/engines/maxwell_3d.h | 21 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/maxwell_to_gl.h | 19 |
2 files changed, 40 insertions, 0 deletions
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h index d795323b0..1b30ce018 100644 --- a/src/video_core/engines/maxwell_3d.h +++ b/src/video_core/engines/maxwell_3d.h | |||
| @@ -357,6 +357,27 @@ public: | |||
| 357 | OneMinusConstantColor = 0x62, | 357 | OneMinusConstantColor = 0x62, |
| 358 | ConstantAlpha = 0x63, | 358 | ConstantAlpha = 0x63, |
| 359 | OneMinusConstantAlpha = 0x64, | 359 | OneMinusConstantAlpha = 0x64, |
| 360 | |||
| 361 | // These values are used by Nouveau and some games. | ||
| 362 | ZeroGL = 0x4000, | ||
| 363 | OneGL = 0x4001, | ||
| 364 | SourceColorGL = 0x4300, | ||
| 365 | OneMinusSourceColorGL = 0x4301, | ||
| 366 | SourceAlphaGL = 0x4302, | ||
| 367 | OneMinusSourceAlphaGL = 0x4303, | ||
| 368 | DestAlphaGL = 0x4304, | ||
| 369 | OneMinusDestAlphaGL = 0x4305, | ||
| 370 | DestColorGL = 0x4306, | ||
| 371 | OneMinusDestColorGL = 0x4307, | ||
| 372 | SourceAlphaSaturateGL = 0x4308, | ||
| 373 | ConstantColorGL = 0xc001, | ||
| 374 | OneMinusConstantColorGL = 0xc002, | ||
| 375 | ConstantAlphaGL = 0xc003, | ||
| 376 | OneMinusConstantAlphaGL = 0xc004, | ||
| 377 | Source1ColorGL = 0xc900, | ||
| 378 | OneMinusSource1ColorGL = 0xc901, | ||
| 379 | Source1AlphaGL = 0xc902, | ||
| 380 | OneMinusSource1AlphaGL = 0xc903, | ||
| 360 | }; | 381 | }; |
| 361 | 382 | ||
| 362 | u32 separate_alpha; | 383 | u32 separate_alpha; |
diff --git a/src/video_core/renderer_opengl/maxwell_to_gl.h b/src/video_core/renderer_opengl/maxwell_to_gl.h index c439446b1..5afd20dbe 100644 --- a/src/video_core/renderer_opengl/maxwell_to_gl.h +++ b/src/video_core/renderer_opengl/maxwell_to_gl.h | |||
| @@ -156,42 +156,61 @@ inline GLenum BlendEquation(Maxwell::Blend::Equation equation) { | |||
| 156 | inline GLenum BlendFunc(Maxwell::Blend::Factor factor) { | 156 | inline GLenum BlendFunc(Maxwell::Blend::Factor factor) { |
| 157 | switch (factor) { | 157 | switch (factor) { |
| 158 | case Maxwell::Blend::Factor::Zero: | 158 | case Maxwell::Blend::Factor::Zero: |
| 159 | case Maxwell::Blend::Factor::ZeroGL: | ||
| 159 | return GL_ZERO; | 160 | return GL_ZERO; |
| 160 | case Maxwell::Blend::Factor::One: | 161 | case Maxwell::Blend::Factor::One: |
| 162 | case Maxwell::Blend::Factor::OneGL: | ||
| 161 | return GL_ONE; | 163 | return GL_ONE; |
| 162 | case Maxwell::Blend::Factor::SourceColor: | 164 | case Maxwell::Blend::Factor::SourceColor: |
| 165 | case Maxwell::Blend::Factor::SourceColorGL: | ||
| 163 | return GL_SRC_COLOR; | 166 | return GL_SRC_COLOR; |
| 164 | case Maxwell::Blend::Factor::OneMinusSourceColor: | 167 | case Maxwell::Blend::Factor::OneMinusSourceColor: |
| 168 | case Maxwell::Blend::Factor::OneMinusSourceColorGL: | ||
| 165 | return GL_ONE_MINUS_SRC_COLOR; | 169 | return GL_ONE_MINUS_SRC_COLOR; |
| 166 | case Maxwell::Blend::Factor::SourceAlpha: | 170 | case Maxwell::Blend::Factor::SourceAlpha: |
| 171 | case Maxwell::Blend::Factor::SourceAlphaGL: | ||
| 167 | return GL_SRC_ALPHA; | 172 | return GL_SRC_ALPHA; |
| 168 | case Maxwell::Blend::Factor::OneMinusSourceAlpha: | 173 | case Maxwell::Blend::Factor::OneMinusSourceAlpha: |
| 174 | case Maxwell::Blend::Factor::OneMinusSourceAlphaGL: | ||
| 169 | return GL_ONE_MINUS_SRC_ALPHA; | 175 | return GL_ONE_MINUS_SRC_ALPHA; |
| 170 | case Maxwell::Blend::Factor::DestAlpha: | 176 | case Maxwell::Blend::Factor::DestAlpha: |
| 177 | case Maxwell::Blend::Factor::DestAlphaGL: | ||
| 171 | return GL_DST_ALPHA; | 178 | return GL_DST_ALPHA; |
| 172 | case Maxwell::Blend::Factor::OneMinusDestAlpha: | 179 | case Maxwell::Blend::Factor::OneMinusDestAlpha: |
| 180 | case Maxwell::Blend::Factor::OneMinusDestAlphaGL: | ||
| 173 | return GL_ONE_MINUS_DST_ALPHA; | 181 | return GL_ONE_MINUS_DST_ALPHA; |
| 174 | case Maxwell::Blend::Factor::DestColor: | 182 | case Maxwell::Blend::Factor::DestColor: |
| 183 | case Maxwell::Blend::Factor::DestColorGL: | ||
| 175 | return GL_DST_COLOR; | 184 | return GL_DST_COLOR; |
| 176 | case Maxwell::Blend::Factor::OneMinusDestColor: | 185 | case Maxwell::Blend::Factor::OneMinusDestColor: |
| 186 | case Maxwell::Blend::Factor::OneMinusDestColorGL: | ||
| 177 | return GL_ONE_MINUS_DST_COLOR; | 187 | return GL_ONE_MINUS_DST_COLOR; |
| 178 | case Maxwell::Blend::Factor::SourceAlphaSaturate: | 188 | case Maxwell::Blend::Factor::SourceAlphaSaturate: |
| 189 | case Maxwell::Blend::Factor::SourceAlphaSaturateGL: | ||
| 179 | return GL_SRC_ALPHA_SATURATE; | 190 | return GL_SRC_ALPHA_SATURATE; |
| 180 | case Maxwell::Blend::Factor::Source1Color: | 191 | case Maxwell::Blend::Factor::Source1Color: |
| 192 | case Maxwell::Blend::Factor::Source1ColorGL: | ||
| 181 | return GL_SRC1_COLOR; | 193 | return GL_SRC1_COLOR; |
| 182 | case Maxwell::Blend::Factor::OneMinusSource1Color: | 194 | case Maxwell::Blend::Factor::OneMinusSource1Color: |
| 195 | case Maxwell::Blend::Factor::OneMinusSource1ColorGL: | ||
| 183 | return GL_ONE_MINUS_SRC1_COLOR; | 196 | return GL_ONE_MINUS_SRC1_COLOR; |
| 184 | case Maxwell::Blend::Factor::Source1Alpha: | 197 | case Maxwell::Blend::Factor::Source1Alpha: |
| 198 | case Maxwell::Blend::Factor::Source1AlphaGL: | ||
| 185 | return GL_SRC1_ALPHA; | 199 | return GL_SRC1_ALPHA; |
| 186 | case Maxwell::Blend::Factor::OneMinusSource1Alpha: | 200 | case Maxwell::Blend::Factor::OneMinusSource1Alpha: |
| 201 | case Maxwell::Blend::Factor::OneMinusSource1AlphaGL: | ||
| 187 | return GL_ONE_MINUS_SRC1_ALPHA; | 202 | return GL_ONE_MINUS_SRC1_ALPHA; |
| 188 | case Maxwell::Blend::Factor::ConstantColor: | 203 | case Maxwell::Blend::Factor::ConstantColor: |
| 204 | case Maxwell::Blend::Factor::ConstantColorGL: | ||
| 189 | return GL_CONSTANT_COLOR; | 205 | return GL_CONSTANT_COLOR; |
| 190 | case Maxwell::Blend::Factor::OneMinusConstantColor: | 206 | case Maxwell::Blend::Factor::OneMinusConstantColor: |
| 207 | case Maxwell::Blend::Factor::OneMinusConstantColorGL: | ||
| 191 | return GL_ONE_MINUS_CONSTANT_COLOR; | 208 | return GL_ONE_MINUS_CONSTANT_COLOR; |
| 192 | case Maxwell::Blend::Factor::ConstantAlpha: | 209 | case Maxwell::Blend::Factor::ConstantAlpha: |
| 210 | case Maxwell::Blend::Factor::ConstantAlphaGL: | ||
| 193 | return GL_CONSTANT_ALPHA; | 211 | return GL_CONSTANT_ALPHA; |
| 194 | case Maxwell::Blend::Factor::OneMinusConstantAlpha: | 212 | case Maxwell::Blend::Factor::OneMinusConstantAlpha: |
| 213 | case Maxwell::Blend::Factor::OneMinusConstantAlphaGL: | ||
| 195 | return GL_ONE_MINUS_CONSTANT_ALPHA; | 214 | return GL_ONE_MINUS_CONSTANT_ALPHA; |
| 196 | } | 215 | } |
| 197 | LOG_CRITICAL(Render_OpenGL, "Unimplemented blend factor={}", static_cast<u32>(factor)); | 216 | LOG_CRITICAL(Render_OpenGL, "Unimplemented blend factor={}", static_cast<u32>(factor)); |