Cogs.Core
ProcessTask.h
1#pragma once
2
3#include "RenderTask.h"
4#include "Utilities/Expressions.h"
5#include "Renderer/EffectCache.h"
6#include "Resources/MaterialOptions.h"
7
8#include "Rendering/Common.h"
9#include "Rendering/SamplerState.h"
10
11#include "Serialization/RenderPipelineReader.h"
12
13namespace Cogs
14{
15 namespace Core
16 {
18 {
20 ProcessTaskProperty(const ProcessTaskProperty& original) : expressions(original.expressions) {
21 definition = original.definition;
22
23 std::memcpy(static_cast<void*>(&float4x4Value), &original.float4x4Value, sizeof(float4x4Value));
24 }
25
26 const ParsedValue* definition = nullptr;
27 std::vector<std::pair<size_t, Expression*>> expressions;
28 union
29 {
30 float floatValue;
31 glm::vec2 float2Value;
32 glm::vec3 float3Value;
33 glm::vec4 float4Value;
34 glm::mat4 float4x4Value;
35 int intValue;
36 glm::ivec2 int2Value;
37 glm::ivec3 int3Value;
38 glm::ivec4 int4Value;
39 uint32_t uintValue;
40 glm::uvec2 uint2Value;
41 glm::uvec3 uint3Value;
42 glm::uvec4 uint4Value;
43 bool boolValue;
44 struct {
45 StringView samplerName; // Stable views from Strings, will be passed to Cogs.Rendering
46 SamplerStateHandle samplerState;
47 } texture;
48 };
49 };
50
51 struct ProcessTask : public RenderTask
52 {
53 virtual ~ProcessTask() {}
54
55 EffectDescription createEffectDesc(RenderTaskContext* context);
56
57 void cleanup(RenderTaskContext * context) override;
58
59 void setProperties(RenderTaskContext * context, Cogs::Core::RenderTexture* targetSource = nullptr);
60
61 ParsedValue effectParameter;
62
63 BlendMode blendMode = BlendMode::None;
64 uint32_t texUnit = 0;
65
66 ExpressionContext* scope = nullptr;
67
68 std::vector<ProcessTaskProperty> properties;
70
71 struct CachedEffect * effect = nullptr;
72 };
73 }
74}
Provides a weakly referenced view over the contents of a string.
Definition: StringView.h:24
BlendMode
Defines blending modes for rendering.
@ None
No blending enabled for opaque shapes, defaults to Blend for transparent shapes.
Contains all Cogs related functionality.
Definition: FieldSetter.h:23
Provides a context for evaluation of expressions.
Definition: Expressions.h:54
Stores the parsed output of a key/value pair.
Definition: Parsing.h:32