mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 00:52:27 +02:00
Re-disable reprojection in OpenVR
This commit is contained in:
parent
82081d7d57
commit
ff24bc982c
2 changed files with 13 additions and 13 deletions
|
@ -40,11 +40,6 @@ bool _openVrDisplayActive { false };
|
|||
static vr::VRTextureBounds_t OPENVR_TEXTURE_BOUNDS_LEFT{ 0, 0, 0.5f, 1 };
|
||||
static vr::VRTextureBounds_t OPENVR_TEXTURE_BOUNDS_RIGHT{ 0.5f, 0, 1, 1 };
|
||||
|
||||
|
||||
|
||||
#define OPENVR_THREADED_SUBMIT 1
|
||||
|
||||
|
||||
#if OPENVR_THREADED_SUBMIT
|
||||
|
||||
static QString readFile(const QString& filename) {
|
||||
|
@ -326,6 +321,7 @@ void OpenVrDisplayPlugin::customizeContext() {
|
|||
|
||||
Parent::customizeContext();
|
||||
|
||||
#if OPENVR_THREADED_SUBMIT
|
||||
_compositeInfos[0].texture = _compositeFramebuffer->getRenderBuffer(0);
|
||||
for (size_t i = 0; i < COMPOSITING_BUFFER_SIZE; ++i) {
|
||||
if (0 != i) {
|
||||
|
@ -333,8 +329,8 @@ void OpenVrDisplayPlugin::customizeContext() {
|
|||
}
|
||||
_compositeInfos[i].textureID = getGLBackend()->getTextureID(_compositeInfos[i].texture, false);
|
||||
}
|
||||
|
||||
_submitThread->start(QThread::HighPriority);
|
||||
#endif
|
||||
}
|
||||
|
||||
void OpenVrDisplayPlugin::uncustomizeContext() {
|
||||
|
@ -459,8 +455,8 @@ void OpenVrDisplayPlugin::hmdPresent() {
|
|||
|
||||
#if OPENVR_THREADED_SUBMIT
|
||||
_submitThread->waitForPresent();
|
||||
|
||||
#else
|
||||
GLuint glTexId = getGLBackend()->getTextureID(_compositeFramebuffer->getRenderBuffer(0), false);
|
||||
vr::Texture_t vrTexture{ (void*)glTexId, vr::API_OpenGL, vr::ColorSpace_Auto };
|
||||
vr::VRCompositor()->Submit(vr::Eye_Left, &vrTexture, &OPENVR_TEXTURE_BOUNDS_LEFT);
|
||||
vr::VRCompositor()->Submit(vr::Eye_Right, &vrTexture, &OPENVR_TEXTURE_BOUNDS_RIGHT);
|
||||
|
|
|
@ -15,8 +15,10 @@
|
|||
|
||||
const float TARGET_RATE_OpenVr = 90.0f; // FIXME: get from sdk tracked device property? This number is vive-only.
|
||||
|
||||
class OpenVrSubmitThread;
|
||||
#define OPENVR_THREADED_SUBMIT 0
|
||||
|
||||
#if OPENVR_THREADED_SUBMIT
|
||||
class OpenVrSubmitThread;
|
||||
static const size_t COMPOSITING_BUFFER_SIZE = 3;
|
||||
|
||||
struct CompositeInfo {
|
||||
|
@ -28,7 +30,7 @@ struct CompositeInfo {
|
|||
glm::mat4 pose;
|
||||
GLsync fence{ 0 };
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
class OpenVrDisplayPlugin : public HmdDisplayPlugin {
|
||||
using Parent = HmdDisplayPlugin;
|
||||
|
@ -64,16 +66,18 @@ protected:
|
|||
|
||||
|
||||
private:
|
||||
CompositeInfo::Array _compositeInfos;
|
||||
size_t _renderingIndex { 0 };
|
||||
vr::IVRSystem* _system { nullptr };
|
||||
std::atomic<vr::EDeviceActivityLevel> _hmdActivityLevel { vr::k_EDeviceActivityLevel_Unknown };
|
||||
std::atomic<uint32_t> _keyboardSupressionCount{ 0 };
|
||||
static const QString NAME;
|
||||
|
||||
vr::HmdMatrix34_t _lastGoodHMDPose;
|
||||
std::shared_ptr<OpenVrSubmitThread> _submitThread;
|
||||
mat4 _sensorResetMat;
|
||||
friend class OpenVrSubmitThread;
|
||||
|
||||
#if OPENVR_THREADED_SUBMIT
|
||||
CompositeInfo::Array _compositeInfos;
|
||||
size_t _renderingIndex { 0 };
|
||||
std::shared_ptr<OpenVrSubmitThread> _submitThread;
|
||||
friend class OpenVrSubmitThread;
|
||||
#endif
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue