aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2020-02-29 04:03:22 -0300
committerReinUsesLisp <reinuseslisp@airmail.cc>2020-03-09 18:40:07 -0300
commit66a8a3e88719aaa65a96dd0289e1fb151d199d9b (patch)
tree63af86085bf2a0b98023aae5ba3982fa82998f99
parent0528be5c92db67b608dc64322c55e57629c80619 (diff)
shader/registry: Cache tessellation state
-rw-r--r--src/video_core/renderer_opengl/gl_shader_disk_cache.cpp2
-rw-r--r--src/video_core/shader/registry.cpp3
-rw-r--r--src/video_core/shader/registry.h8
3 files changed, 10 insertions, 3 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp b/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp
index 5d5118058f..df86c0cc33 100644
--- a/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp
@@ -48,7 +48,7 @@ struct BindlessSamplerKey {
Tegra::Engines::SamplerDescriptor sampler;
};
-constexpr u32 NativeVersion = 17;
+constexpr u32 NativeVersion = 18;
ShaderCacheVersionHash GetShaderCacheVersionHash() {
ShaderCacheVersionHash hash{};
diff --git a/src/video_core/shader/registry.cpp b/src/video_core/shader/registry.cpp
index dc2d3dce3f..90dfab293f 100644
--- a/src/video_core/shader/registry.cpp
+++ b/src/video_core/shader/registry.cpp
@@ -27,6 +27,9 @@ GraphicsInfo MakeGraphicsInfo(ShaderType shader_stage, ConstBufferEngineInterfac
GraphicsInfo info;
info.primitive_topology = graphics.regs.draw.topology;
+ info.tessellation_primitive = graphics.regs.tess_mode.prim;
+ info.tessellation_spacing = graphics.regs.tess_mode.spacing;
+ info.tessellation_clockwise = graphics.regs.tess_mode.cw;
return info;
}
diff --git a/src/video_core/shader/registry.h b/src/video_core/shader/registry.h
index c1a04ea02e..7b7fad3d1a 100644
--- a/src/video_core/shader/registry.h
+++ b/src/video_core/shader/registry.h
@@ -26,15 +26,19 @@ using BindlessSamplerMap =
struct GraphicsInfo {
Tegra::Engines::Maxwell3D::Regs::PrimitiveTopology primitive_topology{};
+ Tegra::Engines::Maxwell3D::Regs::TessellationPrimitive tessellation_primitive{};
+ Tegra::Engines::Maxwell3D::Regs::TessellationSpacing tessellation_spacing{};
+ bool tessellation_clockwise = false;
};
-static_assert(std::is_trivially_copyable_v<GraphicsInfo>);
+static_assert(std::is_trivially_copyable_v<GraphicsInfo> &&
+ std::is_standard_layout_v<GraphicsInfo>);
struct ComputeInfo {
std::array<u32, 3> workgroup_size{};
u32 shared_memory_size_in_words = 0;
u32 local_memory_size_in_words = 0;
};
-static_assert(std::is_trivially_copyable_v<ComputeInfo>);
+static_assert(std::is_trivially_copyable_v<ComputeInfo> && std::is_standard_layout_v<ComputeInfo>);
struct SerializedRegistryInfo {
VideoCore::GuestDriverProfile guest_driver_profile;