Commit a914f7ff by Jiawei Shao Committed by Commit Bot

Use ShaderMap in Statemanager11 - Part II

This patch is the last patch of storing shader resources into ShaderMap in Statemanager11. This patch also splits several large functions into smaller one to make the code structure clearer. BUG=angleproject:2169 Change-Id: Id6d89976de0376b2479bd11d7551fc6f5b521c13 Reviewed-on: https://chromium-review.googlesource.com/1092511Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
parent 4004ae0e
......@@ -299,6 +299,11 @@ class ProgramD3D : public ProgramImpl
const gl::ProgramState &getState() const { return mState; }
bool hasShaderStage(gl::ShaderType shaderType) const
{
return mState.getLinkedShaderStages()[shaderType];
}
private:
// These forward-declared tasks are used for multi-thread shader compiles.
class GetExecutableTask;
......
......@@ -1735,9 +1735,10 @@ void StateManager11::deinitialize()
mVertexDataManager.deinitialize();
mIndexDataManager.deinitialize();
mDriverConstantBufferVS.reset();
mDriverConstantBufferPS.reset();
mDriverConstantBufferCS.reset();
for (d3d11::Buffer &ShaderDriverConstantBuffer : mShaderDriverConstantBuffers)
{
ShaderDriverConstantBuffer.reset();
}
mPointSpriteVertexBuffer.reset();
mPointSpriteIndexBuffer.reset();
......@@ -2400,6 +2401,11 @@ gl::Error StateManager11::syncTextures(const gl::Context *context)
{
ANGLE_TRY(applyTextures(context, gl::ShaderType::Vertex));
ANGLE_TRY(applyTextures(context, gl::ShaderType::Fragment));
if (mProgramD3D->hasShaderStage(gl::ShaderType::Geometry))
{
ANGLE_TRY(applyTextures(context, gl::ShaderType::Geometry));
}
return gl::NoError();
}
......@@ -2985,50 +2991,66 @@ gl::Error StateManager11::generateSwizzles(const gl::Context *context)
return gl::NoError();
}
gl::Error StateManager11::applyUniforms()
gl::Error StateManager11::applyUniformsForShader(gl::ShaderType shaderType)
{
UniformStorage11 *vertexUniformStorage =
GetAs<UniformStorage11>(mProgramD3D->getShaderUniformStorage(gl::ShaderType::Vertex));
UniformStorage11 *fragmentUniformStorage =
GetAs<UniformStorage11>(mProgramD3D->getShaderUniformStorage(gl::ShaderType::Fragment));
ASSERT(vertexUniformStorage);
ASSERT(fragmentUniformStorage);
UniformStorage11 *shaderUniformStorage =
GetAs<UniformStorage11>(mProgramD3D->getShaderUniformStorage(shaderType));
ASSERT(shaderUniformStorage);
ID3D11DeviceContext *deviceContext = mRenderer->getDeviceContext();
const d3d11::Buffer *vertexConstantBuffer = nullptr;
ANGLE_TRY(vertexUniformStorage->getConstantBuffer(mRenderer, &vertexConstantBuffer));
const d3d11::Buffer *pixelConstantBuffer = nullptr;
ANGLE_TRY(fragmentUniformStorage->getConstantBuffer(mRenderer, &pixelConstantBuffer));
const d3d11::Buffer *shaderConstantBuffer = nullptr;
ANGLE_TRY(shaderUniformStorage->getConstantBuffer(mRenderer, &shaderConstantBuffer));
if (vertexUniformStorage->size() > 0 &&
mProgramD3D->areShaderUniformsDirty(gl::ShaderType::Vertex))
if (shaderUniformStorage->size() > 0 && mProgramD3D->areShaderUniformsDirty(shaderType))
{
UpdateUniformBuffer(deviceContext, vertexUniformStorage, vertexConstantBuffer);
}
if (fragmentUniformStorage->size() > 0 &&
mProgramD3D->areShaderUniformsDirty(gl::ShaderType::Fragment))
{
UpdateUniformBuffer(deviceContext, fragmentUniformStorage, pixelConstantBuffer);
UpdateUniformBuffer(deviceContext, shaderUniformStorage, shaderConstantBuffer);
}
unsigned int slot = d3d11::RESERVED_CONSTANT_BUFFER_SLOT_DEFAULT_UNIFORM_BLOCK;
if (mCurrentConstantBufferVS[slot] != vertexConstantBuffer->getSerial())
switch (shaderType)
{
deviceContext->VSSetConstantBuffers(slot, 1, vertexConstantBuffer->getPointer());
mCurrentConstantBufferVS[slot] = vertexConstantBuffer->getSerial();
mCurrentConstantBufferVSOffset[slot] = 0;
mCurrentConstantBufferVSSize[slot] = 0;
case gl::ShaderType::Vertex:
if (mCurrentConstantBufferVS[slot] != shaderConstantBuffer->getSerial())
{
deviceContext->VSSetConstantBuffers(slot, 1, shaderConstantBuffer->getPointer());
mCurrentConstantBufferVS[slot] = shaderConstantBuffer->getSerial();
mCurrentConstantBufferVSOffset[slot] = 0;
mCurrentConstantBufferVSSize[slot] = 0;
}
break;
case gl::ShaderType::Fragment:
if (mCurrentConstantBufferPS[slot] != shaderConstantBuffer->getSerial())
{
deviceContext->PSSetConstantBuffers(slot, 1, shaderConstantBuffer->getPointer());
mCurrentConstantBufferPS[slot] = shaderConstantBuffer->getSerial();
mCurrentConstantBufferPSOffset[slot] = 0;
mCurrentConstantBufferPSSize[slot] = 0;
}
break;
// TODO(jiawei.shao@intel.com): apply geometry shader uniforms
case gl::ShaderType::Geometry:
UNIMPLEMENTED();
break;
default:
UNREACHABLE();
break;
}
if (mCurrentConstantBufferPS[slot] != pixelConstantBuffer->getSerial())
return gl::NoError();
}
gl::Error StateManager11::applyUniforms()
{
ANGLE_TRY(applyUniformsForShader(gl::ShaderType::Vertex));
ANGLE_TRY(applyUniformsForShader(gl::ShaderType::Fragment));
if (mProgramD3D->hasShaderStage(gl::ShaderType::Geometry))
{
deviceContext->PSSetConstantBuffers(slot, 1, pixelConstantBuffer->getPointer());
mCurrentConstantBufferPS[slot] = pixelConstantBuffer->getSerial();
mCurrentConstantBufferPSOffset[slot] = 0;
mCurrentConstantBufferPSSize[slot] = 0;
ANGLE_TRY(applyUniformsForShader(gl::ShaderType::Geometry));
}
mProgramD3D->markUniformsClean();
......@@ -3036,52 +3058,74 @@ gl::Error StateManager11::applyUniforms()
return gl::NoError();
}
gl::Error StateManager11::applyDriverUniforms()
gl::Error StateManager11::applyDriverUniformsForShader(gl::ShaderType shaderType)
{
ID3D11DeviceContext *deviceContext = mRenderer->getDeviceContext();
if (!mDriverConstantBufferVS.valid())
d3d11::Buffer &shaderDriverConstantBuffer = mShaderDriverConstantBuffers[shaderType];
if (!shaderDriverConstantBuffer.valid())
{
size_t requiredSize = mShaderConstants.getRequiredBufferSize(gl::ShaderType::Vertex);
size_t requiredSize = mShaderConstants.getRequiredBufferSize(shaderType);
D3D11_BUFFER_DESC constantBufferDescription = {0};
d3d11::InitConstantBufferDesc(&constantBufferDescription, requiredSize);
ANGLE_TRY(mRenderer->allocateResource(constantBufferDescription, &mDriverConstantBufferVS));
ANGLE_TRY(
mRenderer->allocateResource(constantBufferDescription, &shaderDriverConstantBuffer));
ID3D11Buffer *driverVSConstants = mDriverConstantBufferVS.get();
deviceContext->VSSetConstantBuffers(d3d11::RESERVED_CONSTANT_BUFFER_SLOT_DRIVER, 1,
&driverVSConstants);
}
ID3D11Buffer *driverConstants = shaderDriverConstantBuffer.get();
switch (shaderType)
{
case gl::ShaderType::Vertex:
deviceContext->VSSetConstantBuffers(d3d11::RESERVED_CONSTANT_BUFFER_SLOT_DRIVER, 1,
&driverConstants);
break;
if (!mDriverConstantBufferPS.valid())
{
size_t requiredSize = mShaderConstants.getRequiredBufferSize(gl::ShaderType::Fragment);
case gl::ShaderType::Fragment:
deviceContext->PSSetConstantBuffers(d3d11::RESERVED_CONSTANT_BUFFER_SLOT_DRIVER, 1,
&driverConstants);
break;
D3D11_BUFFER_DESC constantBufferDescription = {0};
d3d11::InitConstantBufferDesc(&constantBufferDescription, requiredSize);
ANGLE_TRY(mRenderer->allocateResource(constantBufferDescription, &mDriverConstantBufferPS));
case gl::ShaderType::Geometry:
deviceContext->GSSetConstantBuffers(d3d11::RESERVED_CONSTANT_BUFFER_SLOT_DRIVER, 1,
&driverConstants);
break;
ID3D11Buffer *driverVSConstants = mDriverConstantBufferPS.get();
deviceContext->PSSetConstantBuffers(d3d11::RESERVED_CONSTANT_BUFFER_SLOT_DRIVER, 1,
&driverVSConstants);
default:
UNREACHABLE();
return gl::NoError();
}
}
// Sampler metadata and driver constants need to coexist in the same constant buffer to conserve
// constant buffer slots. We update both in the constant buffer if needed.
ANGLE_TRY(mShaderConstants.updateBuffer(mRenderer, gl::ShaderType::Vertex, *mProgramD3D,
mDriverConstantBufferVS));
ANGLE_TRY(mShaderConstants.updateBuffer(mRenderer, gl::ShaderType::Fragment, *mProgramD3D,
mDriverConstantBufferPS));
// Sampler metadata and driver constants need to coexist in the same constant buffer to
// conserve constant buffer slots. We update both in the constant buffer if needed.
ANGLE_TRY(mShaderConstants.updateBuffer(mRenderer, shaderType, *mProgramD3D,
shaderDriverConstantBuffer));
return gl::NoError();
}
gl::Error StateManager11::applyDriverUniforms()
{
ID3D11DeviceContext *deviceContext = mRenderer->getDeviceContext();
ANGLE_TRY(applyDriverUniformsForShader(gl::ShaderType::Vertex));
ANGLE_TRY(applyDriverUniformsForShader(gl::ShaderType::Fragment));
if (mProgramD3D->hasShaderStage(gl::ShaderType::Geometry))
{
ANGLE_TRY(applyDriverUniformsForShader(gl::ShaderType::Geometry));
}
// needed for the point sprite geometry shader
// GSSetConstantBuffers triggers device removal on 9_3, so we should only call it for ES3.
if (mRenderer->isES3Capable())
{
if (mCurrentGeometryConstantBuffer != mDriverConstantBufferPS.getSerial())
d3d11::Buffer &driverConstantBufferPS =
mShaderDriverConstantBuffers[gl::ShaderType::Fragment];
if (mCurrentGeometryConstantBuffer != driverConstantBufferPS.getSerial())
{
ASSERT(mDriverConstantBufferPS.valid());
deviceContext->GSSetConstantBuffers(0, 1, mDriverConstantBufferPS.getPointer());
mCurrentGeometryConstantBuffer = mDriverConstantBufferPS.getSerial();
ASSERT(driverConstantBufferPS.valid());
deviceContext->GSSetConstantBuffers(0, 1, driverConstantBufferPS.getPointer());
mCurrentGeometryConstantBuffer = driverConstantBufferPS.getSerial();
}
}
......@@ -3114,54 +3158,48 @@ gl::Error StateManager11::applyComputeUniforms(ProgramD3D *programD3D)
mCurrentComputeConstantBuffer = constantBuffer->getSerial();
}
if (!mDriverConstantBufferCS.valid())
if (!mShaderDriverConstantBuffers[gl::ShaderType::Compute].valid())
{
size_t requiredSize = mShaderConstants.getRequiredBufferSize(gl::ShaderType::Compute);
D3D11_BUFFER_DESC constantBufferDescription = {0};
d3d11::InitConstantBufferDesc(&constantBufferDescription, requiredSize);
ANGLE_TRY(mRenderer->allocateResource(constantBufferDescription, &mDriverConstantBufferCS));
ID3D11Buffer *buffer = mDriverConstantBufferCS.get();
ANGLE_TRY(mRenderer->allocateResource(
constantBufferDescription, &mShaderDriverConstantBuffers[gl::ShaderType::Compute]));
ID3D11Buffer *buffer = mShaderDriverConstantBuffers[gl::ShaderType::Compute].get();
deviceContext->CSSetConstantBuffers(d3d11::RESERVED_CONSTANT_BUFFER_SLOT_DRIVER, 1,
&buffer);
}
ANGLE_TRY(mShaderConstants.updateBuffer(mRenderer, gl::ShaderType::Compute, *programD3D,
mDriverConstantBufferCS));
mShaderDriverConstantBuffers[gl::ShaderType::Compute]));
return gl::NoError();
}
gl::Error StateManager11::syncUniformBuffers(const gl::Context *context)
gl::Error StateManager11::syncUniformBuffersForShader(const gl::Context *context,
gl::ShaderType shaderType)
{
gl::ShaderMap<unsigned int> shaderReservedUBOs = mRenderer->getReservedShaderUniformBuffers();
mProgramD3D->updateUniformBufferCache(context->getCaps(), shaderReservedUBOs);
const auto &vertexUniformBuffers =
mProgramD3D->getShaderUniformBufferCache(gl::ShaderType::Vertex);
const auto &fragmentUniformBuffers =
mProgramD3D->getShaderUniformBufferCache(gl::ShaderType::Fragment);
const auto &glState = context->getGLState();
ID3D11DeviceContext *deviceContext = mRenderer->getDeviceContext();
ID3D11DeviceContext1 *deviceContext1 = mRenderer->getDeviceContext1IfSupported();
mConstantBufferObserver.reset();
unsigned int reservedVertex = shaderReservedUBOs[gl::ShaderType::Vertex];
unsigned int reservedFragment = shaderReservedUBOs[gl::ShaderType::Fragment];
const auto &shaderUniformBuffers = mProgramD3D->getShaderUniformBufferCache(shaderType);
const unsigned int reservedUBOs = shaderReservedUBOs[shaderType];
for (size_t bufferIndex = 0; bufferIndex < vertexUniformBuffers.size(); bufferIndex++)
for (size_t bufferIndex = 0; bufferIndex < shaderUniformBuffers.size(); ++bufferIndex)
{
GLint binding = vertexUniformBuffers[bufferIndex];
const GLint binding = shaderUniformBuffers[bufferIndex];
if (binding == -1)
{
continue;
}
const auto &uniformBuffer = glState.getIndexedUniformBuffer(binding);
GLintptr uniformBufferOffset = uniformBuffer.getOffset();
GLsizeiptr uniformBufferSize = uniformBuffer.getSize();
const auto &uniformBuffer = glState.getIndexedUniformBuffer(binding);
const GLintptr uniformBufferOffset = uniformBuffer.getOffset();
const GLsizeiptr uniformBufferSize = uniformBuffer.getSize();
if (uniformBuffer.get() == nullptr)
{
......@@ -3176,89 +3214,93 @@ gl::Error StateManager11::syncUniformBuffers(const gl::Context *context)
ANGLE_TRY(bufferStorage->getConstantBufferRange(context, uniformBufferOffset,
uniformBufferSize, &constantBuffer,
&firstConstant, &numConstants));
ASSERT(constantBuffer);
if (mCurrentConstantBufferVS[bufferIndex] == constantBuffer->getSerial() &&
mCurrentConstantBufferVSOffset[bufferIndex] == uniformBufferOffset &&
mCurrentConstantBufferVSSize[bufferIndex] == uniformBufferSize)
const unsigned int appliedIndex = reservedUBOs + static_cast<unsigned int>(bufferIndex);
switch (shaderType)
{
continue;
}
unsigned int appliedIndex = reservedVertex + static_cast<unsigned int>(bufferIndex);
case gl::ShaderType::Vertex:
{
if (mCurrentConstantBufferVS[bufferIndex] == constantBuffer->getSerial() &&
mCurrentConstantBufferVSOffset[bufferIndex] == uniformBufferOffset &&
mCurrentConstantBufferVSSize[bufferIndex] == uniformBufferSize)
{
continue;
}
if (firstConstant != 0 && uniformBufferSize != 0)
{
ASSERT(numConstants != 0);
deviceContext1->VSSetConstantBuffers1(appliedIndex, 1, constantBuffer->getPointer(),
&firstConstant, &numConstants);
}
else
{
deviceContext->VSSetConstantBuffers(appliedIndex, 1, constantBuffer->getPointer());
}
if (firstConstant != 0 && uniformBufferSize != 0)
{
ASSERT(numConstants != 0);
deviceContext1->VSSetConstantBuffers1(appliedIndex, 1,
constantBuffer->getPointer(),
&firstConstant, &numConstants);
}
else
{
deviceContext->VSSetConstantBuffers(appliedIndex, 1,
constantBuffer->getPointer());
}
mCurrentConstantBufferVS[appliedIndex] = constantBuffer->getSerial();
mCurrentConstantBufferVSOffset[appliedIndex] = uniformBufferOffset;
mCurrentConstantBufferVSSize[appliedIndex] = uniformBufferSize;
mCurrentConstantBufferVS[appliedIndex] = constantBuffer->getSerial();
mCurrentConstantBufferVSOffset[appliedIndex] = uniformBufferOffset;
mCurrentConstantBufferVSSize[appliedIndex] = uniformBufferSize;
break;
}
mConstantBufferObserver.bindVS(bufferIndex, bufferStorage);
}
case gl::ShaderType::Fragment:
{
if (mCurrentConstantBufferPS[bufferIndex] == constantBuffer->getSerial() &&
mCurrentConstantBufferPSOffset[bufferIndex] == uniformBufferOffset &&
mCurrentConstantBufferPSSize[bufferIndex] == uniformBufferSize)
{
continue;
}
for (size_t bufferIndex = 0; bufferIndex < fragmentUniformBuffers.size(); bufferIndex++)
{
GLint binding = fragmentUniformBuffers[bufferIndex];
if (firstConstant != 0 && uniformBufferSize != 0)
{
deviceContext1->PSSetConstantBuffers1(appliedIndex, 1,
constantBuffer->getPointer(),
&firstConstant, &numConstants);
}
else
{
deviceContext->PSSetConstantBuffers(appliedIndex, 1,
constantBuffer->getPointer());
}
if (binding == -1)
{
continue;
}
mCurrentConstantBufferPS[appliedIndex] = constantBuffer->getSerial();
mCurrentConstantBufferPSOffset[appliedIndex] = uniformBufferOffset;
mCurrentConstantBufferPSSize[appliedIndex] = uniformBufferSize;
break;
}
const auto &uniformBuffer = glState.getIndexedUniformBuffer(binding);
GLintptr uniformBufferOffset = uniformBuffer.getOffset();
GLsizeiptr uniformBufferSize = uniformBuffer.getSize();
// TODO(jiawei.shao@intel.com): update geometry shader uniform buffers.
case gl::ShaderType::Geometry:
UNIMPLEMENTED();
break;
if (uniformBuffer.get() == nullptr)
{
continue;
default:
UNREACHABLE();
}
Buffer11 *bufferStorage = GetImplAs<Buffer11>(uniformBuffer.get());
const d3d11::Buffer *constantBuffer = nullptr;
UINT firstConstant = 0;
UINT numConstants = 0;
ANGLE_TRY(bufferStorage->getConstantBufferRange(context, uniformBufferOffset,
uniformBufferSize, &constantBuffer,
&firstConstant, &numConstants));
ASSERT(constantBuffer);
if (mCurrentConstantBufferPS[bufferIndex] == constantBuffer->getSerial() &&
mCurrentConstantBufferPSOffset[bufferIndex] == uniformBufferOffset &&
mCurrentConstantBufferPSSize[bufferIndex] == uniformBufferSize)
{
continue;
}
mConstantBufferObserver.bindToShader(shaderType, bufferIndex, bufferStorage);
}
unsigned int appliedIndex = reservedFragment + static_cast<unsigned int>(bufferIndex);
return gl::NoError();
}
if (firstConstant != 0 && uniformBufferSize != 0)
{
deviceContext1->PSSetConstantBuffers1(appliedIndex, 1, constantBuffer->getPointer(),
&firstConstant, &numConstants);
}
else
{
deviceContext->PSSetConstantBuffers(appliedIndex, 1, constantBuffer->getPointer());
}
gl::Error StateManager11::syncUniformBuffers(const gl::Context *context)
{
gl::ShaderMap<unsigned int> shaderReservedUBOs = mRenderer->getReservedShaderUniformBuffers();
mProgramD3D->updateUniformBufferCache(context->getCaps(), shaderReservedUBOs);
mCurrentConstantBufferPS[appliedIndex] = constantBuffer->getSerial();
mCurrentConstantBufferPSOffset[appliedIndex] = uniformBufferOffset;
mCurrentConstantBufferPSSize[appliedIndex] = uniformBufferSize;
mConstantBufferObserver.reset();
mConstantBufferObserver.bindPS(bufferIndex, bufferStorage);
ANGLE_TRY(syncUniformBuffersForShader(context, gl::ShaderType::Vertex));
ANGLE_TRY(syncUniformBuffersForShader(context, gl::ShaderType::Fragment));
if (mProgramD3D->hasShaderStage(gl::ShaderType::Geometry))
{
ANGLE_TRY(syncUniformBuffersForShader(context, gl::ShaderType::Geometry));
}
return gl::NoError();
......@@ -3301,18 +3343,19 @@ gl::Error StateManager11::syncTransformFeedbackBuffers(const gl::Context *contex
}
// ConstantBufferObserver implementation.
// TODO(jiawei.shao@intel.com): add constant buffer observers for geometry shader.
StateManager11::ConstantBufferObserver::ConstantBufferObserver()
{
for (size_t vsIndex = 0; vsIndex < gl::IMPLEMENTATION_MAX_VERTEX_SHADER_UNIFORM_BUFFERS;
++vsIndex)
{
mBindingsVS.emplace_back(this, vsIndex);
mShaderBindings[gl::ShaderType::Vertex].emplace_back(this, vsIndex);
}
for (size_t fsIndex = 0; fsIndex < gl::IMPLEMENTATION_MAX_FRAGMENT_SHADER_UNIFORM_BUFFERS;
++fsIndex)
{
mBindingsPS.emplace_back(this, fsIndex);
mShaderBindings[gl::ShaderType::Fragment].emplace_back(this, fsIndex);
}
}
......@@ -3332,30 +3375,24 @@ void StateManager11::ConstantBufferObserver::onSubjectStateChange(const gl::Cont
}
}
void StateManager11::ConstantBufferObserver::bindVS(size_t index, Buffer11 *buffer)
{
ASSERT(buffer);
ASSERT(index < mBindingsVS.size());
mBindingsVS[index].bind(buffer);
}
void StateManager11::ConstantBufferObserver::bindPS(size_t index, Buffer11 *buffer)
void StateManager11::ConstantBufferObserver::bindToShader(gl::ShaderType shaderType,
size_t index,
Buffer11 *buffer)
{
ASSERT(buffer);
ASSERT(index < mBindingsPS.size());
mBindingsPS[index].bind(buffer);
ASSERT(shaderType != gl::ShaderType::InvalidEnum);
ASSERT(index < mShaderBindings[shaderType].size());
mShaderBindings[shaderType][index].bind(buffer);
}
void StateManager11::ConstantBufferObserver::reset()
{
for (angle::ObserverBinding &vsBinding : mBindingsVS)
for (std::vector<angle::ObserverBinding> &shaderBindings : mShaderBindings)
{
vsBinding.bind(nullptr);
}
for (angle::ObserverBinding &psBinding : mBindingsPS)
{
psBinding.bind(nullptr);
for (angle::ObserverBinding &shaderBinding : shaderBindings)
{
shaderBinding.bind(nullptr);
}
}
}
......
......@@ -316,9 +316,12 @@ class StateManager11 final : angle::NonCopyable
gl::Error generateSwizzles(const gl::Context *context);
gl::Error applyDriverUniforms();
gl::Error applyDriverUniformsForShader(gl::ShaderType shaderType);
gl::Error applyUniforms();
gl::Error applyUniformsForShader(gl::ShaderType shaderType);
gl::Error syncUniformBuffers(const gl::Context *context);
gl::Error syncUniformBuffersForShader(const gl::Context *context, gl::ShaderType shaderType);
gl::Error syncTransformFeedbackBuffers(const gl::Context *context);
// These are currently only called internally.
......@@ -513,9 +516,7 @@ class StateManager11 final : angle::NonCopyable
bool mIsMultiviewEnabled;
// Driver Constants.
d3d11::Buffer mDriverConstantBufferVS;
d3d11::Buffer mDriverConstantBufferPS;
d3d11::Buffer mDriverConstantBufferCS;
gl::ShaderMap<d3d11::Buffer> mShaderDriverConstantBuffers;
ResourceSerial mCurrentComputeConstantBuffer;
ResourceSerial mCurrentGeometryConstantBuffer;
......@@ -550,12 +551,10 @@ class StateManager11 final : angle::NonCopyable
angle::SubjectMessage message) override;
void reset();
void bindVS(size_t index, Buffer11 *buffer);
void bindPS(size_t index, Buffer11 *buffer);
void bindToShader(gl::ShaderType shaderType, size_t index, Buffer11 *buffer);
private:
std::vector<angle::ObserverBinding> mBindingsVS;
std::vector<angle::ObserverBinding> mBindingsPS;
gl::ShaderMap<std::vector<angle::ObserverBinding>> mShaderBindings;
};
ConstantBufferObserver mConstantBufferObserver;
......
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