Ion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
renderer.cc File Reference
#include <algorithm>
#include <array>
#include <bitset>
#include <limits>
#include <memory>
#include <vector>
#include "base/integral_types.h"
#include "ion/base/allocationmanager.h"
#include "ion/base/allocationsizetracker.h"
#include "ion/base/enumhelper.h"
#include "ion/base/invalid.h"
#include "ion/base/lockguards.h"
#include "ion/base/logging.h"
#include "ion/base/readwritelock.h"
#include "ion/base/serialize.h"
#include "ion/base/staticsafedeclare.h"
#include "ion/base/stlalloc/allocset.h"
#include "ion/base/stlalloc/allocunorderedset.h"
#include "ion/base/stlalloc/allocvector.h"
#include "ion/gfx/attribute.h"
#include "ion/gfx/attributearray.h"
#include "ion/gfx/bufferobject.h"
#include "ion/gfx/cubemaptexture.h"
#include "ion/gfx/framebufferobject.h"
#include "ion/gfx/image.h"
#include "ion/gfx/renderer.h"
#include "ion/gfx/resourcebase.h"
#include "ion/gfx/shaderinputregistry.h"
#include "ion/gfx/shape.h"
#include "ion/gfx/texture.h"
#include "ion/gfx/texturemanager.h"
#include "ion/gfx/updatestatetable.h"
#include "ion/math/matrix.h"
#include "ion/math/matrixutils.h"
#include "ion/math/range.h"
#include "ion/math/rangeutils.h"
#include "ion/math/utils.h"
#include "ion/math/vector.h"
#include "ion/port/atomic.h"
#include "ion/port/macros.h"
#include "ion/port/mutex.h"
#include "ion/portgfx/glheaders.h"
#include "ion/portgfx/visual.h"
Include dependency graph for renderer.cc:

Go to the source code of this file.

Namespaces

 ion
 Copyright 2016 Google Inc.
 
 ion::gfx
 

Macros

#define SEND_VECTOR_UNIFORM(type, elem_type, num_elements, setter)
 
#define SEND_TEXTURE_UNIFORM(type)
 

Functions

template<>
ResourceKey ion::gfx::Renderer::ResourceManager::GetResourceKey< Renderer::VertexArrayResource > (ResourceBinder *resource_binder, const ResourceHolder *holder)
 VertexArrayResources must be created per shader program. More...
 
template<>
std::vector< ResourceKey > ion::gfx::Renderer::ResourceManager::GetAllResourceKeys< Renderer::VertexArrayResource > (ResourceBinder *resource_binder)
 
template<>
ResourceKey ion::gfx::Renderer::ResourceManager::GetResourceKey< Renderer::VertexArrayEmulatorResource > (ResourceBinder *resource_binder, const ResourceHolder *holder)
 
template<>
std::vector< ResourceKey > ion::gfx::Renderer::ResourceManager::GetAllResourceKeys< Renderer::VertexArrayEmulatorResource > (ResourceBinder *resource_binder)
 
template<>
ResourceKey ion::gfx::Renderer::ResourceManager::GetResourceKey< Renderer::ShaderInputRegistryResource > (ResourceBinder *resource_binder, const ResourceHolder *holder)
 
template<>
ResourceKey ion::gfx::Renderer::ResourceManager::GetResourceKey< Renderer::FramebufferResource > (ResourceBinder *resource_binder, const ResourceHolder *holder)
 
template<>
ResourceKey ion::gfx::Renderer::ResourceManager::GetResourceKey< Renderer::ShaderProgramResource > (ResourceBinder *resource_binder, const ResourceHolder *holder)
 
template<>
std::vector< ResourceKey > ion::gfx::Renderer::ResourceManager::GetAllResourceKeys< Renderer::ShaderProgramResource > (ResourceBinder *resource_binder)
 

Macro Definition Documentation

#define SEND_TEXTURE_UNIFORM (   type)
Value:
/* Get the texture resource from each holder. */ \
if (uniform.IsArrayOf<type##Ptr>()) { \
const size_t count = uniform.GetCount(); \
const base::AllocatorPtr& allocator = \
base::AllocationManager::GetDefaultAllocatorForLifetime( \
base::AllocVector<GLint> ids(allocator); \
ids.reserve(count); \
/* Each resource holds its own id. */ \
for (size_t i = 0; i < count; ++i) \
if (TextureResource* txr = resource_manager_->GetResource( \
uniform.GetValueAt<type##Ptr>(i).Get(), this)) \
ids.push_back(GetLastBoundUnit(txr)); \
gm->Uniform1iv(location, static_cast<GLsizei>(count), &ids[0]); \
} else if (TextureResource* txr = resource_manager_->GetResource( \
uniform.GetValue<type##Ptr>().Get(), this)) { \
gm->Uniform1i(location, GetLastBoundUnit(txr)); \
}
kShortTerm is used for objects that are very transient in nature, such as scratch memory used to comp...
Definition: allocator.h:36
std::string type
Definition: printer.cc:353
SharedPtr< Allocator > AllocatorPtr
Definition: allocator.h:51
#define SEND_VECTOR_UNIFORM (   type,
  elem_type,
  num_elements,
  setter 
)
Value:
if (uniform.IsArrayOf<type>()) { \
/* Check that the values are packed in the uniform data. */ \
if (uniform.GetCount() > 1) { \
reinterpret_cast<const elem_type*>(&uniform.GetValueAt<type>(1)), \
reinterpret_cast<const elem_type*>(&uniform.GetValueAt<type>(0)) + \
num_elements); \
} \
gm->setter( \
location, static_cast<GLsizei>(uniform.GetCount()), \
reinterpret_cast<const elem_type*>(&uniform.GetValueAt<type>(0))); \
} else { \
gm->setter(location, 1, \
reinterpret_cast<const elem_type*>(&uniform.GetValue<type>())); \
}
std::string type
Definition: printer.cc:353
#define DCHECK_EQ(val1, val2)
Definition: logging.h:332