mirror of
https://github.com/ValveSoftware/Proton.git
synced 2024-12-27 07:05:46 +03:00
vrclient: Call SetExplicitTimingMode even on older vrclient versions
This commit is contained in:
parent
f7510f2a7b
commit
d472d536cf
@ -159,7 +159,7 @@ def ivrcompositor_post_present_handoff(cppname, method):
|
|||||||
return "ivrcompositor_post_present_handoff"
|
return "ivrcompositor_post_present_handoff"
|
||||||
|
|
||||||
def ivrcompositor_wait_get_poses(cppname, method):
|
def ivrcompositor_wait_get_poses(cppname, method):
|
||||||
for version in ["021", "022"]:
|
for version in ["016", "018", "019", "020", "021", "022"]:
|
||||||
if version in cppname:
|
if version in cppname:
|
||||||
return "ivrcompositor_wait_get_poses"
|
return "ivrcompositor_wait_get_poses"
|
||||||
return None
|
return None
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
#include "flatapi.h"
|
#include "flatapi.h"
|
||||||
|
|
||||||
|
#include "cppIVRClientCore_IVRClientCore_003.h"
|
||||||
#include "cppIVRCompositor_IVRCompositor_021.h"
|
#include "cppIVRCompositor_IVRCompositor_021.h"
|
||||||
#include "cppIVRCompositor_IVRCompositor_022.h"
|
#include "cppIVRCompositor_IVRCompositor_022.h"
|
||||||
|
|
||||||
@ -482,6 +483,14 @@ VRCompositorError ivrcompositor_008_submit(
|
|||||||
return cpp_func(linux_side, eye, api, texture, bounds, flags);
|
return cpp_func(linux_side, eye, api, texture, bounds, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void *our_compositor;
|
||||||
|
|
||||||
|
static void get_our_compositor(void)
|
||||||
|
{
|
||||||
|
void *client_core = vrclient_VRClientCoreFactory("IVRClientCore_003", NULL);
|
||||||
|
our_compositor = cppIVRClientCore_IVRClientCore_003_GetGenericInterface(client_core, "IVRCompositor_022", NULL);
|
||||||
|
}
|
||||||
|
|
||||||
EVRCompositorError ivrcompositor_submit(
|
EVRCompositorError ivrcompositor_submit(
|
||||||
EVRCompositorError (*cpp_func)(void *, EVREye, Texture_t *, VRTextureBounds_t *, EVRSubmitFlags),
|
EVRCompositorError (*cpp_func)(void *, EVREye, Texture_t *, VRTextureBounds_t *, EVRSubmitFlags),
|
||||||
void *linux_side, EVREye eye, Texture_t *texture, VRTextureBounds_t *bounds, EVRSubmitFlags flags,
|
void *linux_side, EVREye eye, Texture_t *texture, VRTextureBounds_t *bounds, EVRSubmitFlags flags,
|
||||||
@ -514,6 +523,8 @@ EVRCompositorError ivrcompositor_submit(
|
|||||||
wine_texture->lpVtbl->GetDevice(wine_texture, &device);
|
wine_texture->lpVtbl->GetDevice(wine_texture, &device);
|
||||||
if (user_data->d3d11_device != device)
|
if (user_data->d3d11_device != device)
|
||||||
{
|
{
|
||||||
|
void *timing_compositor = linux_side;
|
||||||
|
|
||||||
if (user_data->d3d11_device)
|
if (user_data->d3d11_device)
|
||||||
FIXME("Previous submit was from different D3D11 device.\n");
|
FIXME("Previous submit was from different D3D11 device.\n");
|
||||||
|
|
||||||
@ -534,17 +545,23 @@ EVRCompositorError ivrcompositor_submit(
|
|||||||
TRACE("Enabling explicit timing mode.\n");
|
TRACE("Enabling explicit timing mode.\n");
|
||||||
switch (version)
|
switch (version)
|
||||||
{
|
{
|
||||||
|
/* older, supported versions */
|
||||||
case 21:
|
case 21:
|
||||||
cppIVRCompositor_IVRCompositor_021_SetExplicitTimingMode(linux_side,
|
cppIVRCompositor_IVRCompositor_021_SetExplicitTimingMode(linux_side,
|
||||||
VRCompositorTimingMode_Explicit_ApplicationPerformsPostPresentHandoff);
|
VRCompositorTimingMode_Explicit_ApplicationPerformsPostPresentHandoff);
|
||||||
break;
|
break;
|
||||||
case 22:
|
|
||||||
cppIVRCompositor_IVRCompositor_022_SetExplicitTimingMode(linux_side,
|
|
||||||
VRCompositorTimingMode_Explicit_ApplicationPerformsPostPresentHandoff);
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
FIXME("Version %u not supported.\n", version);
|
{
|
||||||
user_data->wined3d_device = NULL;
|
if(!our_compositor){
|
||||||
|
TRACE("Performing hack for old compositor version %u.\n", version);
|
||||||
|
get_our_compositor();
|
||||||
|
}
|
||||||
|
timing_compositor = our_compositor;
|
||||||
|
}
|
||||||
|
/* fall through, below version MUST match version in get_our_compositor() */
|
||||||
|
case 22:
|
||||||
|
cppIVRCompositor_IVRCompositor_022_SetExplicitTimingMode(timing_compositor,
|
||||||
|
VRCompositorTimingMode_Explicit_ApplicationPerformsPostPresentHandoff);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -796,6 +813,7 @@ static CDECL void d3d11_explicit_timing_callback(const void *data, unsigned int
|
|||||||
{
|
{
|
||||||
const struct explicit_timing_data *callback_data = data;
|
const struct explicit_timing_data *callback_data = data;
|
||||||
EVRCompositorError error;
|
EVRCompositorError error;
|
||||||
|
void *timing_compositor = callback_data->linux_side;
|
||||||
|
|
||||||
TRACE("data {%p, %u}\n", data, data_size);
|
TRACE("data {%p, %u}\n", data, data_size);
|
||||||
|
|
||||||
@ -804,11 +822,18 @@ static CDECL void d3d11_explicit_timing_callback(const void *data, unsigned int
|
|||||||
case 21:
|
case 21:
|
||||||
error = cppIVRCompositor_IVRCompositor_021_SubmitExplicitTimingData(callback_data->linux_side);
|
error = cppIVRCompositor_IVRCompositor_021_SubmitExplicitTimingData(callback_data->linux_side);
|
||||||
break;
|
break;
|
||||||
case 22:
|
|
||||||
error = cppIVRCompositor_IVRCompositor_022_SubmitExplicitTimingData(callback_data->linux_side);
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
ERR("Unexpected version %#x\n", callback_data->version);
|
{
|
||||||
|
if(!our_compositor){
|
||||||
|
TRACE("Performing hack for old compositor version %u.\n", callback_data->version);
|
||||||
|
get_our_compositor();
|
||||||
|
}
|
||||||
|
timing_compositor = our_compositor;
|
||||||
|
}
|
||||||
|
/* fall through, below version MUST match version in get_our_compositor() */
|
||||||
|
case 22:
|
||||||
|
error = cppIVRCompositor_IVRCompositor_022_SubmitExplicitTimingData(timing_compositor);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (error)
|
if (error)
|
||||||
|
@ -942,7 +942,7 @@ DEFINE_THISCALL_WRAPPER(winIVRCompositor_IVRCompositor_020_WaitGetPoses, 28)
|
|||||||
EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_020_WaitGetPoses(winIVRCompositor_IVRCompositor_020 *_this, TrackedDevicePose_t * pRenderPoseArray, uint32_t unRenderPoseArrayCount, TrackedDevicePose_t * pGamePoseArray, uint32_t unGamePoseArrayCount)
|
EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_020_WaitGetPoses(winIVRCompositor_IVRCompositor_020 *_this, TrackedDevicePose_t * pRenderPoseArray, uint32_t unRenderPoseArrayCount, TrackedDevicePose_t * pGamePoseArray, uint32_t unGamePoseArrayCount)
|
||||||
{
|
{
|
||||||
TRACE("%p\n", _this);
|
TRACE("%p\n", _this);
|
||||||
return cppIVRCompositor_IVRCompositor_020_WaitGetPoses(_this->linux_side, pRenderPoseArray, unRenderPoseArrayCount, pGamePoseArray, unGamePoseArrayCount);
|
return ivrcompositor_wait_get_poses(cppIVRCompositor_IVRCompositor_020_WaitGetPoses, _this->linux_side, pRenderPoseArray, unRenderPoseArrayCount, pGamePoseArray, unGamePoseArrayCount, 20, &_this->user_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFINE_THISCALL_WRAPPER(winIVRCompositor_IVRCompositor_020_GetLastPoses, 28)
|
DEFINE_THISCALL_WRAPPER(winIVRCompositor_IVRCompositor_020_GetLastPoses, 28)
|
||||||
@ -1373,7 +1373,7 @@ DEFINE_THISCALL_WRAPPER(winIVRCompositor_IVRCompositor_019_WaitGetPoses, 28)
|
|||||||
EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_019_WaitGetPoses(winIVRCompositor_IVRCompositor_019 *_this, TrackedDevicePose_t * pRenderPoseArray, uint32_t unRenderPoseArrayCount, TrackedDevicePose_t * pGamePoseArray, uint32_t unGamePoseArrayCount)
|
EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_019_WaitGetPoses(winIVRCompositor_IVRCompositor_019 *_this, TrackedDevicePose_t * pRenderPoseArray, uint32_t unRenderPoseArrayCount, TrackedDevicePose_t * pGamePoseArray, uint32_t unGamePoseArrayCount)
|
||||||
{
|
{
|
||||||
TRACE("%p\n", _this);
|
TRACE("%p\n", _this);
|
||||||
return cppIVRCompositor_IVRCompositor_019_WaitGetPoses(_this->linux_side, pRenderPoseArray, unRenderPoseArrayCount, pGamePoseArray, unGamePoseArrayCount);
|
return ivrcompositor_wait_get_poses(cppIVRCompositor_IVRCompositor_019_WaitGetPoses, _this->linux_side, pRenderPoseArray, unRenderPoseArrayCount, pGamePoseArray, unGamePoseArrayCount, 19, &_this->user_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFINE_THISCALL_WRAPPER(winIVRCompositor_IVRCompositor_019_GetLastPoses, 28)
|
DEFINE_THISCALL_WRAPPER(winIVRCompositor_IVRCompositor_019_GetLastPoses, 28)
|
||||||
@ -1795,7 +1795,7 @@ DEFINE_THISCALL_WRAPPER(winIVRCompositor_IVRCompositor_018_WaitGetPoses, 28)
|
|||||||
EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_018_WaitGetPoses(winIVRCompositor_IVRCompositor_018 *_this, TrackedDevicePose_t * pRenderPoseArray, uint32_t unRenderPoseArrayCount, TrackedDevicePose_t * pGamePoseArray, uint32_t unGamePoseArrayCount)
|
EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_018_WaitGetPoses(winIVRCompositor_IVRCompositor_018 *_this, TrackedDevicePose_t * pRenderPoseArray, uint32_t unRenderPoseArrayCount, TrackedDevicePose_t * pGamePoseArray, uint32_t unGamePoseArrayCount)
|
||||||
{
|
{
|
||||||
TRACE("%p\n", _this);
|
TRACE("%p\n", _this);
|
||||||
return cppIVRCompositor_IVRCompositor_018_WaitGetPoses(_this->linux_side, pRenderPoseArray, unRenderPoseArrayCount, pGamePoseArray, unGamePoseArrayCount);
|
return ivrcompositor_wait_get_poses(cppIVRCompositor_IVRCompositor_018_WaitGetPoses, _this->linux_side, pRenderPoseArray, unRenderPoseArrayCount, pGamePoseArray, unGamePoseArrayCount, 18, &_this->user_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFINE_THISCALL_WRAPPER(winIVRCompositor_IVRCompositor_018_GetLastPoses, 28)
|
DEFINE_THISCALL_WRAPPER(winIVRCompositor_IVRCompositor_018_GetLastPoses, 28)
|
||||||
@ -2199,7 +2199,7 @@ DEFINE_THISCALL_WRAPPER(winIVRCompositor_IVRCompositor_016_WaitGetPoses, 28)
|
|||||||
EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_016_WaitGetPoses(winIVRCompositor_IVRCompositor_016 *_this, TrackedDevicePose_t * pRenderPoseArray, uint32_t unRenderPoseArrayCount, TrackedDevicePose_t * pGamePoseArray, uint32_t unGamePoseArrayCount)
|
EVRCompositorError __thiscall winIVRCompositor_IVRCompositor_016_WaitGetPoses(winIVRCompositor_IVRCompositor_016 *_this, TrackedDevicePose_t * pRenderPoseArray, uint32_t unRenderPoseArrayCount, TrackedDevicePose_t * pGamePoseArray, uint32_t unGamePoseArrayCount)
|
||||||
{
|
{
|
||||||
TRACE("%p\n", _this);
|
TRACE("%p\n", _this);
|
||||||
return cppIVRCompositor_IVRCompositor_016_WaitGetPoses(_this->linux_side, pRenderPoseArray, unRenderPoseArrayCount, pGamePoseArray, unGamePoseArrayCount);
|
return ivrcompositor_wait_get_poses(cppIVRCompositor_IVRCompositor_016_WaitGetPoses, _this->linux_side, pRenderPoseArray, unRenderPoseArrayCount, pGamePoseArray, unGamePoseArrayCount, 16, &_this->user_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFINE_THISCALL_WRAPPER(winIVRCompositor_IVRCompositor_016_GetLastPoses, 28)
|
DEFINE_THISCALL_WRAPPER(winIVRCompositor_IVRCompositor_016_GetLastPoses, 28)
|
||||||
|
Loading…
Reference in New Issue
Block a user