Commit 50b40da5 authored by chili's avatar chili
Browse files

pixel shader set and loaded

parent 6086a3d2
...@@ -142,6 +142,15 @@ void Graphics::DrawTestTriangle() ...@@ -142,6 +142,15 @@ void Graphics::DrawTestTriangle()
// bind vertex shader // bind vertex shader
pContext->VSSetShader( pVertexShader.Get(),nullptr,0u ); 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 ) ); GFX_THROW_INFO_ONLY( pContext->Draw( (UINT)std::size( vertices ),0u ) );
......
float4 main() : SV_Target
{
return float4(1.0f,1.0f,1.0f,1.0f);
}
\ No newline at end of file
...@@ -183,6 +183,16 @@ ...@@ -183,6 +183,16 @@
<None Include="DXTrace.inl" /> <None Include="DXTrace.inl" />
</ItemGroup> </ItemGroup>
<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"> <FxCompile Include="VertexShader.hlsl">
<ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)%(Filename).cso</ObjectFileOutput> <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)%(Filename).cso</ObjectFileOutput>
<ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)%(Filename).cso</ObjectFileOutput> <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)%(Filename).cso</ObjectFileOutput>
......
...@@ -118,5 +118,8 @@ ...@@ -118,5 +118,8 @@
<FxCompile Include="VertexShader.hlsl"> <FxCompile Include="VertexShader.hlsl">
<Filter>Shader</Filter> <Filter>Shader</Filter>
</FxCompile> </FxCompile>
<FxCompile Include="PixelShader.hlsl">
<Filter>Shader</Filter>
</FxCompile>
</ItemGroup> </ItemGroup>
</Project> </Project>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment