daniel@transgaming.com | 813bb78 | 2012-11-28 21:03:30 +0000 | [diff] [blame] | 1 | // |
| 2 | // Copyright (c) 2012 The ANGLE Project Authors. All rights reserved. |
| 3 | // Use of this source code is governed by a BSD-style license that can be |
| 4 | // found in the LICENSE file. |
| 5 | // |
| 6 | |
| 7 | // ShaderExecutable11.cpp: Implements a D3D11-specific class to contain shader |
| 8 | // executable implementation details. |
| 9 | |
| 10 | #include "libGLESv2/renderer/ShaderExecutable11.h" |
| 11 | |
| 12 | #include "common/debug.h" |
| 13 | |
| 14 | namespace rx |
| 15 | { |
| 16 | |
daniel@transgaming.com | 7b18d0c | 2012-11-28 21:04:10 +0000 | [diff] [blame^] | 17 | ShaderExecutable11::ShaderExecutable11(const void *function, size_t length, ID3D11PixelShader *executable) |
| 18 | : ShaderExecutable(function, length) |
daniel@transgaming.com | 813bb78 | 2012-11-28 21:03:30 +0000 | [diff] [blame] | 19 | { |
| 20 | mPixelExecutable = executable; |
| 21 | mVertexExecutable = NULL; |
| 22 | } |
| 23 | |
daniel@transgaming.com | 7b18d0c | 2012-11-28 21:04:10 +0000 | [diff] [blame^] | 24 | ShaderExecutable11::ShaderExecutable11(const void *function, size_t length, ID3D11VertexShader *executable) |
| 25 | : ShaderExecutable(function, length) |
daniel@transgaming.com | 813bb78 | 2012-11-28 21:03:30 +0000 | [diff] [blame] | 26 | { |
| 27 | mVertexExecutable = executable; |
| 28 | mPixelExecutable = NULL; |
| 29 | } |
| 30 | |
| 31 | ShaderExecutable11::~ShaderExecutable11() |
| 32 | { |
| 33 | if (mVertexExecutable) |
| 34 | { |
| 35 | mVertexExecutable->Release(); |
| 36 | } |
| 37 | if (mPixelExecutable) |
| 38 | { |
| 39 | mPixelExecutable->Release(); |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | ShaderExecutable11 *ShaderExecutable11::makeShaderExecutable11(ShaderExecutable *executable) |
| 44 | { |
| 45 | ASSERT(dynamic_cast<ShaderExecutable11*>(executable) != NULL); |
| 46 | return static_cast<ShaderExecutable11*>(executable); |
| 47 | } |
| 48 | |
daniel@transgaming.com | 813bb78 | 2012-11-28 21:03:30 +0000 | [diff] [blame] | 49 | ID3D11VertexShader *ShaderExecutable11::getVertexShader() |
| 50 | { |
| 51 | return mVertexExecutable; |
| 52 | } |
| 53 | |
| 54 | ID3D11PixelShader *ShaderExecutable11::getPixelShader() |
| 55 | { |
| 56 | return mPixelExecutable; |
| 57 | } |
| 58 | |
| 59 | gl::D3DConstantTable *ShaderExecutable11::getConstantTable() |
| 60 | { |
| 61 | return NULL; |
| 62 | } |
| 63 | |
| 64 | } |