Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
GamebabyRockSun_QQ
GRSD3D12Sample
提交
8f4ba260
G
GRSD3D12Sample
项目概览
GamebabyRockSun_QQ
/
GRSD3D12Sample
9 个月 前同步成功
通知
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,体验更适合开发者的 AI 搜索 >>
提交
8f4ba260
编写于
6月 08, 2021
作者:
GamebabyRockSun_QQ
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
从示例12中去除了所有关于d3dx12.h的引用
上级
2b50a20d
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
742 addition
and
463 deletion
+742
-463
11-MultiThreadAndAdapter/11-MultiThreadAndAdapter.cpp
11-MultiThreadAndAdapter/11-MultiThreadAndAdapter.cpp
+26
-31
12-D2DWriteOnD3D12/12-D2DWriteOnD3D12.cpp
12-D2DWriteOnD3D12/12-D2DWriteOnD3D12.cpp
+712
-432
Revision.md
Revision.md
+4
-0
未找到文件。
11-MultiThreadAndAdapter/11-MultiThreadAndAdapter.cpp
浏览文件 @
8f4ba260
...
...
@@ -129,7 +129,7 @@ private:
#endif
//默认后缓冲数量
//
默认后缓冲数量
const
UINT
g_nFrameBackBufCount
=
3u
;
// 显卡参数集合
...
...
@@ -230,39 +230,39 @@ struct ST_GRS_PEROBJECT_CB
int
g_iWndWidth
=
1024
;
int
g_iWndHeight
=
768
;
D3D12_VIEWPORT
g_stViewPort
=
{
0.0
f
,
0.0
f
,
static_cast
<
float
>
(
g_iWndWidth
),
static_cast
<
float
>
(
g_iWndHeight
)
,
D3D12_MIN_DEPTH
,
D3D12_MAX_DEPTH
};
D3D12_RECT
g_stScissorRect
=
{
0
,
0
,
static_cast
<
LONG
>
(
g_iWndWidth
),
static_cast
<
LONG
>
(
g_iWndHeight
)
};
D3D12_VIEWPORT
g_stViewPort
=
{
0.0
f
,
0.0
f
,
static_cast
<
float
>
(
g_iWndWidth
),
static_cast
<
float
>
(
g_iWndHeight
)
,
D3D12_MIN_DEPTH
,
D3D12_MAX_DEPTH
};
D3D12_RECT
g_stScissorRect
=
{
0
,
0
,
static_cast
<
LONG
>
(
g_iWndWidth
),
static_cast
<
LONG
>
(
g_iWndHeight
)
};
//初始的默认摄像机的位置
XMFLOAT3
g_f3EyePos
=
XMFLOAT3
(
0.0
f
,
5.0
f
,
-
10.0
f
);
//眼睛位置
XMFLOAT3
g_f3LockAt
=
XMFLOAT3
(
0.0
f
,
0.0
f
,
0.0
f
);
//眼睛所盯的位置
XMFLOAT3
g_f3HeapUp
=
XMFLOAT3
(
0.0
f
,
1.0
f
,
0.0
f
);
//头部正上方位置
XMFLOAT3
g_f3EyePos
=
XMFLOAT3
(
0.0
f
,
5.0
f
,
-
10.0
f
);
//眼睛位置
XMFLOAT3
g_f3LockAt
=
XMFLOAT3
(
0.0
f
,
0.0
f
,
0.0
f
);
//眼睛所盯的位置
XMFLOAT3
g_f3HeapUp
=
XMFLOAT3
(
0.0
f
,
1.0
f
,
0.0
f
);
//头部正上方位置
float
g_fYaw
=
0.0
f
;
// 绕正Z轴的旋转量.
float
g_fPitch
=
0.0
f
;
// 绕XZ平面的旋转量
float
g_fYaw
=
0.0
f
;
// 绕正Z轴的旋转量.
float
g_fPitch
=
0.0
f
;
// 绕XZ平面的旋转量
double
g_fPalstance
=
5.0
f
*
XM_PI
/
180.0
f
;
//物体旋转的角速度,单位:弧度/秒
double
g_fPalstance
=
5.0
f
*
XM_PI
/
180.0
f
;
//物体旋转的角速度,单位:弧度/秒
XMFLOAT4X4
g_mxWorld
=
{};
//World Matrix
XMFLOAT4X4
g_mxVP
=
{};
//View Projection Matrix
// 全局线程参数
const
UINT
g_nMaxThread
=
3
;
const
UINT
g_nThdSphere
=
0
;
const
UINT
g_nThdCube
=
1
;
const
UINT
g_nThdPlane
=
2
;
ST_GRS_THREAD_PARAMS
g_stThread
[
g_nMaxThread
]
=
{};
const
UINT
g_nMaxThread
=
3
;
const
UINT
g_nThdSphere
=
0
;
const
UINT
g_nThdCube
=
1
;
const
UINT
g_nThdPlane
=
2
;
ST_GRS_THREAD_PARAMS
g_stThread
[
g_nMaxThread
]
=
{};
TCHAR
g_pszAppPath
[
MAX_PATH
]
=
{};
TCHAR
g_pszAppPath
[
MAX_PATH
]
=
{};
//后处理需要的参数,设置为全局变量方便在窗口过程中根据按键输入调整
UINT
g_nFunNO
=
1
;
//当前使用效果函数的序号(按空格键循环切换)
UINT
g_nMaxFunNO
=
2
;
//总的效果函数个数
float
g_fQuatLevel
=
2.0
f
;
//量化bit数,取值2-6
float
g_fWaterPower
=
40.0
f
;
//表示水彩扩展力度,单位为像素
UINT
g_nFunNO
=
1
;
//当前使用效果函数的序号(按空格键循环切换)
UINT
g_nMaxFunNO
=
2
;
//总的效果函数个数
float
g_fQuatLevel
=
2.0
f
;
//量化bit数,取值2-6
float
g_fWaterPower
=
40.0
f
;
//表示水彩扩展力度,单位为像素
//使用哪个版本PS做最后的模糊处理:0 原样输出 1 矩阵形式高斯模糊PS 2 双向分离优化后的高斯模糊PS(来自微软官方示例)
UINT
g_nUsePSID
=
1
;
UINT
g_nUsePSID
=
1
;
//渲染子线程函数
UINT
__stdcall
RenderThread
(
void
*
pParam
);
...
...
@@ -958,8 +958,8 @@ int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR l
D3D12_FEATURE_ROOT_SIGNATURE
,
&
stFeatureData
,
sizeof
(
stFeatureData
))))
{
stFeatureData
.
HighestVersion
=
D3D_ROOT_SIGNATURE_VERSION_1_0
;
{
// 1.0版 直接丢异常退出了
GRS_THROW_IF_FAILED
(
E_NOTIMPL
)
;
}
D3D12_DESCRIPTOR_RANGE1
stDSPRanges
[
3
]
=
{};
...
...
@@ -1154,7 +1154,7 @@ int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR l
GRS_SET_D3D12_DEBUGNAME_COMPTR
(
pIRSPostPass
);
}}
//
9
、编译Shader创建渲染管线状态对象
//
8
、编译Shader创建渲染管线状态对象
{
{
#if defined(_DEBUG)
// Enable better shader debugging with the graphics debugging tools.
...
...
@@ -1400,7 +1400,7 @@ int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR l
//---------------------------------------------------------------------------------------------------
}}
//
10
、准备参数并启动多个渲染线程
//
9
、准备参数并启动多个渲染线程
{
{
USES_CONVERSION
;
// 球体个性参数
...
...
@@ -1473,7 +1473,7 @@ int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR l
}
}}
//
11
、加载DDS噪声纹理,注意用于后处理,所以加载到第二个显卡上
//
10
、加载DDS噪声纹理,注意用于后处理,所以加载到第二个显卡上
{
TCHAR
pszNoiseTexture
[
MAX_PATH
]
=
{};
StringCchPrintf
(
pszNoiseTexture
,
MAX_PATH
,
_T
(
"%sAssets
\\
GaussianNoise256.dds"
),
g_pszAppPath
);
...
...
@@ -1597,7 +1597,7 @@ int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR l
stGPU
[
c_nSecondGPU
].
m_pICMDList
->
ResourceBarrier
(
1
,
&
stResStateTransBarrier
);
}
//
12
、建辅助显卡用来渲染或后处理用的矩形框
//
11
、建辅助显卡用来渲染或后处理用的矩形框
{
ST_GRS_VERTEX_QUAD
stVertexQuad
[]
=
{
//( x, y, z, w ) ( u, v )
...
...
@@ -1629,11 +1629,6 @@ int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR l
,
nullptr
,
IID_PPV_ARGS
(
&
pIVBQuadUpload
)));
D3D12_SUBRESOURCE_DATA
stVBDataQuad
=
{};
stVBDataQuad
.
pData
=
reinterpret_cast
<
UINT8
*>
(
stVertexQuad
);
stVBDataQuad
.
RowPitch
=
nszVBQuad
;
stVBDataQuad
.
SlicePitch
=
stVBDataQuad
.
RowPitch
;
// 第一遍Copy
BYTE
*
pData
=
nullptr
;
GRS_THROW_IF_FAILED
(
pIVBQuadUpload
->
Map
(
0
,
nullptr
,
reinterpret_cast
<
void
**>
(
&
pData
)));
...
...
12-D2DWriteOnD3D12/12-D2DWriteOnD3D12.cpp
浏览文件 @
8f4ba260
此差异已折叠。
点击以展开。
Revision.md
浏览文件 @
8f4ba260
...
...
@@ -56,3 +56,7 @@ D3D12 ERROR: ID3D12CommandQueue::Present: Resource state (0x800: D3D12_RESOURCE_
2021-6-7
1、去除了示例11多线程+多显卡渲染示例中所有d3dx12.h的引用;
2021-6-8
1、去除了示例12多线程 + 多显卡渲染 + D2D + DirectWrite示例中所有d3dx12.h的引用;
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录