Example #1
0
///////////////////////// DecalList::begin //////////////////////////////////
bool DecalList::begin(BuildState &state, RenderContext &context, ResourceManager &resources)
{
  m_commandlump = {};

  state = {};
  state.context = &context;
  state.resources = &resources;

  if (!context.ready)
    return false;

  auto commandlump = resources.allocate<CommandLump>(&context);

  if (!commandlump)
    return false;

  auto decalset = commandlump->acquire_descriptor(sizeof(Renderable::Decals::DecalList));

  if (decalset.capacity() == 0)
  {
    resources.destroy(commandlump);
    return false;
  }

  decallist = decalset.memory<Renderable::Decals::DecalList>(decalset.reserve(sizeof(Renderable::Decals::DecalList)));

  decallist->decalcount = 0;

  m_commandlump = { resources, commandlump };

  state.commandlump = commandlump;

  return true;
}
Example #2
0
///////////////////////// LightList::begin //////////////////////////////////
bool LightList::begin(BuildState &state, RenderContext &context, ResourceManager &resources)
{
  m_commandlump = {};

  state = {};
  state.context = &context;
  state.resources = &resources;

  if (!context.ready)
    return false;

  auto commandlump = resources.allocate<CommandLump>(&context);

  if (!commandlump)
    return false;

  auto lightset = commandlump->acquire_descriptor(sizeof(Renderable::Lights::LightList));

  if (lightset.capacity() == 0)
  {
    resources.destroy(commandlump);
    return false;
  }

  lightlist = lightset.memory<Renderable::Lights::LightList>(lightset.reserve(sizeof(Renderable::Lights::LightList)));

  lightlist->pointlightcount = 0;
  lightlist->spotlightcount = 0;
  lightlist->probecount = 0;
  lightlist->environmentcount = 0;

  m_commandlump = { resources, commandlump };

  state.commandlump = commandlump;

  return true;
}
Example #3
0
///////////////////////// SpotCasterList::begin /////////////////////////////
bool SpotCasterList::begin(BuildState &state, SpotMapContext &context, ResourceManager &resources)
{
  m_commandlump = {};

  state = {};
  state.context = &context;
  state.resources = &resources;

  if (!context.ready)
    return false;

  auto commandlump = resources.allocate<CommandLump>(context.rendercontext);

  if (!commandlump)
    return false;

  castercommands = commandlump->allocate_commandbuffer();

  if (!castercommands)
  {
    resources.destroy(commandlump);
    return false;
  }

  using Vulkan::begin;

  begin(context.vulkan, castercommands, 0, context.renderpass, 0, VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT | VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT);

  bind_descriptor(castercommands, context.pipelinelayout, ShaderLocation::sceneset, context.scenedescriptor, VK_PIPELINE_BIND_POINT_GRAPHICS);

  m_commandlump = { resources, commandlump };

  state.commandlump = commandlump;

  return true;
}