1 #include "precompiled.h" 2 // 3 // Copyright (c) 2012-2013 The ANGLE Project Authors. All rights reserved. 4 // Use of this source code is governed by a BSD-style license that can be 5 // found in the LICENSE file. 6 // 7 8 // ShaderExecutable9.cpp: Implements a D3D9-specific class to contain shader 9 // executable implementation details. 10 11 #include "libGLESv2/renderer/ShaderExecutable9.h" 12 13 #include "common/debug.h" 14 15 namespace rx 16 { 17 18 ShaderExecutable9::ShaderExecutable9(const void *function, size_t length, IDirect3DPixelShader9 *executable) 19 : ShaderExecutable(function, length) 20 { 21 mPixelExecutable = executable; 22 mVertexExecutable = NULL; 23 } 24 25 ShaderExecutable9::ShaderExecutable9(const void *function, size_t length, IDirect3DVertexShader9 *executable) 26 : ShaderExecutable(function, length) 27 { 28 mVertexExecutable = executable; 29 mPixelExecutable = NULL; 30 } 31 32 ShaderExecutable9::~ShaderExecutable9() 33 { 34 if (mVertexExecutable) 35 { 36 mVertexExecutable->Release(); 37 } 38 if (mPixelExecutable) 39 { 40 mPixelExecutable->Release(); 41 } 42 } 43 44 ShaderExecutable9 *ShaderExecutable9::makeShaderExecutable9(ShaderExecutable *executable) 45 { 46 ASSERT(HAS_DYNAMIC_TYPE(ShaderExecutable9*, executable)); 47 return static_cast<ShaderExecutable9*>(executable); 48 } 49 50 IDirect3DVertexShader9 *ShaderExecutable9::getVertexShader() const 51 { 52 return mVertexExecutable; 53 } 54 55 IDirect3DPixelShader9 *ShaderExecutable9::getPixelShader() const 56 { 57 return mPixelExecutable; 58 } 59 60 }