summaryrefslogtreecommitdiff
path: root/Runtime/GfxDevice/d3d/CombinerD3D.h
blob: 6f7fb05944ee27e3e55fb3e3e5361491e4165ed6 (plain)
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
#pragma once

#include "D3D9Includes.h"
#include "External/shaderlab/Library/shadertypes.h"

namespace ShaderLab {
	struct TextureBinding;
	class TexEnv;
}


const int kMaxD3DTextureStages = 8;
const int kMaxD3DTextureStagesForPS = 4;

struct D3DTextureStage
{
	D3DTEXTUREOP	colorOp;
	int				colorArgs[3];
	D3DTEXTUREOP	alphaOp;
	int				alphaArgs[3];
};

struct TextureCombinersD3D
{
	static TextureCombinersD3D* Create( int count, const ShaderLab::TextureBinding* texEnvs, const ShaderLab::PropertySheet* props, bool hasVertexColorOrLighting, bool usesAddSpecular );
	static void CleanupCombinerCache();

	D3DTextureStage	stages[kMaxD3DTextureStages+1];
	int envCount, stageCount; // these might be different!
	IDirect3DPixelShader9*	pixelShader;
	const ShaderLab::TextureBinding* texEnvs;

	int	 textureFactorIndex;
	bool textureFactorUsed;

	int		uniqueID;
};