Commit caafd890 by Jamie Madill Committed by Commit Bot

D3D11: Don't store device in InputLayoutCache.

We will need the Renderer pointer for resource allocation, so pass it around instead of storing the device and context. BUG=angleproject:2034 Change-Id: Iaf271913f88c5402895aa81de310aa22fcd72cc4 Reviewed-on: https://chromium-review.googlesource.com/509930Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 341a36cc
...@@ -12,12 +12,13 @@ ...@@ -12,12 +12,13 @@
#include "common/bitset_utils.h" #include "common/bitset_utils.h"
#include "common/utilities.h" #include "common/utilities.h"
#include "libANGLE/Program.h" #include "libANGLE/Program.h"
#include "libANGLE/VertexAttribute.h"
#include "libANGLE/VertexArray.h" #include "libANGLE/VertexArray.h"
#include "libANGLE/VertexAttribute.h"
#include "libANGLE/renderer/d3d/IndexDataManager.h" #include "libANGLE/renderer/d3d/IndexDataManager.h"
#include "libANGLE/renderer/d3d/ProgramD3D.h" #include "libANGLE/renderer/d3d/ProgramD3D.h"
#include "libANGLE/renderer/d3d/VertexDataManager.h" #include "libANGLE/renderer/d3d/VertexDataManager.h"
#include "libANGLE/renderer/d3d/d3d11/Buffer11.h" #include "libANGLE/renderer/d3d/d3d11/Buffer11.h"
#include "libANGLE/renderer/d3d/d3d11/Renderer11.h"
#include "libANGLE/renderer/d3d/d3d11/ShaderExecutable11.h" #include "libANGLE/renderer/d3d/d3d11/ShaderExecutable11.h"
#include "libANGLE/renderer/d3d/d3d11/VertexBuffer11.h" #include "libANGLE/renderer/d3d/d3d11/VertexBuffer11.h"
#include "libANGLE/renderer/d3d/d3d11/formatutils11.h" #include "libANGLE/renderer/d3d/d3d11/formatutils11.h"
...@@ -171,12 +172,10 @@ bool InputLayoutCache::PackedAttributeLayout::operator<(const PackedAttributeLay ...@@ -171,12 +172,10 @@ bool InputLayoutCache::PackedAttributeLayout::operator<(const PackedAttributeLay
} }
InputLayoutCache::InputLayoutCache() InputLayoutCache::InputLayoutCache()
: mCurrentIL(nullptr), : mCurrentIL(angle::DirtyPointer),
mPointSpriteVertexBuffer(nullptr), mPointSpriteVertexBuffer(nullptr),
mPointSpriteIndexBuffer(nullptr), mPointSpriteIndexBuffer(nullptr),
mCacheSize(kDefaultCacheSize), mCacheSize(kDefaultCacheSize)
mDevice(nullptr),
mDeviceContext(nullptr)
{ {
mCurrentBuffers.fill(nullptr); mCurrentBuffers.fill(nullptr);
mCurrentVertexStrides.fill(std::numeric_limits<UINT>::max()); mCurrentVertexStrides.fill(std::numeric_limits<UINT>::max());
...@@ -189,12 +188,9 @@ InputLayoutCache::~InputLayoutCache() ...@@ -189,12 +188,9 @@ InputLayoutCache::~InputLayoutCache()
clear(); clear();
} }
void InputLayoutCache::initialize(ID3D11Device *device, ID3D11DeviceContext *context) void InputLayoutCache::initialize()
{ {
clear(); clear();
mDevice = device;
mDeviceContext = context;
mFeatureLevel = device->GetFeatureLevel();
} }
void InputLayoutCache::clear() void InputLayoutCache::clear()
...@@ -211,7 +207,7 @@ void InputLayoutCache::clear() ...@@ -211,7 +207,7 @@ void InputLayoutCache::clear()
void InputLayoutCache::markDirty() void InputLayoutCache::markDirty()
{ {
mCurrentIL = nullptr; mCurrentIL = angle::DirtyPointer;
for (unsigned int i = 0; i < gl::MAX_VERTEX_ATTRIBS; i++) for (unsigned int i = 0; i < gl::MAX_VERTEX_ATTRIBS; i++)
{ {
mCurrentBuffers[i] = nullptr; mCurrentBuffers[i] = nullptr;
...@@ -221,6 +217,7 @@ void InputLayoutCache::markDirty() ...@@ -221,6 +217,7 @@ void InputLayoutCache::markDirty()
} }
gl::Error InputLayoutCache::applyVertexBuffers( gl::Error InputLayoutCache::applyVertexBuffers(
Renderer11 *renderer,
const gl::State &state, const gl::State &state,
const std::vector<TranslatedAttribute> &vertexArrayAttribs, const std::vector<TranslatedAttribute> &vertexArrayAttribs,
const std::vector<TranslatedAttribute> &currentValueAttribs, const std::vector<TranslatedAttribute> &currentValueAttribs,
...@@ -229,7 +226,8 @@ gl::Error InputLayoutCache::applyVertexBuffers( ...@@ -229,7 +226,8 @@ gl::Error InputLayoutCache::applyVertexBuffers(
TranslatedIndexData *indexInfo, TranslatedIndexData *indexInfo,
GLsizei numIndicesPerInstance) GLsizei numIndicesPerInstance)
{ {
ASSERT(mDevice && mDeviceContext); ID3D11DeviceContext *deviceContext = renderer->getDeviceContext();
ID3D11Device *device = renderer->getDevice();
gl::Program *program = state.getProgram(); gl::Program *program = state.getProgram();
ProgramD3D *programD3D = GetImplAs<ProgramD3D>(program); ProgramD3D *programD3D = GetImplAs<ProgramD3D>(program);
...@@ -241,8 +239,10 @@ gl::Error InputLayoutCache::applyVertexBuffers( ...@@ -241,8 +239,10 @@ gl::Error InputLayoutCache::applyVertexBuffers(
SortAttributesByLayout(program, vertexArrayAttribs, currentValueAttribs, &sortedSemanticIndices, SortAttributesByLayout(program, vertexArrayAttribs, currentValueAttribs, &sortedSemanticIndices,
&mCurrentAttributes); &mCurrentAttributes);
auto featureLevel = renderer->getRenderer11DeviceCaps().featureLevel;
// If we are using FL 9_3, make sure the first attribute is not instanced // If we are using FL 9_3, make sure the first attribute is not instanced
if (mFeatureLevel <= D3D_FEATURE_LEVEL_9_3 && !mCurrentAttributes.empty()) if (featureLevel <= D3D_FEATURE_LEVEL_9_3 && !mCurrentAttributes.empty())
{ {
if (mCurrentAttributes[0]->divisor > 0) if (mCurrentAttributes[0]->divisor > 0)
{ {
...@@ -256,7 +256,8 @@ gl::Error InputLayoutCache::applyVertexBuffers( ...@@ -256,7 +256,8 @@ gl::Error InputLayoutCache::applyVertexBuffers(
} }
} }
ANGLE_TRY(updateInputLayout(state, mode, sortedSemanticIndices, numIndicesPerInstance)); ANGLE_TRY(
updateInputLayout(renderer, state, mode, sortedSemanticIndices, numIndicesPerInstance));
bool dirtyBuffers = false; bool dirtyBuffers = false;
size_t minDiff = gl::MAX_VERTEX_ATTRIBS; size_t minDiff = gl::MAX_VERTEX_ATTRIBS;
...@@ -339,7 +340,6 @@ gl::Error InputLayoutCache::applyVertexBuffers( ...@@ -339,7 +340,6 @@ gl::Error InputLayoutCache::applyVertexBuffers(
// handle missing vertex data and will TDR the system. // handle missing vertex data and will TDR the system.
if (programUsesInstancedPointSprites) if (programUsesInstancedPointSprites)
{ {
HRESULT result = S_OK;
const UINT pointSpriteVertexStride = sizeof(float) * 5; const UINT pointSpriteVertexStride = sizeof(float) * 5;
if (!mPointSpriteVertexBuffer) if (!mPointSpriteVertexBuffer)
...@@ -364,7 +364,8 @@ gl::Error InputLayoutCache::applyVertexBuffers( ...@@ -364,7 +364,8 @@ gl::Error InputLayoutCache::applyVertexBuffers(
vertexBufferDesc.MiscFlags = 0; vertexBufferDesc.MiscFlags = 0;
vertexBufferDesc.StructureByteStride = 0; vertexBufferDesc.StructureByteStride = 0;
result = mDevice->CreateBuffer(&vertexBufferDesc, &vertexBufferData, &mPointSpriteVertexBuffer); HRESULT result = device->CreateBuffer(&vertexBufferDesc, &vertexBufferData,
&mPointSpriteVertexBuffer);
if (FAILED(result)) if (FAILED(result))
{ {
return gl::Error(GL_OUT_OF_MEMORY, "Failed to create instanced pointsprite emulation vertex buffer, HRESULT: 0x%08x", result); return gl::Error(GL_OUT_OF_MEMORY, "Failed to create instanced pointsprite emulation vertex buffer, HRESULT: 0x%08x", result);
...@@ -399,7 +400,8 @@ gl::Error InputLayoutCache::applyVertexBuffers( ...@@ -399,7 +400,8 @@ gl::Error InputLayoutCache::applyVertexBuffers(
indexBufferDesc.MiscFlags = 0; indexBufferDesc.MiscFlags = 0;
indexBufferDesc.StructureByteStride = 0; indexBufferDesc.StructureByteStride = 0;
result = mDevice->CreateBuffer(&indexBufferDesc, &indexBufferData, &mPointSpriteIndexBuffer); HRESULT result =
device->CreateBuffer(&indexBufferDesc, &indexBufferData, &mPointSpriteIndexBuffer);
if (FAILED(result)) if (FAILED(result))
{ {
SafeRelease(mPointSpriteVertexBuffer); SafeRelease(mPointSpriteVertexBuffer);
...@@ -413,14 +415,14 @@ gl::Error InputLayoutCache::applyVertexBuffers( ...@@ -413,14 +415,14 @@ gl::Error InputLayoutCache::applyVertexBuffers(
// non-indexed rendering path in ANGLE (DrawArrays). This means that applyIndexBuffer() // non-indexed rendering path in ANGLE (DrawArrays). This means that applyIndexBuffer()
// on the renderer will not be called and setting this buffer here ensures that the // on the renderer will not be called and setting this buffer here ensures that the
// rendering path will contain the correct index buffers. // rendering path will contain the correct index buffers.
mDeviceContext->IASetIndexBuffer(mPointSpriteIndexBuffer, DXGI_FORMAT_R16_UINT, 0); deviceContext->IASetIndexBuffer(mPointSpriteIndexBuffer, DXGI_FORMAT_R16_UINT, 0);
} }
} }
if (dirtyBuffers) if (dirtyBuffers)
{ {
ASSERT(minDiff <= maxDiff && maxDiff < gl::MAX_VERTEX_ATTRIBS); ASSERT(minDiff <= maxDiff && maxDiff < gl::MAX_VERTEX_ATTRIBS);
mDeviceContext->IASetVertexBuffers( deviceContext->IASetVertexBuffers(
static_cast<UINT>(minDiff), static_cast<UINT>(maxDiff - minDiff + 1), static_cast<UINT>(minDiff), static_cast<UINT>(maxDiff - minDiff + 1),
&mCurrentBuffers[minDiff], &mCurrentVertexStrides[minDiff], &mCurrentBuffers[minDiff], &mCurrentVertexStrides[minDiff],
&mCurrentVertexOffsets[minDiff]); &mCurrentVertexOffsets[minDiff]);
...@@ -429,7 +431,8 @@ gl::Error InputLayoutCache::applyVertexBuffers( ...@@ -429,7 +431,8 @@ gl::Error InputLayoutCache::applyVertexBuffers(
return gl::NoError(); return gl::NoError();
} }
gl::Error InputLayoutCache::updateVertexOffsetsForPointSpritesEmulation(GLint startVertex, gl::Error InputLayoutCache::updateVertexOffsetsForPointSpritesEmulation(Renderer11 *renderer,
GLint startVertex,
GLsizei emulatedInstanceId) GLsizei emulatedInstanceId)
{ {
size_t reservedBuffers = GetReservedBufferCount(true); size_t reservedBuffers = GetReservedBufferCount(true);
...@@ -447,13 +450,15 @@ gl::Error InputLayoutCache::updateVertexOffsetsForPointSpritesEmulation(GLint st ...@@ -447,13 +450,15 @@ gl::Error InputLayoutCache::updateVertexOffsetsForPointSpritesEmulation(GLint st
} }
} }
mDeviceContext->IASetVertexBuffers(0, gl::MAX_VERTEX_ATTRIBS, mCurrentBuffers.data(), ID3D11DeviceContext *deviceContext = renderer->getDeviceContext();
mCurrentVertexStrides.data(), mCurrentVertexOffsets.data()); deviceContext->IASetVertexBuffers(0, gl::MAX_VERTEX_ATTRIBS, mCurrentBuffers.data(),
mCurrentVertexStrides.data(), mCurrentVertexOffsets.data());
return gl::NoError(); return gl::NoError();
} }
gl::Error InputLayoutCache::updateInputLayout(const gl::State &state, gl::Error InputLayoutCache::updateInputLayout(Renderer11 *renderer,
const gl::State &state,
GLenum mode, GLenum mode,
const AttribIndexArray &sortedSemanticIndices, const AttribIndexArray &sortedSemanticIndices,
GLsizei numIndicesPerInstance) GLsizei numIndicesPerInstance)
...@@ -513,8 +518,8 @@ gl::Error InputLayoutCache::updateInputLayout(const gl::State &state, ...@@ -513,8 +518,8 @@ gl::Error InputLayoutCache::updateInputLayout(const gl::State &state,
} }
else else
{ {
ANGLE_TRY(createInputLayout(sortedSemanticIndices, mode, program, numIndicesPerInstance, ANGLE_TRY(createInputLayout(renderer, sortedSemanticIndices, mode, program,
&inputLayout)); numIndicesPerInstance, &inputLayout));
if (mLayoutMap.size() >= mCacheSize) if (mLayoutMap.size() >= mCacheSize)
{ {
WARN() << "Overflowed the limit of " << mCacheSize WARN() << "Overflowed the limit of " << mCacheSize
...@@ -538,22 +543,25 @@ gl::Error InputLayoutCache::updateInputLayout(const gl::State &state, ...@@ -538,22 +543,25 @@ gl::Error InputLayoutCache::updateInputLayout(const gl::State &state,
} }
} }
if (inputLayout != mCurrentIL) if (reinterpret_cast<uintptr_t>(inputLayout) != mCurrentIL)
{ {
mDeviceContext->IASetInputLayout(inputLayout); ID3D11DeviceContext *deviceContext = renderer->getDeviceContext();
mCurrentIL = inputLayout; deviceContext->IASetInputLayout(inputLayout);
mCurrentIL = reinterpret_cast<uintptr_t>(inputLayout);
} }
return gl::NoError(); return gl::NoError();
} }
gl::Error InputLayoutCache::createInputLayout(const AttribIndexArray &sortedSemanticIndices, gl::Error InputLayoutCache::createInputLayout(Renderer11 *renderer,
const AttribIndexArray &sortedSemanticIndices,
GLenum mode, GLenum mode,
gl::Program *program, gl::Program *program,
GLsizei numIndicesPerInstance, GLsizei numIndicesPerInstance,
ID3D11InputLayout **inputLayoutOut) ID3D11InputLayout **inputLayoutOut)
{ {
ProgramD3D *programD3D = GetImplAs<ProgramD3D>(program); ProgramD3D *programD3D = GetImplAs<ProgramD3D>(program);
auto featureLevel = renderer->getRenderer11DeviceCaps().featureLevel;
bool programUsesInstancedPointSprites = bool programUsesInstancedPointSprites =
programD3D->usesPointSize() && programD3D->usesInstancedPointSpriteEmulation(); programD3D->usesPointSize() && programD3D->usesInstancedPointSpriteEmulation();
...@@ -571,7 +579,7 @@ gl::Error InputLayoutCache::createInputLayout(const AttribIndexArray &sortedSema ...@@ -571,7 +579,7 @@ gl::Error InputLayoutCache::createInputLayout(const AttribIndexArray &sortedSema
const auto &vertexFormatType = const auto &vertexFormatType =
gl::GetVertexFormatType(*attrib.attribute, attrib.currentValueType); gl::GetVertexFormatType(*attrib.attribute, attrib.currentValueType);
const auto &vertexFormatInfo = d3d11::GetVertexFormatInfo(vertexFormatType, mFeatureLevel); const auto &vertexFormatInfo = d3d11::GetVertexFormatInfo(vertexFormatType, featureLevel);
auto *inputElement = &inputElements[inputElementCount]; auto *inputElement = &inputElements[inputElementCount];
...@@ -640,15 +648,15 @@ gl::Error InputLayoutCache::createInputLayout(const AttribIndexArray &sortedSema ...@@ -640,15 +648,15 @@ gl::Error InputLayoutCache::createInputLayout(const AttribIndexArray &sortedSema
ShaderExecutableD3D *shader11 = GetAs<ShaderExecutable11>(shader); ShaderExecutableD3D *shader11 = GetAs<ShaderExecutable11>(shader);
ID3D11Device *device = renderer->getDevice();
HRESULT result = HRESULT result =
mDevice->CreateInputLayout(inputElements.data(), inputElementCount, shader11->getFunction(), device->CreateInputLayout(inputElements.data(), inputElementCount, shader11->getFunction(),
shader11->getLength(), inputLayoutOut); shader11->getLength(), inputLayoutOut);
if (FAILED(result)) if (FAILED(result))
{ {
return gl::Error(GL_OUT_OF_MEMORY, return gl::Error(GL_OUT_OF_MEMORY,
"Failed to create internal input layout, HRESULT: 0x%08x", result); "Failed to create internal input layout, HRESULT: 0x%08x", result);
} }
return gl::NoError(); return gl::NoError();
} }
......
...@@ -34,6 +34,7 @@ struct TranslatedAttribute; ...@@ -34,6 +34,7 @@ struct TranslatedAttribute;
struct TranslatedIndexData; struct TranslatedIndexData;
struct SourceIndexData; struct SourceIndexData;
class ProgramD3D; class ProgramD3D;
class Renderer11;
class InputLayoutCache : angle::NonCopyable class InputLayoutCache : angle::NonCopyable
{ {
...@@ -41,11 +42,12 @@ class InputLayoutCache : angle::NonCopyable ...@@ -41,11 +42,12 @@ class InputLayoutCache : angle::NonCopyable
InputLayoutCache(); InputLayoutCache();
virtual ~InputLayoutCache(); virtual ~InputLayoutCache();
void initialize(ID3D11Device *device, ID3D11DeviceContext *context); void initialize();
void clear(); void clear();
void markDirty(); void markDirty();
gl::Error applyVertexBuffers(const gl::State &state, gl::Error applyVertexBuffers(Renderer11 *renderer,
const gl::State &state,
const std::vector<TranslatedAttribute> &vertexArrayAttribs, const std::vector<TranslatedAttribute> &vertexArrayAttribs,
const std::vector<TranslatedAttribute> &currentValueAttribs, const std::vector<TranslatedAttribute> &currentValueAttribs,
GLenum mode, GLenum mode,
...@@ -53,7 +55,8 @@ class InputLayoutCache : angle::NonCopyable ...@@ -53,7 +55,8 @@ class InputLayoutCache : angle::NonCopyable
TranslatedIndexData *indexInfo, TranslatedIndexData *indexInfo,
GLsizei numIndicesPerInstance); GLsizei numIndicesPerInstance);
gl::Error updateVertexOffsetsForPointSpritesEmulation(GLint startVertex, gl::Error updateVertexOffsetsForPointSpritesEmulation(Renderer11 *renderer,
GLint startVertex,
GLsizei emulatedInstanceId); GLsizei emulatedInstanceId);
// Useful for testing // Useful for testing
...@@ -87,11 +90,13 @@ class InputLayoutCache : angle::NonCopyable ...@@ -87,11 +90,13 @@ class InputLayoutCache : angle::NonCopyable
uint32_t attributeData[gl::MAX_VERTEX_ATTRIBS]; uint32_t attributeData[gl::MAX_VERTEX_ATTRIBS];
}; };
gl::Error updateInputLayout(const gl::State &state, gl::Error updateInputLayout(Renderer11 *renderer,
const gl::State &state,
GLenum mode, GLenum mode,
const AttribIndexArray &sortedSemanticIndices, const AttribIndexArray &sortedSemanticIndices,
GLsizei numIndicesPerInstance); GLsizei numIndicesPerInstance);
gl::Error createInputLayout(const AttribIndexArray &sortedSemanticIndices, gl::Error createInputLayout(Renderer11 *renderer,
const AttribIndexArray &sortedSemanticIndices,
GLenum mode, GLenum mode,
gl::Program *program, gl::Program *program,
GLsizei numIndicesPerInstance, GLsizei numIndicesPerInstance,
...@@ -99,7 +104,7 @@ class InputLayoutCache : angle::NonCopyable ...@@ -99,7 +104,7 @@ class InputLayoutCache : angle::NonCopyable
std::map<PackedAttributeLayout, ID3D11InputLayout *> mLayoutMap; std::map<PackedAttributeLayout, ID3D11InputLayout *> mLayoutMap;
ID3D11InputLayout *mCurrentIL; uintptr_t mCurrentIL;
std::array<ID3D11Buffer *, gl::MAX_VERTEX_ATTRIBS> mCurrentBuffers; std::array<ID3D11Buffer *, gl::MAX_VERTEX_ATTRIBS> mCurrentBuffers;
std::array<UINT, gl::MAX_VERTEX_ATTRIBS> mCurrentVertexStrides; std::array<UINT, gl::MAX_VERTEX_ATTRIBS> mCurrentVertexStrides;
std::array<UINT, gl::MAX_VERTEX_ATTRIBS> mCurrentVertexOffsets; std::array<UINT, gl::MAX_VERTEX_ATTRIBS> mCurrentVertexOffsets;
...@@ -109,10 +114,6 @@ class InputLayoutCache : angle::NonCopyable ...@@ -109,10 +114,6 @@ class InputLayoutCache : angle::NonCopyable
ID3D11Buffer *mPointSpriteIndexBuffer; ID3D11Buffer *mPointSpriteIndexBuffer;
unsigned int mCacheSize; unsigned int mCacheSize;
ID3D11Device *mDevice;
ID3D11DeviceContext *mDeviceContext;
D3D_FEATURE_LEVEL mFeatureLevel;
}; };
} // namespace rx } // namespace rx
......
...@@ -796,7 +796,7 @@ void Renderer11::initializeDevice() ...@@ -796,7 +796,7 @@ void Renderer11::initializeDevice()
populateRenderer11DeviceCaps(); populateRenderer11DeviceCaps();
mStateCache.initialize(mDevice); mStateCache.initialize(mDevice);
mInputLayoutCache.initialize(mDevice, mDeviceContext); mInputLayoutCache.initialize();
ASSERT(!mVertexDataManager && !mIndexDataManager); ASSERT(!mVertexDataManager && !mIndexDataManager);
mVertexDataManager = new VertexDataManager(this); mVertexDataManager = new VertexDataManager(this);
...@@ -1811,8 +1811,9 @@ gl::Error Renderer11::applyVertexBuffer(const gl::State &state, ...@@ -1811,8 +1811,9 @@ gl::Error Renderer11::applyVertexBuffer(const gl::State &state,
} }
const auto &vertexArrayAttribs = vertexArray11->getTranslatedAttribs(); const auto &vertexArrayAttribs = vertexArray11->getTranslatedAttribs();
const auto &currentValueAttribs = mStateManager.getCurrentValueAttribs(); const auto &currentValueAttribs = mStateManager.getCurrentValueAttribs();
ANGLE_TRY(mInputLayoutCache.applyVertexBuffers(state, vertexArrayAttribs, currentValueAttribs, ANGLE_TRY(mInputLayoutCache.applyVertexBuffers(this, state, vertexArrayAttribs,
mode, first, indexInfo, numIndicesPerInstance)); currentValueAttribs, mode, first, indexInfo,
numIndicesPerInstance));
// InputLayoutCache::applyVertexBuffers calls through to the Bufer11 to get the native vertex // InputLayoutCache::applyVertexBuffers calls through to the Bufer11 to get the native vertex
// buffer (ID3D11Buffer *). Because we allocate these buffers lazily, this will trigger // buffer (ID3D11Buffer *). Because we allocate these buffers lazily, this will trigger
...@@ -1994,8 +1995,8 @@ gl::Error Renderer11::drawArraysImpl(const gl::ContextState &data, ...@@ -1994,8 +1995,8 @@ gl::Error Renderer11::drawArraysImpl(const gl::ContextState &data,
// offsets. // offsets.
for (GLsizei i = 0; i < instances; i++) for (GLsizei i = 0; i < instances; i++)
{ {
ANGLE_TRY( ANGLE_TRY(mInputLayoutCache.updateVertexOffsetsForPointSpritesEmulation(
mInputLayoutCache.updateVertexOffsetsForPointSpritesEmulation(startVertex, i)); this, startVertex, i));
mDeviceContext->DrawIndexedInstanced(6, count, 0, 0, 0); mDeviceContext->DrawIndexedInstanced(6, count, 0, 0, 0);
} }
} }
...@@ -2057,8 +2058,8 @@ gl::Error Renderer11::drawElementsImpl(const gl::ContextState &data, ...@@ -2057,8 +2058,8 @@ gl::Error Renderer11::drawElementsImpl(const gl::ContextState &data,
// offsets. // offsets.
for (GLsizei i = 0; i < instances; i++) for (GLsizei i = 0; i < instances; i++)
{ {
ANGLE_TRY( ANGLE_TRY(mInputLayoutCache.updateVertexOffsetsForPointSpritesEmulation(
mInputLayoutCache.updateVertexOffsetsForPointSpritesEmulation(startVertex, i)); this, startVertex, i));
mDeviceContext->DrawIndexedInstanced(6, elementsToRender, 0, 0, 0); mDeviceContext->DrawIndexedInstanced(6, elementsToRender, 0, 0, 0);
} }
} }
......
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