committed by
ameerj
28 changed files with 605 additions and 91 deletions
-
2src/shader_recompiler/CMakeLists.txt
-
143src/shader_recompiler/backend/spirv/emit_context.cpp
-
10src/shader_recompiler/backend/spirv/emit_context.h
-
39src/shader_recompiler/backend/spirv/emit_spirv.cpp
-
3src/shader_recompiler/backend/spirv/emit_spirv.h
-
86src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp
-
12src/shader_recompiler/frontend/ir/ir_emitter.cpp
-
4src/shader_recompiler/frontend/ir/ir_emitter.h
-
1src/shader_recompiler/frontend/ir/microinstruction.cpp
-
1src/shader_recompiler/frontend/ir/opcodes.cpp
-
3src/shader_recompiler/frontend/ir/opcodes.inc
-
28src/shader_recompiler/frontend/ir/patch.cpp
-
149src/shader_recompiler/frontend/ir/patch.h
-
41src/shader_recompiler/frontend/ir/type.h
-
9src/shader_recompiler/frontend/ir/value.cpp
-
4src/shader_recompiler/frontend/ir/value.h
-
5src/shader_recompiler/frontend/maxwell/program.cpp
-
25src/shader_recompiler/frontend/maxwell/translate/impl/load_store_attribute.cpp
-
2src/shader_recompiler/frontend/maxwell/translate/impl/move_special_register.cpp
-
41src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp
-
16src/shader_recompiler/profile.h
-
5src/shader_recompiler/shader_info.h
-
13src/video_core/renderer_vulkan/maxwell_to_vk.cpp
-
2src/video_core/renderer_vulkan/maxwell_to_vk.h
-
3src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp
-
30src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
-
2src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp
-
3src/video_core/vulkan_common/vulkan_device.cpp
@ -0,0 +1,28 @@ |
|||
// Copyright 2021 yuzu Emulator Project
|
|||
// Licensed under GPLv2 or any later version
|
|||
// Refer to the license.txt file included.
|
|||
|
|||
#include "shader_recompiler/frontend/ir/patch.h"
|
|||
#include "shader_recompiler/exception.h"
|
|||
|
|||
namespace Shader::IR { |
|||
|
|||
bool IsGeneric(Patch patch) noexcept { |
|||
return patch >= Patch::Component0 && patch <= Patch::Component119; |
|||
} |
|||
|
|||
u32 GenericPatchIndex(Patch patch) { |
|||
if (!IsGeneric(patch)) { |
|||
throw InvalidArgument("Patch {} is not generic", patch); |
|||
} |
|||
return (static_cast<u32>(patch) - static_cast<u32>(Patch::Component0)) / 4; |
|||
} |
|||
|
|||
u32 GenericPatchElement(Patch patch) { |
|||
if (!IsGeneric(patch)) { |
|||
throw InvalidArgument("Patch {} is not generic", patch); |
|||
} |
|||
return (static_cast<u32>(patch) - static_cast<u32>(Patch::Component0)) % 4; |
|||
} |
|||
|
|||
} // namespace Shader::IR
|
|||
@ -0,0 +1,149 @@ |
|||
// Copyright 2021 yuzu Emulator Project |
|||
// Licensed under GPLv2 or any later version |
|||
// Refer to the license.txt file included. |
|||
|
|||
#pragma once |
|||
|
|||
#include "common/common_types.h" |
|||
|
|||
namespace Shader::IR { |
|||
|
|||
enum class Patch : u64 { |
|||
TessellationLodLeft, |
|||
TessellationLodTop, |
|||
TessellationLodRight, |
|||
TessellationLodBottom, |
|||
TessellationLodInteriorU, |
|||
TessellationLodInteriorV, |
|||
ComponentPadding0, |
|||
ComponentPadding1, |
|||
Component0, |
|||
Component1, |
|||
Component2, |
|||
Component3, |
|||
Component4, |
|||
Component5, |
|||
Component6, |
|||
Component7, |
|||
Component8, |
|||
Component9, |
|||
Component10, |
|||
Component11, |
|||
Component12, |
|||
Component13, |
|||
Component14, |
|||
Component15, |
|||
Component16, |
|||
Component17, |
|||
Component18, |
|||
Component19, |
|||
Component20, |
|||
Component21, |
|||
Component22, |
|||
Component23, |
|||
Component24, |
|||
Component25, |
|||
Component26, |
|||
Component27, |
|||
Component28, |
|||
Component29, |
|||
Component30, |
|||
Component31, |
|||
Component32, |
|||
Component33, |
|||
Component34, |
|||
Component35, |
|||
Component36, |
|||
Component37, |
|||
Component38, |
|||
Component39, |
|||
Component40, |
|||
Component41, |
|||
Component42, |
|||
Component43, |
|||
Component44, |
|||
Component45, |
|||
Component46, |
|||
Component47, |
|||
Component48, |
|||
Component49, |
|||
Component50, |
|||
Component51, |
|||
Component52, |
|||
Component53, |
|||
Component54, |
|||
Component55, |
|||
Component56, |
|||
Component57, |
|||
Component58, |
|||
Component59, |
|||
Component60, |
|||
Component61, |
|||
Component62, |
|||
Component63, |
|||
Component64, |
|||
Component65, |
|||
Component66, |
|||
Component67, |
|||
Component68, |
|||
Component69, |
|||
Component70, |
|||
Component71, |
|||
Component72, |
|||
Component73, |
|||
Component74, |
|||
Component75, |
|||
Component76, |
|||
Component77, |
|||
Component78, |
|||
Component79, |
|||
Component80, |
|||
Component81, |
|||
Component82, |
|||
Component83, |
|||
Component84, |
|||
Component85, |
|||
Component86, |
|||
Component87, |
|||
Component88, |
|||
Component89, |
|||
Component90, |
|||
Component91, |
|||
Component92, |
|||
Component93, |
|||
Component94, |
|||
Component95, |
|||
Component96, |
|||
Component97, |
|||
Component98, |
|||
Component99, |
|||
Component100, |
|||
Component101, |
|||
Component102, |
|||
Component103, |
|||
Component104, |
|||
Component105, |
|||
Component106, |
|||
Component107, |
|||
Component108, |
|||
Component109, |
|||
Component110, |
|||
Component111, |
|||
Component112, |
|||
Component113, |
|||
Component114, |
|||
Component115, |
|||
Component116, |
|||
Component117, |
|||
Component118, |
|||
Component119, |
|||
}; |
|||
static_assert(static_cast<u64>(Patch::Component119) == 127); |
|||
|
|||
[[nodiscard]] bool IsGeneric(Patch patch) noexcept; |
|||
|
|||
[[nodiscard]] u32 GenericPatchIndex(Patch patch); |
|||
|
|||
[[nodiscard]] u32 GenericPatchElement(Patch patch); |
|||
|
|||
} // namespace Shader::IR |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue