这篇教程C++ ANGLE_TRY函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中ANGLE_TRY函数的典型用法代码示例。如果您正苦于以下问题:C++ ANGLE_TRY函数的具体用法?C++ ANGLE_TRY怎么用?C++ ANGLE_TRY使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了ANGLE_TRY函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: ANGLE_TRYgl::Error Image11::map(const gl::Context *context, D3D11_MAP mapType, D3D11_MAPPED_SUBRESOURCE *map){ // We must recover from the TextureStorage if necessary, even for D3D11_MAP_WRITE. ANGLE_TRY(recoverFromAssociatedStorage(context)); const TextureHelper11 *stagingTexture = nullptr; unsigned int subresourceIndex = 0; ANGLE_TRY(getStagingTexture(&stagingTexture, &subresourceIndex)); ID3D11DeviceContext *deviceContext = mRenderer->getDeviceContext(); ASSERT(stagingTexture && stagingTexture->valid()); HRESULT result = deviceContext->Map(stagingTexture->get(), subresourceIndex, mapType, 0, map); if (FAILED(result)) { // this can fail if the device is removed (from TDR) if (d3d11::isDeviceLostError(result)) { mRenderer->notifyDeviceLost(); } return gl::OutOfMemory() << "Failed to map staging texture, " << gl::FmtHR(result); } mDirty = true; return gl::NoError();}
开发者ID:wolfviking0,项目名称:webcl-webkit,代码行数:28,
示例2: ANGLE_TRYegl::Error DisplayGLX::waitNative(const gl::Context *context, EGLint engine) const{ // eglWaitNative is used to notice the driver of changes in X11 for the current surface, such as // changes of the window size. We use this event to update the child window of WindowSurfaceGLX // to match its parent window's size. // Handling eglWaitNative this way helps the application control when resize happens. This is // important because drivers have a tendency to clobber the back buffer when the windows are // resized. See http://crbug.com/326995 egl::Surface *drawSurface = context->getCurrentDrawSurface(); egl::Surface *readSurface = context->getCurrentReadSurface(); if (drawSurface != nullptr) { SurfaceGLX *glxDrawSurface = GetImplAs<SurfaceGLX>(drawSurface); ANGLE_TRY(glxDrawSurface->checkForResize()); } if (readSurface != drawSurface && readSurface != nullptr) { SurfaceGLX *glxReadSurface = GetImplAs<SurfaceGLX>(readSurface); ANGLE_TRY(glxReadSurface->checkForResize()); } // We still need to forward the resizing of the child window to the driver. mGLX.waitX(); return egl::NoError();}
开发者ID:wolfviking0,项目名称:webcl-webkit,代码行数:26,
示例3: ValidateCreateStreamProducerD3DTextureNV12ANGLEError ValidateCreateStreamProducerD3DTextureNV12ANGLE(const Display *display, const Stream *stream, const AttributeMap &attribs){ ANGLE_TRY(ValidateDisplay(display)); const DisplayExtensions &displayExtensions = display->getExtensions(); if (!displayExtensions.streamProducerD3DTextureNV12) { return Error(EGL_BAD_ACCESS, "Stream producer extension not active"); } ANGLE_TRY(ValidateStream(display, stream)); if (!attribs.isEmpty()) { return Error(EGL_BAD_ATTRIBUTE, "Invalid attribute"); } if (stream->getState() != EGL_STREAM_STATE_CONNECTING_KHR) { return Error(EGL_BAD_STATE_KHR, "Stream not in connecting state"); } if (stream->getConsumerType() != Stream::ConsumerType::GLTextureYUV || stream->getPlaneCount() != 2) { return Error(EGL_BAD_MATCH, "Incompatible stream consumer type"); } return Error(EGL_SUCCESS);}
开发者ID:servo,项目名称:angle,代码行数:32,
示例4: GetVertexRangeInfoangle::Result GetVertexRangeInfo(const gl::Context *context, GLint firstVertex, GLsizei vertexOrIndexCount, gl::DrawElementsType indexTypeOrInvalid, const void *indices, GLint baseVertex, GLint *startVertexOut, size_t *vertexCountOut){ if (indexTypeOrInvalid != gl::DrawElementsType::InvalidEnum) { gl::IndexRange indexRange; ANGLE_TRY(context->getState().getVertexArray()->getIndexRange( context, indexTypeOrInvalid, vertexOrIndexCount, indices, &indexRange)); ANGLE_TRY(ComputeStartVertex(context->getImplementation(), indexRange, baseVertex, startVertexOut)); *vertexCountOut = indexRange.vertexCount(); } else { *startVertexOut = firstVertex; *vertexCountOut = vertexOrIndexCount; } return angle::Result::Continue;}
开发者ID:null77,项目名称:angle,代码行数:25,
示例5: UsePresentPathFastgl::Error Framebuffer11::clearImpl(const gl::Context *context, const ClearParameters &clearParams){ Clear11 *clearer = mRenderer->getClearer(); const gl::FramebufferAttachment *colorAttachment = mState.getFirstColorAttachment(); if (clearParams.scissorEnabled == true && colorAttachment != nullptr && UsePresentPathFast(mRenderer, colorAttachment)) { // If the current framebuffer is using the default colorbuffer, and present path fast is // active, and the scissor rect is enabled, then we should invert the scissor rect // vertically ClearParameters presentPathFastClearParams = clearParams; gl::Extents framebufferSize = colorAttachment->getSize(); presentPathFastClearParams.scissor.y = framebufferSize.height - presentPathFastClearParams.scissor.y - presentPathFastClearParams.scissor.height; ANGLE_TRY(clearer->clearFramebuffer(context, presentPathFastClearParams, mState)); } else { ANGLE_TRY(clearer->clearFramebuffer(context, clearParams, mState)); } ANGLE_TRY(markAttachmentsDirty(context)); return gl::NoError();}
开发者ID:jrmuizel,项目名称:angle,代码行数:27,
示例6: ANGLE_TRYangle::Result PixelTransfer11::buildShaderMap(const gl::Context *context){ d3d11::PixelShader bufferToTextureFloat; d3d11::PixelShader bufferToTextureInt; d3d11::PixelShader bufferToTextureUint; Context11 *context11 = GetImplAs<Context11>(context); ANGLE_TRY(mRenderer->allocateResource(context11, ShaderData(g_PS_BufferToTexture_4F), &bufferToTextureFloat)); ANGLE_TRY(mRenderer->allocateResource(context11, ShaderData(g_PS_BufferToTexture_4I), &bufferToTextureInt)); ANGLE_TRY(mRenderer->allocateResource(context11, ShaderData(g_PS_BufferToTexture_4UI), &bufferToTextureUint)); bufferToTextureFloat.setDebugName("BufferToTexture RGBA ps"); bufferToTextureInt.setDebugName("BufferToTexture RGBA-I ps"); bufferToTextureUint.setDebugName("BufferToTexture RGBA-UI ps"); mBufferToTexturePSMap[GL_FLOAT] = std::move(bufferToTextureFloat); mBufferToTexturePSMap[GL_INT] = std::move(bufferToTextureInt); mBufferToTexturePSMap[GL_UNSIGNED_INT] = std::move(bufferToTextureUint); return angle::Result::Continue();}
开发者ID:jasonLaster,项目名称:gecko-dev,代码行数:25,
示例7: ASSERT// staticangle::Result VertexDataManager::StoreStaticAttrib(const gl::Context *context, TranslatedAttribute *translated){ ASSERT(translated->attribute && translated->binding); const auto &attrib = *translated->attribute; const auto &binding = *translated->binding; gl::Buffer *buffer = binding.getBuffer().get(); ASSERT(buffer && attrib.enabled && !DirectStoragePossible(context, attrib, binding)); BufferD3D *bufferD3D = GetImplAs<BufferD3D>(buffer); // Compute source data pointer const uint8_t *sourceData = nullptr; const int offset = static_cast<int>(ComputeVertexAttributeOffset(attrib, binding)); ANGLE_TRY(bufferD3D->getData(context, &sourceData)); sourceData += offset; unsigned int streamOffset = 0; translated->storage = nullptr; ANGLE_TRY(bufferD3D->getFactory()->getVertexSpaceRequired(context, attrib, binding, 1, 0, &translated->stride)); auto *staticBuffer = bufferD3D->getStaticVertexBuffer(attrib, binding); ASSERT(staticBuffer); if (staticBuffer->empty()) { // Convert the entire buffer int totalCount = ElementsInBuffer(attrib, binding, static_cast<unsigned int>(bufferD3D->getSize())); int startIndex = offset / static_cast<int>(ComputeVertexAttributeStride(attrib, binding)); ANGLE_TRY(staticBuffer->storeStaticAttribute(context, attrib, binding, -startIndex, totalCount, 0, sourceData)); } unsigned int firstElementOffset = (static_cast<unsigned int>(offset) / static_cast<unsigned int>(ComputeVertexAttributeStride(attrib, binding))) * translated->stride; VertexBuffer *vertexBuffer = staticBuffer->getVertexBuffer(); CheckedNumeric<unsigned int> checkedOffset(streamOffset); checkedOffset += firstElementOffset; ANGLE_CHECK_HR_MATH(GetImplAs<ContextD3D>(context), checkedOffset.IsValid()); translated->vertexBuffer.set(vertexBuffer); translated->serial = vertexBuffer->getSerial(); translated->baseOffset = streamOffset + firstElementOffset; // Instanced vertices do not apply the 'start' offset translated->usesFirstVertexOffset = (binding.getDivisor() == 0); return angle::Result::Continue();}
开发者ID:jasonLaster,项目名称:gecko-dev,代码行数:60,
示例8: ASSERT// For each Direct3D sampler of either the pixel or vertex stage,// looks up the corresponding OpenGL texture image unit and texture type,// and sets the texture and its addressing/filtering state (or NULL when inactive).// Sampler mapping needs to be up-to-date on the program object before this is called.gl::Error RendererD3D::applyTextures(GLImplFactory *implFactory, const gl::ContextState &data, gl::SamplerType shaderType, const FramebufferTextureArray &framebufferTextures, size_t framebufferTextureCount){ ProgramD3D *programD3D = GetImplAs<ProgramD3D>(data.state->getProgram()); ASSERT(!programD3D->isSamplerMappingDirty()); unsigned int samplerRange = programD3D->getUsedSamplerRange(shaderType); for (unsigned int samplerIndex = 0; samplerIndex < samplerRange; samplerIndex++) { GLenum textureType = programD3D->getSamplerTextureType(shaderType, samplerIndex); GLint textureUnit = programD3D->getSamplerMapping(shaderType, samplerIndex, *data.caps); if (textureUnit != -1) { gl::Texture *texture = data.state->getSamplerTexture(textureUnit, textureType); ASSERT(texture); gl::Sampler *samplerObject = data.state->getSampler(textureUnit); const gl::SamplerState &samplerState = samplerObject ? samplerObject->getSamplerState() : texture->getSamplerState(); // TODO: std::binary_search may become unavailable using older versions of GCC if (texture->getTextureState().isSamplerComplete(samplerState, data) && !std::binary_search(framebufferTextures.begin(), framebufferTextures.begin() + framebufferTextureCount, texture)) { ANGLE_TRY(setSamplerState(shaderType, samplerIndex, texture, samplerState)); ANGLE_TRY(setTexture(shaderType, samplerIndex, texture)); } else { // Texture is not sampler complete or it is in use by the framebuffer. Bind the incomplete texture. gl::Texture *incompleteTexture = getIncompleteTexture(implFactory, textureType); ANGLE_TRY(setSamplerState(shaderType, samplerIndex, incompleteTexture, incompleteTexture->getSamplerState())); ANGLE_TRY(setTexture(shaderType, samplerIndex, incompleteTexture)); } } else { // No texture bound to this slot even though it is used by the shader, bind a NULL texture ANGLE_TRY(setTexture(shaderType, samplerIndex, nullptr)); } } // Set all the remaining textures to NULL size_t samplerCount = (shaderType == gl::SAMPLER_PIXEL) ? data.caps->maxTextureImageUnits : data.caps->maxVertexTextureImageUnits; clearTextures(shaderType, samplerRange, samplerCount); return gl::NoError();}
开发者ID:bats20082008,项目名称:angle,代码行数:61,
示例9: ANGLE_TRYError Renderbuffer::onDestroy(const Context *context){ ANGLE_TRY(orphanImages(context)); if (mImplementation) { ANGLE_TRY(mImplementation->onDestroy(context)); } return NoError();}
开发者ID:jrmuizel,项目名称:angle,代码行数:11,
示例10: getBoundFramebufferTexturesgl::Error RendererD3D::applyTextures(GLImplFactory *implFactory, const gl::ContextState &data){ FramebufferTextureArray framebufferTextures; size_t framebufferSerialCount = getBoundFramebufferTextures(data, &framebufferTextures); ANGLE_TRY(applyTextures(implFactory, data, gl::SAMPLER_VERTEX, framebufferTextures, framebufferSerialCount)); ANGLE_TRY(applyTextures(implFactory, data, gl::SAMPLER_PIXEL, framebufferTextures, framebufferSerialCount)); return gl::NoError();}
开发者ID:bats20082008,项目名称:angle,代码行数:11,
示例11: ValidateStreamPostD3DTextureNV12ANGLEError ValidateStreamPostD3DTextureNV12ANGLE(const Display *display, const Stream *stream, void *texture, const AttributeMap &attribs){ ANGLE_TRY(ValidateDisplay(display)); const DisplayExtensions &displayExtensions = display->getExtensions(); if (!displayExtensions.streamProducerD3DTextureNV12) { return Error(EGL_BAD_ACCESS, "Stream producer extension not active"); } ANGLE_TRY(ValidateStream(display, stream)); for (auto &attributeIter : attribs) { EGLAttrib attribute = attributeIter.first; EGLAttrib value = attributeIter.second; switch (attribute) { case EGL_D3D_TEXTURE_SUBRESOURCE_ID_ANGLE: if (value < 0) { return Error(EGL_BAD_PARAMETER, "Invalid subresource index"); } break; default: return Error(EGL_BAD_ATTRIBUTE, "Invalid attribute"); } } if (stream->getState() != EGL_STREAM_STATE_EMPTY_KHR && stream->getState() != EGL_STREAM_STATE_NEW_FRAME_AVAILABLE_KHR && stream->getState() != EGL_STREAM_STATE_OLD_FRAME_AVAILABLE_KHR) { return Error(EGL_BAD_STATE_KHR, "Stream not fully configured"); } if (stream->getProducerType() != Stream::ProducerType::D3D11TextureNV12) { return Error(EGL_BAD_MATCH, "Incompatible stream producer"); } if (texture == nullptr) { return egl::Error(EGL_BAD_PARAMETER, "Texture is null"); } return stream->validateD3D11NV12Texture(texture);}
开发者ID:servo,项目名称:angle,代码行数:52,
示例12: resetgl::LinkResult ProgramVk::link(const gl::Context *glContext, const gl::ProgramLinkedResources &resources, gl::InfoLog &infoLog){ ContextVk *contextVk = vk::GetImpl(glContext); RendererVk *renderer = contextVk->getRenderer(); GlslangWrapper *glslangWrapper = renderer->getGlslangWrapper(); VkDevice device = renderer->getDevice(); reset(device); std::vector<uint32_t> vertexCode; std::vector<uint32_t> fragmentCode; bool linkSuccess = false; ANGLE_TRY_RESULT( glslangWrapper->linkProgram(glContext, mState, resources, &vertexCode, &fragmentCode), linkSuccess); if (!linkSuccess) { return false; } { VkShaderModuleCreateInfo vertexShaderInfo; vertexShaderInfo.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO; vertexShaderInfo.pNext = nullptr; vertexShaderInfo.flags = 0; vertexShaderInfo.codeSize = vertexCode.size() * sizeof(uint32_t); vertexShaderInfo.pCode = vertexCode.data(); ANGLE_TRY(mLinkedVertexModule.init(device, vertexShaderInfo)); } { VkShaderModuleCreateInfo fragmentShaderInfo; fragmentShaderInfo.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO; fragmentShaderInfo.pNext = nullptr; fragmentShaderInfo.flags = 0; fragmentShaderInfo.codeSize = fragmentCode.size() * sizeof(uint32_t); fragmentShaderInfo.pCode = fragmentCode.data(); ANGLE_TRY(mLinkedFragmentModule.init(device, fragmentShaderInfo)); } ANGLE_TRY(initPipelineLayout(contextVk)); ANGLE_TRY(initDescriptorSets(contextVk)); ANGLE_TRY(initDefaultUniformBlocks(glContext)); return true;}
开发者ID:wolfviking0,项目名称:webcl-webkit,代码行数:50,
示例13: ANGLE_TRYgl::Error Framebuffer11::markAttachmentsDirty() const{ for (const auto &colorAttachment : mState.getColorAttachments()) { if (colorAttachment.isAttached()) { ANGLE_TRY(MarkAttachmentsDirty(&colorAttachment)); } } ANGLE_TRY(MarkAttachmentsDirty(mState.getDepthAttachment())); ANGLE_TRY(MarkAttachmentsDirty(mState.getStencilAttachment())); return gl::NoError();}
开发者ID:Wafflespeanut,项目名称:gecko-dev,代码行数:15,
示例14: ANGLE_TRYgl::Error HLSLCompiler::disassembleBinary(ID3DBlob *shaderBinary, std::string *disassemblyOut){ ANGLE_TRY(ensureInitialized()); // Retrieve disassembly UINT flags = D3D_DISASM_ENABLE_DEFAULT_VALUE_PRINTS | D3D_DISASM_ENABLE_INSTRUCTION_NUMBERING; ID3DBlob *disassembly = nullptr; pD3DDisassemble disassembleFunc = reinterpret_cast<pD3DDisassemble>(mD3DDisassembleFunc); LPCVOID buffer = shaderBinary->GetBufferPointer(); SIZE_T bufSize = shaderBinary->GetBufferSize(); HRESULT result = disassembleFunc(buffer, bufSize, flags, "", &disassembly); if (SUCCEEDED(result)) { *disassemblyOut = std::string(reinterpret_cast<const char*>(disassembly->GetBufferPointer())); } else { *disassemblyOut = ""; } SafeRelease(disassembly); return gl::NoError();}
开发者ID:Wafflespeanut,项目名称:gecko-dev,代码行数:25,
示例15: ANGLE_TRYangle::Result ContextGL::drawRangeElements(const gl::Context *context, gl::PrimitiveMode mode, GLuint start, GLuint end, GLsizei count, gl::DrawElementsType type, const void *indices){ const gl::Program *program = context->getState().getProgram(); const bool usesMultiview = program->usesMultiview(); const GLsizei instanceCount = usesMultiview ? program->getNumViews() : 0; const void *drawIndexPointer = nullptr; ANGLE_TRY( setDrawElementsState(context, count, type, indices, instanceCount, &drawIndexPointer)); if (!usesMultiview) { getFunctions()->drawRangeElements(ToGLenum(mode), start, end, count, ToGLenum(type), drawIndexPointer); } else { getFunctions()->drawElementsInstanced(ToGLenum(mode), count, ToGLenum(type), drawIndexPointer, instanceCount); } return angle::Result::Continue;}
开发者ID:google,项目名称:angle,代码行数:27,
示例16: ASSERTError FramebufferAttachment::initializeContents(const Context *context){ ASSERT(mResource); ANGLE_TRY(mResource->initializeContents(context, mTarget.textureIndex())); setInitState(InitState::Initialized); return NoError();}
开发者ID:jrmuizel,项目名称:angle,代码行数:7,
示例17: ANGLE_TRYgl::Error VertexBuffer11::storeVertexAttributes(const gl::VertexAttribute &attrib, GLenum currentValueType, GLint start, GLsizei count, GLsizei instances, unsigned int offset, const uint8_t *sourceData){ if (!mBuffer) { return gl::Error(GL_OUT_OF_MEMORY, "Internal vertex buffer is not initialized."); } int inputStride = static_cast<int>(ComputeVertexAttributeStride(attrib)); // This will map the resource if it isn't already mapped. ANGLE_TRY(mapResource()); uint8_t *output = mMappedResourceData + offset; const uint8_t *input = sourceData; if (instances == 0 || attrib.divisor == 0) { input += inputStride * start; } gl::VertexFormatType vertexFormatType = gl::GetVertexFormatType(attrib, currentValueType); const D3D_FEATURE_LEVEL featureLevel = mRenderer->getRenderer11DeviceCaps().featureLevel; const d3d11::VertexFormat &vertexFormatInfo = d3d11::GetVertexFormatInfo(vertexFormatType, featureLevel); ASSERT(vertexFormatInfo.copyFunction != NULL); vertexFormatInfo.copyFunction(input, inputStride, count, output); return gl::NoError();}
开发者ID:eocanha,项目名称:webkit,代码行数:35,
示例18: ASSERTegl::Error DisplayD3D::initialize(egl::Display *display){ ASSERT(mRenderer == nullptr && display != nullptr); mDisplay = display; ANGLE_TRY(CreateRendererD3D(display, &mRenderer)); return egl::Error(EGL_SUCCESS);}
开发者ID:Wafflespeanut,项目名称:gecko-dev,代码行数:7,
示例19: ANGLE_TRYError Surface::initialize(const Display *display){ ANGLE_TRY(mImplementation->initialize(display)); // Initialized here since impl is nullptr in the constructor. // Must happen after implementation initialize for Android. mSwapBehavior = mImplementation->getSwapBehavior(); if (mBuftype == EGL_IOSURFACE_ANGLE) { GLenum internalFormat = static_cast<GLenum>(mState.attributes.get(EGL_TEXTURE_INTERNAL_FORMAT_ANGLE)); GLenum type = static_cast<GLenum>(mState.attributes.get(EGL_TEXTURE_TYPE_ANGLE)); mColorFormat = gl::Format(internalFormat, type); } if (mBuftype == EGL_D3D_TEXTURE_ANGLE) { const angle::Format *colorFormat = mImplementation->getD3DTextureColorFormat(); ASSERT(colorFormat != nullptr); GLenum internalFormat = colorFormat->fboImplementationInternalFormat; mColorFormat = gl::Format(internalFormat, colorFormat->componentType); mGLColorspace = EGL_GL_COLORSPACE_LINEAR; if (mColorFormat.info->colorEncoding == GL_SRGB) { mGLColorspace = EGL_GL_COLORSPACE_SRGB; } } return NoError();}
开发者ID:jasonLaster,项目名称:gecko-dev,代码行数:30,
示例20: ANGLE_TRYANGLE_INLINE angle::Result ContextGL::setDrawArraysState(const gl::Context *context, GLint first, GLsizei count, GLsizei instanceCount){ if (context->getStateCache().hasAnyActiveClientAttrib()) { const gl::State &glState = context->getState(); const gl::Program *program = glState.getProgram(); const gl::VertexArray *vao = glState.getVertexArray(); const VertexArrayGL *vaoGL = GetImplAs<VertexArrayGL>(vao); ANGLE_TRY(vaoGL->syncClientSideData(context, program->getActiveAttribLocationsMask(), first, count, instanceCount)); } if (context->getExtensions().webglCompatibility) { const gl::State &glState = context->getState(); FramebufferGL *framebufferGL = GetImplAs<FramebufferGL>(glState.getDrawFramebuffer()); framebufferGL->maskOutInactiveOutputDrawBuffers(context); } return angle::Result::Continue;}
开发者ID:null77,项目名称:angle,代码行数:25,
示例21: ANGLE_TRYError Surface::destroyImpl(const Display *display){ if (mState.defaultFramebuffer) { mState.defaultFramebuffer->destroyDefault(display); } if (mImplementation) { mImplementation->destroy(display); } if (mTexture.get()) { if (mImplementation) { ANGLE_TRY(mImplementation->releaseTexImage(EGL_BACK_BUFFER)); } auto glErr = mTexture->releaseTexImageFromSurface(display->getProxyContext()); if (glErr.isError()) { return Error(EGL_BAD_SURFACE); } mTexture.set(nullptr, nullptr); } if (mState.defaultFramebuffer) { mState.defaultFramebuffer->onDestroy(display->getProxyContext()); } SafeDelete(mState.defaultFramebuffer); SafeDelete(mImplementation); delete this; return NoError();}
开发者ID:luke-chang,项目名称:gecko-1,代码行数:35,
示例22: ASSERTvk::Error ProgramVk::updateUniforms(ContextVk *contextVk){ if (!mDefaultUniformBlocks[VertexShader].uniformsDirty && !mDefaultUniformBlocks[FragmentShader].uniformsDirty) { return vk::NoError(); } ASSERT(mDescriptorSetOffset == 0); VkDevice device = contextVk->getDevice(); // Update buffer memory by immediate mapping. This immediate update only works once. // TODO(jmadill): Handle inserting updates into the command stream, or use dynamic buffers. for (auto &uniformBlock : mDefaultUniformBlocks) { if (uniformBlock.uniformsDirty) { ANGLE_TRY(SyncDefaultUniformBlock(device, &uniformBlock.storage.memory, uniformBlock.uniformData)); uniformBlock.uniformsDirty = false; } } return vk::NoError();}
开发者ID:wolfviking0,项目名称:webcl-webkit,代码行数:26,
示例23: ASSERTegl::Error DisplayD3D::restoreLostDevice(const egl::Display *display){ // Release surface resources to make the Reset() succeed for (egl::Surface *surface : mState.surfaceSet) { ASSERT(!surface->getBoundTexture()); SurfaceD3D *surfaceD3D = GetImplAs<SurfaceD3D>(surface); surfaceD3D->releaseSwapChain(); } if (!mRenderer->resetDevice()) { return egl::EglBadAlloc(); } // Restore any surfaces that may have been lost for (const egl::Surface *surface : mState.surfaceSet) { SurfaceD3D *surfaceD3D = GetImplAs<SurfaceD3D>(surface); ANGLE_TRY(surfaceD3D->resetSwapChain(display)); } return egl::NoError();}
开发者ID:null77,项目名称:angle,代码行数:25,
示例24: ANGLE_TRYgl::Error RendererGL::drawRangeElements(const gl::Context *context, GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices){ const gl::Program *program = context->getGLState().getProgram(); const bool usesMultiview = program->usesMultiview(); const GLsizei instanceCount = usesMultiview ? program->getNumViews() : 0; const void *drawIndexPointer = nullptr; ANGLE_TRY(mStateManager->setDrawElementsState(context, count, type, indices, instanceCount, &drawIndexPointer)); if (!mSkipDrawCalls) { if (!usesMultiview) { mFunctions->drawRangeElements(mode, start, end, count, type, drawIndexPointer); } else { mFunctions->drawElementsInstanced(mode, count, type, drawIndexPointer, instanceCount); } } return gl::NoError();}
开发者ID:luke-chang,项目名称:gecko-1,代码行数:28,
示例25: ASSERTegl::Error DisplayVk::initialize(egl::Display *display){ ASSERT(mRenderer != nullptr && display != nullptr); angle::Result result = mRenderer->initialize(this, display, getWSIName()); ANGLE_TRY(angle::ToEGL(result, this, EGL_NOT_INITIALIZED)); return egl::NoError();}
开发者ID:null77,项目名称:angle,代码行数:7,
注:本文中的ANGLE_TRY函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ ANIMATE函数代码示例 C++ ANDROID_ALARM_GET_TIME函数代码示例 |