зеркало из https://github.com/AvaloniaUI/angle.git
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: Jamie Madill <jmadill@chromium.org>
This commit is contained in:
Родитель
a25fcc579d
Коммит
d13c9e78cf
|
@ -48,7 +48,7 @@ class WaitableCompileEvent : public angle::WaitableEvent
|
|||
class ShaderImpl : angle::NonCopyable
|
||||
{
|
||||
public:
|
||||
ShaderImpl(const gl::ShaderState &data) : mData(data) {}
|
||||
ShaderImpl(const gl::ShaderState &state) : mState(state) {}
|
||||
virtual ~ShaderImpl() {}
|
||||
|
||||
virtual void destroy() {}
|
||||
|
@ -59,7 +59,7 @@ class ShaderImpl : angle::NonCopyable
|
|||
|
||||
virtual std::string getDebugInfo() const = 0;
|
||||
|
||||
const gl::ShaderState &getData() const { return mData; }
|
||||
const gl::ShaderState &getState() const { return mState; }
|
||||
|
||||
protected:
|
||||
std::shared_ptr<WaitableCompileEvent> compileImpl(const gl::Context *context,
|
||||
|
@ -67,7 +67,7 @@ class ShaderImpl : angle::NonCopyable
|
|||
const std::string &source,
|
||||
ShCompileOptions compileOptions);
|
||||
|
||||
const gl::ShaderState &mData;
|
||||
const gl::ShaderState &mState;
|
||||
};
|
||||
|
||||
} // namespace rx
|
||||
|
|
|
@ -1263,7 +1263,7 @@ void DynamicHLSL::getPixelShaderOutputKey(const gl::State &data,
|
|||
return;
|
||||
}
|
||||
|
||||
const auto &shaderOutputVars = fragmentShader->getData().getActiveOutputVariables();
|
||||
const auto &shaderOutputVars = fragmentShader->getState().getActiveOutputVariables();
|
||||
|
||||
for (size_t outputLocationIndex = 0u;
|
||||
outputLocationIndex < programData.getOutputLocations().size(); ++outputLocationIndex)
|
||||
|
|
|
@ -524,7 +524,7 @@ bool ProgramD3DMetadata::usesCustomOutVars() const
|
|||
{
|
||||
|
||||
const rx::ShaderD3D *shader = mAttachedShaders[gl::ShaderType::Vertex];
|
||||
int version = shader ? shader->getData().getShaderVersion() : -1;
|
||||
int version = shader ? shader->getState().getShaderVersion() : -1;
|
||||
|
||||
switch (mClientType)
|
||||
{
|
||||
|
@ -2643,7 +2643,7 @@ template <typename T>
|
|||
void ProgramD3D::setUniformImpl(const gl::VariableLocation &locationInfo,
|
||||
GLsizei count,
|
||||
const T *v,
|
||||
uint8_t *targetData,
|
||||
uint8_t *targetState,
|
||||
GLenum uniformType)
|
||||
{
|
||||
D3DUniform *targetUniform = mD3DUniforms[locationInfo.index];
|
||||
|
@ -2652,7 +2652,7 @@ void ProgramD3D::setUniformImpl(const gl::VariableLocation &locationInfo,
|
|||
|
||||
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;
|
||||
|
||||
for (GLint i = 0; i < count; i++, dest += 4, source += components)
|
||||
|
@ -2663,7 +2663,7 @@ void ProgramD3D::setUniformImpl(const gl::VariableLocation &locationInfo,
|
|||
else
|
||||
{
|
||||
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++)
|
||||
{
|
||||
|
|
|
@ -87,10 +87,10 @@ class WaitableCompileEventD3D final : public WaitableCompileEvent
|
|||
std::shared_ptr<TranslateTaskD3D> mTranslateTask;
|
||||
};
|
||||
|
||||
ShaderD3D::ShaderD3D(const gl::ShaderState &data,
|
||||
ShaderD3D::ShaderD3D(const gl::ShaderState &state,
|
||||
const angle::FeaturesD3D &features,
|
||||
const gl::Extensions &extensions)
|
||||
: ShaderImpl(data), mAdditionalOptions(0)
|
||||
: ShaderImpl(state), mAdditionalOptions(0)
|
||||
{
|
||||
uncompile();
|
||||
|
||||
|
@ -117,7 +117,7 @@ ShaderD3D::ShaderD3D(const gl::ShaderState &data,
|
|||
mAdditionalOptions |= SH_EMULATE_ISNAN_FLOAT_FUNCTION;
|
||||
}
|
||||
if (features.skipVSConstantRegisterZero.enabled &&
|
||||
mData.getShaderType() == gl::ShaderType::Vertex)
|
||||
mState.getShaderType() == gl::ShaderType::Vertex)
|
||||
{
|
||||
mAdditionalOptions |= SH_SKIP_D3D_CONSTANT_REGISTER_ZERO;
|
||||
}
|
||||
|
@ -144,7 +144,7 @@ std::string ShaderD3D::getDebugInfo() const
|
|||
return "";
|
||||
}
|
||||
|
||||
return mDebugInfo + std::string("\n// ") + gl::GetShaderTypeString(mData.getShaderType()) +
|
||||
return mDebugInfo + std::string("\n// ") + gl::GetShaderTypeString(mState.getShaderType()) +
|
||||
" SHADER END\n";
|
||||
}
|
||||
|
||||
|
@ -263,7 +263,7 @@ std::shared_ptr<WaitableCompileEvent> ShaderD3D::compile(const gl::Context *cont
|
|||
|
||||
ShCompileOptions additionalOptions = 0;
|
||||
|
||||
const std::string &source = mData.getSource();
|
||||
const std::string &source = mState.getSource();
|
||||
|
||||
#if !defined(ANGLE_ENABLE_WINDOWS_UWP)
|
||||
if (gl::DebugAnnotationsActive())
|
||||
|
@ -282,7 +282,7 @@ std::shared_ptr<WaitableCompileEvent> ShaderD3D::compile(const gl::Context *cont
|
|||
// TODO(jmadill): We shouldn't need to cache this.
|
||||
mCompilerOutputType = compiler->getShaderOutputType();
|
||||
|
||||
const std::string &translatedSource = mData.getTranslatedSource();
|
||||
const std::string &translatedSource = mState.getTranslatedSource();
|
||||
|
||||
mUsesMultipleRenderTargets = translatedSource.find("GL_USES_MRT") != 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
|
|||
mUsedImage2DFunctionNames =
|
||||
GetUsedImage2DFunctionNames(sh::GetUsedImage2DFunctionNames(compilerHandle));
|
||||
|
||||
for (const sh::InterfaceBlock &interfaceBlock : mData.getUniformBlocks())
|
||||
for (const sh::InterfaceBlock &interfaceBlock : mState.getUniformBlocks())
|
||||
{
|
||||
if (interfaceBlock.active)
|
||||
{
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -343,9 +343,9 @@ std::shared_ptr<WaitableCompileEvent> ShaderD3D::compile(const gl::Context *cont
|
|||
}
|
||||
}
|
||||
|
||||
mDebugInfo +=
|
||||
std::string("// ") + gl::GetShaderTypeString(mData.getShaderType()) + " SHADER BEGIN\n";
|
||||
mDebugInfo += "\n// GLSL BEGIN\n\n" + mData.getSource() + "\n\n// GLSL END\n\n\n";
|
||||
mDebugInfo += std::string("// ") + gl::GetShaderTypeString(mState.getShaderType()) +
|
||||
" SHADER BEGIN\n";
|
||||
mDebugInfo += "\n// GLSL BEGIN\n\n" + mState.getSource() + "\n\n// GLSL END\n\n\n";
|
||||
mDebugInfo +=
|
||||
"// INITIAL HLSL BEGIN\n\n" + translatedSource + "\n// INITIAL HLSL END\n\n\n";
|
||||
// Successive steps will append more info
|
||||
|
|
|
@ -33,7 +33,7 @@ struct D3DUniform;
|
|||
class ShaderD3D : public ShaderImpl
|
||||
{
|
||||
public:
|
||||
ShaderD3D(const gl::ShaderState &data,
|
||||
ShaderD3D(const gl::ShaderState &state,
|
||||
const angle::FeaturesD3D &features,
|
||||
const gl::Extensions &extensions);
|
||||
~ShaderD3D() override;
|
||||
|
|
|
@ -247,7 +247,7 @@ std::shared_ptr<WaitableCompileEvent> ShaderGL::compile(const gl::Context *conte
|
|||
ShCompileOptions additionalOptions = SH_INIT_GL_POSITION;
|
||||
|
||||
bool isWebGL = context->getExtensions().webglCompatibility;
|
||||
if (isWebGL && (mData.getShaderType() != gl::ShaderType::Compute))
|
||||
if (isWebGL && (mState.getShaderType() != gl::ShaderType::Compute))
|
||||
{
|
||||
additionalOptions |= SH_INIT_OUTPUT_VARIABLES;
|
||||
}
|
||||
|
@ -374,7 +374,7 @@ std::shared_ptr<WaitableCompileEvent> ShaderGL::compile(const gl::Context *conte
|
|||
|
||||
auto workerThreadPool = context->getWorkerThreadPool();
|
||||
|
||||
const std::string &source = mData.getSource();
|
||||
const std::string &source = mState.getSource();
|
||||
|
||||
auto postTranslateFunctor = [this](std::string *infoLog) {
|
||||
if (mCompileStatus == GL_FALSE)
|
||||
|
@ -437,7 +437,7 @@ std::shared_ptr<WaitableCompileEvent> ShaderGL::compile(const gl::Context *conte
|
|||
|
||||
std::string ShaderGL::getDebugInfo() const
|
||||
{
|
||||
return mData.getTranslatedSource();
|
||||
return mState.getTranslatedSource();
|
||||
}
|
||||
|
||||
GLuint ShaderGL::getShaderID() const
|
||||
|
|
|
@ -19,7 +19,7 @@ enum class MultiviewImplementationTypeGL;
|
|||
class ShaderGL : public ShaderImpl
|
||||
{
|
||||
public:
|
||||
ShaderGL(const gl::ShaderState &data,
|
||||
ShaderGL(const gl::ShaderState &state,
|
||||
GLuint shaderID,
|
||||
MultiviewImplementationTypeGL multiviewImplementationType,
|
||||
const std::shared_ptr<RendererGL> &renderer);
|
||||
|
|
|
@ -19,7 +19,7 @@ namespace rx
|
|||
class ShaderMtl : public ShaderImpl
|
||||
{
|
||||
public:
|
||||
ShaderMtl(const gl::ShaderState &data);
|
||||
ShaderMtl(const gl::ShaderState &state);
|
||||
~ShaderMtl() override;
|
||||
|
||||
std::shared_ptr<WaitableCompileEvent> compile(const gl::Context *context,
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
namespace rx
|
||||
{
|
||||
|
||||
ShaderMtl::ShaderMtl(const gl::ShaderState &data) : ShaderImpl(data) {}
|
||||
ShaderMtl::ShaderMtl(const gl::ShaderState &state) : ShaderImpl(state) {}
|
||||
|
||||
ShaderMtl::~ShaderMtl() {}
|
||||
|
||||
|
@ -27,19 +27,19 @@ std::shared_ptr<WaitableCompileEvent> ShaderMtl::compile(const gl::Context *cont
|
|||
ShCompileOptions compileOptions = SH_INITIALIZE_UNINITIALIZED_LOCALS;
|
||||
|
||||
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_CLAMP_POINT_SIZE;
|
||||
|
||||
return compileImpl(context, compilerInstance, mData.getSource(), compileOptions | options);
|
||||
return compileImpl(context, compilerInstance, mState.getSource(), compileOptions | options);
|
||||
}
|
||||
|
||||
std::string ShaderMtl::getDebugInfo() const
|
||||
{
|
||||
return mData.getTranslatedSource();
|
||||
return mState.getTranslatedSource();
|
||||
}
|
||||
|
||||
} // namespace rx
|
||||
|
|
|
@ -23,7 +23,7 @@ std::shared_ptr<WaitableCompileEvent> ShaderNULL::compile(const gl::Context *con
|
|||
gl::ShCompilerInstance *compilerInstance,
|
||||
ShCompileOptions options)
|
||||
{
|
||||
return compileImpl(context, compilerInstance, mData.getSource(), options);
|
||||
return compileImpl(context, compilerInstance, mState.getSource(), options);
|
||||
}
|
||||
|
||||
std::string ShaderNULL::getDebugInfo() const
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
namespace rx
|
||||
{
|
||||
|
||||
ShaderVk::ShaderVk(const gl::ShaderState &data) : ShaderImpl(data) {}
|
||||
ShaderVk::ShaderVk(const gl::ShaderState &state) : ShaderImpl(state) {}
|
||||
|
||||
ShaderVk::~ShaderVk() {}
|
||||
|
||||
|
@ -37,7 +37,7 @@ std::shared_ptr<WaitableCompileEvent> ShaderVk::compile(const gl::Context *conte
|
|||
// Extra initialization in spirv shader may affect performance.
|
||||
compileOptions |= SH_INITIALIZE_UNINITIALIZED_LOCALS;
|
||||
|
||||
if (mData.getShaderType() != gl::ShaderType::Compute)
|
||||
if (mState.getShaderType() != gl::ShaderType::Compute)
|
||||
{
|
||||
compileOptions |= SH_INIT_OUTPUT_VARIABLES;
|
||||
}
|
||||
|
@ -78,12 +78,12 @@ std::shared_ptr<WaitableCompileEvent> ShaderVk::compile(const gl::Context *conte
|
|||
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
|
||||
{
|
||||
return mData.getTranslatedSource();
|
||||
return mState.getTranslatedSource();
|
||||
}
|
||||
|
||||
} // namespace rx
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace rx
|
|||
class ShaderVk : public ShaderImpl
|
||||
{
|
||||
public:
|
||||
ShaderVk(const gl::ShaderState &data);
|
||||
ShaderVk(const gl::ShaderState &state);
|
||||
~ShaderVk() override;
|
||||
|
||||
std::shared_ptr<WaitableCompileEvent> compile(const gl::Context *context,
|
||||
|
|
Загрузка…
Ссылка в новой задаче