Commit d13c9e78 by Jamie Madill Committed by Commit Bot

Rename ShaderImpl::mData to mState.

Makes it consistent with the other back-end types. Bug: angleproject:5076 Change-Id: I7a54dd4a0a54e6dc05e257b7b2ac1ec21ceea700 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2420748 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent a25fcc57
...@@ -48,7 +48,7 @@ class WaitableCompileEvent : public angle::WaitableEvent ...@@ -48,7 +48,7 @@ class WaitableCompileEvent : public angle::WaitableEvent
class ShaderImpl : angle::NonCopyable class ShaderImpl : angle::NonCopyable
{ {
public: public:
ShaderImpl(const gl::ShaderState &data) : mData(data) {} ShaderImpl(const gl::ShaderState &state) : mState(state) {}
virtual ~ShaderImpl() {} virtual ~ShaderImpl() {}
virtual void destroy() {} virtual void destroy() {}
...@@ -59,7 +59,7 @@ class ShaderImpl : angle::NonCopyable ...@@ -59,7 +59,7 @@ class ShaderImpl : angle::NonCopyable
virtual std::string getDebugInfo() const = 0; virtual std::string getDebugInfo() const = 0;
const gl::ShaderState &getData() const { return mData; } const gl::ShaderState &getState() const { return mState; }
protected: protected:
std::shared_ptr<WaitableCompileEvent> compileImpl(const gl::Context *context, std::shared_ptr<WaitableCompileEvent> compileImpl(const gl::Context *context,
...@@ -67,7 +67,7 @@ class ShaderImpl : angle::NonCopyable ...@@ -67,7 +67,7 @@ class ShaderImpl : angle::NonCopyable
const std::string &source, const std::string &source,
ShCompileOptions compileOptions); ShCompileOptions compileOptions);
const gl::ShaderState &mData; const gl::ShaderState &mState;
}; };
} // namespace rx } // namespace rx
......
...@@ -1263,7 +1263,7 @@ void DynamicHLSL::getPixelShaderOutputKey(const gl::State &data, ...@@ -1263,7 +1263,7 @@ void DynamicHLSL::getPixelShaderOutputKey(const gl::State &data,
return; return;
} }
const auto &shaderOutputVars = fragmentShader->getData().getActiveOutputVariables(); const auto &shaderOutputVars = fragmentShader->getState().getActiveOutputVariables();
for (size_t outputLocationIndex = 0u; for (size_t outputLocationIndex = 0u;
outputLocationIndex < programData.getOutputLocations().size(); ++outputLocationIndex) outputLocationIndex < programData.getOutputLocations().size(); ++outputLocationIndex)
......
...@@ -524,7 +524,7 @@ bool ProgramD3DMetadata::usesCustomOutVars() const ...@@ -524,7 +524,7 @@ bool ProgramD3DMetadata::usesCustomOutVars() const
{ {
const rx::ShaderD3D *shader = mAttachedShaders[gl::ShaderType::Vertex]; const rx::ShaderD3D *shader = mAttachedShaders[gl::ShaderType::Vertex];
int version = shader ? shader->getData().getShaderVersion() : -1; int version = shader ? shader->getState().getShaderVersion() : -1;
switch (mClientType) switch (mClientType)
{ {
...@@ -2643,7 +2643,7 @@ template <typename T> ...@@ -2643,7 +2643,7 @@ template <typename T>
void ProgramD3D::setUniformImpl(const gl::VariableLocation &locationInfo, void ProgramD3D::setUniformImpl(const gl::VariableLocation &locationInfo,
GLsizei count, GLsizei count,
const T *v, const T *v,
uint8_t *targetData, uint8_t *targetState,
GLenum uniformType) GLenum uniformType)
{ {
D3DUniform *targetUniform = mD3DUniforms[locationInfo.index]; D3DUniform *targetUniform = mD3DUniforms[locationInfo.index];
...@@ -2652,7 +2652,7 @@ void ProgramD3D::setUniformImpl(const gl::VariableLocation &locationInfo, ...@@ -2652,7 +2652,7 @@ void ProgramD3D::setUniformImpl(const gl::VariableLocation &locationInfo,
if (targetUniform->typeInfo.type == uniformType) if (targetUniform->typeInfo.type == uniformType)
{ {
T *dest = reinterpret_cast<T *>(targetData) + arrayElementOffset * 4; T *dest = reinterpret_cast<T *>(targetState) + arrayElementOffset * 4;
const T *source = v; const T *source = v;
for (GLint i = 0; i < count; i++, dest += 4, source += components) for (GLint i = 0; i < count; i++, dest += 4, source += components)
...@@ -2663,7 +2663,7 @@ void ProgramD3D::setUniformImpl(const gl::VariableLocation &locationInfo, ...@@ -2663,7 +2663,7 @@ void ProgramD3D::setUniformImpl(const gl::VariableLocation &locationInfo,
else else
{ {
ASSERT(targetUniform->typeInfo.type == gl::VariableBoolVectorType(uniformType)); ASSERT(targetUniform->typeInfo.type == gl::VariableBoolVectorType(uniformType));
GLint *boolParams = reinterpret_cast<GLint *>(targetData) + arrayElementOffset * 4; GLint *boolParams = reinterpret_cast<GLint *>(targetState) + arrayElementOffset * 4;
for (GLint i = 0; i < count; i++) for (GLint i = 0; i < count; i++)
{ {
......
...@@ -87,10 +87,10 @@ class WaitableCompileEventD3D final : public WaitableCompileEvent ...@@ -87,10 +87,10 @@ class WaitableCompileEventD3D final : public WaitableCompileEvent
std::shared_ptr<TranslateTaskD3D> mTranslateTask; std::shared_ptr<TranslateTaskD3D> mTranslateTask;
}; };
ShaderD3D::ShaderD3D(const gl::ShaderState &data, ShaderD3D::ShaderD3D(const gl::ShaderState &state,
const angle::FeaturesD3D &features, const angle::FeaturesD3D &features,
const gl::Extensions &extensions) const gl::Extensions &extensions)
: ShaderImpl(data), mAdditionalOptions(0) : ShaderImpl(state), mAdditionalOptions(0)
{ {
uncompile(); uncompile();
...@@ -117,7 +117,7 @@ ShaderD3D::ShaderD3D(const gl::ShaderState &data, ...@@ -117,7 +117,7 @@ ShaderD3D::ShaderD3D(const gl::ShaderState &data,
mAdditionalOptions |= SH_EMULATE_ISNAN_FLOAT_FUNCTION; mAdditionalOptions |= SH_EMULATE_ISNAN_FLOAT_FUNCTION;
} }
if (features.skipVSConstantRegisterZero.enabled && if (features.skipVSConstantRegisterZero.enabled &&
mData.getShaderType() == gl::ShaderType::Vertex) mState.getShaderType() == gl::ShaderType::Vertex)
{ {
mAdditionalOptions |= SH_SKIP_D3D_CONSTANT_REGISTER_ZERO; mAdditionalOptions |= SH_SKIP_D3D_CONSTANT_REGISTER_ZERO;
} }
...@@ -144,7 +144,7 @@ std::string ShaderD3D::getDebugInfo() const ...@@ -144,7 +144,7 @@ std::string ShaderD3D::getDebugInfo() const
return ""; return "";
} }
return mDebugInfo + std::string("\n// ") + gl::GetShaderTypeString(mData.getShaderType()) + return mDebugInfo + std::string("\n// ") + gl::GetShaderTypeString(mState.getShaderType()) +
" SHADER END\n"; " SHADER END\n";
} }
...@@ -263,7 +263,7 @@ std::shared_ptr<WaitableCompileEvent> ShaderD3D::compile(const gl::Context *cont ...@@ -263,7 +263,7 @@ std::shared_ptr<WaitableCompileEvent> ShaderD3D::compile(const gl::Context *cont
ShCompileOptions additionalOptions = 0; ShCompileOptions additionalOptions = 0;
const std::string &source = mData.getSource(); const std::string &source = mState.getSource();
#if !defined(ANGLE_ENABLE_WINDOWS_UWP) #if !defined(ANGLE_ENABLE_WINDOWS_UWP)
if (gl::DebugAnnotationsActive()) if (gl::DebugAnnotationsActive())
...@@ -282,7 +282,7 @@ std::shared_ptr<WaitableCompileEvent> ShaderD3D::compile(const gl::Context *cont ...@@ -282,7 +282,7 @@ std::shared_ptr<WaitableCompileEvent> ShaderD3D::compile(const gl::Context *cont
// TODO(jmadill): We shouldn't need to cache this. // TODO(jmadill): We shouldn't need to cache this.
mCompilerOutputType = compiler->getShaderOutputType(); mCompilerOutputType = compiler->getShaderOutputType();
const std::string &translatedSource = mData.getTranslatedSource(); const std::string &translatedSource = mState.getTranslatedSource();
mUsesMultipleRenderTargets = translatedSource.find("GL_USES_MRT") != std::string::npos; mUsesMultipleRenderTargets = translatedSource.find("GL_USES_MRT") != std::string::npos;
mUsesFragColor = translatedSource.find("GL_USES_FRAG_COLOR") != std::string::npos; mUsesFragColor = translatedSource.find("GL_USES_FRAG_COLOR") != std::string::npos;
...@@ -314,7 +314,7 @@ std::shared_ptr<WaitableCompileEvent> ShaderD3D::compile(const gl::Context *cont ...@@ -314,7 +314,7 @@ std::shared_ptr<WaitableCompileEvent> ShaderD3D::compile(const gl::Context *cont
mUsedImage2DFunctionNames = mUsedImage2DFunctionNames =
GetUsedImage2DFunctionNames(sh::GetUsedImage2DFunctionNames(compilerHandle)); GetUsedImage2DFunctionNames(sh::GetUsedImage2DFunctionNames(compilerHandle));
for (const sh::InterfaceBlock &interfaceBlock : mData.getUniformBlocks()) for (const sh::InterfaceBlock &interfaceBlock : mState.getUniformBlocks())
{ {
if (interfaceBlock.active) if (interfaceBlock.active)
{ {
...@@ -330,7 +330,7 @@ std::shared_ptr<WaitableCompileEvent> ShaderD3D::compile(const gl::Context *cont ...@@ -330,7 +330,7 @@ std::shared_ptr<WaitableCompileEvent> ShaderD3D::compile(const gl::Context *cont
} }
} }
for (const sh::InterfaceBlock &interfaceBlock : mData.getShaderStorageBlocks()) for (const sh::InterfaceBlock &interfaceBlock : mState.getShaderStorageBlocks())
{ {
if (interfaceBlock.active) if (interfaceBlock.active)
{ {
...@@ -343,9 +343,9 @@ std::shared_ptr<WaitableCompileEvent> ShaderD3D::compile(const gl::Context *cont ...@@ -343,9 +343,9 @@ std::shared_ptr<WaitableCompileEvent> ShaderD3D::compile(const gl::Context *cont
} }
} }
mDebugInfo += mDebugInfo += std::string("// ") + gl::GetShaderTypeString(mState.getShaderType()) +
std::string("// ") + gl::GetShaderTypeString(mData.getShaderType()) + " SHADER BEGIN\n"; " SHADER BEGIN\n";
mDebugInfo += "\n// GLSL BEGIN\n\n" + mData.getSource() + "\n\n// GLSL END\n\n\n"; mDebugInfo += "\n// GLSL BEGIN\n\n" + mState.getSource() + "\n\n// GLSL END\n\n\n";
mDebugInfo += mDebugInfo +=
"// INITIAL HLSL BEGIN\n\n" + translatedSource + "\n// INITIAL HLSL END\n\n\n"; "// INITIAL HLSL BEGIN\n\n" + translatedSource + "\n// INITIAL HLSL END\n\n\n";
// Successive steps will append more info // Successive steps will append more info
......
...@@ -33,7 +33,7 @@ struct D3DUniform; ...@@ -33,7 +33,7 @@ struct D3DUniform;
class ShaderD3D : public ShaderImpl class ShaderD3D : public ShaderImpl
{ {
public: public:
ShaderD3D(const gl::ShaderState &data, ShaderD3D(const gl::ShaderState &state,
const angle::FeaturesD3D &features, const angle::FeaturesD3D &features,
const gl::Extensions &extensions); const gl::Extensions &extensions);
~ShaderD3D() override; ~ShaderD3D() override;
......
...@@ -247,7 +247,7 @@ std::shared_ptr<WaitableCompileEvent> ShaderGL::compile(const gl::Context *conte ...@@ -247,7 +247,7 @@ std::shared_ptr<WaitableCompileEvent> ShaderGL::compile(const gl::Context *conte
ShCompileOptions additionalOptions = SH_INIT_GL_POSITION; ShCompileOptions additionalOptions = SH_INIT_GL_POSITION;
bool isWebGL = context->getExtensions().webglCompatibility; bool isWebGL = context->getExtensions().webglCompatibility;
if (isWebGL && (mData.getShaderType() != gl::ShaderType::Compute)) if (isWebGL && (mState.getShaderType() != gl::ShaderType::Compute))
{ {
additionalOptions |= SH_INIT_OUTPUT_VARIABLES; additionalOptions |= SH_INIT_OUTPUT_VARIABLES;
} }
...@@ -374,7 +374,7 @@ std::shared_ptr<WaitableCompileEvent> ShaderGL::compile(const gl::Context *conte ...@@ -374,7 +374,7 @@ std::shared_ptr<WaitableCompileEvent> ShaderGL::compile(const gl::Context *conte
auto workerThreadPool = context->getWorkerThreadPool(); auto workerThreadPool = context->getWorkerThreadPool();
const std::string &source = mData.getSource(); const std::string &source = mState.getSource();
auto postTranslateFunctor = [this](std::string *infoLog) { auto postTranslateFunctor = [this](std::string *infoLog) {
if (mCompileStatus == GL_FALSE) if (mCompileStatus == GL_FALSE)
...@@ -437,7 +437,7 @@ std::shared_ptr<WaitableCompileEvent> ShaderGL::compile(const gl::Context *conte ...@@ -437,7 +437,7 @@ std::shared_ptr<WaitableCompileEvent> ShaderGL::compile(const gl::Context *conte
std::string ShaderGL::getDebugInfo() const std::string ShaderGL::getDebugInfo() const
{ {
return mData.getTranslatedSource(); return mState.getTranslatedSource();
} }
GLuint ShaderGL::getShaderID() const GLuint ShaderGL::getShaderID() const
......
...@@ -19,7 +19,7 @@ enum class MultiviewImplementationTypeGL; ...@@ -19,7 +19,7 @@ enum class MultiviewImplementationTypeGL;
class ShaderGL : public ShaderImpl class ShaderGL : public ShaderImpl
{ {
public: public:
ShaderGL(const gl::ShaderState &data, ShaderGL(const gl::ShaderState &state,
GLuint shaderID, GLuint shaderID,
MultiviewImplementationTypeGL multiviewImplementationType, MultiviewImplementationTypeGL multiviewImplementationType,
const std::shared_ptr<RendererGL> &renderer); const std::shared_ptr<RendererGL> &renderer);
......
...@@ -19,7 +19,7 @@ namespace rx ...@@ -19,7 +19,7 @@ namespace rx
class ShaderMtl : public ShaderImpl class ShaderMtl : public ShaderImpl
{ {
public: public:
ShaderMtl(const gl::ShaderState &data); ShaderMtl(const gl::ShaderState &state);
~ShaderMtl() override; ~ShaderMtl() override;
std::shared_ptr<WaitableCompileEvent> compile(const gl::Context *context, std::shared_ptr<WaitableCompileEvent> compile(const gl::Context *context,
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
namespace rx namespace rx
{ {
ShaderMtl::ShaderMtl(const gl::ShaderState &data) : ShaderImpl(data) {} ShaderMtl::ShaderMtl(const gl::ShaderState &state) : ShaderImpl(state) {}
ShaderMtl::~ShaderMtl() {} ShaderMtl::~ShaderMtl() {}
...@@ -27,19 +27,19 @@ std::shared_ptr<WaitableCompileEvent> ShaderMtl::compile(const gl::Context *cont ...@@ -27,19 +27,19 @@ std::shared_ptr<WaitableCompileEvent> ShaderMtl::compile(const gl::Context *cont
ShCompileOptions compileOptions = SH_INITIALIZE_UNINITIALIZED_LOCALS; ShCompileOptions compileOptions = SH_INITIALIZE_UNINITIALIZED_LOCALS;
bool isWebGL = context->getExtensions().webglCompatibility; bool isWebGL = context->getExtensions().webglCompatibility;
if (isWebGL && mData.getShaderType() != gl::ShaderType::Compute) if (isWebGL && mState.getShaderType() != gl::ShaderType::Compute)
{ {
compileOptions |= SH_INIT_OUTPUT_VARIABLES; compileOptions |= SH_INIT_OUTPUT_VARIABLES;
} }
compileOptions |= SH_CLAMP_POINT_SIZE; compileOptions |= SH_CLAMP_POINT_SIZE;
return compileImpl(context, compilerInstance, mData.getSource(), compileOptions | options); return compileImpl(context, compilerInstance, mState.getSource(), compileOptions | options);
} }
std::string ShaderMtl::getDebugInfo() const std::string ShaderMtl::getDebugInfo() const
{ {
return mData.getTranslatedSource(); return mState.getTranslatedSource();
} }
} // namespace rx } // namespace rx
...@@ -23,7 +23,7 @@ std::shared_ptr<WaitableCompileEvent> ShaderNULL::compile(const gl::Context *con ...@@ -23,7 +23,7 @@ std::shared_ptr<WaitableCompileEvent> ShaderNULL::compile(const gl::Context *con
gl::ShCompilerInstance *compilerInstance, gl::ShCompilerInstance *compilerInstance,
ShCompileOptions options) ShCompileOptions options)
{ {
return compileImpl(context, compilerInstance, mData.getSource(), options); return compileImpl(context, compilerInstance, mState.getSource(), options);
} }
std::string ShaderNULL::getDebugInfo() const std::string ShaderNULL::getDebugInfo() const
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
namespace rx namespace rx
{ {
ShaderVk::ShaderVk(const gl::ShaderState &data) : ShaderImpl(data) {} ShaderVk::ShaderVk(const gl::ShaderState &state) : ShaderImpl(state) {}
ShaderVk::~ShaderVk() {} ShaderVk::~ShaderVk() {}
...@@ -37,7 +37,7 @@ std::shared_ptr<WaitableCompileEvent> ShaderVk::compile(const gl::Context *conte ...@@ -37,7 +37,7 @@ std::shared_ptr<WaitableCompileEvent> ShaderVk::compile(const gl::Context *conte
// Extra initialization in spirv shader may affect performance. // Extra initialization in spirv shader may affect performance.
compileOptions |= SH_INITIALIZE_UNINITIALIZED_LOCALS; compileOptions |= SH_INITIALIZE_UNINITIALIZED_LOCALS;
if (mData.getShaderType() != gl::ShaderType::Compute) if (mState.getShaderType() != gl::ShaderType::Compute)
{ {
compileOptions |= SH_INIT_OUTPUT_VARIABLES; compileOptions |= SH_INIT_OUTPUT_VARIABLES;
} }
...@@ -78,12 +78,12 @@ std::shared_ptr<WaitableCompileEvent> ShaderVk::compile(const gl::Context *conte ...@@ -78,12 +78,12 @@ std::shared_ptr<WaitableCompileEvent> ShaderVk::compile(const gl::Context *conte
compileOptions |= SH_ADD_PRE_ROTATION; compileOptions |= SH_ADD_PRE_ROTATION;
} }
return compileImpl(context, compilerInstance, mData.getSource(), compileOptions | options); return compileImpl(context, compilerInstance, mState.getSource(), compileOptions | options);
} }
std::string ShaderVk::getDebugInfo() const std::string ShaderVk::getDebugInfo() const
{ {
return mData.getTranslatedSource(); return mState.getTranslatedSource();
} }
} // namespace rx } // namespace rx
...@@ -18,7 +18,7 @@ namespace rx ...@@ -18,7 +18,7 @@ namespace rx
class ShaderVk : public ShaderImpl class ShaderVk : public ShaderImpl
{ {
public: public:
ShaderVk(const gl::ShaderState &data); ShaderVk(const gl::ShaderState &state);
~ShaderVk() override; ~ShaderVk() override;
std::shared_ptr<WaitableCompileEvent> compile(const gl::Context *context, std::shared_ptr<WaitableCompileEvent> compile(const gl::Context *context,
......
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