Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
GamebabyRockSun_QQ
GRSD3D12Sample
提交
42c049f7
G
GRSD3D12Sample
项目概览
GamebabyRockSun_QQ
/
GRSD3D12Sample
大约 1 年 前同步成功
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
1
Wiki
分析
仓库
DevOps
项目成员
Pages
G
GRSD3D12Sample
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
1
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
42c049f7
编写于
12月 01, 2019
作者:
GamebabyRockSun_QQ
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
删除了第11个示例项目中已经不再使用的DoNothingPS渲染管线相关代码,删除了对对_com_err异常的拦截和使用代码,目前没有必要使用这些
上级
35091d86
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
7 addition
and
56 deletion
+7
-56
11-MultiThreadAndAdapter/11-MultiThreadAndAdapter.cpp
11-MultiThreadAndAdapter/11-MultiThreadAndAdapter.cpp
+7
-56
未找到文件。
11-MultiThreadAndAdapter/11-MultiThreadAndAdapter.cpp
浏览文件 @
42c049f7
...
...
@@ -3,7 +3,6 @@
#include <windows.h>
#include <tchar.h>
#include <fstream> //for ifstream
#include <comdef.h >
#include <wrl.h> //添加WTL支持 方便使用COM
#include <atlconv.h>
#include <atlcoll.h> //for atl array
...
...
@@ -27,11 +26,6 @@ using namespace DirectX;
#pragma comment(lib, "dxgi.lib")
#pragma comment(lib, "d3d12.lib")
#pragma comment(lib, "d3dcompiler.lib")
#if defined(_DEBUG)
#pragma comment(lib, "comsuppwd.lib")
#else
#pragma comment(lib, "comsuppw.lib")
#endif // DEBUG
#ifndef GRS_BLOCK
...
...
@@ -337,7 +331,7 @@ int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR l
ComPtr
<
ID3D12Resource
>
pIVBQuadUpload
;
D3D12_VERTEX_BUFFER_VIEW
pstVBVQuad
;
SIZE_T
szSecondPassCB
=
GRS_UPPER
(
sizeof
(
ST_GRS_PEROBJECT_CB
),
256
);
ST_GRS_PEROBJECT_CB
*
pstCBSecondPass
=
nullptr
;
ST_GRS_PEROBJECT_CB
*
pstCBSecondPass
=
nullptr
;
ComPtr
<
ID3D12Resource
>
pICBResSecondPass
;
ComPtr
<
ID3D12Resource
>
pINoiseTexture
;
ComPtr
<
ID3D12Resource
>
pINoiseTextureUpload
;
...
...
@@ -350,8 +344,6 @@ int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR l
ComPtr
<
ID3D12DescriptorHeap
>
pISRVHeapPostPass
[
c_nPostPassCnt
];
ComPtr
<
ID3D12DescriptorHeap
>
pISampleHeapPostPass
;
ComPtr
<
ID3D12PipelineState
>
pIPSODoNothing
;
//简单的显示颜色的PS的管线状态对象
try
{
GRS_THROW_IF_FAILED
(
::
CoInitialize
(
nullptr
));
...
...
@@ -1240,31 +1232,6 @@ int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR l
,
IID_PPV_ARGS
(
&
pIPSOPostPass
[
c_nPostPass1
])));
GRS_SET_D3D12_DEBUGNAME_COMPTR
(
pIPSOPostPass
[
c_nPostPass1
]);
//---------------------------------------------------------------------------------------------------
// DoNothing PS PSO
pIPSCode
.
Reset
();
pIErrMsg
.
Reset
();
StringCchPrintf
(
pszShaderFileName
,
MAX_PATH
,
_T
(
"%s11-MultiThreadAndAdapter
\\
Shader
\\
11-DoNothingPS.hlsl"
),
g_pszAppPath
);
//后处理渲染,只编译PS就可以了,VS就用之前的QuadVS即可,都是后处理主要玩PS
hr
=
D3DCompileFromFile
(
pszShaderFileName
,
nullptr
,
nullptr
,
"PSMain"
,
"ps_5_0"
,
nShaderCompileFlags
,
0
,
&
pIPSCode
,
&
pIErrMsg
);
if
(
FAILED
(
hr
))
{
if
(
nullptr
!=
pIErrMsg
)
{
StringCchPrintfA
(
pszErrMsg
,
MAX_PATH
,
"
\n
%s
\n
"
,
(
CHAR
*
)
pIErrMsg
->
GetBufferPointer
());
::
OutputDebugStringA
(
pszErrMsg
);
}
throw
CGRSCOMException
(
hr
);
}
stPSOThirdPassDesc
.
PS
=
CD3DX12_SHADER_BYTECODE
(
pIPSCode
.
Get
());
GRS_THROW_IF_FAILED
(
stGPU
[
c_nSecondGPU
].
m_pID3D12Device4
->
CreateGraphicsPipelineState
(
&
stPSOThirdPassDesc
,
IID_PPV_ARGS
(
&
pIPSODoNothing
)));
GRS_SET_D3D12_DEBUGNAME_COMPTR
(
pIPSODoNothing
);
}}
//10、准备参数并启动多个渲染线程
...
...
@@ -2004,15 +1971,9 @@ int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR l
//-------------------------------------------------------------------------------------------------------
// 3 Thrid Pass
if
(
0
==
g_nUsePSID
)
{
//没有 高斯模糊
pICMDListPostPass
->
SetPipelineState
(
pIPSODoNothing
.
Get
());
}
else
{
//使用高斯模糊
pICMDListPostPass
->
SetPipelineState
(
pIPSOPostPass
[
c_nPostPass0
].
Get
());
}
//使用高斯模糊
pICMDListPostPass
->
SetPipelineState
(
pIPSOPostPass
[
c_nPostPass0
].
Get
());
arDesHeaps
.
RemoveAll
();
arDesHeaps
.
Add
(
pISRVHeapPostPass
[
c_nPostPass0
].
Get
());
arDesHeaps
.
Add
(
pISampleHeapPostPass
.
Get
());
...
...
@@ -2054,15 +2015,9 @@ int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR l
//-------------------------------------------------------------------------------------------------------
// 4 Fourth Pass
if
(
0
==
g_nUsePSID
)
{
//没有 高斯模糊
pICMDListPostPass
->
SetPipelineState
(
pIPSODoNothing
.
Get
());
}
else
{
//高斯模糊
pICMDListPostPass
->
SetPipelineState
(
pIPSOPostPass
[
c_nPostPass1
].
Get
());
}
//高斯模糊
pICMDListPostPass
->
SetPipelineState
(
pIPSOPostPass
[
c_nPostPass1
].
Get
());
arDesHeaps
.
RemoveAll
();
arDesHeaps
.
Add
(
pISRVHeapPostPass
[
c_nPostPass1
].
Get
());
arDesHeaps
.
Add
(
pISampleHeapPostPass
.
Get
());
...
...
@@ -2177,10 +2132,6 @@ int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR l
{
//发生了COM异常
e
;
}
catch
(
_com_error
&
e
)
{
e
.
ErrorInfo
();
}
try
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录