39 : context_(
std::move(context)) {
40 if (!context_ || !context_->IsValid()) {
44 auto unskinned_variant =
45 MakePipelineVariants<UnskinnedVertexShader, UnlitFragmentShader>(
47 if (!unskinned_variant) {
48 FML_LOG(
ERROR) <<
"Could not create unskinned pipeline variant.";
52 std::move(unskinned_variant);
54 auto skinned_variant =
55 MakePipelineVariants<SkinnedVertexShader, UnlitFragmentShader>(*context_);
56 if (!skinned_variant) {
57 FML_LOG(
ERROR) <<
"Could not create skinned pipeline variant.";
61 std::move(skinned_variant);
67 texture_descriptor.
size = {1, 1};
70 placeholder_texture_ =
71 context_->GetResourceAllocator()->CreateTexture(texture_descriptor);
72 placeholder_texture_->SetLabel(
"Placeholder Texture");
73 if (!placeholder_texture_) {
74 FML_LOG(
ERROR) <<
"Could not create placeholder texture.";
78 uint8_t pixel[] = {0xFF, 0xFF, 0xFF, 0xFF};
79 if (!placeholder_texture_->SetContents(pixel, 4)) {
80 FML_LOG(
ERROR) <<
"Could not set contents of placeholder texture.";
std::shared_ptr< Context > GetContext() const
SceneContext(std::shared_ptr< Context > context)
std::shared_ptr< Pipeline< PipelineDescriptor > > GetPipeline(PipelineKey key, SceneContextOptions opts) const
std::shared_ptr< Texture > GetPlaceholderTexture() const
A lightweight object that describes the attributes of a texture that can then used an allocator to cr...
PrimitiveType primitive_type
void ApplyToPipelineDescriptor(const Capabilities &capabilities, PipelineDescriptor &desc) const