Qt3DRender::QWaitFence Class
class Qt3DRender::QWaitFenceFrameGraphNode serviva per attendere che un blocco nel flusso di comandi grafici venisse segnalato. Continua...
| Intestazione: | #include <qwaitfence.h> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS 3drender) target_link_libraries(mytarget PRIVATE Qt6::3drender) |
| qmake: | QT += 3drender |
| Eredita da: | Qt3DRender::QFrameGraphNode |
| Stato: | Obsoleta |
Questa classe è deprecata. Si sconsiglia vivamente di utilizzarla nel nuovo codice.
Proprietà
- handle : QVariant
- handleType : HandleType
- timeout : quint64
- waitOnCPU : bool
Funzioni pubbliche
| QVariant | handle() const |
| Qt3DRender::QWaitFence::HandleType | handleType() const |
| void | setHandle(QVariant handle) |
| void | setHandleType(Qt3DRender::QWaitFence::HandleType type) |
| void | setTimeout(quint64 timeout) |
| void | setWaitOnCPU(bool waitOnCPU) |
| quint64 | timeout() const |
| bool | waitOnCPU() const |
Segnali
| void | handleChanged(QVariant handle) |
| void | handleTypeChanged(Qt3DRender::QWaitFence::HandleType handleType) |
| void | timeoutChanged(quint64 timeoutChanged) |
| void | waitOnCPUChanged(bool waitOnCPU) |
Descrizione dettagliata
I fence consentono di sincronizzare i carichi di lavoro della GPU e della CPU. I comandi della GPU sono solitamente non bloccanti. Una volta emessi, i comandi vengono inseriti in buffer di comandi che saranno letti in un secondo momento dalla GPU. In alcuni casi, è necessario continuare l'elaborazione o emettere un comando specifico solo quando si è certi che un comando sia stato eseguito dall'hardware. I fence rappresentano uno strumento per raggiungere questo obiettivo. Ciò è particolarmente importante quando si utilizzano motori di terze parti con Qt3D: Qt3D dovrebbe accedere alle risorse condivise solo quando si ha la certezza che i comandi dell’altro motore abbiano terminato di modificare la risorsa.
QWaitFence è un nodo FrameGraph che impone di attendere che venga segnalato prima che i comandi successivi vengano inseriti nel flusso di comandi. Può quindi essere utilizzato in combinazione con QSetFence e contiene proprietà per configurare la durata dell’attesa e se debba bloccare il lato CPU.
Nota: Qt 3D carica le risorse della GPU (texture, shader, buffer) prima di emettere le chiamate di disegno.
Documentazione delle proprietà
handle : QVariant
Contiene l'handle della recinzione sottostante racchiuso in un oggetto ` QVariant`.
Funzioni di accesso:
| QVariant | handle() const |
| void | setHandle(QVariant handle) |
Segnale di notifica:
| void | handleChanged(QVariant handle) |
handleType : HandleType
Specifica il tipo di handle in uso. Attualmente sono supportati solo gli ID Fence di OpenGL.
Funzioni di accesso:
| Qt3DRender::QWaitFence::HandleType | handleType() const |
| void | setHandleType(Qt3DRender::QWaitFence::HandleType type) |
Segnale di notifica:
| void | handleTypeChanged(Qt3DRender::QWaitFence::HandleType handleType) |
timeout : quint64
Specifica il tempo massimo, espresso in nanosecondi, da attendere affinché il fence venga attivato.
Funzioni di accesso:
| quint64 | timeout() const |
| void | setTimeout(quint64 timeout) |
Segnale del notificatore:
| void | timeoutChanged(quint64 timeoutChanged) |
waitOnCPU : bool
Specifica se la CPU debba essere bloccata in attesa che il fence venga segnalato. Il valore predefinito è false.
Funzioni di accesso:
| bool | waitOnCPU() const |
| void | setWaitOnCPU(bool waitOnCPU) |
Segnale del notificatore:
| void | waitOnCPUChanged(bool waitOnCPU) |
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.