Cogs.Core
RenderMaterial.h
1#pragma once
2
3#include "RenderResourceBase.h"
4
5#include "Resources/Material.h"
6
7#include "Rendering/Common.h"
8#include "Rendering/IBuffers.h"
9#include "Rendering/IEffects.h"
10
11#include "RenderEffect.h"
12
13namespace Cogs
14{
15 class IGraphicsDevice;
16
17 namespace Core
18 {
19 class IRenderer;
20 struct EffectBinding;
21 struct MaterialInstance;
22 enum struct ClipShapeType : uint32_t;
23
25 {
26 ActivationResult update(Material * material, IGraphicsDevice * device, class RenderResources * resources, struct RenderStates * renderStates);
27
28 void release(class Renderer * renderer);
29
31 EffectBinding * getBinding(const size_t permutationIndex,
32 const MaterialInstance * materialInstance,
33 const MeshStreamsLayout* streamsLayout,
34 const EnginePermutation * enginePermutation,
35 const RenderPassOptions& passOptions,
36 const ClipShapeType clipShape);
37
39 {
40 EffectBinding * binding;
41 size_t code;
42 EffectHandle effect;
43 };
44
45 std::vector<EffectBindingInstance> bindings;
46 std::vector<EffectBindingInstance> pendingBindings;
47
49 {
50 Cogs::SamplerStateHandle samplerState;
51 size_t hash;
52 };
53 std::vector<TexturePropertyState> texturePropertyStates;
54
55 uint32_t updatedGeneration = ~0u;
56
57 private:
58 IRenderer * renderer = nullptr;
59 };
60 }
61}
Renderer interface used by the engine to control registered renderer instances.
Definition: IRenderer.h:154
Contains render resources used by the renderer.
Core renderer system.
Definition: Renderer.h:28
Represents a graphics device used to manage graphics resources and issue drawing commands.
ClipShapeType
Specifices what kind of shape a clip shape has.
ActivationResult
Defines results for resource activation.
Definition: ResourceBase.h:14
Contains all Cogs related functionality.
Definition: FieldSetter.h:23
Material instances represent a specialized Material combined with state for all its buffers and prope...
Material resources define the how of geometry rendering (the what is defined by Mesh and Texture reso...
Definition: Material.h:82
EffectBinding * getBinding(const size_t permutationIndex, const MaterialInstance *materialInstance, const MeshStreamsLayout *streamsLayout, const EnginePermutation *enginePermutation, const RenderPassOptions &passOptions, const ClipShapeType clipShape)
Render resources represent Engine resources like Mesh, Effect or MaterialInstance,...