blob: fe8d9283aa857dc753f43968f7f9589333a87b92 (
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//
//===========================================================================//
#ifndef SHADERRENDERBASE_H
#define SHADERRENDERBASE_H
#ifdef _WIN32
#pragma once
#endif
#include "togl/rendermechanism.h"
#include "shaderapi/ishaderapi.h"
#include "shaderapi_global.h"
#include "locald3dtypes.h"
// Colors for PIX graphs
#define PIX_VALVE_ORANGE 0xFFF5940F
//-----------------------------------------------------------------------------
// The Base implementation of the shader rendering interface
//-----------------------------------------------------------------------------
class CShaderAPIBase : public IShaderAPI
{
public:
// constructor, destructor
CShaderAPIBase();
virtual ~CShaderAPIBase();
// Called when the device is initializing or shutting down
virtual bool OnDeviceInit() = 0;
virtual void OnDeviceShutdown() = 0;
// Pix events
virtual void BeginPIXEvent( unsigned long color, const char *szName ) = 0;
virtual void EndPIXEvent() = 0;
virtual void AdvancePIXFrame() = 0;
// Release, reacquire objects
virtual void ReleaseShaderObjects() = 0;
virtual void RestoreShaderObjects() = 0;
// Resets the render state to its well defined initial value
virtual void ResetRenderState( bool bFullReset = true ) = 0;
// Returns a d3d texture associated with a texture handle
virtual IDirect3DBaseTexture* GetD3DTexture( ShaderAPITextureHandle_t hTexture ) = 0;
// Queues a non-full reset of render state next BeginFrame.
virtual void QueueResetRenderState() = 0;
// Methods of IShaderDynamicAPI
public:
virtual void GetCurrentColorCorrection( ShaderColorCorrectionInfo_t* pInfo );
protected:
};
//-----------------------------------------------------------------------------
// Pix measurement class
//-----------------------------------------------------------------------------
class CPixEvent
{
public:
CPixEvent( unsigned long color, const char *szName )
{
if ( g_pShaderAPI )
g_pShaderAPI->BeginPIXEvent( color, szName );
}
~CPixEvent()
{
if ( g_pShaderAPI )
g_pShaderAPI->EndPIXEvent();
}
};
#endif // SHADERRENDERBASE_H
|