diff options
| author | 2018-04-14 15:57:58 -0400 | |
|---|---|---|
| committer | 2018-04-14 16:01:41 -0400 | |
| commit | e6224fec275a725bfbb261003c9db44a3da475df (patch) | |
| tree | fe71eabcb16f765a3dbf107d8b7dca9dfde854f0 /src | |
| parent | gl_shader_decompiler: Cleanup log statements. (diff) | |
| download | yuzu-e6224fec275a725bfbb261003c9db44a3da475df.tar.gz yuzu-e6224fec275a725bfbb261003c9db44a3da475df.tar.xz yuzu-e6224fec275a725bfbb261003c9db44a3da475df.zip | |
shaders: Address PR review feedback.
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/engines/shader_bytecode.h | 2 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 14 |
2 files changed, 9 insertions, 7 deletions
diff --git a/src/video_core/engines/shader_bytecode.h b/src/video_core/engines/shader_bytecode.h index e285d097d..98af381df 100644 --- a/src/video_core/engines/shader_bytecode.h +++ b/src/video_core/engines/shader_bytecode.h | |||
| @@ -247,6 +247,7 @@ static_assert(sizeof(OpCode) == 0x8, "Incorrect structure size"); | |||
| 247 | 247 | ||
| 248 | namespace std { | 248 | namespace std { |
| 249 | 249 | ||
| 250 | // TODO(bunne): The below is forbidden by the C++ standard, but works fine. See #330. | ||
| 250 | template <> | 251 | template <> |
| 251 | struct make_unsigned<Tegra::Shader::Attribute> { | 252 | struct make_unsigned<Tegra::Shader::Attribute> { |
| 252 | using type = Tegra::Shader::Attribute; | 253 | using type = Tegra::Shader::Attribute; |
| @@ -281,7 +282,6 @@ enum class SubOp : u64 { | |||
| 281 | Rsq = 0x5, | 282 | Rsq = 0x5, |
| 282 | }; | 283 | }; |
| 283 | 284 | ||
| 284 | #pragma pack(1) | ||
| 285 | union Instruction { | 285 | union Instruction { |
| 286 | Instruction& operator=(const Instruction& instr) { | 286 | Instruction& operator=(const Instruction& instr) { |
| 287 | hex = instr.hex; | 287 | hex = instr.hex; |
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index 6251a4be2..1290fa4cd 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp | |||
| @@ -448,17 +448,19 @@ private: | |||
| 448 | 448 | ||
| 449 | for (const auto& index : declr_input_attribute) { | 449 | for (const auto& index : declr_input_attribute) { |
| 450 | // TODO(bunnei): Use proper number of elements for these | 450 | // TODO(bunnei): Use proper number of elements for these |
| 451 | declarations.AddLine( | 451 | declarations.AddLine("layout(location = " + |
| 452 | "layout(location = " + std::to_string(static_cast<u32>(index) - 8) + ") in vec4 " + | 452 | std::to_string(static_cast<u32>(index) - |
| 453 | GetInputAttribute(index) + ";"); | 453 | static_cast<u32>(Attribute::Index::Attribute_0)) + |
| 454 | ") in vec4 " + GetInputAttribute(index) + ";"); | ||
| 454 | } | 455 | } |
| 455 | declarations.AddLine(""); | 456 | declarations.AddLine(""); |
| 456 | 457 | ||
| 457 | for (const auto& index : declr_output_attribute) { | 458 | for (const auto& index : declr_output_attribute) { |
| 458 | // TODO(bunnei): Use proper number of elements for these | 459 | // TODO(bunnei): Use proper number of elements for these |
| 459 | declarations.AddLine( | 460 | declarations.AddLine("layout(location = " + |
| 460 | "layout(location = " + std::to_string(static_cast<u32>(index) - 8) + ") out vec4 " + | 461 | std::to_string(static_cast<u32>(index) - |
| 461 | GetOutputAttribute(index) + ";"); | 462 | static_cast<u32>(Attribute::Index::Attribute_0)) + |
| 463 | ") out vec4 " + GetOutputAttribute(index) + ";"); | ||
| 462 | } | 464 | } |
| 463 | declarations.AddLine(""); | 465 | declarations.AddLine(""); |
| 464 | } | 466 | } |