MCPcopy Create free account
hub / github.com/LibreVR/Revive / ovr_CreateMirrorTextureWithOptionsVk

Function ovr_CreateMirrorTextureWithOptionsVk

ReviveXR/REV_CAPI_Vk.cpp:232–262  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230
231OVR_PUBLIC_FUNCTION(ovrResult)
232ovr_CreateMirrorTextureWithOptionsVk(
233 ovrSession session,
234 VkDevice device,
235 const ovrMirrorTextureDesc* desc,
236 ovrMirrorTexture* out_MirrorTexture)
237{
238 REV_TRACE(ovr_CreateMirrorTextureWithOptionsVk);
239
240 if (!session)
241 return ovrError_InvalidSession;
242
243 if (!device || !desc || !out_MirrorTexture)
244 return ovrError_InvalidParameter;
245
246 ovrMirrorTexture mirrorTexture = new ovrMirrorTextureData();
247 mirrorTexture->Desc = *desc;
248 *out_MirrorTexture = mirrorTexture;
249
250 ovrTextureSwapChainDesc swapDesc;
251 swapDesc.Type = ovrTexture_2D;
252 swapDesc.Format = desc->Format;
253 swapDesc.ArraySize = 1;
254 swapDesc.Width = desc->Width;
255 swapDesc.Height = desc->Height;
256 swapDesc.MipLevels = 1;
257 swapDesc.SampleCount = 1;
258 swapDesc.StaticImage = ovrTrue;
259 swapDesc.MiscFlags = desc->MiscFlags;
260 swapDesc.BindFlags = 0;
261 return ovr_CreateTextureSwapChainVk(session, device, &swapDesc, &mirrorTexture->Dummy);
262}
263
264OVR_PUBLIC_FUNCTION(ovrResult)
265ovr_GetMirrorTextureBufferVk(

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected