PixelBullet  0.0.1
A C++ game engine
Loading...
Searching...
No Matches
skybox_scene_subrender_internal.h
1#pragma once
2
3#include "pixelbullet/private/graphics/rendering/buffers/buffer.h"
4#include "pixelbullet/private/graphics/rendering/buffers/uniform_handler.h"
5#include "pixelbullet/private/graphics/rendering/descriptors/descriptors_handler.h"
6#include "pixelbullet/private/graphics/rendering/images/image_cube.h"
7#include "pixelbullet/private/graphics/rendering/pipelines/pipeline_graphics.h"
8#include "pixelbullet/graphics/subrender.h"
9#include "pixelbullet/private/scene/rendering/render_resource_resolver.h"
10#include "pixelbullet/scene/render_data.h"
11
12#include <cstddef>
13#include <memory>
14#include <optional>
15#include <string>
16#include <vector>
17
18namespace pixelbullet
19{
20class Filesystem;
21class RenderDevice;
22class ResourceCache;
23struct SkyboxSceneSubrenderImpl
24{
25 SkyboxSceneSubrenderImpl(const Subrender::Stage& stage, RenderDevice& render_device, Filesystem& filesystem,
26 ResourceCache& resource_cache, const SceneRenderData& render_data);
27
28 void InvalidateCubemap();
29
30 const SceneRenderData* render_data = nullptr;
31 RenderResourceResolver resource_resolver;
32 std::unique_ptr<Buffer> vertex_buffer;
33 PipelineGraphics pipeline;
34 UniformHandler uniforms;
35 DescriptorsHandler descriptors;
36 std::optional<std::string> environment_asset_path;
37 std::optional<std::string> cubemap_root;
38 std::shared_ptr<ImageCube> cubemap;
39};
40
41namespace skybox_scene_subrender_internal
42{
43std::unique_ptr<SkyboxSceneSubrenderImpl> CreateImpl(const Subrender::Stage& stage, RenderDevice& render_device, Filesystem& filesystem,
44 ResourceCache& resource_cache, const SceneRenderData& render_data);
45bool MatchesActiveEnvironmentAsset(const std::optional<std::string>& environment_asset_path,
46 const std::vector<std::string>& changed_environment_assets) noexcept;
47bool MatchesActiveCubemapRoot(const std::optional<std::string>& cubemap_root, const std::vector<std::string>& changed_cubemaps) noexcept;
48void Render(SkyboxSceneSubrenderImpl& impl, const RenderFrameContext& frame_context);
49std::size_t RefreshAllAssetCaches(SkyboxSceneSubrenderImpl& impl);
50std::size_t RefreshEnvironmentCaches(SkyboxSceneSubrenderImpl& impl, const std::vector<std::string>& changed_environment_assets,
51 const std::vector<std::string>& changed_cubemaps);
52} // namespace skybox_scene_subrender_internal
53} // namespace pixelbullet
Definition filesystem.h:16
Definition render_device.h:15
Definition render_frame_context.h:17
Definition resource_cache.h:16
Definition render_data.h:117
Definition skybox_scene_subrender_internal.h:24