aboutsummaryrefslogtreecommitdiff
path: root/demo/d3d12/lineRenderPipelineD3D12.h
blob: ce3db588717b22aed70138b245e3643a35a9c65e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
* Copyright (c) 2008-2016, NVIDIA CORPORATION.  All rights reserved.
*
* NVIDIA CORPORATION and its licensors retain all intellectual property
* and proprietary rights in and to this software, related documentation
* and any modifications thereto.  Any use, reproduction, disclosure or
* distribution of this software and related documentation without an express
* license agreement from NVIDIA CORPORATION is strictly prohibited.
*/

#ifndef LINE_RENDER_PIPELINE_D3D12_H
#define LINE_RENDER_PIPELINE_D3D12_H

#include <DirectXMath.h>
#include "renderStateD3D12.h"
#include "meshRenderer.h"

#include <NvCoDx12RenderTarget.h>

#include <string>

namespace FlexSample {
using namespace nvidia;

enum LineDrawStage
{
	LINE_DRAW_NORMAL,
	LINE_DRAW_SHADOW,
};

struct LineDrawParams
{
	Hlsl::float4x4 m_modelWorldProjection;	/// Transforms point from world-space to clip space
	LineDrawStage m_drawStage;
};

struct LineRenderPipelineD3D12: public RenderPipeline
{
	//NV_CO_DECLARE_POLYMORPHIC_CLASS(LineRenderPipelineD3D12, RenderPipeline);
public:
	typedef RenderPipeline Parent;

	enum PipelineStateType
	{		
		PIPELINE_STATE_NORMAL,				
		PIPELINE_STATE_SHADOW,
		PIPELINE_STATE_COUNT_OF,
	};

	LineRenderPipelineD3D12();
	
		/// Initialize
	int initialize(const RenderStateD3D12& state, const std::wstring& shadersDir, NvCo::Dx12RenderTarget* shadowMap);
		/// Do the binding
	virtual int bind(const void* paramsIn, const void* platformState) override;
	virtual int draw(const RenderAllocation& alloc, size_t sizeOfAlloc, const void* platformState) override;

	protected:

	PipelineStateD3D12 m_states[PIPELINE_STATE_COUNT_OF];
};

} // namespace FlexSample

#endif