Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Obs Studio
提交
dbb453d0
O
Obs Studio
项目概览
小白菜888
/
Obs Studio
通知
4
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Obs Studio
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
dbb453d0
编写于
4月 03, 2020
作者:
J
Jim
提交者:
GitHub
4月 03, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2591 from jpark37/vulkan-unsupported-fix
win-capture: Fix crash if GPU can't Vulkan capture
上级
9703d175
348fcd5b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
27 addition
and
20 deletion
+27
-20
plugins/win-capture/graphics-hook/vulkan-capture.c
plugins/win-capture/graphics-hook/vulkan-capture.c
+27
-20
未找到文件。
plugins/win-capture/graphics-hook/vulkan-capture.c
浏览文件 @
dbb453d0
...
...
@@ -1181,18 +1181,17 @@ static inline bool is_device_link_info(VkLayerDeviceCreateInfo *lici)
}
static
VkResult
VKAPI
OBS_CreateDevice
(
VkPhysicalDevice
phy_device
,
const
VkDeviceCreateInfo
*
c
info
,
const
VkDeviceCreateInfo
*
info
,
const
VkAllocationCallbacks
*
ac
,
VkDevice
*
p_device
)
{
VkDeviceCreateInfo
info
=
*
cinfo
;
struct
vk_inst_data
*
idata
=
get_inst_data
(
phy_device
);
struct
vk_inst_funcs
*
ifuncs
=
&
idata
->
funcs
;
struct
vk_data
*
data
=
NULL
;
VkResult
ret
=
VK_ERROR_INITIALIZATION_FAILED
;
VkLayerDeviceCreateInfo
*
ldci
=
(
void
*
)
info
.
pNext
;
VkLayerDeviceCreateInfo
*
ldci
=
(
void
*
)
info
->
pNext
;
/* -------------------------------------------------------- */
/* step through chain until we get to the link info */
...
...
@@ -1222,8 +1221,7 @@ static VkResult VKAPI OBS_CreateDevice(VkPhysicalDevice phy_device,
PFN_vkCreateDevice
createFunc
=
(
PFN_vkCreateDevice
)
gipa
(
VK_NULL_HANDLE
,
"vkCreateDevice"
);
ret
=
createFunc
(
phy_device
,
idata
->
valid
?
&
info
:
cinfo
,
ac
,
p_device
);
ret
=
createFunc
(
phy_device
,
info
,
ac
,
p_device
);
if
(
ret
!=
VK_SUCCESS
)
{
goto
fail
;
}
...
...
@@ -1291,6 +1289,7 @@ static VkResult VKAPI OBS_CreateDevice(VkPhysicalDevice phy_device,
if
(
funcs_not_found
)
{
goto
fail
;
}
if
(
!
idata
->
valid
)
{
flog
(
"instance not valid"
);
goto
fail
;
...
...
@@ -1320,11 +1319,15 @@ static void VKAPI OBS_DestroyDevice(VkDevice device,
if
(
!
data
)
return
;
for
(
uint32_t
fam_idx
=
0
;
fam_idx
<
_countof
(
data
->
cmd_pools
);
fam_idx
++
)
{
struct
vk_cmd_pool_data
*
pool_data
=
&
data
->
cmd_pools
[
fam_idx
];
if
(
pool_data
->
cmd_pool
!=
VK_NULL_HANDLE
)
{
vk_shtex_destroy_cmd_pool_objects
(
data
,
pool_data
);
if
(
data
->
valid
)
{
for
(
uint32_t
fam_idx
=
0
;
fam_idx
<
_countof
(
data
->
cmd_pools
);
fam_idx
++
)
{
struct
vk_cmd_pool_data
*
pool_data
=
&
data
->
cmd_pools
[
fam_idx
];
if
(
pool_data
->
cmd_pool
!=
VK_NULL_HANDLE
)
{
vk_shtex_destroy_cmd_pool_objects
(
data
,
pool_data
);
}
}
}
...
...
@@ -1339,15 +1342,17 @@ OBS_CreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR *cinfo,
const
VkAllocationCallbacks
*
ac
,
VkSwapchainKHR
*
p_sc
)
{
struct
vk_data
*
data
=
get_device_data
(
device
);
struct
vk_device_funcs
*
funcs
=
&
data
->
funcs
;
VkSwapchainCreateInfoKHR
info
=
*
cinfo
;
info
.
imageUsage
|=
VK_IMAGE_USAGE_TRANSFER_SRC_BIT
;
if
(
data
->
valid
)
info
.
imageUsage
|=
VK_IMAGE_USAGE_TRANSFER_SRC_BIT
;
struct
vk_device_funcs
*
funcs
=
&
data
->
funcs
;
VkResult
res
=
funcs
->
CreateSwapchainKHR
(
device
,
&
info
,
ac
,
p_sc
);
debug_res
(
"CreateSwapchainKHR"
,
res
);
if
(
res
!=
VK_SUCCESS
)
if
(
(
res
!=
VK_SUCCESS
)
||
!
data
->
valid
)
return
res
;
VkSwapchainKHR
sc
=
*
p_sc
;
uint32_t
count
=
0
;
...
...
@@ -1379,14 +1384,16 @@ static void VKAPI OBS_DestroySwapchainKHR(VkDevice device, VkSwapchainKHR sc,
struct
vk_data
*
data
=
get_device_data
(
device
);
struct
vk_device_funcs
*
funcs
=
&
data
->
funcs
;
struct
vk_swap_data
*
swap
=
get_swap_data
(
data
,
sc
);
if
(
swap
)
{
if
(
data
->
cur_swap
==
swap
)
{
vk_shtex_free
(
data
);
if
(
data
->
valid
)
{
struct
vk_swap_data
*
swap
=
get_swap_data
(
data
,
sc
);
if
(
swap
)
{
if
(
data
->
cur_swap
==
swap
)
{
vk_shtex_free
(
data
);
}
swap
->
sc
=
VK_NULL_HANDLE
;
swap
->
hwnd
=
NULL
;
}
swap
->
sc
=
VK_NULL_HANDLE
;
swap
->
hwnd
=
NULL
;
}
funcs
->
DestroySwapchainKHR
(
device
,
sc
,
ac
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录