summaryrefslogtreecommitdiff
path: root/materialsystem/shaderapidx9/textureheap.h
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /materialsystem/shaderapidx9/textureheap.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'materialsystem/shaderapidx9/textureheap.h')
-rw-r--r--materialsystem/shaderapidx9/textureheap.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/materialsystem/shaderapidx9/textureheap.h b/materialsystem/shaderapidx9/textureheap.h
new file mode 100644
index 0000000..ceeb3a9
--- /dev/null
+++ b/materialsystem/shaderapidx9/textureheap.h
@@ -0,0 +1,42 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+//=============================================================================
+
+#ifndef TEXTUREHEAP_H
+#define TEXTUREHEAP_H
+
+#if defined( _X360 )
+
+#include "locald3dtypes.h"
+
+class CTextureHeap
+{
+public:
+ IDirect3DTexture *AllocTexture( int width, int height, int levels, DWORD usage, D3DFORMAT format, bool bFallback, bool bNoD3DMemory );
+ IDirect3DCubeTexture *AllocCubeTexture( int width, int levels, DWORD usage, D3DFORMAT format, bool bFallback, bool bNoD3DMemory );
+ IDirect3DVolumeTexture *AllocVolumeTexture( int width, int height, int depth, int levels, DWORD usage, D3DFORMAT format );
+ IDirect3DSurface *AllocRenderTargetSurface( int width, int height, D3DFORMAT format, bool bMultiSample = false , int base = -1);
+
+ // Perform the real d3d allocation, returns true if succesful, false otherwise.
+ // Only valid for a texture created with no d3d bits, otherwise no-op.
+ bool AllocD3DMemory( IDirect3DBaseTexture *pTexture );
+
+ // Release header and d3d bits.
+ void FreeTexture( IDirect3DBaseTexture *pTexture );
+
+ // Returns the amount of memory needed or allocated for the texture.
+ int GetSize( IDirect3DBaseTexture *pTexture );
+
+ // Crunch the heap.
+ void Compact();
+
+ // Get current backbuffer multisample type
+ D3DMULTISAMPLE_TYPE GetBackBufferMultiSampleType();
+};
+
+extern CTextureHeap g_TextureHeap;
+
+#endif
+#endif // TEXTUREHEAP_H