Cogs.Core
Utilities.h
1#pragma once
2
3#include <OsoMemoryProfiler/CogsMemoryProfile.h>
4
5namespace Cogs
6{
7 struct IIOHandler;
8
9 inline void* glTextureFakeAddress(unsigned glName) { return (void*)((size_t(1 + 0) << 23) + size_t(glName)); }
10 inline void* glBufferFakeAddress(unsigned glName) { return (void*)((size_t(1 + 0) << 24) + size_t(glName)); }
11
13 {
14 std::string origin;
15 std::string content;
16 std::vector<size_t> sourceStop;
17 std::vector<std::string> sourceName;
18 };
19
21 {
22 ProcessedContent effect;
23
24 ProcessedContent vertexShader;
25 ProcessedContent hullShader;
26 ProcessedContent domainShader;
27 ProcessedContent geometryShader;
28 ProcessedContent pixelShader;
29
30 ProcessedContent computeShader;
31 };
32
33 COGSRENDERING_DLL_API void RegisterGPUResource(void* handle, size_t size, MemBlockType type, const OsoMPAttribute* attributes = nullptr, uint32_t noOfAttributes = 0);
34 COGSRENDERING_DLL_API void RegisterGPUResourceAttributes(void* handle, const OsoMPAttribute* attributes, uint32_t noOfAttributes);
35 COGSRENDERING_DLL_API void UnregisterGPUResource(void* handle);
36
38 {
39 public:
40 static bool preprocessFile(IIOHandler * handler, const StringView & filename, ProcessedContent & content);
41
42 static bool preprocessContent(IIOHandler * handler, const StringView & input, ProcessedContent & content);
43 static bool preprocessContent(IIOHandler * handler, const StringView & fileName, std::istream & stream, ProcessedContent & content);
44
45 static bool preprocessContent(IIOHandler * handler, const StringView & input, std::string & content);
46 static bool preprocessContent(IIOHandler * handler, const StringView & fileName, std::istream & stream, std::string & content);
47
48 static bool readFile(IIOHandler * handler, const StringView & fileName, ProcessedContent & content);
49 static bool resolveFile(IIOHandler * handler, const StringView & source, const StringView & fileName, ProcessedContent & content);
50 };
51}
Provides a weakly referenced view over the contents of a string.
Definition: StringView.h:24
Contains all Cogs related functionality.
Definition: FieldSetter.h:23
I/O handler.
Definition: IEffects.h:106