Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Clark Lin
hw3d
Commits
50b40da5
Commit
50b40da5
authored
Jan 29, 2019
by
chili
Browse files
pixel shader set and loaded
parent
6086a3d2
Changes
4
Show whitespace changes
Inline
Side-by-side
hw3d/Graphics.cpp
View file @
50b40da5
...
...
@@ -144,6 +144,15 @@ void Graphics::DrawTestTriangle()
pContext
->
VSSetShader
(
pVertexShader
.
Get
(),
nullptr
,
0u
);
// create pixel shader
wrl
::
ComPtr
<
ID3D11PixelShader
>
pPixelShader
;
GFX_THROW_INFO
(
D3DReadFileToBlob
(
L"PixelShader.cso"
,
&
pBlob
)
);
GFX_THROW_INFO
(
pDevice
->
CreatePixelShader
(
pBlob
->
GetBufferPointer
(),
pBlob
->
GetBufferSize
(),
nullptr
,
&
pPixelShader
)
);
// bind pixel shader
pContext
->
PSSetShader
(
pPixelShader
.
Get
(),
nullptr
,
0u
);
GFX_THROW_INFO_ONLY
(
pContext
->
Draw
(
(
UINT
)
std
::
size
(
vertices
),
0u
)
);
}
...
...
hw3d/PixelShader.hlsl
0 → 100644
View file @
50b40da5
float4
main
()
:
SV_Target
{
return
float4
(
1
.
0
f
,
1
.
0
f
,
1
.
0
f
,
1
.
0
f
);
}
\ No newline at end of file
hw3d/hw3d.vcxproj
View file @
50b40da5
...
...
@@ -183,6 +183,16 @@
<None
Include=
"DXTrace.inl"
/>
</ItemGroup>
<ItemGroup>
<FxCompile
Include=
"PixelShader.hlsl"
>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
Pixel
</ShaderType>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
Pixel
</ShaderType>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
Pixel
</ShaderType>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
Pixel
</ShaderType>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
</FxCompile>
<FxCompile
Include=
"VertexShader.hlsl"
>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
...
...
hw3d/hw3d.vcxproj.filters
View file @
50b40da5
...
...
@@ -118,5 +118,8 @@
<FxCompile
Include=
"VertexShader.hlsl"
>
<Filter>
Shader
</Filter>
</FxCompile>
<FxCompile
Include=
"PixelShader.hlsl"
>
<Filter>
Shader
</Filter>
</FxCompile>
</ItemGroup>
</Project>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment