00001 /* 00002 * Direct3D11 hardware buffer file 00003 * 00004 * This file is part of the "SoftPixel Engine" (Copyright (c) 2008 by Lukas Hermanns) 00005 * See "SoftPixelEngine.hpp" for license information. 00006 */ 00007 00008 #ifndef __SP_D3D11_HARDWARE_BUFFER_H__ 00009 #define __SP_D3D11_HARDWARE_BUFFER_H__ 00010 00011 00012 #include "Base/spStandard.hpp" 00013 00014 #if defined(SP_COMPILE_WITH_DIRECT3D11) 00015 00016 00017 #include "Base/spDimensionUniversalBuffer.hpp" 00018 #include "Base/spMaterialConfigTypes.hpp" 00019 00020 #include <d3d11.h> 00021 00022 00023 namespace sp 00024 { 00025 namespace video 00026 { 00027 00028 00029 class IndexFormat; 00030 00032 class D3D11HardwareBuffer 00033 { 00034 00035 private: 00036 00037 friend class Direct3D11RenderSystem; 00038 #ifdef SP_COMPILE_WITH_OPENCL 00039 friend class OpenCLBuffer; 00040 #endif 00041 00042 /* Functions */ 00043 00044 D3D11HardwareBuffer(); 00045 ~D3D11HardwareBuffer(); 00046 00047 void update( 00048 ID3D11Device* D3DDevice, ID3D11DeviceContext* D3DDeviceContext, 00049 const dim::UniversalBuffer &BufferData, const ERendererDataTypes FormatType, 00050 const EHWBufferUsage Usage, D3D11_BIND_FLAG BindFlag, const io::stringc &Name 00051 ); 00052 00053 void update( 00054 ID3D11DeviceContext* D3DDeviceContext, const dim::UniversalBuffer &BufferData, u32 Index 00055 ); 00056 00057 /* Members */ 00058 00059 DXGI_FORMAT FormatFlags_; 00060 00061 u32 ElementCount_; 00062 u32 BufferSize_; 00063 00064 D3D11_BUFFER_DESC BufferDesc_; 00065 ID3D11Buffer* HWBuffer_; 00066 00067 }; 00068 00069 00070 } // /namespace video 00071 00072 } // /namespace sp 00073 00074 00075 #endif 00076 00077 #endif 00078 00079 00080 00081 // ================================================================================