Skip to content

Commit

Permalink
Merge pull request hrydgard#11164 from unknownbrackets/debugger
Browse files Browse the repository at this point in the history
Fix a few warnings seen using debugger in debug mode
  • Loading branch information
hrydgard committed Jun 10, 2018
2 parents 9d96e65 + 1cfb219 commit 6c494c3
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Windows/GEDebugger/TabState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ void CtrlStateValues::OnRightClick(int row, int column, const POINT &point) {
SetMenuDefaultItem(subMenu, ID_REGLIST_CHANGE, FALSE);

// Ehh, kinda ugly.
if (rows_ == &watchList[0]) {
if (!watchList.empty() && rows_ == &watchList[0]) {
ModifyMenu(subMenu, ID_GEDBG_WATCH, MF_BYCOMMAND | MF_STRING, ID_GEDBG_WATCH, L"Remove Watch");
} else {
ModifyMenu(subMenu, ID_GEDBG_WATCH, MF_BYCOMMAND | MF_STRING, ID_GEDBG_WATCH, L"Add Watch");
Expand Down
2 changes: 2 additions & 0 deletions ext/native/net/sinks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@ bool OutputSink::Flush(bool allowBlock) {
if (!allowBlock || !Block()) {
return false;
}
} else if (bytes < 0) {
return false;
}
}

Expand Down
2 changes: 1 addition & 1 deletion ext/native/net/websocket_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ void WebSocketServer::SendFlush() {

// Drain out as much of our buffer as possible.
size_t totalPushed = 0;
while (!outBuf_.empty()) {
while (outBuf_.size() - totalPushed != 0) {
size_t pushed = out_->PushAtMost((const char *)&outBuf_[totalPushed], outBuf_.size() - totalPushed);
if (pushed == 0)
break;
Expand Down
20 changes: 14 additions & 6 deletions ext/native/thin3d/VulkanQueueRunner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,12 @@ void VulkanQueueRunner::SetupTransitionToTransferSrc(VKRImage &img, VkImageMemor
}
barrier.dstAccessMask = VK_ACCESS_TRANSFER_READ_BIT;
barrier.newLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL;
barrier.subresourceRange.aspectMask = aspect;
if (img.format == VK_FORMAT_D16_UNORM_S8_UINT || img.format == VK_FORMAT_D24_UNORM_S8_UINT || img.format == VK_FORMAT_D32_SFLOAT_S8_UINT) {
// Barrier must specify both for combined depth/stencil buffers.
barrier.subresourceRange.aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT;
} else {
barrier.subresourceRange.aspectMask = aspect;
}
barrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
barrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
img.layout = barrier.newLayout;
Expand Down Expand Up @@ -1140,7 +1145,12 @@ void VulkanQueueRunner::SetupTransitionToTransferDst(VKRImage &img, VkImageMemor
}
barrier.dstAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT;
barrier.newLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL;
barrier.subresourceRange.aspectMask = aspect;
if (img.format == VK_FORMAT_D16_UNORM_S8_UINT || img.format == VK_FORMAT_D24_UNORM_S8_UINT || img.format == VK_FORMAT_D32_SFLOAT_S8_UINT) {
// Barrier must specify both for combined depth/stencil buffers.
barrier.subresourceRange.aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT;
} else {
barrier.subresourceRange.aspectMask = aspect;
}
barrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
barrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
img.layout = barrier.newLayout;
Expand Down Expand Up @@ -1192,11 +1202,9 @@ void VulkanQueueRunner::PerformReadback(const VKRStep &step, VkCommandBuffer cmd
VKRImage *srcImage;
if (step.readback.aspectMask & VK_IMAGE_ASPECT_COLOR_BIT) {
srcImage = &step.readback.src->color;
}
else if (step.readback.aspectMask & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) {
} else if (step.readback.aspectMask & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) {
srcImage = &step.readback.src->depth;
}
else {
} else {
_dbg_assert_msg_(G3D, false, "No image aspect to readback?");
return;
}
Expand Down

0 comments on commit 6c494c3

Please sign in to comment.