当前位置: 首页>>代码示例>>C++>>正文


C++ SCOPED_SERIALISE_CONTEXT函数代码示例

本文整理汇总了C++中SCOPED_SERIALISE_CONTEXT函数的典型用法代码示例。如果您正苦于以下问题:C++ SCOPED_SERIALISE_CONTEXT函数的具体用法?C++ SCOPED_SERIALISE_CONTEXT怎么用?C++ SCOPED_SERIALISE_CONTEXT使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了SCOPED_SERIALISE_CONTEXT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetResourceManager

void WrappedOpenGL::glLinkProgram(GLuint program)
{
	m_Real.glLinkProgram(program);
	
	if(m_State >= WRITING)
	{
		GLResourceRecord *record = GetResourceManager()->GetResourceRecord(ProgramRes(GetCtx(), program));
		RDCASSERT(record);
		{
			SCOPED_SERIALISE_CONTEXT(LINKPROGRAM);
			Serialise_glLinkProgram(program);

			record->AddChunk(scope.Get());
		}
	}
}
开发者ID:debaetsd,项目名称:renderdoc,代码行数:16,代码来源:gl_shader_funcs.cpp

示例2: SCOPED_SERIALISE_CONTEXT

void WrappedOpenGL::glNamedStringARB(GLenum type, GLint namelen, const GLchar *name,
                                     GLint stringlen, const GLchar *str)
{
  m_Real.glNamedStringARB(type, namelen, name, stringlen, str);

  if(m_State >= WRITING)
  {
    SCOPED_SERIALISE_CONTEXT(NAMEDSTRING);
    Serialise_glNamedStringARB(type, namelen, name, stringlen, str);

    // if a program repeatedly created/destroyed named strings this will fill up with useless
    // strings,
    // but chances are that won't be the case - a few will be created at init time and that's it
    m_DeviceRecord->AddChunk(scope.Get());
  }
}
开发者ID:JasonWinston,项目名称:renderdoc,代码行数:16,代码来源:gl_shader_funcs.cpp

示例3: RDCASSERT

void WrappedOpenGL::glTexStorage1D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width)
{
	m_Real.glTexStorage1D(target, levels, internalformat, width);
	
	if(m_State >= WRITING)
	{
		GLResourceRecord *record = m_TextureRecord[m_TextureUnit];
		RDCASSERT(record);

		SCOPED_SERIALISE_CONTEXT(TEXSTORAGE1D);
		Serialise_glTextureStorage1DEXT(GetResourceManager()->GetCurrentResource(record->GetResourceID()).name,
																		target, levels, internalformat, width);

		record->AddChunk(scope.Get());
	}
}
开发者ID:FeuernD,项目名称:renderdoc,代码行数:16,代码来源:gl_texture_funcs.cpp

示例4: GetResourceManager

void WrappedOpenGL::glBindFragDataLocation(GLuint program, GLuint color, const GLchar *name)
{
  m_Real.glBindFragDataLocation(program, color, name);

  if(m_State >= WRITING)
  {
    GLResourceRecord *record = GetResourceManager()->GetResourceRecord(ProgramRes(GetCtx(), program));
    RDCASSERT(record);
    {
      SCOPED_SERIALISE_CONTEXT(BINDFRAGDATA_LOCATION);
      Serialise_glBindFragDataLocation(program, color, name);

      record->AddChunk(scope.Get());
    }
  }
}
开发者ID:JasonWinston,项目名称:renderdoc,代码行数:16,代码来源:gl_shader_funcs.cpp

示例5: RDCASSERT

void WrappedOpenGL::glTexBufferRange(GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size)
{
	m_Real.glTexBufferRange(target, internalformat, buffer, offset, size);
		
	if(m_State >= WRITING)
	{
		GLResourceRecord *record = m_TextureRecord[m_TextureUnit];
		RDCASSERT(record);

		SCOPED_SERIALISE_CONTEXT(TEXBUFFER_RANGE);
		Serialise_glTextureBufferRangeEXT(GetResourceManager()->GetCurrentResource(record->GetResourceID()).name,
																		  target, internalformat, buffer, offset, size);

		record->AddChunk(scope.Get());
	}
}
开发者ID:Waferix,项目名称:renderdoc,代码行数:16,代码来源:gl_texture_funcs.cpp

示例6: SCOPED_SERIALISE_CONTEXT

void WrappedOpenGL::glBindSamplers(GLuint first, GLsizei count, const GLuint *samplers)
{
  m_Real.glBindSamplers(first, count, samplers);

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(BIND_SAMPLERS);
    Serialise_glBindSamplers(first, count, samplers);

    m_ContextRecord->AddChunk(scope.Get());
    for(GLsizei i = 0; i < count; i++)
      if(samplers != NULL && samplers[i] != 0)
        GetResourceManager()->MarkResourceFrameReferenced(SamplerRes(GetCtx(), samplers[i]),
                                                          eFrameRef_Read);
  }
}
开发者ID:DrChat,项目名称:renderdoc,代码行数:16,代码来源:gl_sampler_funcs.cpp

示例7: GetCtxData

void WrappedOpenGL::glBindProgramPipeline(GLuint pipeline)
{
  m_Real.glBindProgramPipeline(pipeline);

  GetCtxData().m_ProgramPipeline = pipeline;

  if(m_State == WRITING_CAPFRAME)
  {
    SCOPED_SERIALISE_CONTEXT(BIND_PROGRAMPIPE);
    Serialise_glBindProgramPipeline(pipeline);

    m_ContextRecord->AddChunk(scope.Get());
    GetResourceManager()->MarkResourceFrameReferenced(ProgramPipeRes(GetCtx(), pipeline),
                                                      eFrameRef_Read);
  }
}
开发者ID:JasonWinston,项目名称:renderdoc,代码行数:16,代码来源:gl_shader_funcs.cpp

示例8: Unwrap

VkResult WrappedVulkan::vkCreateBufferView(
			VkDevice                                    device,
			const VkBufferViewCreateInfo*               pCreateInfo,
			const VkAllocationCallbacks*                pAllocator,
			VkBufferView*                               pView)
{
	VkBufferViewCreateInfo unwrappedInfo = *pCreateInfo;
	unwrappedInfo.buffer = Unwrap(unwrappedInfo.buffer);
	VkResult ret = ObjDisp(device)->CreateBufferView(Unwrap(device), &unwrappedInfo, pAllocator, pView);

	if(ret == VK_SUCCESS)
	{
		ResourceId id = GetResourceManager()->WrapResource(Unwrap(device), *pView);
		
		if(m_State >= WRITING)
		{
			Chunk *chunk = NULL;

			{
				CACHE_THREAD_SERIALISER();
		
				SCOPED_SERIALISE_CONTEXT(CREATE_BUFFER_VIEW);
				Serialise_vkCreateBufferView(localSerialiser, device, pCreateInfo, NULL, pView);

				chunk = scope.Get();
			}

			VkResourceRecord *bufferRecord = GetRecord(pCreateInfo->buffer);

			VkResourceRecord *record = GetResourceManager()->AddResourceRecord(*pView);
			record->AddChunk(chunk);
			record->AddParent(bufferRecord);

			// store the base resource
			record->baseResource = bufferRecord->baseResource;
			record->sparseInfo = bufferRecord->sparseInfo;
		}
		else
		{
			GetResourceManager()->AddLiveResource(id, *pView);
		
			m_CreationInfo.m_BufferView[id].Init(GetResourceManager(), m_CreationInfo, &unwrappedInfo);
		}
	}

	return ret;
}
开发者ID:281627166,项目名称:renderdoc,代码行数:47,代码来源:vk_resource_funcs.cpp

示例9: SCOPED_SERIALISE_CONTEXT

void WrappedOpenGL::glPixelStorei(GLenum pname, GLint param)
{
	m_Real.glPixelStorei(pname, param);

	if(m_State >= WRITING)
	{
		SCOPED_SERIALISE_CONTEXT(PIXELSTORE);
		Serialise_glPixelStorei(pname, param);

		if(m_TextureRecord[m_TextureUnit])
			m_TextureRecord[m_TextureUnit]->AddChunk(scope.Get());
		else if(m_State == WRITING_IDLE)
			m_DeviceRecord->AddChunk(scope.Get());
		else if(m_State == WRITING_CAPFRAME)
			m_ContextRecord->AddChunk(scope.Get());
	}
}
开发者ID:FeuernD,项目名称:renderdoc,代码行数:17,代码来源:gl_texture_funcs.cpp

示例10: SCOPED_LOCK

HRESULT WrappedID3D12Device::CreateCommandQueue(const D3D12_COMMAND_QUEUE_DESC *pDesc, REFIID riid,
                                                void **ppCommandQueue)
{
  if(ppCommandQueue == NULL)
    return m_pDevice->CreateCommandQueue(pDesc, riid, NULL);

  if(riid != __uuidof(ID3D12CommandQueue))
    return E_NOINTERFACE;

  ID3D12CommandQueue *real = NULL;
  HRESULT ret = m_pDevice->CreateCommandQueue(pDesc, riid, (void **)&real);

  if(SUCCEEDED(ret))
  {
    SCOPED_LOCK(m_D3DLock);

    WrappedID3D12CommandQueue *wrapped =
        new WrappedID3D12CommandQueue(real, this, m_pSerialiser, m_State);

    if(m_State >= WRITING)
    {
      SCOPED_SERIALISE_CONTEXT(CREATE_COMMAND_QUEUE);
      Serialise_CreateCommandQueue(pDesc, riid, (void **)&wrapped);

      m_DeviceRecord->AddChunk(scope.Get());
    }
    else
    {
      GetResourceManager()->AddLiveResource(wrapped->GetResourceID(), wrapped);
    }

    if(pDesc->Type == D3D12_COMMAND_LIST_TYPE_DIRECT)
    {
      if(m_Queue != NULL)
        RDCERR("Don't support multiple queues yet!");

      m_Queue = wrapped;

      CreateInternalResources();
    }

    *ppCommandQueue = (ID3D12CommandQueue *)wrapped;
  }

  return ret;
}
开发者ID:Anteru,项目名称:renderdoc,代码行数:46,代码来源:d3d12_device_wrap.cpp

示例11: ObjDisp

VkResult WrappedVulkan::vkQueueWaitIdle(VkQueue queue)
{
  VkResult ret = ObjDisp(queue)->QueueWaitIdle(Unwrap(queue));

  if(m_State >= WRITING_CAPFRAME)
  {
    CACHE_THREAD_SERIALISER();

    SCOPED_SERIALISE_CONTEXT(QUEUE_WAIT_IDLE);
    Serialise_vkQueueWaitIdle(localSerialiser, queue);

    m_FrameCaptureRecord->AddChunk(scope.Get());
    GetResourceManager()->MarkResourceFrameReferenced(GetResID(queue), eFrameRef_Read);
  }

  return ret;
}
开发者ID:Anteru,项目名称:renderdoc,代码行数:17,代码来源:vk_queue_funcs.cpp

示例12: GetResourceManager

void WrappedOpenGL::glTextureView(GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers)
{
	m_Real.glTextureView(texture, target, origtexture, internalformat, minlevel, numlevels, minlayer, numlayers);
	
	if(m_State >= WRITING)
	{
		ResourceRecord *record = GetResourceManager()->GetResourceRecord(TextureRes(texture));
		ResourceRecord *origrecord = GetResourceManager()->GetResourceRecord(TextureRes(origtexture));
		RDCASSERT(record && origrecord);

		SCOPED_SERIALISE_CONTEXT(TEXTURE_VIEW);
		Serialise_glTextureView(texture, target, origtexture, internalformat, minlevel, numlevels, minlayer, numlayers);

		record->AddChunk(scope.Get());
		record->AddParent(origrecord);
	}
}
开发者ID:Waferix,项目名称:renderdoc,代码行数:17,代码来源:gl_texture_funcs.cpp

示例13: GetResourceManager

void WrappedOpenGL::glNamedFramebufferTextureLayerEXT(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer)
{
	m_Real.glNamedFramebufferTextureLayerEXT(framebuffer, attachment, texture, level, layer);
	
	if(m_State >= WRITING)
	{
		GLResourceRecord *record = GetResourceManager()->GetResourceRecord(FramebufferRes(GetCtx(), framebuffer));

		SCOPED_SERIALISE_CONTEXT(FRAMEBUFFER_TEXLAYER);
		Serialise_glNamedFramebufferTextureLayerEXT(framebuffer, attachment, texture, level, layer);
		
		if(m_State == WRITING_IDLE)
			record->AddChunk(scope.Get());
		else
			m_ContextRecord->AddChunk(scope.Get());
	}
}
开发者ID:Lonesled,项目名称:renderdoc,代码行数:17,代码来源:gl_framebuffer_funcs.cpp

示例14: SCOPED_LOCK

HRESULT WrappedID3D11Device::CreateBlendState1(const D3D11_BLEND_DESC1 *pBlendStateDesc, ID3D11BlendState1 **ppBlendState)
{
	if(m_pDevice1 == NULL) return E_NOINTERFACE;
	if(ppBlendState == NULL) return m_pDevice1->CreateBlendState1(pBlendStateDesc, NULL);

	ID3D11BlendState1 *real = NULL;
	HRESULT ret = m_pDevice1->CreateBlendState1(pBlendStateDesc, &real);
	
	if(SUCCEEDED(ret))
	{
		SCOPED_LOCK(m_D3DLock);
		
		// duplicate states can be returned, if Create is called with a previous descriptor
		if(GetResourceManager()->HasWrapper(real))
		{
			real->Release();
			*ppBlendState = (ID3D11BlendState1 *)GetResourceManager()->GetWrapper(real);
			(*ppBlendState)->AddRef();
			return ret;
		}
		
		ID3D11BlendState1 *wrapped = new WrappedID3D11BlendState1(real, this);

		CachedObjectsGarbageCollect();

		{
			RDCASSERT(m_CachedStateObjects.find(wrapped) == m_CachedStateObjects.end());
			wrapped->AddRef();
			InternalRef();
			m_CachedStateObjects.insert(wrapped);
		}

		if(m_State >= WRITING)
		{
			SCOPED_SERIALISE_CONTEXT(CREATE_BLEND_STATE1);
			Serialise_CreateBlendState1(pBlendStateDesc, &wrapped);

			m_DeviceRecord->AddChunk(scope.Get());
		}

		*ppBlendState = wrapped;
	}

	return ret;
}
开发者ID:281627166,项目名称:renderdoc,代码行数:45,代码来源:d3d11_device1_wrap.cpp

示例15: Unwrap

HRESULT WrappedID3D12Device::CreateComputePipelineState(const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc,
                                                        REFIID riid, void **ppPipelineState)
{
  D3D12_COMPUTE_PIPELINE_STATE_DESC unwrappedDesc = *pDesc;
  unwrappedDesc.pRootSignature = Unwrap(unwrappedDesc.pRootSignature);

  if(ppPipelineState == NULL)
    return m_pDevice->CreateComputePipelineState(&unwrappedDesc, riid, NULL);

  if(riid != __uuidof(ID3D12PipelineState))
    return E_NOINTERFACE;

  ID3D12PipelineState *real = NULL;
  HRESULT ret = m_pDevice->CreateComputePipelineState(&unwrappedDesc, riid, (void **)&real);

  if(SUCCEEDED(ret))
  {
    SCOPED_LOCK(m_D3DLock);

    WrappedID3D12PipelineState *wrapped = new WrappedID3D12PipelineState(real, this);

    if(m_State >= WRITING)
    {
      SCOPED_SERIALISE_CONTEXT(CREATE_COMPUTE_PIPE);
      Serialise_CreateComputePipelineState(pDesc, riid, (void **)&wrapped);

      D3D12ResourceRecord *record = GetResourceManager()->AddResourceRecord(wrapped->GetResourceID());
      record->type = Resource_PipelineState;
      record->Length = 0;
      wrapped->SetResourceRecord(record);

      record->AddParent(GetRecord(pDesc->pRootSignature));

      record->AddChunk(scope.Get());
    }
    else
    {
      GetResourceManager()->AddLiveResource(wrapped->GetResourceID(), wrapped);
    }

    *ppPipelineState = (ID3D12PipelineState *)wrapped;
  }

  return ret;
}
开发者ID:Anteru,项目名称:renderdoc,代码行数:45,代码来源:d3d12_device_wrap.cpp


注:本文中的SCOPED_SERIALISE_CONTEXT函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。