/**
*
* \file Asura_Direct3D_Caps.h
*
* Created by Kevin Lea - 16/07/2002 14:10:31
*
* Copyright (C) 2002 Rebellion, All Rights Reserved.
*
* \brief
*
**/
#ifdef ASURA_USE_PRAGMA_ONCE
	#pragma once
#endif

#ifndef __ASURA_DIRECT3D_CAPS_H__
#define __ASURA_DIRECT3D_CAPS_H__

// Uncomment this if you want to debug the vertex shaders
//	#define ASURA_DIRECT3D_DEBUG_VS (1)

//	#define ASURA_DIRECT3D_DEBUG_PS (1)

// NOTE: To debug D3D Effects, you also need to comment in the line at the top
// ~~~~~ of "Asura_Direct3D_Effect.cpp", and change the path to that of the
//       effect you wish to debug.


class Asura_Direct3D_Caps
{
	public:
		inline static bool HasHardwarePixelShaders(void)
		{
			return HardwarePixelShaderSupported;
		}

		inline static bool HasHardwareVertexShaders(void)
		{
			return HardwareVertexShaderSupported;
		}

		inline static float GetHardwareVertexShaderVersion(void)
		{
			return s_fVertexShaderVersion;
		}

		inline static float GetHardwarePixelShaderVersion(void)
		{
			return s_fPixelShaderVersion;
		}

		inline static bool HasHardwareTnL(void)
		{
			return HardwareTnLSupported;
		}

		inline static bool HasAnisotropicFiltering(void)
		{
			return (s_uMaxAnisotropy!=0);
		}

		inline static int GetMaxNumberOfTexturesPerPass(void)
		{
			return MaxNumberOfTexturesPerPass;
		}
		
		inline static u_int GetMaxNumberOfTextureStages( void)
		{
			return( s_uMaxNumberOfTextureStages);
		}
		
		inline static u_int GetMaxLevelOfAnisotropicFiltering(void)
		{
			return s_uMaxAnisotropy;
		}
		
		inline static u_int GetNumberOfVertexShaderConstants( void )
		{
			return s_uNumberOfVertexShaderConstants;
		}
		
		inline static u_int GetMaxNumberOfRenderTargets( void)
		{
			return( s_uNumberOfRenderTargets);
		}

		inline static int GetDepthTextureBitDepth( void )
		{
			return DepthTextureBitDepth;
		}
		
		inline static bool HasDepthTextures( void )
		{
			return DepthTextureBitDepth != 0;
		}
		
		// Set on some cards like the Radeon 8500 - means we can't do dependent reads from nonpow2 textures
		// This forces us to create pow2 buffers for things like the heat haze effect
		inline static bool IsNonPow2Conditional( void )
		{
			return s_bIsNonPow2Conditional;
		}
		
		// DLH - 17 July 2006 12:24:58 - Some older cards will not read non-pow 2 textures (This includes render target textures)
		inline static bool IsTextureNonPow2Supported( void)
		{
			return( s_bTextureNonPOW2);
		}

		inline static bool IsIndependentMRTBitDepthsSupported( void )
		{
			return (s_bMRTSupportsIndependentBitDepths);
		}

		inline static bool IsMRTPostPSBlendingSupported( void )
		{
			return (s_bMRTSupportsPostPSBlending);
		}

		//! KJFL - 2004-02-24 10:04:03 -  Set caps by interrogating DirectX
		//! Called by Asura_Direct3D::Initialise(), so don't bother calling in-game.
		static void QueryCaps(void);
		
	private:

		static bool		HardwarePixelShaderSupported;
		static bool		HardwareVertexShaderSupported;
		static bool		HardwareTnLSupported;

		static int		DepthTextureBitDepth;

		static u_int	s_uNumberOfRenderTargets;
		static int		MaxNumberOfTexturesPerPass;
		static u_int	s_uMaxNumberOfTextureStages;
		static u_int	s_uMaxAnisotropy;
		static u_int	s_uNumberOfVertexShaderConstants;
		static u_int	s_uMaximumNumberOfSmoothSkinBonesAllowed;
		static float	s_fVertexShaderVersion;
		static float	s_fPixelShaderVersion;
		static bool		s_bIsNonPow2Conditional;
		static bool		s_bTextureNonPOW2;
		static bool		s_bMRTSupportsPostPSBlending;
		static bool		s_bMRTSupportsIndependentBitDepths;
};

#endif//__ASURA_DIRECT3D_CAPS_H__
