/
redgpu
/
ezEngine
Обзор
Документация
Войти
/
redgpu
/
ezEngine
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
ms9
Code/Samples/ComputeShaderHistogram/Main.h
53 строки
2 KB
jankrassnigg
Restructured the repository such that all code actually resides under the "Code" folder.
23 янв 2019, 18:34
23 янв 2019, 18:34
2ade834
Код
Авторство
О чём код?
#pragma once #include <GameEngine/GameApplication/GameApplication.h> #include <Foundation/Types/UniquePtr.h> #include <RendererCore/Meshes/MeshResource.h> #include <RendererCore/Material/MaterialResource.h> #include <Foundation/IO/DirectoryWatcher.h> class ezWindow; class ezDirectoryWatcher; /// Uses shader reloading mechanism of the ShaderExplorer sample for quick prototyping. class ezComputeShaderHistogramApp : public ezGameApplication { public: typedef ezGameApplication SUPER; ezComputeShaderHistogramApp(); ~ezComputeShaderHistogramApp(); virtual ezApplication::ApplicationExecution Run() override; virtual void AfterCoreSystemsStartup() override; virtual void BeforeHighLevelSystemsShutdown() override; private: void CreateHistogramQuad(); void OnFileChanged(const char* filename, ezDirectoryWatcherAction action); ezUniquePtr<ezWindow> m_pWindow; ezGALTextureHandle m_hScreenTexture; ezGALRenderTargetViewHandle m_hScreenRTV; ezGALResourceViewHandle m_hScreenSRV; // Could use buffer, but access and organisation with texture is more straight forward. ezGALTextureHandle m_hHistogramTexture; ezGALUnorderedAccessViewHandle m_hHistogramUAV; ezGALResourceViewHandle m_hHistogramSRV; ezGALRenderTargetViewHandle m_hBackbufferRTV; ezShaderResourceHandle m_hScreenShader; ezShaderResourceHandle m_hHistogramDisplayShader; ezShaderResourceHandle m_hHistogramComputeShader; ezMeshBufferResourceHandle m_hHistogramQuadMeshBuffer; ezUniquePtr<ezDirectoryWatcher> m_directoryWatcher; bool m_stuffChanged; };