Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
GamebabyRockSun_QQ
GRSD3D12Sample
提交
fefc3fcb
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,发现更多精彩内容 >>
提交
fefc3fcb
编写于
10月 26, 2019
作者:
GamebabyRockSun_QQ
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修正了GRS_THROW_IF_FAILED宏定义,防止因宏展开带来的重复调用问题
上级
81930397
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
19 addition
and
15 deletion
+19
-15
1-D3D12Triangle/1-D3D12Trigger.cpp
1-D3D12Triangle/1-D3D12Trigger.cpp
+1
-1
10-PixelShaderTips/10-PixelShaderTips.cpp
10-PixelShaderTips/10-PixelShaderTips.cpp
+7
-5
2-D3D12WICTexture/2-D3D12WICTexture.cpp
2-D3D12WICTexture/2-D3D12WICTexture.cpp
+1
-1
3-PlacedTexture/3-D3D12PlacedTexture.cpp
3-PlacedTexture/3-D3D12PlacedTexture.cpp
+1
-1
4-D3D12TextureCube/4-D3D12TextureCube.cpp
4-D3D12TextureCube/4-D3D12TextureCube.cpp
+2
-1
5-SkyBox/5-SkyBox.cpp
5-SkyBox/5-SkyBox.cpp
+1
-1
6-MultiThread/6-MultiThread.cpp
6-MultiThread/6-MultiThread.cpp
+1
-1
6-MultiThread/6-MultiThreadWithMsgWait.cpp
6-MultiThread/6-MultiThreadWithMsgWait.cpp
+1
-1
7-D3D12MultiAdapter/7-D3D12MultiAdapter.cpp
7-D3D12MultiAdapter/7-D3D12MultiAdapter.cpp
+1
-1
8-UIRenderBase/8-UIRenderBase.cpp
8-UIRenderBase/8-UIRenderBase.cpp
+2
-1
9-D3D12RenderToTexture/9-RenderToTexture.cpp
9-D3D12RenderToTexture/9-RenderToTexture.cpp
+1
-1
未找到文件。
1-D3D12Triangle/1-D3D12Trigger.cpp
浏览文件 @
fefc3fcb
...
...
@@ -26,7 +26,7 @@ using namespace DirectX;
#define GRS_WND_CLASS_NAME _T("GRS Game Window Class")
#define GRS_WND_TITLE _T("GRS DirectX12 Trigger Sample")
#define GRS_THROW_IF_FAILED(hr)
if (FAILED(hr)){ throw CGRSCOMException(hr);
}
#define GRS_THROW_IF_FAILED(hr)
{HRESULT _hr = (hr);if (FAILED(_hr)){ throw CGRSCOMException(_hr); }
}
class
CGRSCOMException
{
...
...
10-PixelShaderTips/10-PixelShaderTips.cpp
浏览文件 @
fefc3fcb
...
...
@@ -30,7 +30,7 @@ using namespace DirectX;
#define GRS_WND_CLASS_NAME _T("GRS Game Window Class")
#define GRS_WND_TITLE _T("GRS DirectX12 MultiThread Sample")
#define GRS_THROW_IF_FAILED(hr)
if (FAILED(hr)){ throw CGRSCOMException(hr);
}
#define GRS_THROW_IF_FAILED(hr)
{HRESULT _hr = (hr);if (FAILED(_hr)){ throw CGRSCOMException(_hr); }
}
//新定义的宏用于上取整除法
#define GRS_UPPER_DIV(A,B) ((UINT)(((A)+((B)-1))/(B)))
...
...
@@ -161,7 +161,7 @@ struct ST_GRS_THREAD_PARAMS
XMFLOAT2
v2TexSize
;
TCHAR
pszDDSFile
[
MAX_PATH
];
CHAR
pszMeshFile
[
MAX_PATH
];
ID3D12Device
4
*
pID3DDevice
;
ID3D12Device
*
pID3DDevice
;
ID3D12CommandAllocator
*
pICmdAlloc
;
ID3D12GraphicsCommandList
*
pICmdList
;
ID3D12RootSignature
*
pIRS
;
...
...
@@ -234,7 +234,7 @@ int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR l
ComPtr
<
IDXGIFactory5
>
pIDXGIFactory5
;
ComPtr
<
IDXGIAdapter1
>
pIAdapter
;
ComPtr
<
ID3D12Device
4
>
pID3DDevice
;
ComPtr
<
ID3D12Device
>
pID3DDevice
;
ComPtr
<
ID3D12CommandQueue
>
pIMainCmdQueue
;
ComPtr
<
IDXGISwapChain1
>
pISwapChain1
;
ComPtr
<
IDXGISwapChain3
>
pISwapChain3
;
...
...
@@ -343,6 +343,8 @@ int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR l
{
//选择NUMA架构的独显来创建3D设备对象,暂时先不支持集显了,当然你可以修改这些行为
D3D12_FEATURE_DATA_ARCHITECTURE
stArchitecture
=
{};
DXGI_ADAPTER_DESC1
stAdapterDesc
=
{};
D3D_FEATURE_LEVEL
emFeatureLevel
=
D3D_FEATURE_LEVEL_11_0
;
HRESULT
hr
=
S_OK
;
for
(
UINT
nAdapterIndex
=
0
;
DXGI_ERROR_NOT_FOUND
!=
pIDXGIFactory5
->
EnumAdapters1
(
nAdapterIndex
,
&
pIAdapter
);
++
nAdapterIndex
)
...
...
@@ -356,7 +358,7 @@ int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR l
}
GRS_THROW_IF_FAILED
(
D3D12CreateDevice
(
pIAdapter
.
Get
()
,
D3D_FEATURE_LEVEL_12_1
,
emFeatureLevel
,
IID_PPV_ARGS
(
&
pID3DDevice
)));
GRS_THROW_IF_FAILED
(
pID3DDevice
->
CheckFeatureSupport
(
...
...
@@ -704,7 +706,7 @@ int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR l
{
USES_CONVERSION
;
// 球体个性参数
StringCchPrintf
(
g_stThreadParams
[
g_nThdSphere
].
pszDDSFile
,
MAX_PATH
,
_T
(
"%s
\\
Mesh
\\
7777
.dds"
),
g_pszAppPath
);
StringCchPrintf
(
g_stThreadParams
[
g_nThdSphere
].
pszDDSFile
,
MAX_PATH
,
_T
(
"%s
\\
Mesh
\\
Earth_512
.dds"
),
g_pszAppPath
);
StringCchPrintfA
(
g_stThreadParams
[
g_nThdSphere
].
pszMeshFile
,
MAX_PATH
,
"%s
\\
Mesh
\\
sphere.txt"
,
T2A
(
g_pszAppPath
));
g_stThreadParams
[
g_nThdSphere
].
v4ModelPos
=
XMFLOAT4
(
2.0
f
,
2.0
f
,
0.0
f
,
1.0
f
);
...
...
2-D3D12WICTexture/2-D3D12WICTexture.cpp
浏览文件 @
fefc3fcb
...
...
@@ -26,7 +26,7 @@ using namespace DirectX;
#define GRS_WND_CLASS_NAME _T("GRS Game Window Class")
#define GRS_WND_TITLE _T("GRS DirectX12 Texture Sample")
#define GRS_THROW_IF_FAILED(hr)
if (FAILED(hr)){ throw CGRSCOMException(hr);
}
#define GRS_THROW_IF_FAILED(hr)
{HRESULT _hr = (hr);if (FAILED(_hr)){ throw CGRSCOMException(_hr); }
}
class
CGRSCOMException
{
...
...
3-PlacedTexture/3-D3D12PlacedTexture.cpp
浏览文件 @
fefc3fcb
...
...
@@ -26,7 +26,7 @@ using namespace DirectX;
#define GRS_WND_CLASS_NAME _T("GRS Game Window Class")
#define GRS_WND_TITLE _T("GRS DirectX12 Texture Sample")
#define GRS_THROW_IF_FAILED(hr)
if (FAILED(hr)){ throw CGRSCOMException(hr);
}
#define GRS_THROW_IF_FAILED(hr)
{HRESULT _hr = (hr);if (FAILED(_hr)){ throw CGRSCOMException(_hr); }
}
//新定义的宏用于上取整除法
#define GRS_UPPER_DIV(A,B) ((UINT)(((A)+((B)-1))/(B)))
...
...
4-D3D12TextureCube/4-D3D12TextureCube.cpp
浏览文件 @
fefc3fcb
...
...
@@ -27,7 +27,8 @@ using namespace DirectX;
#define GRS_WND_CLASS_NAME _T("GRS Game Window Class")
#define GRS_WND_TITLE _T("GRS DirectX12 Texture Sample")
#define GRS_THROW_IF_FAILED(hr) if (FAILED(hr)){ throw CGRSCOMException(hr); }
#define GRS_THROW_IF_FAILED(hr) {HRESULT _hr = (hr);if (FAILED(_hr)){ throw CGRSCOMException(_hr); }}
//新定义的宏用于上取整除法
#define GRS_UPPER_DIV(A,B) ((UINT)(((A)+((B)-1))/(B)))
...
...
5-SkyBox/5-SkyBox.cpp
浏览文件 @
fefc3fcb
...
...
@@ -31,7 +31,7 @@ using namespace DirectX;
#define GRS_WND_CLASS_NAME _T("GRS Game Window Class")
#define GRS_WND_TITLE _T("GRS DirectX12 Texture Sample")
#define GRS_THROW_IF_FAILED(hr)
if (FAILED(hr)){ throw CGRSCOMException(hr);
}
#define GRS_THROW_IF_FAILED(hr)
{HRESULT _hr = (hr);if (FAILED(_hr)){ throw CGRSCOMException(_hr); }
}
//新定义的宏用于上取整除法
#define GRS_UPPER_DIV(A,B) ((UINT)(((A)+((B)-1))/(B)))
...
...
6-MultiThread/6-MultiThread.cpp
浏览文件 @
fefc3fcb
...
...
@@ -30,7 +30,7 @@ using namespace DirectX;
#define GRS_WND_CLASS_NAME _T("GRS Game Window Class")
#define GRS_WND_TITLE _T("GRS DirectX12 MultiThread Sample")
#define GRS_THROW_IF_FAILED(hr)
if (FAILED(hr)){ throw CGRSCOMException(hr);
}
#define GRS_THROW_IF_FAILED(hr)
{HRESULT _hr = (hr);if (FAILED(_hr)){ throw CGRSCOMException(_hr); }
}
//新定义的宏用于上取整除法
#define GRS_UPPER_DIV(A,B) ((UINT)(((A)+((B)-1))/(B)))
...
...
6-MultiThread/6-MultiThreadWithMsgWait.cpp
浏览文件 @
fefc3fcb
...
...
@@ -30,7 +30,7 @@ using namespace DirectX;
#define GRS_WND_CLASS_NAME _T("GRS Game Window Class")
#define GRS_WND_TITLE _T("GRS DirectX12 MultiThread Sample")
#define GRS_THROW_IF_FAILED(hr)
if (FAILED(hr)){ throw CGRSCOMException(hr);
}
#define GRS_THROW_IF_FAILED(hr)
{HRESULT _hr = (hr);if (FAILED(_hr)){ throw CGRSCOMException(_hr); }
}
//新定义的宏用于上取整除法
#define GRS_UPPER_DIV(A,B) ((UINT)(((A)+((B)-1))/(B)))
...
...
7-D3D12MultiAdapter/7-D3D12MultiAdapter.cpp
浏览文件 @
fefc3fcb
...
...
@@ -31,7 +31,7 @@ using namespace DirectX;
#define GRS_WND_TITLE _T("GRS D3D12 MultiAdapter Sample")
#define GRS_SAFE_RELEASE(p) if(p){(p)->Release();(p)=nullptr;}
#define GRS_THROW_IF_FAILED(hr)
if (FAILED(hr)){ throw CGRSCOMException(hr);
}
#define GRS_THROW_IF_FAILED(hr)
{HRESULT _hr = (hr);if (FAILED(_hr)){ throw CGRSCOMException(_hr); }
}
//新定义的宏用于上取整除法
#define GRS_UPPER_DIV(A,B) ((UINT)(((A)+((B)-1))/(B)))
...
...
8-UIRenderBase/8-UIRenderBase.cpp
浏览文件 @
fefc3fcb
...
...
@@ -27,7 +27,8 @@ using namespace DirectX;
#define GRS_WND_CLASS_NAME _T("GRS Game Window Class")
#define GRS_WND_TITLE _T("GRS DirectX12 UI Render Base Sample")
#define GRS_THROW_IF_FAILED(hr) if (FAILED(hr)){ throw CGRSCOMException(hr); }
#define GRS_THROW_IF_FAILED(hr) {HRESULT _hr = (hr);if (FAILED(_hr)){ throw CGRSCOMException(_hr); }}
//更简洁的向上边界对齐算法 内存管理中常用 请记住
#define GRS_UPPER(A,B) ((UINT)(((A)+((B)-1))&~(B - 1)))
...
...
9-D3D12RenderToTexture/9-RenderToTexture.cpp
浏览文件 @
fefc3fcb
...
...
@@ -28,7 +28,7 @@ using namespace DirectX;
#define GRS_WND_CLASS_NAME _T("GRS Game Window Class")
#define GRS_WND_TITLE _T("GRS DirectX12 Render To Texture Sample")
#define GRS_THROW_IF_FAILED(hr)
if (FAILED(hr)){ throw CGRSCOMException(hr);
}
#define GRS_THROW_IF_FAILED(hr)
{HRESULT _hr = (hr);if (FAILED(_hr)){ throw CGRSCOMException(_hr); }
}
//新定义的宏用于上取整除法
#define GRS_UPPER_DIV(A,B) ((UINT)(((A)+((B)-1))/(B)))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录