Commit c86c8b0c by Jamie Madill Committed by Commit Bot

D3D9: Use angle::Result error pattern.

Bug: angleproject:2752 Change-Id: Ica77969c6e4b8d61d491396a4fd56b0864e4803c Reviewed-on: https://chromium-review.googlesource.com/1163320 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org>
parent c93eeaab
......@@ -238,4 +238,15 @@ unsigned int GetBlendSampleMask(const gl::State &glState, int samples)
return mask;
}
GLenum DefaultGLErrorCode(HRESULT hr)
{
switch (hr)
{
case D3DERR_OUTOFVIDEOMEMORY:
case E_OUTOFMEMORY:
return GL_OUT_OF_MEMORY;
default:
return GL_INVALID_OPERATION;
}
}
} // namespace rx
......@@ -427,7 +427,7 @@ class RendererD3D : public BufferFactoryD3D
unsigned int GetBlendSampleMask(const gl::State &glState, int samples);
bool InstancedPointSpritesActive(ProgramD3D *programD3D, gl::PrimitiveMode mode);
GLenum DefaultGLErrorCode(HRESULT hr);
} // namespace rx
#endif // LIBANGLE_RENDERER_D3D_RENDERERD3D_H_
......@@ -105,17 +105,6 @@ gl::Error ReadbackIndirectBuffer(const gl::Context *context,
*bufferPtrOut = reinterpret_cast<const IndirectBufferT *>(bufferData + offset);
return gl::NoError();
}
GLenum DefaultGLErrorCode(HRESULT hr)
{
switch (hr)
{
case E_OUTOFMEMORY:
return GL_OUT_OF_MEMORY;
default:
return GL_INVALID_OPERATION;
}
}
} // anonymous namespace
Context11::Context11(const gl::ContextState &state, Renderer11 *renderer)
......
......@@ -24,6 +24,7 @@ struct Offset;
namespace rx
{
class Context9;
class Renderer9;
class TextureStorage;
......@@ -33,41 +34,41 @@ class Blit9 : angle::NonCopyable
explicit Blit9(Renderer9 *renderer);
~Blit9();
gl::Error initialize();
angle::Result initialize(Context9 *context9);
// Copy from source surface to dest surface.
// sourceRect, xoffset, yoffset are in D3D coordinates (0,0 in upper-left)
gl::Error copy2D(const gl::Context *context,
const gl::Framebuffer *framebuffer,
const RECT &sourceRect,
GLenum destFormat,
const gl::Offset &destOffset,
TextureStorage *storage,
GLint level);
gl::Error copyCube(const gl::Context *context,
const gl::Framebuffer *framebuffer,
const RECT &sourceRect,
GLenum destFormat,
const gl::Offset &destOffset,
TextureStorage *storage,
gl::TextureTarget target,
GLint level);
gl::Error copyTexture(const gl::Context *context,
const gl::Texture *source,
GLint sourceLevel,
const RECT &sourceRect,
GLenum destFormat,
const gl::Offset &destOffset,
TextureStorage *storage,
gl::TextureTarget destTarget,
GLint destLevel,
bool flipY,
bool premultiplyAlpha,
bool unmultiplyAlpha);
angle::Result copy2D(const gl::Context *context,
const gl::Framebuffer *framebuffer,
const RECT &sourceRect,
GLenum destFormat,
const gl::Offset &destOffset,
TextureStorage *storage,
GLint level);
angle::Result copyCube(const gl::Context *context,
const gl::Framebuffer *framebuffer,
const RECT &sourceRect,
GLenum destFormat,
const gl::Offset &destOffset,
TextureStorage *storage,
gl::TextureTarget target,
GLint level);
angle::Result copyTexture(const gl::Context *context,
const gl::Texture *source,
GLint sourceLevel,
const RECT &sourceRect,
GLenum destFormat,
const gl::Offset &destOffset,
TextureStorage *storage,
gl::TextureTarget destTarget,
GLint destLevel,
bool flipY,
bool premultiplyAlpha,
bool unmultiplyAlpha);
// 2x2 box filter sample from source to dest.
// Requires that source is RGB(A) and dest has the same format as source.
gl::Error boxFilter(IDirect3DSurface9 *source, IDirect3DSurface9 *dest);
angle::Result boxFilter(Context9 *context9, IDirect3DSurface9 *source, IDirect3DSurface9 *dest);
private:
Renderer9 *mRenderer;
......@@ -80,32 +81,36 @@ class Blit9 : angle::NonCopyable
// sourceRect, xoffset, yoffset are in D3D coordinates (0,0 in upper-left)
// source is interpreted as RGBA and destFormat specifies the desired result format. For
// example, if destFormat = GL_RGB, the alpha channel will be forced to 0.
gl::Error formatConvert(IDirect3DBaseTexture9 *source,
const RECT &sourceRect,
const gl::Extents &sourceSize,
GLenum destFormat,
const gl::Offset &destOffset,
IDirect3DSurface9 *dest,
bool flipY,
bool premultiplyAlpha,
bool unmultiplyAlpha);
gl::Error setFormatConvertShaders(GLenum destFormat,
bool flipY,
bool premultiplyAlpha,
bool unmultiplyAlpha);
gl::Error copy(IDirect3DSurface9 *source,
IDirect3DBaseTexture9 *sourceTexture,
const RECT &sourceRect,
GLenum destFormat,
const gl::Offset &destOffset,
IDirect3DSurface9 *dest,
bool flipY,
bool premultiplyAlpha,
bool unmultiplyAlpha);
gl::Error copySurfaceToTexture(IDirect3DSurface9 *surface,
const RECT &sourceRect,
IDirect3DBaseTexture9 **outTexture);
angle::Result formatConvert(Context9 *context9,
IDirect3DBaseTexture9 *source,
const RECT &sourceRect,
const gl::Extents &sourceSize,
GLenum destFormat,
const gl::Offset &destOffset,
IDirect3DSurface9 *dest,
bool flipY,
bool premultiplyAlpha,
bool unmultiplyAlpha);
angle::Result setFormatConvertShaders(Context9 *context9,
GLenum destFormat,
bool flipY,
bool premultiplyAlpha,
bool unmultiplyAlpha);
angle::Result copy(Context9 *context9,
IDirect3DSurface9 *source,
IDirect3DBaseTexture9 *sourceTexture,
const RECT &sourceRect,
GLenum destFormat,
const gl::Offset &destOffset,
IDirect3DSurface9 *dest,
bool flipY,
bool premultiplyAlpha,
bool unmultiplyAlpha);
angle::Result copySurfaceToTexture(Context9 *context9,
IDirect3DSurface9 *surface,
const RECT &sourceRect,
angle::ComPtr<IDirect3DBaseTexture9> *outTexture);
void setViewportAndShaderConstants(const RECT &sourceRect,
const gl::Extents &sourceSize,
const RECT &destRect,
......@@ -132,15 +137,17 @@ class Blit9 : angle::NonCopyable
IUnknown *mCompiledShaders[SHADER_COUNT];
template <class D3DShaderType>
gl::Error setShader(ShaderId source,
const char *profile,
gl::Error (Renderer9::*createShader)(const DWORD *,
size_t length,
D3DShaderType **outShader),
HRESULT (WINAPI IDirect3DDevice9::*setShader)(D3DShaderType *));
gl::Error setVertexShader(ShaderId shader);
gl::Error setPixelShader(ShaderId shader);
angle::Result setShader(Context9 *,
ShaderId source,
const char *profile,
angle::Result (Renderer9::*createShader)(Context9 *context9,
const DWORD *,
size_t length,
D3DShaderType **outShader),
HRESULT (WINAPI IDirect3DDevice9::*setShader)(D3DShaderType *));
angle::Result setVertexShader(Context9 *context9, ShaderId shader);
angle::Result setPixelShader(Context9 *context9, ShaderId shader);
void render();
void saveState();
......
......@@ -138,12 +138,12 @@ std::vector<PathImpl *> Context9::createPaths(GLsizei)
gl::Error Context9::flush(const gl::Context *context)
{
return mRenderer->flush();
return mRenderer->flush(context);
}
gl::Error Context9::finish(const gl::Context *context)
{
return mRenderer->finish();
return mRenderer->finish(context);
}
gl::Error Context9::drawArrays(const gl::Context *context,
......@@ -334,4 +334,26 @@ gl::Error Context9::getIncompleteTexture(const gl::Context *context,
{
return mIncompleteTextures.getIncompleteTexture(context, type, nullptr, textureOut);
}
void Context9::handleError(HRESULT hr,
const char *message,
const char *file,
const char *function,
unsigned int line)
{
ASSERT(FAILED(hr));
if (d3d9::isDeviceLostError(hr))
{
mRenderer->notifyDeviceLost();
}
GLenum glErrorCode = DefaultGLErrorCode(hr);
std::stringstream errorStream;
errorStream << "Internal D3D9 error: " << gl::FmtHR(hr) << ", in " << file << ", " << function
<< ":" << line << ". " << message;
mErrors->handleError(gl::Error(glErrorCode, glErrorCode, errorStream.str()));
}
} // namespace rx
......@@ -151,6 +151,12 @@ class Context9 : public ContextImpl
gl::TextureType type,
gl::Texture **textureOut);
void handleError(HRESULT hr,
const char *message,
const char *file,
const char *function,
unsigned int line);
private:
Renderer9 *mRenderer;
IncompleteTextureSet mIncompleteTextures;
......
......@@ -7,8 +7,11 @@
// Fence9.cpp: Defines the rx::FenceNV9 class.
#include "libANGLE/renderer/d3d/d3d9/Fence9.h"
#include "libANGLE/renderer/d3d/d3d9/renderer9_utils.h"
#include "libANGLE/Context.h"
#include "libANGLE/renderer/d3d/d3d9/Context9.h"
#include "libANGLE/renderer/d3d/d3d9/Renderer9.h"
#include "libANGLE/renderer/d3d/d3d9/renderer9_utils.h"
namespace rx
{
......@@ -26,11 +29,7 @@ gl::Error FenceNV9::set(const gl::Context *context, GLenum condition)
{
if (!mQuery)
{
gl::Error error = mRenderer->allocateEventQuery(&mQuery);
if (error.isError())
{
return error;
}
ANGLE_TRY(mRenderer->allocateEventQuery(context, &mQuery));
}
HRESULT result = mQuery->Issue(D3DISSUE_END);
......@@ -46,7 +45,7 @@ gl::Error FenceNV9::set(const gl::Context *context, GLenum condition)
gl::Error FenceNV9::test(const gl::Context *context, GLboolean *outFinished)
{
return testHelper(true, outFinished);
return testHelper(GetImplAs<Context9>(context), true, outFinished);
}
gl::Error FenceNV9::finish(const gl::Context *context)
......@@ -54,38 +53,25 @@ gl::Error FenceNV9::finish(const gl::Context *context)
GLboolean finished = GL_FALSE;
while (finished != GL_TRUE)
{
gl::Error error = testHelper(true, &finished);
if (error.isError())
{
return error;
}
ANGLE_TRY(testHelper(GetImplAs<Context9>(context), true, &finished));
Sleep(0);
}
return gl::NoError();
}
gl::Error FenceNV9::testHelper(bool flushCommandBuffer, GLboolean *outFinished)
angle::Result FenceNV9::testHelper(Context9 *context9,
bool flushCommandBuffer,
GLboolean *outFinished)
{
ASSERT(mQuery);
DWORD getDataFlags = (flushCommandBuffer ? D3DGETDATA_FLUSH : 0);
HRESULT result = mQuery->GetData(nullptr, 0, getDataFlags);
if (d3d9::isDeviceLostError(result))
{
mRenderer->notifyDeviceLost();
return gl::OutOfMemory() << "Device was lost while querying result of an event query.";
}
else if (FAILED(result))
{
return gl::OutOfMemory() << "Failed to get query data, " << gl::FmtHR(result);
}
ANGLE_TRY_HR(context9, result, "Failed to get query data");
ASSERT(result == S_OK || result == S_FALSE);
*outFinished = ((result == S_OK) ? GL_TRUE : GL_FALSE);
return gl::NoError();
return angle::Result::Continue();
}
} // namespace rx
......@@ -14,6 +14,7 @@
namespace rx
{
class Context9;
class Renderer9;
class FenceNV9 : public FenceNVImpl
......@@ -27,7 +28,7 @@ class FenceNV9 : public FenceNVImpl
gl::Error finish(const gl::Context *context) override;
private:
gl::Error testHelper(bool flushCommandBuffer, GLboolean *outFinished);
angle::Result testHelper(Context9 *context9, bool flushCommandBuffer, GLboolean *outFinished);
Renderer9 *mRenderer;
IDirect3DQuery9 *mQuery;
......
......@@ -71,8 +71,9 @@ gl::Error Framebuffer9::clearImpl(const gl::Context *context, const ClearParamet
mRenderer->setScissorRectangle(glState.getScissor(), glState.isScissorTestEnabled());
return mRenderer->clear(context, clearParams, mRenderTargetCache.getColors()[0],
mRenderTargetCache.getDepthStencil());
mRenderer->clear(clearParams, mRenderTargetCache.getColors()[0],
mRenderTargetCache.getDepthStencil());
return gl::NoError();
}
gl::Error Framebuffer9::readPixelsImpl(const gl::Context *context,
......
......@@ -20,6 +20,7 @@ class Framebuffer;
namespace rx
{
class Context9;
class Renderer9;
class Image9 : public ImageD3D
......@@ -28,17 +29,21 @@ class Image9 : public ImageD3D
Image9(Renderer9 *renderer);
~Image9() override;
static gl::Error generateMipmap(Image9 *dest, Image9 *source);
static gl::Error generateMip(IDirect3DSurface9 *destSurface, IDirect3DSurface9 *sourceSurface);
static gl::Error copyLockableSurfaces(IDirect3DSurface9 *dest, IDirect3DSurface9 *source);
static gl::Error CopyImage(const gl::Context *context,
Image9 *dest,
Image9 *source,
const gl::Rectangle &sourceRect,
const gl::Offset &destOffset,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha);
static angle::Result GenerateMipmap(Context9 *context9, Image9 *dest, Image9 *source);
static angle::Result GenerateMip(Context9 *context9,
IDirect3DSurface9 *destSurface,
IDirect3DSurface9 *sourceSurface);
static angle::Result CopyLockableSurfaces(Context9 *context9,
IDirect3DSurface9 *dest,
IDirect3DSurface9 *source);
static angle::Result CopyImage(const gl::Context *context,
Image9 *dest,
Image9 *source,
const gl::Rectangle &sourceRect,
const gl::Offset &destOffset,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha);
bool redefine(gl::TextureType type,
GLenum internalformat,
......@@ -80,18 +85,19 @@ class Image9 : public ImageD3D
const gl::Framebuffer *source) override;
private:
gl::Error getSurface(IDirect3DSurface9 **outSurface);
angle::Result getSurface(Context9 *context9, IDirect3DSurface9 **outSurface);
gl::Error createSurface();
gl::Error setManagedSurface(IDirect3DSurface9 *surface);
gl::Error copyToSurface(IDirect3DSurface9 *dest, const gl::Box &area);
angle::Result createSurface(Context9 *context9);
angle::Result setManagedSurface(Context9 *context9, IDirect3DSurface9 *surface);
angle::Result copyToSurface(Context9 *context9, IDirect3DSurface9 *dest, const gl::Box &area);
gl::Error lock(D3DLOCKED_RECT *lockedRect, const RECT &rect);
angle::Result lock(Context9 *context9, D3DLOCKED_RECT *lockedRect, const RECT &rect);
void unlock();
gl::Error copyFromRTInternal(const gl::Offset &destOffset,
const gl::Rectangle &sourceArea,
RenderTargetD3D *source);
angle::Result copyFromRTInternal(Context9 *context9,
const gl::Offset &destOffset,
const gl::Rectangle &sourceArea,
RenderTargetD3D *source);
Renderer9 *mRenderer;
......
......@@ -13,6 +13,7 @@
#include "libANGLE/Error.h"
#include "common/debug.h"
#include "libANGLE/renderer/d3d/d3d9/Context9.h"
#include <cstddef>
#include <unordered_map>
......@@ -37,7 +38,10 @@ class ShaderCache : angle::NonCopyable
mDevice = device;
}
gl::Error create(const DWORD *function, size_t length, ShaderObject **outShaderObject)
angle::Result create(Context9 *context9,
const DWORD *function,
size_t length,
ShaderObject **outShaderObject)
{
std::string key(reinterpret_cast<const char*>(function), length);
typename Map::iterator it = mMap.find(key);
......@@ -45,15 +49,12 @@ class ShaderCache : angle::NonCopyable
{
it->second->AddRef();
*outShaderObject = it->second;
return gl::NoError();
return angle::Result::Continue();
}
ShaderObject *shader;
HRESULT result = createShader(function, &shader);
if (FAILED(result))
{
return gl::OutOfMemory() << "Failed to create shader, " << gl::FmtHR(result);
}
ANGLE_TRY_HR(context9, result, "Failed to create shader");
// Random eviction policy.
if (mMap.size() >= kMaxMapSize)
......@@ -66,7 +67,7 @@ class ShaderCache : angle::NonCopyable
mMap[key] = shader;
*outShaderObject = shader;
return gl::NoError();
return angle::Result::Continue();
}
void clear()
......
......@@ -377,8 +377,7 @@ void StateManager9::syncState(const gl::State &state, const gl::State::DirtyBits
}
}
gl::Error StateManager9::setBlendDepthRasterStates(const gl::State &glState,
unsigned int sampleMask)
void StateManager9::setBlendDepthRasterStates(const gl::State &glState, unsigned int sampleMask)
{
const gl::Framebuffer *framebuffer = glState.getDrawFramebuffer();
......@@ -470,8 +469,6 @@ gl::Error StateManager9::setBlendDepthRasterStates(const gl::State &glState,
{
setSampleMask(sampleMask);
}
return gl::NoError();
}
void StateManager9::setViewportState(const gl::Rectangle &viewport,
......
......@@ -43,7 +43,7 @@ class StateManager9 final : angle::NonCopyable
void syncState(const gl::State &state, const gl::State::DirtyBits &dirtyBits);
gl::Error setBlendDepthRasterStates(const gl::State &glState, unsigned int sampleMask);
void setBlendDepthRasterStates(const gl::State &glState, unsigned int sampleMask);
void setScissorState(const gl::Rectangle &scissor, bool enabled);
void setViewportState(const gl::Rectangle &viewport,
float zNear,
......
......@@ -32,13 +32,13 @@ class TextureStorage9 : public TextureStorage
D3DPOOL getPool() const;
DWORD getUsage() const;
virtual gl::Error getSurfaceLevel(const gl::Context *context,
gl::TextureTarget target,
int level,
bool dirty,
IDirect3DSurface9 **outSurface) = 0;
virtual gl::Error getBaseTexture(const gl::Context *context,
IDirect3DBaseTexture9 **outTexture) = 0;
virtual angle::Result getSurfaceLevel(const gl::Context *context,
gl::TextureTarget target,
int level,
bool dirty,
IDirect3DSurface9 **outSurface) = 0;
virtual angle::Result getBaseTexture(const gl::Context *context,
IDirect3DBaseTexture9 **outTexture) = 0;
int getTopLevel() const override;
bool isRenderTarget() const override;
......@@ -78,16 +78,16 @@ class TextureStorage9_2D : public TextureStorage9
TextureStorage9_2D(Renderer9 *renderer, GLenum internalformat, bool renderTarget, GLsizei width, GLsizei height, int levels);
~TextureStorage9_2D() override;
gl::Error getSurfaceLevel(const gl::Context *context,
gl::TextureTarget target,
int level,
bool dirty,
IDirect3DSurface9 **outSurface) override;
angle::Result getSurfaceLevel(const gl::Context *context,
gl::TextureTarget target,
int level,
bool dirty,
IDirect3DSurface9 **outSurface) override;
gl::Error getRenderTarget(const gl::Context *context,
const gl::ImageIndex &index,
RenderTargetD3D **outRT) override;
gl::Error getBaseTexture(const gl::Context *context,
IDirect3DBaseTexture9 **outTexture) override;
angle::Result getBaseTexture(const gl::Context *context,
IDirect3DBaseTexture9 **outTexture) override;
gl::Error generateMipmap(const gl::Context *context,
const gl::ImageIndex &sourceIndex,
const gl::ImageIndex &destIndex) override;
......@@ -104,16 +104,16 @@ class TextureStorage9_EGLImage final : public TextureStorage9
TextureStorage9_EGLImage(Renderer9 *renderer, EGLImageD3D *image, RenderTarget9 *renderTarget9);
~TextureStorage9_EGLImage() override;
gl::Error getSurfaceLevel(const gl::Context *context,
gl::TextureTarget target,
int level,
bool dirty,
IDirect3DSurface9 **outSurface) override;
angle::Result getSurfaceLevel(const gl::Context *context,
gl::TextureTarget target,
int level,
bool dirty,
IDirect3DSurface9 **outSurface) override;
gl::Error getRenderTarget(const gl::Context *context,
const gl::ImageIndex &index,
RenderTargetD3D **outRT) override;
gl::Error getBaseTexture(const gl::Context *context,
IDirect3DBaseTexture9 **outTexture) override;
angle::Result getBaseTexture(const gl::Context *context,
IDirect3DBaseTexture9 **outTexture) override;
gl::Error generateMipmap(const gl::Context *context,
const gl::ImageIndex &sourceIndex,
const gl::ImageIndex &destIndex) override;
......@@ -129,16 +129,16 @@ class TextureStorage9_Cube : public TextureStorage9
TextureStorage9_Cube(Renderer9 *renderer, GLenum internalformat, bool renderTarget, int size, int levels, bool hintLevelZeroOnly);
~TextureStorage9_Cube() override;
gl::Error getSurfaceLevel(const gl::Context *context,
gl::TextureTarget target,
int level,
bool dirty,
IDirect3DSurface9 **outSurface) override;
angle::Result getSurfaceLevel(const gl::Context *context,
gl::TextureTarget target,
int level,
bool dirty,
IDirect3DSurface9 **outSurface) override;
gl::Error getRenderTarget(const gl::Context *context,
const gl::ImageIndex &index,
RenderTargetD3D **outRT) override;
gl::Error getBaseTexture(const gl::Context *context,
IDirect3DBaseTexture9 **outTexture) override;
angle::Result getBaseTexture(const gl::Context *context,
IDirect3DBaseTexture9 **outTexture) override;
gl::Error generateMipmap(const gl::Context *context,
const gl::ImageIndex &sourceIndex,
const gl::ImageIndex &destIndex) override;
......
......@@ -8,9 +8,11 @@
#include "libANGLE/renderer/d3d/d3d9/VertexDeclarationCache.h"
#include "libANGLE/Context.h"
#include "libANGLE/VertexAttribute.h"
#include "libANGLE/formatutils.h"
#include "libANGLE/renderer/d3d/ProgramD3D.h"
#include "libANGLE/renderer/d3d/d3d9/Context9.h"
#include "libANGLE/renderer/d3d/d3d9/VertexBuffer9.h"
#include "libANGLE/renderer/d3d/d3d9/formatutils9.h"
......@@ -42,7 +44,8 @@ VertexDeclarationCache::~VertexDeclarationCache()
}
}
gl::Error VertexDeclarationCache::applyDeclaration(
angle::Result VertexDeclarationCache::applyDeclaration(
const gl::Context *context,
IDirect3DDevice9 *device,
const std::vector<TranslatedAttribute> &attributes,
gl::Program *program,
......@@ -152,7 +155,7 @@ gl::Error VertexDeclarationCache::applyDeclaration(
VertexBuffer9 *vertexBuffer = GetAs<VertexBuffer9>(attributes[i].vertexBuffer.get());
unsigned int offset = 0;
ANGLE_TRY(attributes[i].computeOffset(start, &offset));
ANGLE_TRY_HANDLE(context, attributes[i].computeOffset(start, &offset));
if (mAppliedVBs[stream].serial != attributes[i].serial ||
mAppliedVBs[stream].stride != attributes[i].stride ||
......@@ -207,7 +210,7 @@ gl::Error VertexDeclarationCache::applyDeclaration(
mLastSetVDecl = entry->vertexDeclaration;
}
return gl::NoError();
return angle::Result::Continue();
}
}
......@@ -230,17 +233,14 @@ gl::Error VertexDeclarationCache::applyDeclaration(
memcpy(lastCache->cachedElements, elements, (element - elements) * sizeof(D3DVERTEXELEMENT9));
HRESULT result = device->CreateVertexDeclaration(elements, &lastCache->vertexDeclaration);
if (FAILED(result))
{
return gl::OutOfMemory() << "Failed to create internal vertex declaration, "
<< gl::FmtHR(result);
}
ANGLE_TRY_HR(GetImplAs<Context9>(context), result,
"Failed to create internal vertex declaration");
device->SetVertexDeclaration(lastCache->vertexDeclaration);
mLastSetVDecl = lastCache->vertexDeclaration;
lastCache->lruCount = ++mMaxLru;
return gl::NoError();
return angle::Result::Continue();
}
void VertexDeclarationCache::markStateDirty()
......
......@@ -20,19 +20,19 @@ class Program;
namespace rx
{
class VertexDeclarationCache
{
public:
VertexDeclarationCache();
~VertexDeclarationCache();
gl::Error applyDeclaration(IDirect3DDevice9 *device,
const std::vector<TranslatedAttribute> &attributes,
gl::Program *program,
GLint start,
GLsizei instances,
GLsizei *repeatDraw);
angle::Result applyDeclaration(const gl::Context *context,
IDirect3DDevice9 *device,
const std::vector<TranslatedAttribute> &attributes,
gl::Program *program,
GLint start,
GLsizei instances,
GLsizei *repeatDraw);
void markStateDirty();
......
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