Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/3rdParty/coin
Submodule coin updated 69 files
+37 −0 RELNOTES
+73 −0 cmake/CoinCompileSpirv.cmake
+84 −0 cmake/CoinCompileSpirvEmbed.cmake
+0 −32 include/Inventor/actions/SoIRRenderAction.h
+0 −32 include/Inventor/elements/SoDevicePixelRatioElement.h
+4 −15 include/Inventor/elements/SoElement.h
+4 −2 include/Inventor/elements/SoGLLazyElement.h
+9 −34 include/Inventor/rendering/SoRenderIR.h
+0 −32 include/Inventor/rendering/SoVulkanImageCopy.h
+0 −32 include/Inventor/rendering/SoVulkanRenderManager.h
+0 −32 include/Inventor/rendering/SoVulkanRenderTarget.h
+0 −32 include/Inventor/rendering/SoVulkanViewSettings.h
+0 −32 src/actions/SoIRRenderAction.cpp
+0 −32 src/elements/SoDevicePixelRatioElement.cpp
+18 −0 src/elements/SoElement.cpp
+0 −7 src/glue/glslp.h
+11 −0 src/rendering/CMakeLists.txt
+0 −32 src/rendering/SoClippingPlanes.h
+0 −32 src/rendering/SoFnv1a.h
+0 −32 src/rendering/SoGLContext.cpp
+0 −32 src/rendering/SoGLRenderBackend.cpp
+0 −32 src/rendering/SoGLRenderBackend.h
+0 −32 src/rendering/SoRenderBackend.cpp
+0 −32 src/rendering/SoRenderBackend.h
+0 −32 src/rendering/SoRenderIR.cpp
+0 −32 src/rendering/SoRenderIRP.h
+0 −32 src/rendering/SoVulkanConfig.cpp
+0 −32 src/rendering/SoVulkanConfig.h
+0 −32 src/rendering/SoVulkanDebug.h
+0 −32 src/rendering/SoVulkanDebugUtils.h
+0 −32 src/rendering/SoVulkanGpuTimers.cpp
+0 −32 src/rendering/SoVulkanGpuTimers.h
+0 −32 src/rendering/SoVulkanPlatform.h
+4 −32 src/rendering/SoVulkanRenderBackend.h
+5 −36 src/rendering/SoVulkanRenderBackend/SoVulkanPipelineCache.cpp
+37 −102 src/rendering/SoVulkanRenderBackend/SoVulkanPipelineCache.h
+0 −32 src/rendering/SoVulkanRenderBackend/SoVulkanRecordContext.h
+0 −32 src/rendering/SoVulkanRenderBackend/SoVulkanRenderBackendCommand.cpp
+0 −32 src/rendering/SoVulkanRenderBackend/SoVulkanRenderBackendCore.cpp
+0 −32 src/rendering/SoVulkanRenderBackend/SoVulkanRenderBackendFrame.cpp
+9 −38 src/rendering/SoVulkanRenderBackend/SoVulkanRenderBackendGeometry.cpp
+0 −32 src/rendering/SoVulkanRenderBackend/SoVulkanRenderBackendGeometryLod.cpp
+30 −35 src/rendering/SoVulkanRenderBackend/SoVulkanRenderBackendP.h
+0 −32 src/rendering/SoVulkanRenderBackend/SoVulkanRenderBackendPipeline.cpp
+0 −32 src/rendering/SoVulkanRenderBackend/SoVulkanRenderBackendTexture.cpp
+1 −36 src/rendering/SoVulkanRenderBackend/SoVulkanRenderBackendWideLine.cpp
+0 −32 src/rendering/SoVulkanRenderBackend/SoVulkanRenderPassCache.cpp
+0 −32 src/rendering/SoVulkanRenderBackend/SoVulkanRenderPassCache.h
+0 −32 src/rendering/SoVulkanRenderBackend/VmaImpl.cpp
+15 −36 src/rendering/SoVulkanRenderManager.cpp
+0 −32 src/rendering/SoVulkanReplayKey.h
+0 −32 src/rendering/SoVulkanResult.h
+0 −32 src/rendering/SoVulkanShared.h
+0 −81 src/rendering/vulkan/visual/BackgroundFragment.spv.h
+0 −74 src/rendering/vulkan/visual/BackgroundVertex.spv.h
+0 −453 src/rendering/vulkan/visual/Fragment.spv.h
+0 −243 src/rendering/vulkan/visual/SubPixelCull.spv.h
+0 −216 src/rendering/vulkan/visual/Vertex.spv.h
+0 −92 src/rendering/vulkan/visual/WideLineFragment.spv.h
+0 −326 src/rendering/vulkan/visual/WideLineInstancedVertex.spv.h
+0 −98 src/rendering/vulkan/visual/WideLineVertex.spv.h
+0 −32 src/shaders/SoGLSLShaderDiagnostics.h
+233 −6 src/shapenodes/SoShape.cpp
+11 −2 src/shapenodes/SoText2.cpp
+15 −1 testsuite/CMakeLists.txt
+525 −0 testsuite/IRRetainedCacheTest.cpp
+0 −32 testsuite/LegacyRendererTest.cpp
+666 −0 testsuite/VulkanGeometryStalenessTest.cpp
+0 −32 testsuite/VulkanSmokeTest.cpp
16 changes: 14 additions & 2 deletions src/Gui/FileDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,14 +409,21 @@
QString selectedQtFilter = (selectedFilterIndex >= 0) ? qtFilterList[selectedFilterIndex] : "";
QStringList selected;
if (mode == NativeFileDialogMode::OpenSingle) {
selected << QFileDialog::getOpenFileName(
const QString file = QFileDialog::getOpenFileName(
parent,
caption,
startPath,
qtFilterList.join(QStringLiteral(";;")),
&selectedQtFilter,
options
);
// Cancelling returns an empty string, and appending it anyway would
// leave a one-element list whose entry is empty. The cancellation test
// below is selected.isEmpty(), so the empty entry must not be added or
// a plain cancel would be reported as a filter mismatch.
if (!file.isEmpty()) {
selected << file;
}
}
else if (mode == NativeFileDialogMode::OpenMultiple) {
selected << QFileDialog::getOpenFileNames(
Expand All @@ -429,14 +436,19 @@
);
}
else /* (mode == NativeFileDialogMode::Save) */ {
selected << QFileDialog::getSaveFileName(
const QString file = QFileDialog::getSaveFileName(
parent,
caption,
startPath,
qtFilterList.join(QStringLiteral(";;")),
&selectedQtFilter,
options
);
// See the OpenSingle case: a cancelled save dialog returns an empty
// string, which must not become an entry of `selected`.
if (!file.isEmpty()) {
selected << file;
}
}
selectedFilterIndex = qtFilterList.indexOf(selectedQtFilter);
if (selectedFilterIndex < 0 && selected.isEmpty()) {
Expand Down Expand Up @@ -1610,4 +1622,4 @@
}


#include "moc_FileDialog.cpp"

Check failure on line 1625 in src/Gui/FileDialog.cpp

View workflow job for this annotation

GitHub Actions / Lint / Lint

'moc_FileDialog.cpp' file not found [clang-diagnostic-error]
54 changes: 54 additions & 0 deletions src/Gui/Inventor/So3DAnnotation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@
#include "So3DAnnotation.h"
#include <Gui/Selection/Selection.h>

#ifdef HAVE_COIN_IR_RENDER_ACTION
# include <Inventor/actions/SoIRRenderAction.h>
# include <Inventor/elements/SoViewportRegionElement.h>
# include <Inventor/rendering/SoRenderIR.h>
#endif

using namespace Gui;

SO_ELEMENT_SOURCE(SoDelayedAnnotationsElement);
Expand Down Expand Up @@ -184,3 +190,51 @@ void So3DAnnotation::GLRenderOffPath(SoGLRenderAction* /* action */)
{
// should never render, this is a separator node
}

#ifdef HAVE_COIN_IR_RENDER_ACTION
void So3DAnnotation::IRRender(SoIRRenderAction* action)
{
// On the OpenGL path annotations are deferred through SoDelayedAnnotationsElement
// and replayed later with the depth buffer cleared, so the subtree always draws on
// top of the scene (while still depth-testing against itself). The retained-IR
// path has no delayed replay: render the subtree inline and then promote the
// commands it recorded to the OVERLAY pass, which the raster backend draws last,
// on top. This mirrors SoFCSelection/SoRasterOverlay. Without it, for example a
// PartDesign pattern's semi-transparent removed-volume preview is depth-rejected
// by the opaque solid it is embedded in, so it never appears.
if (!action) {
return;
}

SoDrawList& list = action->getMutableDrawList();
const int firstCommand = list.getNumCommands();

inherited::IRRender(action);

const int count = list.getNumCommands();
if (count <= firstCommand) {
return;
}

SoState* state = action->getState();
const SbViewportRegion vp = SoViewportRegionElement::get(state);
const short vx = static_cast<short>(
std::max(0, static_cast<int>(vp.getViewportOriginPixels()[0])));
const short vy = static_cast<short>(
std::max(0, static_cast<int>(vp.getViewportOriginPixels()[1])));
const short vw = static_cast<short>(
std::max(1, static_cast<int>(vp.getViewportSizePixels()[0])));
const short vh = static_cast<short>(
std::max(1, static_cast<int>(vp.getViewportSizePixels()[1])));

for (int i = firstCommand; i < count; ++i) {
SoRenderCommand& command = list.getCommand(i);
command.pass = SO_RENDERPASS_OVERLAY;
command.state.raster.scissorEnabled = TRUE;
command.state.raster.scissorX = vx;
command.state.raster.scissorY = vy;
command.state.raster.scissorWidth = vw;
command.state.raster.scissorHeight = vh;
}
}
#endif
6 changes: 6 additions & 0 deletions src/Gui/Inventor/So3DAnnotation.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#include <FCGlobal.h>
#include <vector>

class SoIRRenderAction;

namespace Gui
{

Expand Down Expand Up @@ -123,6 +125,10 @@ class GuiExport So3DAnnotation: public SoSeparator
void GLRenderInPath(SoGLRenderAction* action) override;
void GLRenderOffPath(SoGLRenderAction* action) override;

#ifdef HAVE_COIN_IR_RENDER_ACTION
void IRRender(SoIRRenderAction* action) override;
#endif

protected:
~So3DAnnotation() override = default;
};
Expand Down
8 changes: 8 additions & 0 deletions src/Gui/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
#include <QWhatsThis>
#include <QWindow>
#include <QPushButton>
#include <cstdlib>
#include <string>


Expand Down Expand Up @@ -1054,6 +1055,13 @@

int MainWindow::confirmSave(App::Document* doc, QWidget* parent, bool addCheckbox)
{
// Test hook: FC_SKIP_UNSAVED_PROMPT=1 makes an unattended run (the fcprobe
// harness) never block on this modal dialog -- it discards unsaved changes
// instead of asking. No effect on a normal interactive session.
if (std::getenv("FC_SKIP_UNSAVED_PROMPT") != nullptr) {

Check warning on line 1061 in src/Gui/MainWindow.cpp

View workflow job for this annotation

GitHub Actions / Lint / Lint

function is not thread safe [concurrency-mt-unsafe]
return ConfirmSaveResult::Discard;
}

QMessageBox box(parent ? parent : this);
box.setObjectName(QStringLiteral("confirmSave"));
box.setIcon(QMessageBox::Question);
Expand Down Expand Up @@ -3343,5 +3351,5 @@
}


#include "moc_MainWindow.cpp"

Check failure on line 3354 in src/Gui/MainWindow.cpp

View workflow job for this annotation

GitHub Actions / Lint / Lint

'moc_MainWindow.cpp' file not found [clang-diagnostic-error]
#include "MainWindow.moc"
10 changes: 7 additions & 3 deletions src/Gui/NaviCube.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1164,7 +1164,11 @@ void NaviCubeImplementation::setHilite(PickId hilite)
if (soNaviCube) {
soNaviCube->hiliteId = static_cast<int>(hiliteId);
}
viewer->getSoRenderManager()->scheduleRedraw();
// The GL render-manager redraw never reaches the display-only Vulkan
// widget (the cube lives in the decoration overlay, which the adapter's
// scene sensor does not watch), so route the wake through
// requestRedraw() -- it also asks the viewer for a display frame.
requestRedraw(false);
}
}

Expand Down Expand Up @@ -1231,7 +1235,7 @@ bool NaviCubeImplementation::mouseMoved(short x, short y)

if (hovering != this->hovering) {
this->hovering = hovering;
viewer->getSoRenderManager()->scheduleRedraw();
requestRedraw(false);
}

if (!dragStarted) {
Expand All @@ -1257,7 +1261,7 @@ bool NaviCubeImplementation::mouseMoved(short x, short y)
relPos[0] = std::min(std::max(newX, 0.0f), 1.0f);
relPos[1] = std::min(std::max(newY, 0.0f), 1.0f);

viewer->getSoRenderManager()->scheduleRedraw();
requestRedraw(false);
}
return true;
}
Expand Down
14 changes: 13 additions & 1 deletion src/Gui/Navigation/NavigationStyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2716,7 +2716,19 @@
MenuItem view;
Gui::Application::Instance->setupContextMenu("View", &view);

auto contextMenu = new QMenu(viewer->getGLWidget());
// A QMenu is a popup (top level) window and Qt derives its transient parent
// from the parent widget's window in QMenuPrivate::transientParentWindow().
// The GL widget is a native *child* of the viewer as soon as a Vulkan page
// exists -- QWidget::createWindowContainer() makes the viewer and all its
// ancestors native (QWindowContainerPrivate::updateUsesNativeWidgets() sees
// the QGraphicsView, and QWidget::create() propagates that upwards) -- so
// Qt's fallback QWidget::nativeParentWidget() hands it the viewer's native
// child window. QWindow::setTransientParent() rejects that with
// "QWidgetWindow(...) must be a top level window." and drops the transient
// parent. Parent the menu to the view's top level window instead, so the
// popup resolves to a real top level window and gets the transient parent
// it is supposed to have.
auto contextMenu = new QMenu(viewer->getGLWidget()->window());
MenuManager::getInstance()->setupContextMenu(&view, *contextMenu);
contextMenu->setAttribute(Qt::WA_DeleteOnClose);

Expand All @@ -2741,7 +2753,7 @@
if (contextViewProvider) {
objectMenu = new QMenu(contextMenu);
auto receiver = new NavigationStyleContextMenuReceiver(contextViewProvider, objectMenu);
contextViewProvider->setupContextMenu(objectMenu, receiver, SLOT(startEditing()));

Check warning on line 2756 in src/Gui/Navigation/NavigationStyle.cpp

View workflow job for this annotation

GitHub Actions / Lint / Lint

contextViewProvider->setupContextMenu(objectMenu, receiver, SLOT(startEditing())); <-- Consider using functor-based connections
objectActions = objectMenu->actions();
if (!objectActions.empty()) {
contextMenu->setDefaultAction(objectActions.front());
Expand Down
61 changes: 61 additions & 0 deletions src/Gui/OverlayManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
#include <QPropertyAnimation>

#include <array>
#include <cstdio>
#include <cstdlib>
#include <unordered_map>

#include "OverlayManager.h"
Expand Down Expand Up @@ -1810,8 +1812,26 @@
return d.x() * d.x() + d.y() * d.y() < tol;
}

bool OverlayManager::eventFilter(QObject* o, QEvent* ev)

Check warning on line 1815 in src/Gui/OverlayManager.cpp

View workflow job for this annotation

GitHub Actions / Lint / Lint

function 'eventFilter' has cognitive complexity of 257 (threshold 25) [readability-function-cognitive-complexity]
{
if (std::getenv("FC_DRAG_DEBUG")) { // DNDBG
const QEvent::Type _t = ev->type();
if (_t == QEvent::MouseButtonPress || _t == QEvent::MouseMove
|| _t == QEvent::MouseButtonRelease || _t == QEvent::MouseButtonDblClick) {
auto* _me = static_cast<QMouseEvent*>(ev);
const QPoint _g = _me->globalPosition().toPoint();
QWidget* _wa = QApplication::widgetAt(_g);
fprintf(stderr,
"[DNDBG] ev=%d recv=%s isWidget=%d btn=%d btns=%d qbtn=%d g=(%d,%d) "
"wAt=%s dragging=%s grab=%s\n",
int(_t), o->metaObject()->className(), o->isWidgetType() ? 1 : 0,
int(_me->button()), int(_me->buttons()), int(QApplication::mouseButtons()),
_g.x(), _g.y(), _wa ? _wa->metaObject()->className() : "-",
OverlayTabWidget::_Dragging
? OverlayTabWidget::_Dragging->metaObject()->className() : "-",
QWidget::mouseGrabber() ? QWidget::mouseGrabber()->metaObject()->className() : "-");
}
}
if (d->intercepting || !getMainWindow() || !o->isWidgetType()) {
return false;
}
Expand Down Expand Up @@ -1923,12 +1943,53 @@
return false;
}
if (OverlayTabWidget::_Dragging && OverlayTabWidget::_Dragging != o) {
if (std::getenv("FC_DRAG_DEBUG")) { // DNDBG
fprintf(stderr, "[DNDBG] MISMATCH dragging=%s recv=%s isWidget=%d\n",
OverlayTabWidget::_Dragging->metaObject()->className(),
o->metaObject()->className(), o->isWidgetType() ? 1 : 0);
}
// Wayland has no platform mouse grab (grabMouse() is skipped
// below), so during a drag the pointer events are delivered to
// the widget under the cursor instead of to the drag source, and
// the drag would end as soon as the cursor leaves the thin title
// bar. Forward the drag's own move/release events to the source
// so it keeps tracking. On platforms where the grab works the
// source already receives its own events (o == _Dragging), so this
// is only reached here on Wayland.
if (QGuiApplication::platformName() == QLatin1String("wayland")) {
QWidget* src = OverlayTabWidget::_Dragging;
auto* me = dynamic_cast<QMouseEvent*>(ev);
const bool dragMove = me && me->type() == QEvent::MouseMove
&& (me->buttons() & Qt::LeftButton);
const bool dragRelease = me && me->type() == QEvent::MouseButtonRelease
&& me->button() == Qt::LeftButton;
if (dragMove || dragRelease) {
if (std::getenv("FC_DRAG_DEBUG")) { // DNDBG
fprintf(stderr, "[DNDBG] FORWARD type=%d to=%s\n",
int(me->type()), src->metaObject()->className());
}
QMouseEvent fwd(me->type(),
src->mapFromGlobal(me->globalPosition()),
me->globalPosition(),
me->button(),
me->buttons(),
me->modifiers());
QApplication::sendEvent(src, &fwd);
return true;
}
}
if (auto titleBar = qobject_cast<OverlayTitleBar*>(OverlayTabWidget::_Dragging)) {
if (std::getenv("FC_DRAG_DEBUG")) { // DNDBG
fprintf(stderr, "[DNDBG] ENDDRAG titlebar\n");
}
titleBar->endDrag();
}
else if (
auto splitHandle = qobject_cast<OverlaySplitterHandle*>(OverlayTabWidget::_Dragging)
) {
if (std::getenv("FC_DRAG_DEBUG")) { // DNDBG
fprintf(stderr, "[DNDBG] ENDDRAG splitter\n");
}
splitHandle->endDrag();
}
}
Expand Down Expand Up @@ -2323,4 +2384,4 @@
}
}

#include "moc_OverlayManager.cpp"

Check failure on line 2387 in src/Gui/OverlayManager.cpp

View workflow job for this annotation

GitHub Actions / Lint / Lint

'moc_OverlayManager.cpp' file not found [clang-diagnostic-error]
Loading
Loading