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


C++ GetResourceManager函数代码示例

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


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

示例1: SERIALISE_ELEMENT

bool WrappedOpenGL::Serialise_glShaderSource(GLuint shader, GLsizei count,
                                             const GLchar *const *source, const GLint *length)
{
  SERIALISE_ELEMENT(ResourceId, id, GetResourceManager()->GetID(ShaderRes(GetCtx(), shader)));
  SERIALISE_ELEMENT(uint32_t, Count, count);

  vector<string> srcs;

  for(uint32_t i = 0; i < Count; i++)
  {
    string s;
    if(source && source[i])
      s = (length && length[i] > 0) ? string(source[i], source[i] + length[i]) : string(source[i]);

    m_pSerialiser->SerialiseString("source", s);

    if(m_State == READING)
      srcs.push_back(s);
  }

  if(m_State == READING)
  {
    size_t numStrings = srcs.size();

    const char **strings = new const char *[numStrings];
    for(size_t i = 0; i < numStrings; i++)
      strings[i] = srcs[i].c_str();

    ResourceId liveId = GetResourceManager()->GetLiveID(id);

    m_Shaders[liveId].sources.clear();
    m_Shaders[liveId].sources.reserve(Count);

    for(uint32_t i = 0; i < Count; i++)
      m_Shaders[liveId].sources.push_back(strings[i]);

    m_Real.glShaderSource(GetResourceManager()->GetLiveResource(id).name, Count, strings, NULL);

    delete[] strings;
  }

  return true;
}
开发者ID:JasonWinston,项目名称:renderdoc,代码行数:43,代码来源:gl_shader_funcs.cpp

示例2:

void WrappedID3D12CommandQueue::ClearAfterCapture()
{
  // delete cmd buffers now - had to keep them alive until after serialiser flush.
  for(size_t i = 0; i < m_CmdListRecords.size(); i++)
    m_CmdListRecords[i]->Delete(GetResourceManager());

  m_CmdListRecords.clear();

  m_QueueRecord->DeleteChunks();
}
开发者ID:Anteru,项目名称:renderdoc,代码行数:10,代码来源:d3d12_commands.cpp

示例3: SERIALISE_ELEMENT

bool WrappedOpenGL::Serialise_glBindProgramPipeline(GLuint pipeline)
{
	SERIALISE_ELEMENT(ResourceId, id, (pipeline ? GetResourceManager()->GetID(ProgramPipeRes(GetCtx(), pipeline)) : ResourceId()));

	if(m_State <= EXECUTING)
	{
		if(id == ResourceId())
		{
			m_Real.glBindProgramPipeline(0);
		}
		else
		{
			GLuint live = GetResourceManager()->GetLiveResource(id).name;
			m_Real.glBindProgramPipeline(live);
		}
	}

	return true;
}
开发者ID:debaetsd,项目名称:renderdoc,代码行数:19,代码来源:gl_shader_funcs.cpp

示例4: SCOPED_LOCK

// needs to be separate so we don't erase from m_ImageLayouts in other destroy functions
void WrappedVulkan::vkDestroyImage(VkDevice device, VkImage obj, const VkAllocationCallbacks* pAllocator)
{
	{
		SCOPED_LOCK(m_ImageLayoutsLock);
		m_ImageLayouts.erase(GetResID(obj));
	}
	VkImage unwrappedObj = Unwrap(obj);
	GetResourceManager()->ReleaseWrappedResource(obj, true);
	return ObjDisp(device)->DestroyImage(Unwrap(device), unwrappedObj, pAllocator);
}
开发者ID:Althar93,项目名称:renderdoc,代码行数:11,代码来源:vk_misc_funcs.cpp

示例5: SERIALISE_ELEMENT

bool WrappedVulkan::Serialise_vkCreateGraphicsPipelines(
    Serialiser *localSerialiser, VkDevice device, VkPipelineCache pipelineCache, uint32_t count,
    const VkGraphicsPipelineCreateInfo *pCreateInfos, const VkAllocationCallbacks *pAllocator,
    VkPipeline *pPipelines)
{
  SERIALISE_ELEMENT(ResourceId, devId, GetResID(device));
  SERIALISE_ELEMENT(ResourceId, cacheId, GetResID(pipelineCache));
  SERIALISE_ELEMENT(VkGraphicsPipelineCreateInfo, info, *pCreateInfos);
  SERIALISE_ELEMENT(ResourceId, id, GetResID(*pPipelines));

  if(m_State == READING)
  {
    VkPipeline pipe = VK_NULL_HANDLE;

    device = GetResourceManager()->GetLiveHandle<VkDevice>(devId);
    // don't use pipeline caches on replay
    pipelineCache =
        VK_NULL_HANDLE;    // GetResourceManager()->GetLiveHandle<VkPipelineCache>(cacheId);

    VkResult ret = ObjDisp(device)->CreateGraphicsPipelines(Unwrap(device), Unwrap(pipelineCache),
                                                            1, &info, NULL, &pipe);

    if(ret != VK_SUCCESS)
    {
      RDCERR("Failed on resource serialise-creation, VkResult: 0x%08x", ret);
    }
    else
    {
      ResourceId live;

      if(GetResourceManager()->HasWrapper(ToTypedHandle(pipe)))
      {
        live = GetResourceManager()->GetNonDispWrapper(pipe)->id;

        // destroy this instance of the duplicate, as we must have matching create/destroy
        // calls and there won't be a wrapped resource hanging around to destroy this one.
        ObjDisp(device)->DestroyPipeline(Unwrap(device), pipe, NULL);

        // whenever the new ID is requested, return the old ID, via replacements.
        GetResourceManager()->ReplaceResource(id, GetResourceManager()->GetOriginalID(live));
      }
      else
      {
        live = GetResourceManager()->WrapResource(Unwrap(device), pipe);
        GetResourceManager()->AddLiveResource(id, pipe);

        m_CreationInfo.m_Pipeline[live].Init(GetResourceManager(), m_CreationInfo, &info);
      }
    }
  }

  return true;
}
开发者ID:AJ92,项目名称:renderdoc,代码行数:53,代码来源:vk_shader_funcs.cpp

示例6: SERIALISE_ELEMENT

bool WrappedOpenGL::Serialise_glGenSamplers(GLsizei n, GLuint *samplers)
{
  SERIALISE_ELEMENT(ResourceId, id, GetResourceManager()->GetID(SamplerRes(GetCtx(), *samplers)));

  if(m_State == READING)
  {
    GLuint real = 0;
    m_Real.glGenSamplers(1, &real);
    m_Real.glBindSampler(0, real);
    m_Real.glBindSampler(0, 0);

    GLResource res = SamplerRes(GetCtx(), real);

    ResourceId live = m_ResourceManager->RegisterResource(res);
    GetResourceManager()->AddLiveResource(id, res);
  }

  return true;
}
开发者ID:DrChat,项目名称:renderdoc,代码行数:19,代码来源:gl_sampler_funcs.cpp

示例7: SERIALISE_ELEMENT

bool WrappedID3D12Device::Serialise_CreatePlacedResource(ID3D12Heap *pHeap, UINT64 HeapOffset,
                                                         const D3D12_RESOURCE_DESC *pDesc,
                                                         D3D12_RESOURCE_STATES InitialState,
                                                         const D3D12_CLEAR_VALUE *pOptimizedClearValue,
                                                         REFIID riid, void **ppvResource)
{
  SERIALISE_ELEMENT(ResourceId, Heap, GetResID(pHeap));
  SERIALISE_ELEMENT(UINT64, Offset, HeapOffset);
  SERIALISE_ELEMENT(D3D12_RESOURCE_DESC, desc, *pDesc);
  SERIALISE_ELEMENT(D3D12_RESOURCE_STATES, state, InitialState);

  SERIALISE_ELEMENT(bool, HasClearValue, pOptimizedClearValue != NULL);
  SERIALISE_ELEMENT_OPT(D3D12_CLEAR_VALUE, clearVal, *pOptimizedClearValue, HasClearValue);

  SERIALISE_ELEMENT(IID, guid, riid);
  SERIALISE_ELEMENT(ResourceId, Res, ((WrappedID3D12Resource *)*ppvResource)->GetResourceID());

  if(m_State == READING)
  {
    pHeap = GetResourceManager()->GetLiveAs<ID3D12Heap>(Heap);
    pOptimizedClearValue = HasClearValue ? &clearVal : NULL;

    ID3D12Resource *ret = NULL;
    HRESULT hr = m_pDevice->CreatePlacedResource(Unwrap(pHeap), Offset, &desc, state,
                                                 pOptimizedClearValue, guid, (void **)&ret);

    if(FAILED(hr))
    {
      RDCERR("Failed on resource serialise-creation, HRESULT: 0x%08x", hr);
    }
    else
    {
      ret = new WrappedID3D12Resource(ret, this);

      GetResourceManager()->AddLiveResource(Res, ret);

      SubresourceStateVector &states = m_ResourceStates[GetResID(ret)];
      states.resize(GetNumSubresources(&desc), state);
    }
  }

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

示例8: Weapon

Parachute::Parachute() : Weapon(WEAPON_PARACHUTE, "parachute", new ParachuteConfig(), false)
{
  UpdateTranslationStrings();

  m_category = MOVE;
  m_initial_nb_ammo = 2;
  use_unit_on_first_shoot = false;
  m_used_this_turn = false;
  img = GetResourceManager().LoadSprite(weapons_res_profile, "parachute_sprite");
}
开发者ID:yeKcim,项目名称:warmux,代码行数:10,代码来源:parachute.cpp

示例9: SERIALISE_ELEMENT

bool WrappedOpenGL::Serialise_glTextureBufferRangeEXT(GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size)
{
	SERIALISE_ELEMENT(GLenum, Target, target);
	SERIALISE_ELEMENT(uint64_t, offs, (uint64_t)offset);
	SERIALISE_ELEMENT(uint64_t, Size, (uint64_t)size);
	SERIALISE_ELEMENT(GLenum, fmt, internalformat);
	SERIALISE_ELEMENT(ResourceId, texid, GetResourceManager()->GetID(TextureRes(texture)));
	SERIALISE_ELEMENT(ResourceId, bufid, GetResourceManager()->GetID(TextureRes(buffer)));
	
	if(m_State == READING)
	{
		m_Real.glTextureBufferRangeEXT(GetResourceManager()->GetLiveResource(texid).name,
																	 Target, fmt,
																	 GetResourceManager()->GetLiveResource(bufid).name,
																	 (GLintptr)offs, (GLsizeiptr)Size);
	}

	return true;
}
开发者ID:Waferix,项目名称:renderdoc,代码行数:19,代码来源:gl_texture_funcs.cpp

示例10: Widget

MultiTabs::MultiTabs(const Point2i& size)
 : Widget(size)
 , max_visible_tabs(50)
 , current_tab(-1)
 , first_tab(0)
 , nb_visible_tabs(1)
 , tab_header_width(TAB_MIN_WIDTH)
{
  Profile *res = GetResourceManager().LoadXMLProfile("graphism.xml",false);

  prev_tab_bt = new Button(res, "menu/really_big_minus", false);
  next_tab_bt = new Button(res, "menu/really_big_plus", false);
  tab_header_height = prev_tab_bt->GetSizeY() + 4;

  Widget::SetBorder(defaultOptionColorRect, BORDER);
  Widget::SetBackgroundColor(defaultOptionColorBox);

  GetResourceManager().UnLoadXMLProfile(res);
}
开发者ID:yeKcim,项目名称:warmux,代码行数:19,代码来源:tabs.cpp

示例11: BenchItem

  BenchItem(BenchType t, const std::string& name, uint height)
    : HBox(height, false, false, true /* use full height */)
    , type(t)
  {
    Profile *res = GetResourceManager().LoadXMLProfile("graphism.xml", false);

    bench = new Label(name, 0, Font::FONT_BIG, Font::FONT_BOLD,
                      dark_gray_color, Text::ALIGN_CENTER);
    AddWidget(bench);

    score = new Label("N/A", 300, Font::FONT_BIG, Font::FONT_BOLD,
                      primary_red_color, Text::ALIGN_CENTER);
    AddWidget(score);

    run = new Button(res, "menu/really_big_plus", true);
    AddWidget(run);

    GetResourceManager().UnLoadXMLProfile(res);
  }
开发者ID:yeKcim,项目名称:warmux,代码行数:19,代码来源:benchmark_menu.cpp

示例12: SERIALISE_ELEMENT_PTR

bool WrappedID3D11Device::Serialise_CreateTexture2D1(const D3D11_TEXTURE2D_DESC1 *pDesc,
                                                     const D3D11_SUBRESOURCE_DATA *pInitialData,
                                                     ID3D11Texture2D1 **ppTexture2D)
{
  SERIALISE_ELEMENT_PTR(D3D11_TEXTURE2D_DESC1, Descriptor, pDesc);
  SERIALISE_ELEMENT(ResourceId, pTexture, GetIDForResource(*ppTexture2D));

  SERIALISE_ELEMENT(bool, HasInitialData, pInitialData != NULL);

  vector<D3D11_SUBRESOURCE_DATA> descs = Serialise_CreateTextureData(
      ppTexture2D ? *ppTexture2D : NULL, pTexture, pInitialData, Descriptor.Width, Descriptor.Height,
      1, Descriptor.Format, Descriptor.MipLevels, Descriptor.ArraySize, HasInitialData);

  if(m_State == READING)
  {
    ID3D11Texture2D1 *ret = NULL;
    HRESULT hr = E_NOINTERFACE;

    TextureDisplayType dispType = DispTypeForTexture(Descriptor);

    // unset flags that are unimportant/problematic in replay
    Descriptor.MiscFlags &=
        ~(D3D11_RESOURCE_MISC_SHARED | D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX |
          D3D11_RESOURCE_MISC_GDI_COMPATIBLE | D3D11_RESOURCE_MISC_SHARED_NTHANDLE);

    if(m_pDevice3)
    {
      if(HasInitialData)
        hr = m_pDevice3->CreateTexture2D1(&Descriptor, &descs[0], &ret);
      else
        hr = m_pDevice3->CreateTexture2D1(&Descriptor, NULL, &ret);
    }
    else
    {
      RDCERR("Replaying a D3D11.3 device without D3D11.3 available");
    }

    if(FAILED(hr))
    {
      RDCERR("Failed on resource serialise-creation, HRESULT: 0x%08x", hr);
    }
    else
    {
      ret = new WrappedID3D11Texture2D1((ID3D11Texture2D1 *)ret, this, dispType);

      GetResourceManager()->AddLiveResource(pTexture, ret);
    }
  }

  for(size_t i = 0; i < descs.size(); i++)
    SAFE_DELETE_ARRAY(descs[i].pSysMem);

  return true;
}
开发者ID:AJ92,项目名称:renderdoc,代码行数:54,代码来源:d3d11_device3_wrap.cpp

示例13: SCOPED_SERIALISE_CONTEXT

void WrappedOpenGL::glBindFramebuffer(GLenum target, GLuint framebuffer)
{
	if(m_State == WRITING_CAPFRAME)
	{
		SCOPED_SERIALISE_CONTEXT(BIND_FRAMEBUFFER);
		Serialise_glBindFramebuffer(target, framebuffer);
		
		m_ContextRecord->AddChunk(scope.Get());
	}

	if(framebuffer == 0 && m_State < WRITING)
		framebuffer = m_FakeBB_FBO;

	if(target == eGL_DRAW_FRAMEBUFFER || target == eGL_FRAMEBUFFER)
		m_DrawFramebufferRecord = GetResourceManager()->GetResourceRecord(FramebufferRes(GetCtx(), framebuffer));
	else
		m_ReadFramebufferRecord = GetResourceManager()->GetResourceRecord(FramebufferRes(GetCtx(), framebuffer));

	m_Real.glBindFramebuffer(target, framebuffer);
}
开发者ID:Lonesled,项目名称:renderdoc,代码行数:20,代码来源:gl_framebuffer_funcs.cpp

示例14: SERIALISE_ELEMENT

bool WrappedOpenGL::Serialise_glBindFramebuffer(GLenum target, GLuint framebuffer)
{
	SERIALISE_ELEMENT(GLenum, Target, target);
	SERIALISE_ELEMENT(ResourceId, Id, (framebuffer ? GetResourceManager()->GetID(FramebufferRes(GetCtx(), framebuffer)) : ResourceId()));

	if(m_State <= EXECUTING)
	{
		if(Id == ResourceId())
		{
			m_Real.glBindFramebuffer(Target, m_FakeBB_FBO);
		}
		else
		{
			GLResource res = GetResourceManager()->GetLiveResource(Id);
			m_Real.glBindFramebuffer(Target, res.name);
		}
	}

	return true;
}
开发者ID:Lonesled,项目名称:renderdoc,代码行数:20,代码来源:gl_framebuffer_funcs.cpp

示例15: GetResourceManager

void WrappedOpenGL::glCompileShader(GLuint shader)
{
  m_Real.glCompileShader(shader);

  if(m_State >= WRITING)
  {
    GLResourceRecord *record = GetResourceManager()->GetResourceRecord(ShaderRes(GetCtx(), shader));
    RDCASSERT(record);
    {
      SCOPED_SERIALISE_CONTEXT(COMPILESHADER);
      Serialise_glCompileShader(shader);

      record->AddChunk(scope.Get());
    }
  }
  else
  {
    m_Shaders[GetResourceManager()->GetID(ShaderRes(GetCtx(), shader))].Compile(*this);
  }
}
开发者ID:JasonWinston,项目名称:renderdoc,代码行数:20,代码来源:gl_shader_funcs.cpp


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