Commit 359ef269 by Geoff Lang

Rename ShaderExecutable to ShaderExecutableD3D and move it to the D3D folder.

BUG=angle:681 Change-Id: I097d6591be4e873c9a6f210cc91e3f4eb60f036b Reviewed-on: https://chromium-review.googlesource.com/238473Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarBrandon Jones <bajones@chromium.org> Tested-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 2dc4639f
......@@ -29,7 +29,6 @@ namespace rx
class Renderer;
class Renderer;
struct TranslatedAttribute;
class UniformStorage;
class ProgramImpl;
}
......
......@@ -13,10 +13,10 @@
#include "libANGLE/FramebufferAttachment.h"
#include "libANGLE/Program.h"
#include "libANGLE/features.h"
#include "libANGLE/renderer/ShaderExecutable.h"
#include "libANGLE/renderer/d3d/DynamicHLSL.h"
#include "libANGLE/renderer/d3d/RendererD3D.h"
#include "libANGLE/renderer/d3d/ShaderD3D.h"
#include "libANGLE/renderer/d3d/ShaderExecutableD3D.h"
#include "libANGLE/renderer/d3d/VertexDataManager.h"
namespace rx
......@@ -124,7 +124,7 @@ struct AttributeSorter
ProgramD3D::VertexExecutable::VertexExecutable(const gl::VertexFormat inputLayout[],
const GLenum signature[],
ShaderExecutable *shaderExecutable)
ShaderExecutableD3D *shaderExecutable)
: mShaderExecutable(shaderExecutable)
{
for (size_t attributeIndex = 0; attributeIndex < gl::MAX_VERTEX_ATTRIBS; attributeIndex++)
......@@ -152,7 +152,7 @@ bool ProgramD3D::VertexExecutable::matchesSignature(const GLenum signature[]) co
return true;
}
ProgramD3D::PixelExecutable::PixelExecutable(const std::vector<GLenum> &outputSignature, ShaderExecutable *shaderExecutable)
ProgramD3D::PixelExecutable::PixelExecutable(const std::vector<GLenum> &outputSignature, ShaderExecutableD3D *shaderExecutable)
: mOutputSignature(outputSignature),
mShaderExecutable(shaderExecutable)
{
......@@ -581,7 +581,7 @@ LinkResult ProgramD3D::load(gl::InfoLog &infoLog, gl::BinaryInputStream *stream)
unsigned int vertexShaderSize = stream->readInt<unsigned int>();
const unsigned char *vertexShaderFunction = binary + stream->offset();
ShaderExecutable *shaderExecutable = NULL;
ShaderExecutableD3D *shaderExecutable = NULL;
gl::Error error = mRenderer->loadExecutable(vertexShaderFunction, vertexShaderSize,
SHADER_VERTEX,
mTransformFeedbackLinkedVaryings,
......@@ -620,7 +620,7 @@ LinkResult ProgramD3D::load(gl::InfoLog &infoLog, gl::BinaryInputStream *stream)
const size_t pixelShaderSize = stream->readInt<unsigned int>();
const unsigned char *pixelShaderFunction = binary + stream->offset();
ShaderExecutable *shaderExecutable = NULL;
ShaderExecutableD3D *shaderExecutable = NULL;
gl::Error error = mRenderer->loadExecutable(pixelShaderFunction, pixelShaderSize, SHADER_PIXEL,
mTransformFeedbackLinkedVaryings,
(mTransformFeedbackBufferMode == GL_SEPARATE_ATTRIBS),
......@@ -841,7 +841,7 @@ gl::Error ProgramD3D::save(gl::BinaryOutputStream *stream)
return gl::Error(GL_NO_ERROR);
}
gl::Error ProgramD3D::getPixelExecutableForFramebuffer(const gl::Framebuffer *fbo, ShaderExecutable **outExecutable)
gl::Error ProgramD3D::getPixelExecutableForFramebuffer(const gl::Framebuffer *fbo, ShaderExecutableD3D **outExecutable)
{
std::vector<GLenum> outputs;
......@@ -865,7 +865,7 @@ gl::Error ProgramD3D::getPixelExecutableForFramebuffer(const gl::Framebuffer *fb
}
gl::Error ProgramD3D::getPixelExecutableForOutputLayout(const std::vector<GLenum> &outputSignature,
ShaderExecutable **outExectuable,
ShaderExecutableD3D **outExectuable,
gl::InfoLog *infoLog)
{
for (size_t executableIndex = 0; executableIndex < mPixelExecutables.size(); executableIndex++)
......@@ -881,7 +881,7 @@ gl::Error ProgramD3D::getPixelExecutableForOutputLayout(const std::vector<GLenum
outputSignature);
// Generate new pixel executable
ShaderExecutable *pixelExecutable = NULL;
ShaderExecutableD3D *pixelExecutable = NULL;
gl::InfoLog tempInfoLog;
gl::InfoLog *currentInfoLog = infoLog ? infoLog : &tempInfoLog;
......@@ -911,7 +911,7 @@ gl::Error ProgramD3D::getPixelExecutableForOutputLayout(const std::vector<GLenum
}
gl::Error ProgramD3D::getVertexExecutableForInputLayout(const gl::VertexFormat inputLayout[gl::MAX_VERTEX_ATTRIBS],
ShaderExecutable **outExectuable,
ShaderExecutableD3D **outExectuable,
gl::InfoLog *infoLog)
{
GLenum signature[gl::MAX_VERTEX_ATTRIBS];
......@@ -930,7 +930,7 @@ gl::Error ProgramD3D::getVertexExecutableForInputLayout(const gl::VertexFormat i
std::string finalVertexHLSL = mDynamicHLSL->generateVertexShaderForInputLayout(mVertexHLSL, inputLayout, mShaderAttributes);
// Generate new vertex executable
ShaderExecutable *vertexExecutable = NULL;
ShaderExecutableD3D *vertexExecutable = NULL;
gl::InfoLog tempInfoLog;
gl::InfoLog *currentInfoLog = infoLog ? infoLog : &tempInfoLog;
......@@ -967,7 +967,7 @@ LinkResult ProgramD3D::compileProgramExecutables(gl::InfoLog &infoLog, gl::Shade
gl::VertexFormat defaultInputLayout[gl::MAX_VERTEX_ATTRIBS];
GetDefaultInputLayoutFromShader(vertexShader->getActiveAttributes(), defaultInputLayout);
ShaderExecutable *defaultVertexExecutable = NULL;
ShaderExecutableD3D *defaultVertexExecutable = NULL;
gl::Error error = getVertexExecutableForInputLayout(defaultInputLayout, &defaultVertexExecutable, &infoLog);
if (error.isError())
{
......@@ -975,7 +975,7 @@ LinkResult ProgramD3D::compileProgramExecutables(gl::InfoLog &infoLog, gl::Shade
}
std::vector<GLenum> defaultPixelOutput = GetDefaultOutputLayoutFromShader(getPixelShaderKey());
ShaderExecutable *defaultPixelExecutable = NULL;
ShaderExecutableD3D *defaultPixelExecutable = NULL;
error = getPixelExecutableForOutputLayout(defaultPixelOutput, &defaultPixelExecutable, &infoLog);
if (error.isError())
{
......
......@@ -27,8 +27,8 @@ struct VertexFormat;
namespace rx
{
class RendererD3D;
class UniformStorage;
class ShaderExecutable;
class UniformStorageD3D;
class ShaderExecutableD3D;
#if !defined(ANGLE_COMPILE_OPTIMIZATION_LEVEL)
// WARNING: D3DCOMPILE_OPTIMIZATION_LEVEL3 may lead to a DX9 shader compiler hang.
......@@ -63,10 +63,10 @@ class ProgramD3D : public ProgramImpl
LinkResult load(gl::InfoLog &infoLog, gl::BinaryInputStream *stream);
gl::Error save(gl::BinaryOutputStream *stream);
gl::Error getPixelExecutableForFramebuffer(const gl::Framebuffer *fbo, ShaderExecutable **outExectuable);
gl::Error getPixelExecutableForOutputLayout(const std::vector<GLenum> &outputLayout, ShaderExecutable **outExectuable, gl::InfoLog *infoLog);
gl::Error getVertexExecutableForInputLayout(const gl::VertexFormat inputLayout[gl::MAX_VERTEX_ATTRIBS], ShaderExecutable **outExectuable, gl::InfoLog *infoLog);
ShaderExecutable *getGeometryExecutable() const { return mGeometryExecutable; }
gl::Error getPixelExecutableForFramebuffer(const gl::Framebuffer *fbo, ShaderExecutableD3D **outExectuable);
gl::Error getPixelExecutableForOutputLayout(const std::vector<GLenum> &outputLayout, ShaderExecutableD3D **outExectuable, gl::InfoLog *infoLog);
gl::Error getVertexExecutableForInputLayout(const gl::VertexFormat inputLayout[gl::MAX_VERTEX_ATTRIBS], ShaderExecutableD3D **outExectuable, gl::InfoLog *infoLog);
ShaderExecutableD3D *getGeometryExecutable() const { return mGeometryExecutable; }
LinkResult compileProgramExecutables(gl::InfoLog &infoLog, gl::Shader *fragmentShader, gl::Shader *vertexShader,
int registers);
......@@ -113,8 +113,8 @@ class ProgramD3D : public ProgramImpl
void getUniformiv(GLint location, GLint *params);
void getUniformuiv(GLint location, GLuint *params);
const UniformStorage &getVertexUniformStorage() const { return *mVertexUniformStorage; }
const UniformStorage &getFragmentUniformStorage() const { return *mFragmentUniformStorage; }
const UniformStorageD3D &getVertexUniformStorage() const { return *mVertexUniformStorage; }
const UniformStorageD3D &getFragmentUniformStorage() const { return *mFragmentUniformStorage; }
bool linkUniforms(gl::InfoLog &infoLog, const gl::Shader &vertexShader, const gl::Shader &fragmentShader,
const gl::Caps &caps);
......@@ -136,35 +136,35 @@ class ProgramD3D : public ProgramImpl
public:
VertexExecutable(const gl::VertexFormat inputLayout[gl::MAX_VERTEX_ATTRIBS],
const GLenum signature[gl::MAX_VERTEX_ATTRIBS],
ShaderExecutable *shaderExecutable);
ShaderExecutableD3D *shaderExecutable);
~VertexExecutable();
bool matchesSignature(const GLenum convertedLayout[gl::MAX_VERTEX_ATTRIBS]) const;
const gl::VertexFormat *inputs() const { return mInputs; }
const GLenum *signature() const { return mSignature; }
ShaderExecutable *shaderExecutable() const { return mShaderExecutable; }
ShaderExecutableD3D *shaderExecutable() const { return mShaderExecutable; }
private:
gl::VertexFormat mInputs[gl::MAX_VERTEX_ATTRIBS];
GLenum mSignature[gl::MAX_VERTEX_ATTRIBS];
ShaderExecutable *mShaderExecutable;
ShaderExecutableD3D *mShaderExecutable;
};
class PixelExecutable
{
public:
PixelExecutable(const std::vector<GLenum> &outputSignature, ShaderExecutable *shaderExecutable);
PixelExecutable(const std::vector<GLenum> &outputSignature, ShaderExecutableD3D *shaderExecutable);
~PixelExecutable();
bool matchesSignature(const std::vector<GLenum> &signature) const { return mOutputSignature == signature; }
const std::vector<GLenum> &outputSignature() const { return mOutputSignature; }
ShaderExecutable *shaderExecutable() const { return mShaderExecutable; }
ShaderExecutableD3D *shaderExecutable() const { return mShaderExecutable; }
private:
std::vector<GLenum> mOutputSignature;
ShaderExecutable *mShaderExecutable;
ShaderExecutableD3D *mShaderExecutable;
};
struct Sampler
......@@ -203,7 +203,7 @@ class ProgramD3D : public ProgramImpl
std::vector<VertexExecutable *> mVertexExecutables;
std::vector<PixelExecutable *> mPixelExecutables;
ShaderExecutable *mGeometryExecutable;
ShaderExecutableD3D *mGeometryExecutable;
std::string mVertexHLSL;
D3DWorkaroundType mVertexWorkarounds;
......@@ -215,8 +215,8 @@ class ProgramD3D : public ProgramImpl
bool mUsesPointSize;
UniformStorage *mVertexUniformStorage;
UniformStorage *mFragmentUniformStorage;
UniformStorageD3D *mVertexUniformStorage;
UniformStorageD3D *mFragmentUniformStorage;
GLenum mTransformFeedbackBufferMode;
......
......@@ -29,10 +29,10 @@ namespace rx
class ImageD3D;
class IndexBuffer;
class RenderTargetD3D;
class ShaderExecutable;
class ShaderExecutableD3D;
class SwapChainD3D;
class TextureStorage;
class UniformStorage;
class UniformStorageD3D;
class VertexBuffer;
enum ShaderType
......@@ -122,12 +122,12 @@ class RendererD3D : public Renderer
// Shader operations
virtual gl::Error loadExecutable(const void *function, size_t length, ShaderType type,
const std::vector<gl::LinkedVarying> &transformFeedbackVaryings,
bool separatedOutputBuffers, ShaderExecutable **outExecutable) = 0;
bool separatedOutputBuffers, ShaderExecutableD3D **outExecutable) = 0;
virtual gl::Error compileToExecutable(gl::InfoLog &infoLog, const std::string &shaderHLSL, ShaderType type,
const std::vector<gl::LinkedVarying> &transformFeedbackVaryings,
bool separatedOutputBuffers, D3DWorkaroundType workaround,
ShaderExecutable **outExectuable) = 0;
virtual UniformStorage *createUniformStorage(size_t storageSize) = 0;
ShaderExecutableD3D **outExectuable) = 0;
virtual UniformStorageD3D *createUniformStorage(size_t storageSize) = 0;
// Image operations
virtual ImageD3D *createImage() = 0;
......
//
// Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
// Copyright (c) 2012-2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// ShaderExecutable.h: Defines a renderer-agnostic class to contain shader
// executable implementation details.
// ShaderExecutable.cpp: Implements a class to contain D3D shader executable
// implementation details.
#ifndef LIBANGLE_RENDERER_SHADEREXECUTABLE_H_
#define LIBANGLE_RENDERER_SHADEREXECUTABLE_H_
#include "libANGLE/renderer/d3d/ShaderExecutableD3D.h"
#include "common/angleutils.h"
#include "common/debug.h"
#include <vector>
#include <cstdint>
namespace rx
{
class ShaderExecutable
ShaderExecutableD3D::ShaderExecutableD3D(const void *function, size_t length)
: mFunctionBuffer(length)
{
public:
ShaderExecutable(const void *function, size_t length)
: mFunctionBuffer(length)
{
memcpy(mFunctionBuffer.data(), function, length);
}
virtual ~ShaderExecutable() {}
const uint8_t *getFunction() const
{
return mFunctionBuffer.data();
}
size_t getLength() const
{
return mFunctionBuffer.size();
}
memcpy(mFunctionBuffer.data(), function, length);
}
const std::string &getDebugInfo() const
{
return mDebugInfo;
}
ShaderExecutableD3D::~ShaderExecutableD3D()
{
}
void appendDebugInfo(const std::string &info)
{
mDebugInfo += info;
}
const uint8_t *ShaderExecutableD3D::getFunction() const
{
return mFunctionBuffer.data();
}
private:
DISALLOW_COPY_AND_ASSIGN(ShaderExecutable);
size_t ShaderExecutableD3D::getLength() const
{
return mFunctionBuffer.size();
}
std::vector<uint8_t> mFunctionBuffer;
std::string mDebugInfo;
};
const std::string &ShaderExecutableD3D::getDebugInfo() const
{
return mDebugInfo;
}
class UniformStorage
void ShaderExecutableD3D::appendDebugInfo(const std::string &info)
{
public:
UniformStorage(size_t initialSize)
: mSize(initialSize)
{
}
mDebugInfo += info;
}
virtual ~UniformStorage() {}
size_t size() const { return mSize; }
UniformStorageD3D::UniformStorageD3D(size_t initialSize) : mSize(initialSize)
{
}
private:
size_t mSize;
};
UniformStorageD3D::~UniformStorageD3D()
{
}
size_t UniformStorageD3D::size() const
{
return mSize;
}
#endif // LIBANGLE_RENDERER_SHADEREXECUTABLE_H_
}
//
// Copyright (c) 2012-2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// ShaderExecutable.h: Defines a class to contain D3D shader executable
// implementation details.
#ifndef LIBANGLE_RENDERER_D3D_SHADEREXECUTABLED3D_H_
#define LIBANGLE_RENDERER_D3D_SHADEREXECUTABLED3D_H_
#include "common/debug.h"
#include <vector>
#include <cstdint>
namespace rx
{
class ShaderExecutableD3D
{
public:
ShaderExecutableD3D(const void *function, size_t length);
virtual ~ShaderExecutableD3D();
const uint8_t *getFunction() const;
size_t getLength() const;
const std::string &getDebugInfo() const;
void appendDebugInfo(const std::string &info);
private:
DISALLOW_COPY_AND_ASSIGN(ShaderExecutableD3D);
std::vector<uint8_t> mFunctionBuffer;
std::string mDebugInfo;
};
class UniformStorageD3D
{
public:
UniformStorageD3D(size_t initialSize);
virtual ~UniformStorageD3D();
size_t size() const;
private:
size_t mSize;
};
}
#endif // LIBANGLE_RENDERER_D3D_SHADEREXECUTABLED3D_H_
......@@ -169,14 +169,14 @@ gl::Error InputLayoutCache::applyVertexBuffers(TranslatedAttribute attributes[gl
GetInputLayout(attributes, shaderInputLayout);
ProgramD3D *programD3D = ProgramD3D::makeProgramD3D(program->getImplementation());
ShaderExecutable *shader = NULL;
ShaderExecutableD3D *shader = NULL;
gl::Error error = programD3D->getVertexExecutableForInputLayout(shaderInputLayout, &shader, nullptr);
if (error.isError())
{
return error;
}
ShaderExecutable *shader11 = ShaderExecutable11::makeShaderExecutable11(shader);
ShaderExecutableD3D *shader11 = ShaderExecutable11::makeShaderExecutable11(shader);
D3D11_INPUT_ELEMENT_DESC descs[gl::MAX_VERTEX_ATTRIBS];
for (unsigned int j = 0; j < ilKey.elementCount; ++j)
......
......@@ -1547,21 +1547,21 @@ gl::Error Renderer11::applyShaders(gl::Program *program, const gl::VertexFormat
{
ProgramD3D *programD3D = ProgramD3D::makeProgramD3D(program->getImplementation());
ShaderExecutable *vertexExe = NULL;
ShaderExecutableD3D *vertexExe = NULL;
gl::Error error = programD3D->getVertexExecutableForInputLayout(inputLayout, &vertexExe, nullptr);
if (error.isError())
{
return error;
}
ShaderExecutable *pixelExe = NULL;
ShaderExecutableD3D *pixelExe = NULL;
error = programD3D->getPixelExecutableForFramebuffer(framebuffer, &pixelExe);
if (error.isError())
{
return error;
}
ShaderExecutable *geometryExe = programD3D->getGeometryExecutable();
ShaderExecutableD3D *geometryExe = programD3D->getGeometryExecutable();
ID3D11VertexShader *vertexShader = (vertexExe ? ShaderExecutable11::makeShaderExecutable11(vertexExe)->getVertexShader() : NULL);
......@@ -2518,7 +2518,7 @@ ProgramImpl *Renderer11::createProgram()
gl::Error Renderer11::loadExecutable(const void *function, size_t length, ShaderType type,
const std::vector<gl::LinkedVarying> &transformFeedbackVaryings,
bool separatedOutputBuffers, ShaderExecutable **outExecutable)
bool separatedOutputBuffers, ShaderExecutableD3D **outExecutable)
{
switch (type)
{
......@@ -2606,7 +2606,7 @@ gl::Error Renderer11::loadExecutable(const void *function, size_t length, Shader
gl::Error Renderer11::compileToExecutable(gl::InfoLog &infoLog, const std::string &shaderHLSL, ShaderType type,
const std::vector<gl::LinkedVarying> &transformFeedbackVaryings,
bool separatedOutputBuffers, D3DWorkaroundType workaround,
ShaderExecutable **outExectuable)
ShaderExecutableD3D **outExectuable)
{
const char *profileType = NULL;
switch (type)
......@@ -2680,7 +2680,7 @@ gl::Error Renderer11::compileToExecutable(gl::InfoLog &infoLog, const std::strin
return gl::Error(GL_NO_ERROR);
}
UniformStorage *Renderer11::createUniformStorage(size_t storageSize)
UniformStorageD3D *Renderer11::createUniformStorage(size_t storageSize)
{
return new UniformStorage11(this, storageSize);
}
......
......@@ -143,12 +143,12 @@ class Renderer11 : public RendererD3D
// Shader operations
virtual gl::Error loadExecutable(const void *function, size_t length, ShaderType type,
const std::vector<gl::LinkedVarying> &transformFeedbackVaryings,
bool separatedOutputBuffers, ShaderExecutable **outExecutable);
bool separatedOutputBuffers, ShaderExecutableD3D **outExecutable);
virtual gl::Error compileToExecutable(gl::InfoLog &infoLog, const std::string &shaderHLSL, ShaderType type,
const std::vector<gl::LinkedVarying> &transformFeedbackVaryings,
bool separatedOutputBuffers, D3DWorkaroundType workaround,
ShaderExecutable **outExectuable);
virtual UniformStorage *createUniformStorage(size_t storageSize);
ShaderExecutableD3D **outExectuable);
virtual UniformStorageD3D *createUniformStorage(size_t storageSize);
// Image operations
virtual ImageD3D *createImage();
......
......@@ -14,7 +14,7 @@ namespace rx
{
ShaderExecutable11::ShaderExecutable11(const void *function, size_t length, ID3D11PixelShader *executable)
: ShaderExecutable(function, length)
: ShaderExecutableD3D(function, length)
{
mPixelExecutable = executable;
mVertexExecutable = NULL;
......@@ -23,7 +23,7 @@ ShaderExecutable11::ShaderExecutable11(const void *function, size_t length, ID3D
}
ShaderExecutable11::ShaderExecutable11(const void *function, size_t length, ID3D11VertexShader *executable, ID3D11GeometryShader *streamOut)
: ShaderExecutable(function, length)
: ShaderExecutableD3D(function, length)
{
mVertexExecutable = executable;
mPixelExecutable = NULL;
......@@ -32,7 +32,7 @@ ShaderExecutable11::ShaderExecutable11(const void *function, size_t length, ID3D
}
ShaderExecutable11::ShaderExecutable11(const void *function, size_t length, ID3D11GeometryShader *executable)
: ShaderExecutable(function, length)
: ShaderExecutableD3D(function, length)
{
mGeometryExecutable = executable;
mVertexExecutable = NULL;
......@@ -48,7 +48,7 @@ ShaderExecutable11::~ShaderExecutable11()
SafeRelease(mStreamOutExecutable);
}
ShaderExecutable11 *ShaderExecutable11::makeShaderExecutable11(ShaderExecutable *executable)
ShaderExecutable11 *ShaderExecutable11::makeShaderExecutable11(ShaderExecutableD3D *executable)
{
ASSERT(HAS_DYNAMIC_TYPE(ShaderExecutable11*, executable));
return static_cast<ShaderExecutable11*>(executable);
......@@ -75,7 +75,7 @@ ID3D11GeometryShader *ShaderExecutable11::getStreamOutShader() const
}
UniformStorage11::UniformStorage11(Renderer11 *renderer, size_t initialSize)
: UniformStorage(initialSize),
: UniformStorageD3D(initialSize),
mConstantBuffer(NULL)
{
ID3D11Device *d3d11Device = renderer->getDevice();
......@@ -101,7 +101,7 @@ UniformStorage11::~UniformStorage11()
SafeRelease(mConstantBuffer);
}
const UniformStorage11 *UniformStorage11::makeUniformStorage11(const UniformStorage *uniformStorage)
const UniformStorage11 *UniformStorage11::makeUniformStorage11(const UniformStorageD3D *uniformStorage)
{
ASSERT(HAS_DYNAMIC_TYPE(const UniformStorage11*, uniformStorage));
return static_cast<const UniformStorage11*>(uniformStorage);
......
......@@ -10,14 +10,14 @@
#ifndef LIBANGLE_RENDERER_D3D_D3D11_SHADEREXECUTABLE11_H_
#define LIBANGLE_RENDERER_D3D_D3D11_SHADEREXECUTABLE11_H_
#include "libANGLE/renderer/ShaderExecutable.h"
#include "libANGLE/renderer/d3d/ShaderExecutableD3D.h"
namespace rx
{
class Renderer11;
class UniformStorage11;
class ShaderExecutable11 : public ShaderExecutable
class ShaderExecutable11 : public ShaderExecutableD3D
{
public:
ShaderExecutable11(const void *function, size_t length, ID3D11PixelShader *executable);
......@@ -26,7 +26,7 @@ class ShaderExecutable11 : public ShaderExecutable
virtual ~ShaderExecutable11();
static ShaderExecutable11 *makeShaderExecutable11(ShaderExecutable *executable);
static ShaderExecutable11 *makeShaderExecutable11(ShaderExecutableD3D *executable);
ID3D11PixelShader *getPixelShader() const;
ID3D11VertexShader *getVertexShader() const;
......@@ -42,13 +42,13 @@ class ShaderExecutable11 : public ShaderExecutable
ID3D11GeometryShader *mStreamOutExecutable;
};
class UniformStorage11 : public UniformStorage
class UniformStorage11 : public UniformStorageD3D
{
public:
UniformStorage11(Renderer11 *renderer, size_t initialSize);
virtual ~UniformStorage11();
static const UniformStorage11 *makeUniformStorage11(const UniformStorage *uniformStorage);
static const UniformStorage11 *makeUniformStorage11(const UniformStorageD3D *uniformStorage);
ID3D11Buffer *getConstantBuffer() const { return mConstantBuffer; }
......
......@@ -1765,14 +1765,14 @@ gl::Error Renderer9::applyShaders(gl::Program *program, const gl::VertexFormat i
ProgramD3D *programD3D = ProgramD3D::makeProgramD3D(program->getImplementation());
ShaderExecutable *vertexExe = NULL;
ShaderExecutableD3D *vertexExe = NULL;
gl::Error error = programD3D->getVertexExecutableForInputLayout(inputLayout, &vertexExe, nullptr);
if (error.isError())
{
return error;
}
ShaderExecutable *pixelExe = NULL;
ShaderExecutableD3D *pixelExe = NULL;
error = programD3D->getPixelExecutableForFramebuffer(framebuffer, &pixelExe);
if (error.isError())
{
......@@ -2622,7 +2622,7 @@ ProgramImpl *Renderer9::createProgram()
gl::Error Renderer9::loadExecutable(const void *function, size_t length, ShaderType type,
const std::vector<gl::LinkedVarying> &transformFeedbackVaryings,
bool separatedOutputBuffers, ShaderExecutable **outExecutable)
bool separatedOutputBuffers, ShaderExecutableD3D **outExecutable)
{
// Transform feedback is not supported in ES2 or D3D9
ASSERT(transformFeedbackVaryings.size() == 0);
......@@ -2662,7 +2662,7 @@ gl::Error Renderer9::loadExecutable(const void *function, size_t length, ShaderT
gl::Error Renderer9::compileToExecutable(gl::InfoLog &infoLog, const std::string &shaderHLSL, ShaderType type,
const std::vector<gl::LinkedVarying> &transformFeedbackVaryings,
bool separatedOutputBuffers, D3DWorkaroundType workaround,
ShaderExecutable **outExectuable)
ShaderExecutableD3D **outExectuable)
{
// Transform feedback is not supported in ES2 or D3D9
ASSERT(transformFeedbackVaryings.size() == 0);
......@@ -2745,9 +2745,9 @@ gl::Error Renderer9::compileToExecutable(gl::InfoLog &infoLog, const std::string
return gl::Error(GL_NO_ERROR);
}
UniformStorage *Renderer9::createUniformStorage(size_t storageSize)
UniformStorageD3D *Renderer9::createUniformStorage(size_t storageSize)
{
return new UniformStorage(storageSize);
return new UniformStorageD3D(storageSize);
}
gl::Error Renderer9::boxFilter(IDirect3DSurface9 *source, IDirect3DSurface9 *dest)
......
......@@ -152,12 +152,12 @@ class Renderer9 : public RendererD3D
// Shader operations
virtual gl::Error loadExecutable(const void *function, size_t length, ShaderType type,
const std::vector<gl::LinkedVarying> &transformFeedbackVaryings,
bool separatedOutputBuffers, ShaderExecutable **outExecutable);
bool separatedOutputBuffers, ShaderExecutableD3D **outExecutable);
virtual gl::Error compileToExecutable(gl::InfoLog &infoLog, const std::string &shaderHLSL, ShaderType type,
const std::vector<gl::LinkedVarying> &transformFeedbackVaryings,
bool separatedOutputBuffers, D3DWorkaroundType workaround,
ShaderExecutable **outExectuable);
virtual UniformStorage *createUniformStorage(size_t storageSize);
ShaderExecutableD3D **outExectuable);
virtual UniformStorageD3D *createUniformStorage(size_t storageSize);
// Image operations
virtual ImageD3D *createImage();
......
......@@ -15,14 +15,14 @@ namespace rx
{
ShaderExecutable9::ShaderExecutable9(const void *function, size_t length, IDirect3DPixelShader9 *executable)
: ShaderExecutable(function, length)
: ShaderExecutableD3D(function, length)
{
mPixelExecutable = executable;
mVertexExecutable = NULL;
}
ShaderExecutable9::ShaderExecutable9(const void *function, size_t length, IDirect3DVertexShader9 *executable)
: ShaderExecutable(function, length)
: ShaderExecutableD3D(function, length)
{
mVertexExecutable = executable;
mPixelExecutable = NULL;
......@@ -34,7 +34,7 @@ ShaderExecutable9::~ShaderExecutable9()
SafeRelease(mPixelExecutable);
}
ShaderExecutable9 *ShaderExecutable9::makeShaderExecutable9(ShaderExecutable *executable)
ShaderExecutable9 *ShaderExecutable9::makeShaderExecutable9(ShaderExecutableD3D *executable)
{
ASSERT(HAS_DYNAMIC_TYPE(ShaderExecutable9*, executable));
return static_cast<ShaderExecutable9*>(executable);
......
......@@ -10,19 +10,19 @@
#ifndef LIBANGLE_RENDERER_D3D_D3D9_SHADEREXECUTABLE9_H_
#define LIBANGLE_RENDERER_D3D_D3D9_SHADEREXECUTABLE9_H_
#include "libANGLE/renderer/ShaderExecutable.h"
#include "libANGLE/renderer/d3d/ShaderExecutableD3D.h"
namespace rx
{
class ShaderExecutable9 : public ShaderExecutable
class ShaderExecutable9 : public ShaderExecutableD3D
{
public:
ShaderExecutable9(const void *function, size_t length, IDirect3DPixelShader9 *executable);
ShaderExecutable9(const void *function, size_t length, IDirect3DVertexShader9 *executable);
virtual ~ShaderExecutable9();
static ShaderExecutable9 *makeShaderExecutable9(ShaderExecutable *executable);
static ShaderExecutable9 *makeShaderExecutable9(ShaderExecutableD3D *executable);
IDirect3DPixelShader9 *getPixelShader() const;
IDirect3DVertexShader9 *getVertexShader() const;
......
......@@ -122,7 +122,6 @@
'libANGLE/renderer/RenderbufferImpl.cpp',
'libANGLE/renderer/Renderer.cpp',
'libANGLE/renderer/Renderer.h',
'libANGLE/renderer/ShaderExecutable.h',
'libANGLE/renderer/ShaderImpl.h',
'libANGLE/renderer/SurfaceImpl.cpp',
'libANGLE/renderer/SurfaceImpl.h',
......@@ -184,6 +183,8 @@
'libANGLE/renderer/d3d/RenderTargetD3D.cpp',
'libANGLE/renderer/d3d/ShaderD3D.cpp',
'libANGLE/renderer/d3d/ShaderD3D.h',
'libANGLE/renderer/d3d/ShaderExecutableD3D.cpp',
'libANGLE/renderer/d3d/ShaderExecutableD3D.h',
'libANGLE/renderer/d3d/SurfaceD3D.cpp',
'libANGLE/renderer/d3d/SurfaceD3D.h',
'libANGLE/renderer/d3d/SwapChainD3D.h',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment