diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/bcat/backend/boxcat.cpp | 10 | ||||
| -rw-r--r-- | src/input_common/udp/client.cpp | 13 | ||||
| -rw-r--r-- | src/input_common/udp/client.h | 4 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/fixed_pipeline_state.cpp | 3 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/fixed_pipeline_state.h | 10 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp | 5 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_pipeline_cache.cpp | 3 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_rasterizer.cpp | 11 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_rasterizer.h | 1 |
9 files changed, 27 insertions, 33 deletions
diff --git a/src/core/hle/service/bcat/backend/boxcat.cpp b/src/core/hle/service/bcat/backend/boxcat.cpp index 589e288df..3b6f7498e 100644 --- a/src/core/hle/service/bcat/backend/boxcat.cpp +++ b/src/core/hle/service/bcat/backend/boxcat.cpp | |||
| @@ -454,6 +454,16 @@ Boxcat::StatusResult Boxcat::GetStatus(std::optional<std::string>& global, | |||
| 454 | {std::string("Boxcat-Client-Type"), std::string(BOXCAT_CLIENT_TYPE)}, | 454 | {std::string("Boxcat-Client-Type"), std::string(BOXCAT_CLIENT_TYPE)}, |
| 455 | }; | 455 | }; |
| 456 | 456 | ||
| 457 | if (!client.is_valid()) { | ||
| 458 | LOG_ERROR(Service_BCAT, "Client is invalid, going offline!"); | ||
| 459 | return StatusResult::Offline; | ||
| 460 | } | ||
| 461 | |||
| 462 | if (!client.is_socket_open()) { | ||
| 463 | LOG_ERROR(Service_BCAT, "Failed to open socket, going offline!"); | ||
| 464 | return StatusResult::Offline; | ||
| 465 | } | ||
| 466 | |||
| 457 | const auto response = client.Get(BOXCAT_PATHNAME_EVENTS, headers); | 467 | const auto response = client.Get(BOXCAT_PATHNAME_EVENTS, headers); |
| 458 | if (response == nullptr) | 468 | if (response == nullptr) |
| 459 | return StatusResult::Offline; | 469 | return StatusResult::Offline; |
diff --git a/src/input_common/udp/client.cpp b/src/input_common/udp/client.cpp index bb109562c..7039d6fc3 100644 --- a/src/input_common/udp/client.cpp +++ b/src/input_common/udp/client.cpp | |||
| @@ -333,15 +333,18 @@ const std::array<Common::SPSCQueue<UDPPadStatus>, 4>& Client::GetPadQueue() cons | |||
| 333 | } | 333 | } |
| 334 | 334 | ||
| 335 | void TestCommunication(const std::string& host, u16 port, std::size_t pad_index, u32 client_id, | 335 | void TestCommunication(const std::string& host, u16 port, std::size_t pad_index, u32 client_id, |
| 336 | std::function<void()> success_callback, | 336 | const std::function<void()>& success_callback, |
| 337 | std::function<void()> failure_callback) { | 337 | const std::function<void()>& failure_callback) { |
| 338 | std::thread([=] { | 338 | std::thread([=] { |
| 339 | Common::Event success_event; | 339 | Common::Event success_event; |
| 340 | SocketCallback callback{[](Response::Version version) {}, [](Response::PortInfo info) {}, | 340 | SocketCallback callback{ |
| 341 | [&](Response::PadData data) { success_event.Set(); }}; | 341 | .version = [](Response::Version) {}, |
| 342 | .port_info = [](Response::PortInfo) {}, | ||
| 343 | .pad_data = [&](Response::PadData) { success_event.Set(); }, | ||
| 344 | }; | ||
| 342 | Socket socket{host, port, pad_index, client_id, std::move(callback)}; | 345 | Socket socket{host, port, pad_index, client_id, std::move(callback)}; |
| 343 | std::thread worker_thread{SocketLoop, &socket}; | 346 | std::thread worker_thread{SocketLoop, &socket}; |
| 344 | bool result = success_event.WaitFor(std::chrono::seconds(8)); | 347 | const bool result = success_event.WaitFor(std::chrono::seconds(8)); |
| 345 | socket.Stop(); | 348 | socket.Stop(); |
| 346 | worker_thread.join(); | 349 | worker_thread.join(); |
| 347 | if (result) { | 350 | if (result) { |
diff --git a/src/input_common/udp/client.h b/src/input_common/udp/client.h index 2491a03a2..747e0c0a2 100644 --- a/src/input_common/udp/client.h +++ b/src/input_common/udp/client.h | |||
| @@ -150,7 +150,7 @@ private: | |||
| 150 | }; | 150 | }; |
| 151 | 151 | ||
| 152 | void TestCommunication(const std::string& host, u16 port, std::size_t pad_index, u32 client_id, | 152 | void TestCommunication(const std::string& host, u16 port, std::size_t pad_index, u32 client_id, |
| 153 | std::function<void()> success_callback, | 153 | const std::function<void()>& success_callback, |
| 154 | std::function<void()> failure_callback); | 154 | const std::function<void()>& failure_callback); |
| 155 | 155 | ||
| 156 | } // namespace InputCommon::CemuhookUDP | 156 | } // namespace InputCommon::CemuhookUDP |
diff --git a/src/video_core/renderer_vulkan/fixed_pipeline_state.cpp b/src/video_core/renderer_vulkan/fixed_pipeline_state.cpp index 81a39a3b8..da5c550ea 100644 --- a/src/video_core/renderer_vulkan/fixed_pipeline_state.cpp +++ b/src/video_core/renderer_vulkan/fixed_pipeline_state.cpp | |||
| @@ -58,6 +58,7 @@ void FixedPipelineState::Fill(const Maxwell& regs, bool has_extended_dynamic_sta | |||
| 58 | logic_op_enable.Assign(regs.logic_op.enable != 0 ? 1 : 0); | 58 | logic_op_enable.Assign(regs.logic_op.enable != 0 ? 1 : 0); |
| 59 | logic_op.Assign(PackLogicOp(regs.logic_op.operation)); | 59 | logic_op.Assign(PackLogicOp(regs.logic_op.operation)); |
| 60 | rasterize_enable.Assign(regs.rasterize_enable != 0 ? 1 : 0); | 60 | rasterize_enable.Assign(regs.rasterize_enable != 0 ? 1 : 0); |
| 61 | topology.Assign(regs.draw.topology); | ||
| 61 | 62 | ||
| 62 | std::memcpy(&point_size, ®s.point_size, sizeof(point_size)); // TODO: C++20 std::bit_cast | 63 | std::memcpy(&point_size, ®s.point_size, sizeof(point_size)); // TODO: C++20 std::bit_cast |
| 63 | 64 | ||
| @@ -131,7 +132,6 @@ void FixedPipelineState::BlendingAttachment::Fill(const Maxwell& regs, std::size | |||
| 131 | } | 132 | } |
| 132 | 133 | ||
| 133 | void FixedPipelineState::DynamicState::Fill(const Maxwell& regs) { | 134 | void FixedPipelineState::DynamicState::Fill(const Maxwell& regs) { |
| 134 | const u32 topology_index = static_cast<u32>(regs.draw.topology.Value()); | ||
| 135 | u32 packed_front_face = PackFrontFace(regs.front_face); | 135 | u32 packed_front_face = PackFrontFace(regs.front_face); |
| 136 | if (regs.screen_y_control.triangle_rast_flip != 0) { | 136 | if (regs.screen_y_control.triangle_rast_flip != 0) { |
| 137 | // Flip front face | 137 | // Flip front face |
| @@ -161,7 +161,6 @@ void FixedPipelineState::DynamicState::Fill(const Maxwell& regs) { | |||
| 161 | depth_test_enable.Assign(regs.depth_test_enable); | 161 | depth_test_enable.Assign(regs.depth_test_enable); |
| 162 | front_face.Assign(packed_front_face); | 162 | front_face.Assign(packed_front_face); |
| 163 | depth_test_func.Assign(PackComparisonOp(regs.depth_test_func)); | 163 | depth_test_func.Assign(PackComparisonOp(regs.depth_test_func)); |
| 164 | topology.Assign(topology_index); | ||
| 165 | cull_face.Assign(PackCullFace(regs.cull_face)); | 164 | cull_face.Assign(PackCullFace(regs.cull_face)); |
| 166 | cull_enable.Assign(regs.cull_test_enabled != 0 ? 1 : 0); | 165 | cull_enable.Assign(regs.cull_test_enabled != 0 ? 1 : 0); |
| 167 | 166 | ||
diff --git a/src/video_core/renderer_vulkan/fixed_pipeline_state.h b/src/video_core/renderer_vulkan/fixed_pipeline_state.h index cdcbb65f5..2c18eeaae 100644 --- a/src/video_core/renderer_vulkan/fixed_pipeline_state.h +++ b/src/video_core/renderer_vulkan/fixed_pipeline_state.h | |||
| @@ -150,9 +150,8 @@ struct FixedPipelineState { | |||
| 150 | }; | 150 | }; |
| 151 | union { | 151 | union { |
| 152 | u32 raw2; | 152 | u32 raw2; |
| 153 | BitField<0, 4, u32> topology; | 153 | BitField<0, 2, u32> cull_face; |
| 154 | BitField<4, 2, u32> cull_face; | 154 | BitField<2, 1, u32> cull_enable; |
| 155 | BitField<6, 1, u32> cull_enable; | ||
| 156 | }; | 155 | }; |
| 157 | std::array<VertexBinding, Maxwell::NumVertexArrays> vertex_bindings; | 156 | std::array<VertexBinding, Maxwell::NumVertexArrays> vertex_bindings; |
| 158 | 157 | ||
| @@ -169,10 +168,6 @@ struct FixedPipelineState { | |||
| 169 | Maxwell::FrontFace FrontFace() const noexcept { | 168 | Maxwell::FrontFace FrontFace() const noexcept { |
| 170 | return UnpackFrontFace(front_face.Value()); | 169 | return UnpackFrontFace(front_face.Value()); |
| 171 | } | 170 | } |
| 172 | |||
| 173 | constexpr Maxwell::PrimitiveTopology Topology() const noexcept { | ||
| 174 | return static_cast<Maxwell::PrimitiveTopology>(topology.Value()); | ||
| 175 | } | ||
| 176 | }; | 171 | }; |
| 177 | 172 | ||
| 178 | union { | 173 | union { |
| @@ -190,6 +185,7 @@ struct FixedPipelineState { | |||
| 190 | BitField<18, 1, u32> logic_op_enable; | 185 | BitField<18, 1, u32> logic_op_enable; |
| 191 | BitField<19, 4, u32> logic_op; | 186 | BitField<19, 4, u32> logic_op; |
| 192 | BitField<23, 1, u32> rasterize_enable; | 187 | BitField<23, 1, u32> rasterize_enable; |
| 188 | BitField<24, 4, Maxwell::PrimitiveTopology> topology; | ||
| 193 | }; | 189 | }; |
| 194 | u32 point_size; | 190 | u32 point_size; |
| 195 | std::array<u32, Maxwell::NumVertexArrays> binding_divisors; | 191 | std::array<u32, Maxwell::NumVertexArrays> binding_divisors; |
diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index a4b9e7ef5..696eaeb5f 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp | |||
| @@ -261,12 +261,12 @@ vk::Pipeline VKGraphicsPipeline::CreatePipeline(const RenderPassParams& renderpa | |||
| 261 | vertex_input_ci.pNext = &input_divisor_ci; | 261 | vertex_input_ci.pNext = &input_divisor_ci; |
| 262 | } | 262 | } |
| 263 | 263 | ||
| 264 | const auto input_assembly_topology = MaxwellToVK::PrimitiveTopology(device, dynamic.Topology()); | 264 | const auto input_assembly_topology = MaxwellToVK::PrimitiveTopology(device, state.topology); |
| 265 | const VkPipelineInputAssemblyStateCreateInfo input_assembly_ci{ | 265 | const VkPipelineInputAssemblyStateCreateInfo input_assembly_ci{ |
| 266 | .sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO, | 266 | .sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO, |
| 267 | .pNext = nullptr, | 267 | .pNext = nullptr, |
| 268 | .flags = 0, | 268 | .flags = 0, |
| 269 | .topology = MaxwellToVK::PrimitiveTopology(device, dynamic.Topology()), | 269 | .topology = MaxwellToVK::PrimitiveTopology(device, state.topology), |
| 270 | .primitiveRestartEnable = state.primitive_restart_enable != 0 && | 270 | .primitiveRestartEnable = state.primitive_restart_enable != 0 && |
| 271 | SupportsPrimitiveRestart(input_assembly_topology), | 271 | SupportsPrimitiveRestart(input_assembly_topology), |
| 272 | }; | 272 | }; |
| @@ -400,7 +400,6 @@ vk::Pipeline VKGraphicsPipeline::CreatePipeline(const RenderPassParams& renderpa | |||
| 400 | static constexpr std::array extended{ | 400 | static constexpr std::array extended{ |
| 401 | VK_DYNAMIC_STATE_CULL_MODE_EXT, | 401 | VK_DYNAMIC_STATE_CULL_MODE_EXT, |
| 402 | VK_DYNAMIC_STATE_FRONT_FACE_EXT, | 402 | VK_DYNAMIC_STATE_FRONT_FACE_EXT, |
| 403 | VK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY_EXT, | ||
| 404 | VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE_EXT, | 403 | VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE_EXT, |
| 405 | VK_DYNAMIC_STATE_DEPTH_TEST_ENABLE_EXT, | 404 | VK_DYNAMIC_STATE_DEPTH_TEST_ENABLE_EXT, |
| 406 | VK_DYNAMIC_STATE_DEPTH_WRITE_ENABLE_EXT, | 405 | VK_DYNAMIC_STATE_DEPTH_WRITE_ENABLE_EXT, |
diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index 5c038f4bc..dedc9c466 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp | |||
| @@ -331,8 +331,7 @@ void VKPipelineCache::OnShaderRemoval(Shader* shader) { | |||
| 331 | std::pair<SPIRVProgram, std::vector<VkDescriptorSetLayoutBinding>> | 331 | std::pair<SPIRVProgram, std::vector<VkDescriptorSetLayoutBinding>> |
| 332 | VKPipelineCache::DecompileShaders(const FixedPipelineState& fixed_state) { | 332 | VKPipelineCache::DecompileShaders(const FixedPipelineState& fixed_state) { |
| 333 | Specialization specialization; | 333 | Specialization specialization; |
| 334 | if (fixed_state.dynamic_state.Topology() == Maxwell::PrimitiveTopology::Points || | 334 | if (fixed_state.topology == Maxwell::PrimitiveTopology::Points) { |
| 335 | device.IsExtExtendedDynamicStateSupported()) { | ||
| 336 | float point_size; | 335 | float point_size; |
| 337 | std::memcpy(&point_size, &fixed_state.point_size, sizeof(float)); | 336 | std::memcpy(&point_size, &fixed_state.point_size, sizeof(float)); |
| 338 | specialization.point_size = point_size; | 337 | specialization.point_size = point_size; |
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index f3c2483c8..e0fb8693f 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp | |||
| @@ -948,7 +948,6 @@ void RasterizerVulkan::UpdateDynamicStates() { | |||
| 948 | UpdateDepthWriteEnable(regs); | 948 | UpdateDepthWriteEnable(regs); |
| 949 | UpdateDepthCompareOp(regs); | 949 | UpdateDepthCompareOp(regs); |
| 950 | UpdateFrontFace(regs); | 950 | UpdateFrontFace(regs); |
| 951 | UpdatePrimitiveTopology(regs); | ||
| 952 | UpdateStencilOp(regs); | 951 | UpdateStencilOp(regs); |
| 953 | UpdateStencilTestEnable(regs); | 952 | UpdateStencilTestEnable(regs); |
| 954 | } | 953 | } |
| @@ -1418,16 +1417,6 @@ void RasterizerVulkan::UpdateFrontFace(Tegra::Engines::Maxwell3D::Regs& regs) { | |||
| 1418 | [front_face](vk::CommandBuffer cmdbuf) { cmdbuf.SetFrontFaceEXT(front_face); }); | 1417 | [front_face](vk::CommandBuffer cmdbuf) { cmdbuf.SetFrontFaceEXT(front_face); }); |
| 1419 | } | 1418 | } |
| 1420 | 1419 | ||
| 1421 | void RasterizerVulkan::UpdatePrimitiveTopology(Tegra::Engines::Maxwell3D::Regs& regs) { | ||
| 1422 | const Maxwell::PrimitiveTopology primitive_topology = regs.draw.topology.Value(); | ||
| 1423 | if (!state_tracker.ChangePrimitiveTopology(primitive_topology)) { | ||
| 1424 | return; | ||
| 1425 | } | ||
| 1426 | scheduler.Record([this, primitive_topology](vk::CommandBuffer cmdbuf) { | ||
| 1427 | cmdbuf.SetPrimitiveTopologyEXT(MaxwellToVK::PrimitiveTopology(device, primitive_topology)); | ||
| 1428 | }); | ||
| 1429 | } | ||
| 1430 | |||
| 1431 | void RasterizerVulkan::UpdateStencilOp(Tegra::Engines::Maxwell3D::Regs& regs) { | 1420 | void RasterizerVulkan::UpdateStencilOp(Tegra::Engines::Maxwell3D::Regs& regs) { |
| 1432 | if (!state_tracker.TouchStencilOp()) { | 1421 | if (!state_tracker.TouchStencilOp()) { |
| 1433 | return; | 1422 | return; |
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.h b/src/video_core/renderer_vulkan/vk_rasterizer.h index b47c8fc13..237e51fa4 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.h +++ b/src/video_core/renderer_vulkan/vk_rasterizer.h | |||
| @@ -259,7 +259,6 @@ private: | |||
| 259 | void UpdateDepthWriteEnable(Tegra::Engines::Maxwell3D::Regs& regs); | 259 | void UpdateDepthWriteEnable(Tegra::Engines::Maxwell3D::Regs& regs); |
| 260 | void UpdateDepthCompareOp(Tegra::Engines::Maxwell3D::Regs& regs); | 260 | void UpdateDepthCompareOp(Tegra::Engines::Maxwell3D::Regs& regs); |
| 261 | void UpdateFrontFace(Tegra::Engines::Maxwell3D::Regs& regs); | 261 | void UpdateFrontFace(Tegra::Engines::Maxwell3D::Regs& regs); |
| 262 | void UpdatePrimitiveTopology(Tegra::Engines::Maxwell3D::Regs& regs); | ||
| 263 | void UpdateStencilOp(Tegra::Engines::Maxwell3D::Regs& regs); | 262 | void UpdateStencilOp(Tegra::Engines::Maxwell3D::Regs& regs); |
| 264 | void UpdateStencilTestEnable(Tegra::Engines::Maxwell3D::Regs& regs); | 263 | void UpdateStencilTestEnable(Tegra::Engines::Maxwell3D::Regs& regs); |
| 265 | 264 | ||