Add debug names for textures
Also changes pipeline barrier behavior, disable project window on Windows, and change window resizing behaviour to get around Windows-specific bug
This commit is contained in:
parent
c548971d5a
commit
93b55e7022
13 changed files with 50 additions and 6 deletions
|
@ -220,6 +220,7 @@ std::unique_ptr<Texture> load_texture(const file::Path path) {
|
||||||
texture->height = height;
|
texture->height = height;
|
||||||
|
|
||||||
GFXTextureCreateInfo createInfo = {};
|
GFXTextureCreateInfo createInfo = {};
|
||||||
|
createInfo.label = path.string();
|
||||||
createInfo.width = width;
|
createInfo.width = width;
|
||||||
createInfo.height = height;
|
createInfo.height = height;
|
||||||
createInfo.format = GFXPixelFormat::R8G8B8A8_UNORM;
|
createInfo.format = GFXPixelFormat::R8G8B8A8_UNORM;
|
||||||
|
|
|
@ -432,8 +432,8 @@ void Engine::resize(const int identifier, const prism::Extent extent) {
|
||||||
Expects(identifier >= 0);
|
Expects(identifier >= 0);
|
||||||
|
|
||||||
auto window = get_window(identifier);
|
auto window = get_window(identifier);
|
||||||
|
if (window == nullptr)
|
||||||
Expects(window != nullptr);
|
return;
|
||||||
|
|
||||||
window->extent = extent;
|
window->extent = extent;
|
||||||
|
|
||||||
|
|
|
@ -252,6 +252,8 @@ enum class GFXFilter {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct GFXTextureCreateInfo {
|
struct GFXTextureCreateInfo {
|
||||||
|
std::string label; // only used for debug
|
||||||
|
|
||||||
GFXTextureType type = GFXTextureType::Single2D;
|
GFXTextureType type = GFXTextureType::Single2D;
|
||||||
uint32_t width = 0;
|
uint32_t width = 0;
|
||||||
uint32_t height = 0;
|
uint32_t height = 0;
|
||||||
|
|
|
@ -299,6 +299,8 @@ GFXTexture* GFXVulkan::create_texture(const GFXTextureCreateInfo& info) {
|
||||||
|
|
||||||
vkCreateImage(device, &imageInfo, nullptr, &texture->handle);
|
vkCreateImage(device, &imageInfo, nullptr, &texture->handle);
|
||||||
|
|
||||||
|
name_object(device, VK_OBJECT_TYPE_IMAGE, (uint64_t)texture->handle, info.label);
|
||||||
|
|
||||||
texture->width = info.width;
|
texture->width = info.width;
|
||||||
texture->height = info.height;
|
texture->height = info.height;
|
||||||
texture->format = imageFormat;
|
texture->format = imageFormat;
|
||||||
|
@ -1650,11 +1652,11 @@ void GFXVulkan::inlineTransitionImageLayout(VkCommandBuffer commandBuffer, VkIma
|
||||||
destinationStage = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT;
|
destinationStage = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
barrier.srcAccessMask = 0;
|
barrier.srcAccessMask = VK_ACCESS_MEMORY_READ_BIT;
|
||||||
barrier.dstAccessMask = VK_ACCESS_SHADER_READ_BIT;
|
barrier.dstAccessMask = VK_ACCESS_MEMORY_READ_BIT;
|
||||||
|
|
||||||
sourceStage = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT;
|
sourceStage = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT;
|
||||||
destinationStage = VK_PIPELINE_STAGE_TRANSFER_BIT;
|
destinationStage = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
vkCmdPipelineBarrier(
|
vkCmdPipelineBarrier(
|
||||||
|
|
|
@ -53,6 +53,7 @@ DoFPass::DoFPass(GFX* gfx, Renderer* renderer) : renderer(renderer) {
|
||||||
pipeline = gfx->create_graphics_pipeline(create_info);
|
pipeline = gfx->create_graphics_pipeline(create_info);
|
||||||
|
|
||||||
GFXTextureCreateInfo textureInfo = {};
|
GFXTextureCreateInfo textureInfo = {};
|
||||||
|
textureInfo.label = "Normal Field";
|
||||||
textureInfo.width = extent.width;
|
textureInfo.width = extent.width;
|
||||||
textureInfo.height = extent.height;
|
textureInfo.height = extent.height;
|
||||||
textureInfo.format = GFXPixelFormat::RGBA_32F;
|
textureInfo.format = GFXPixelFormat::RGBA_32F;
|
||||||
|
@ -60,6 +61,8 @@ DoFPass::DoFPass(GFX* gfx, Renderer* renderer) : renderer(renderer) {
|
||||||
textureInfo.samplingMode = SamplingMode::ClampToEdge;
|
textureInfo.samplingMode = SamplingMode::ClampToEdge;
|
||||||
|
|
||||||
normal_field = gfx->create_texture(textureInfo);
|
normal_field = gfx->create_texture(textureInfo);
|
||||||
|
|
||||||
|
textureInfo.label = "Far Field";
|
||||||
far_field = gfx->create_texture(textureInfo);
|
far_field = gfx->create_texture(textureInfo);
|
||||||
|
|
||||||
GFXFramebufferCreateInfo framebufferInfo = {};
|
GFXFramebufferCreateInfo framebufferInfo = {};
|
||||||
|
|
|
@ -34,6 +34,7 @@ GaussianHelper::GaussianHelper(GFX* gfx, const prism::Extent extent) : extent(ex
|
||||||
|
|
||||||
// resources
|
// resources
|
||||||
GFXTextureCreateInfo textureInfo = {};
|
GFXTextureCreateInfo textureInfo = {};
|
||||||
|
textureInfo.label = "Gaussian";
|
||||||
textureInfo.width = extent.width;
|
textureInfo.width = extent.width;
|
||||||
textureInfo.height = extent.height;
|
textureInfo.height = extent.height;
|
||||||
textureInfo.format = GFXPixelFormat::RGBA_32F;
|
textureInfo.format = GFXPixelFormat::RGBA_32F;
|
||||||
|
|
|
@ -16,7 +16,7 @@ void ImGuiPass::initialize() {
|
||||||
io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset;
|
io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset;
|
||||||
io.BackendFlags |= ImGuiBackendFlags_RendererHasViewports;
|
io.BackendFlags |= ImGuiBackendFlags_RendererHasViewports;
|
||||||
|
|
||||||
#if !defined(PLATFORM_TVOS) && !defined(PLATFORM_IOS) && !defined(PLATFORM_WINDOWS)
|
#if !defined(PLATFORM_TVOS) && !defined(PLATFORM_IOS)
|
||||||
load_font("OpenSans-Regular.ttf");
|
load_font("OpenSans-Regular.ttf");
|
||||||
#endif
|
#endif
|
||||||
create_font_texture();
|
create_font_texture();
|
||||||
|
@ -175,6 +175,7 @@ void ImGuiPass::create_font_texture() {
|
||||||
io.Fonts->GetTexDataAsRGBA32(&pixels, &width, &height);
|
io.Fonts->GetTexDataAsRGBA32(&pixels, &width, &height);
|
||||||
|
|
||||||
GFXTextureCreateInfo createInfo = {};
|
GFXTextureCreateInfo createInfo = {};
|
||||||
|
createInfo.label = "ImGui Font";
|
||||||
createInfo.width = width;
|
createInfo.width = width;
|
||||||
createInfo.height = height;
|
createInfo.height = height;
|
||||||
createInfo.format = GFXPixelFormat::RGBA8_UNORM;
|
createInfo.format = GFXPixelFormat::RGBA8_UNORM;
|
||||||
|
|
|
@ -772,6 +772,7 @@ void Renderer::create_mesh_pipeline(Material& material) {
|
||||||
|
|
||||||
void Renderer::createDummyTexture() {
|
void Renderer::createDummyTexture() {
|
||||||
GFXTextureCreateInfo createInfo = {};
|
GFXTextureCreateInfo createInfo = {};
|
||||||
|
createInfo.label = "Dummy";
|
||||||
createInfo.width = 1;
|
createInfo.width = 1;
|
||||||
createInfo.height = 1;
|
createInfo.height = 1;
|
||||||
createInfo.format = GFXPixelFormat::R8G8B8A8_UNORM;
|
createInfo.format = GFXPixelFormat::R8G8B8A8_UNORM;
|
||||||
|
@ -801,6 +802,7 @@ void Renderer::createOffscreenResources() {
|
||||||
const auto extent = get_render_extent();
|
const auto extent = get_render_extent();
|
||||||
|
|
||||||
GFXTextureCreateInfo textureInfo = {};
|
GFXTextureCreateInfo textureInfo = {};
|
||||||
|
textureInfo.label = "Offscreen Color";
|
||||||
textureInfo.width = extent.width;
|
textureInfo.width = extent.width;
|
||||||
textureInfo.height = extent.height;
|
textureInfo.height = extent.height;
|
||||||
textureInfo.format = GFXPixelFormat::RGBA_32F;
|
textureInfo.format = GFXPixelFormat::RGBA_32F;
|
||||||
|
@ -808,8 +810,11 @@ void Renderer::createOffscreenResources() {
|
||||||
textureInfo.samplingMode = SamplingMode::ClampToEdge;
|
textureInfo.samplingMode = SamplingMode::ClampToEdge;
|
||||||
|
|
||||||
offscreenColorTexture = gfx->create_texture(textureInfo);
|
offscreenColorTexture = gfx->create_texture(textureInfo);
|
||||||
|
|
||||||
|
textureInfo.label = "Offscreen Back";
|
||||||
offscreenBackTexture = gfx->create_texture(textureInfo);
|
offscreenBackTexture = gfx->create_texture(textureInfo);
|
||||||
|
|
||||||
|
textureInfo.label = "Offscreen Depth";
|
||||||
textureInfo.format = GFXPixelFormat::DEPTH_32F;
|
textureInfo.format = GFXPixelFormat::DEPTH_32F;
|
||||||
|
|
||||||
offscreenDepthTexture = gfx->create_texture(textureInfo);
|
offscreenDepthTexture = gfx->create_texture(textureInfo);
|
||||||
|
@ -829,6 +834,7 @@ void Renderer::createOffscreenResources() {
|
||||||
viewportRenderPass = gfx->create_render_pass(renderPassInfo);
|
viewportRenderPass = gfx->create_render_pass(renderPassInfo);
|
||||||
|
|
||||||
GFXTextureCreateInfo textureInfo = {};
|
GFXTextureCreateInfo textureInfo = {};
|
||||||
|
textureInfo.label = "Viewport Color";
|
||||||
textureInfo.width = extent.width;
|
textureInfo.width = extent.width;
|
||||||
textureInfo.height = extent.height;
|
textureInfo.height = extent.height;
|
||||||
textureInfo.format = GFXPixelFormat::RGBA8_UNORM;
|
textureInfo.format = GFXPixelFormat::RGBA8_UNORM;
|
||||||
|
@ -934,6 +940,7 @@ void Renderer::createFontPipeline() {
|
||||||
worldTextPipeline = gfx->create_graphics_pipeline(pipelineInfo);
|
worldTextPipeline = gfx->create_graphics_pipeline(pipelineInfo);
|
||||||
|
|
||||||
GFXTextureCreateInfo textureInfo = {};
|
GFXTextureCreateInfo textureInfo = {};
|
||||||
|
textureInfo.label = "UI Font";
|
||||||
textureInfo.width = font.width;
|
textureInfo.width = font.width;
|
||||||
textureInfo.height = font.height;
|
textureInfo.height = font.height;
|
||||||
textureInfo.format = GFXPixelFormat::R8_UNORM;
|
textureInfo.format = GFXPixelFormat::R8_UNORM;
|
||||||
|
@ -1003,6 +1010,7 @@ void Renderer::createGaussianResources() {
|
||||||
gHelper = std::make_unique<GaussianHelper>(gfx, extent);
|
gHelper = std::make_unique<GaussianHelper>(gfx, extent);
|
||||||
|
|
||||||
GFXTextureCreateInfo textureInfo = {};
|
GFXTextureCreateInfo textureInfo = {};
|
||||||
|
textureInfo.label = "Blur Store";
|
||||||
textureInfo.width = extent.width;
|
textureInfo.width = extent.width;
|
||||||
textureInfo.height = extent.height;
|
textureInfo.height = extent.height;
|
||||||
textureInfo.format = GFXPixelFormat::RGBA_32F;
|
textureInfo.format = GFXPixelFormat::RGBA_32F;
|
||||||
|
@ -1031,6 +1039,7 @@ void Renderer::createBRDF() {
|
||||||
brdfPipeline = gfx->create_graphics_pipeline(pipelineInfo);
|
brdfPipeline = gfx->create_graphics_pipeline(pipelineInfo);
|
||||||
|
|
||||||
GFXTextureCreateInfo textureInfo = {};
|
GFXTextureCreateInfo textureInfo = {};
|
||||||
|
textureInfo.label = "BRDF LUT";
|
||||||
textureInfo.format = GFXPixelFormat::R8G8_SFLOAT;
|
textureInfo.format = GFXPixelFormat::R8G8_SFLOAT;
|
||||||
textureInfo.width = brdf_resolution;
|
textureInfo.width = brdf_resolution;
|
||||||
textureInfo.height = brdf_resolution;
|
textureInfo.height = brdf_resolution;
|
||||||
|
@ -1088,6 +1097,7 @@ void Renderer::create_histogram_resources() {
|
||||||
histogram_buffer = gfx->create_buffer(nullptr, sizeof(uint32_t) * 256, false, GFXBufferUsage::Storage);
|
histogram_buffer = gfx->create_buffer(nullptr, sizeof(uint32_t) * 256, false, GFXBufferUsage::Storage);
|
||||||
|
|
||||||
GFXTextureCreateInfo texture_info = {};
|
GFXTextureCreateInfo texture_info = {};
|
||||||
|
texture_info.label = "Average Luminance Store";
|
||||||
texture_info.width = 1;
|
texture_info.width = 1;
|
||||||
texture_info.height = 1;
|
texture_info.height = 1;
|
||||||
texture_info.format = GFXPixelFormat::R_16F;
|
texture_info.format = GFXPixelFormat::R_16F;
|
||||||
|
|
|
@ -67,6 +67,7 @@ SceneCapture::SceneCapture(GFX* gfx) {
|
||||||
renderPass = gfx->create_render_pass(renderPassInfo);
|
renderPass = gfx->create_render_pass(renderPassInfo);
|
||||||
|
|
||||||
GFXTextureCreateInfo textureInfo = {};
|
GFXTextureCreateInfo textureInfo = {};
|
||||||
|
textureInfo.label = "Scene Capture Color";
|
||||||
textureInfo.width = scene_cubemap_resolution;
|
textureInfo.width = scene_cubemap_resolution;
|
||||||
textureInfo.height = scene_cubemap_resolution;
|
textureInfo.height = scene_cubemap_resolution;
|
||||||
textureInfo.format = GFXPixelFormat::R8G8B8A8_UNORM;
|
textureInfo.format = GFXPixelFormat::R8G8B8A8_UNORM;
|
||||||
|
@ -76,6 +77,7 @@ SceneCapture::SceneCapture(GFX* gfx) {
|
||||||
offscreenTexture = gfx->create_texture(textureInfo);
|
offscreenTexture = gfx->create_texture(textureInfo);
|
||||||
|
|
||||||
GFXTextureCreateInfo depthTextureInfo = {};
|
GFXTextureCreateInfo depthTextureInfo = {};
|
||||||
|
depthTextureInfo.label = "Scene Capture Depth";
|
||||||
depthTextureInfo.width = scene_cubemap_resolution;
|
depthTextureInfo.width = scene_cubemap_resolution;
|
||||||
depthTextureInfo.height = scene_cubemap_resolution;
|
depthTextureInfo.height = scene_cubemap_resolution;
|
||||||
depthTextureInfo.format = GFXPixelFormat::DEPTH_32F;
|
depthTextureInfo.format = GFXPixelFormat::DEPTH_32F;
|
||||||
|
@ -91,6 +93,7 @@ SceneCapture::SceneCapture(GFX* gfx) {
|
||||||
offscreenFramebuffer = gfx->create_framebuffer(info);
|
offscreenFramebuffer = gfx->create_framebuffer(info);
|
||||||
|
|
||||||
GFXTextureCreateInfo cubeTextureInfo = {};
|
GFXTextureCreateInfo cubeTextureInfo = {};
|
||||||
|
cubeTextureInfo.label = "Scene Capture Cubemap";
|
||||||
cubeTextureInfo.type = GFXTextureType::Cubemap;
|
cubeTextureInfo.type = GFXTextureType::Cubemap;
|
||||||
cubeTextureInfo.width = scene_cubemap_resolution;
|
cubeTextureInfo.width = scene_cubemap_resolution;
|
||||||
cubeTextureInfo.height = scene_cubemap_resolution;
|
cubeTextureInfo.height = scene_cubemap_resolution;
|
||||||
|
@ -113,6 +116,7 @@ void SceneCapture::create_scene_resources(Scene& scene) {
|
||||||
|
|
||||||
if(gfx->supports_feature(GFXFeature::CubemapArray)) {
|
if(gfx->supports_feature(GFXFeature::CubemapArray)) {
|
||||||
GFXTextureCreateInfo cubeTextureInfo = {};
|
GFXTextureCreateInfo cubeTextureInfo = {};
|
||||||
|
cubeTextureInfo.label = "Irriadiance Cubemap";
|
||||||
cubeTextureInfo.type = GFXTextureType::CubemapArray;
|
cubeTextureInfo.type = GFXTextureType::CubemapArray;
|
||||||
cubeTextureInfo.width = irradiance_cubemap_resolution;
|
cubeTextureInfo.width = irradiance_cubemap_resolution;
|
||||||
cubeTextureInfo.height = irradiance_cubemap_resolution;
|
cubeTextureInfo.height = irradiance_cubemap_resolution;
|
||||||
|
@ -124,6 +128,7 @@ void SceneCapture::create_scene_resources(Scene& scene) {
|
||||||
scene.irradianceCubeArray = gfx->create_texture(cubeTextureInfo);
|
scene.irradianceCubeArray = gfx->create_texture(cubeTextureInfo);
|
||||||
|
|
||||||
cubeTextureInfo = {};
|
cubeTextureInfo = {};
|
||||||
|
cubeTextureInfo.label = "Prefiltered Cubemap";
|
||||||
cubeTextureInfo.type = GFXTextureType::CubemapArray;
|
cubeTextureInfo.type = GFXTextureType::CubemapArray;
|
||||||
cubeTextureInfo.width = scene_cubemap_resolution;
|
cubeTextureInfo.width = scene_cubemap_resolution;
|
||||||
cubeTextureInfo.height = scene_cubemap_resolution;
|
cubeTextureInfo.height = scene_cubemap_resolution;
|
||||||
|
@ -408,6 +413,7 @@ void SceneCapture::createIrradianceResources() {
|
||||||
GFX* gfx = engine->get_gfx();
|
GFX* gfx = engine->get_gfx();
|
||||||
|
|
||||||
GFXTextureCreateInfo textureInfo = {};
|
GFXTextureCreateInfo textureInfo = {};
|
||||||
|
textureInfo.label = "Irradiance Offscreen";
|
||||||
textureInfo.width = irradiance_cubemap_resolution;
|
textureInfo.width = irradiance_cubemap_resolution;
|
||||||
textureInfo.height = irradiance_cubemap_resolution;
|
textureInfo.height = irradiance_cubemap_resolution;
|
||||||
textureInfo.format = GFXPixelFormat::R8G8B8A8_UNORM;
|
textureInfo.format = GFXPixelFormat::R8G8B8A8_UNORM;
|
||||||
|
@ -461,6 +467,7 @@ void SceneCapture::createPrefilterResources() {
|
||||||
GFX* gfx = engine->get_gfx();
|
GFX* gfx = engine->get_gfx();
|
||||||
|
|
||||||
GFXTextureCreateInfo textureInfo = {};
|
GFXTextureCreateInfo textureInfo = {};
|
||||||
|
textureInfo.label = "Prefiltered Offscreen";
|
||||||
textureInfo.width = scene_cubemap_resolution;
|
textureInfo.width = scene_cubemap_resolution;
|
||||||
textureInfo.height = scene_cubemap_resolution;
|
textureInfo.height = scene_cubemap_resolution;
|
||||||
textureInfo.format = GFXPixelFormat::R8G8B8A8_UNORM;
|
textureInfo.format = GFXPixelFormat::R8G8B8A8_UNORM;
|
||||||
|
|
|
@ -45,6 +45,7 @@ void ShadowPass::create_scene_resources(Scene& scene) {
|
||||||
// sun light
|
// sun light
|
||||||
{
|
{
|
||||||
GFXTextureCreateInfo textureInfo = {};
|
GFXTextureCreateInfo textureInfo = {};
|
||||||
|
textureInfo.label = "Shadow Depth";
|
||||||
textureInfo.width = render_options.shadow_resolution;
|
textureInfo.width = render_options.shadow_resolution;
|
||||||
textureInfo.height = render_options.shadow_resolution;
|
textureInfo.height = render_options.shadow_resolution;
|
||||||
textureInfo.format = GFXPixelFormat::DEPTH_32F;
|
textureInfo.format = GFXPixelFormat::DEPTH_32F;
|
||||||
|
@ -62,6 +63,7 @@ void ShadowPass::create_scene_resources(Scene& scene) {
|
||||||
// point lights
|
// point lights
|
||||||
if(gfx->supports_feature(GFXFeature::CubemapArray)) {
|
if(gfx->supports_feature(GFXFeature::CubemapArray)) {
|
||||||
GFXTextureCreateInfo cubeTextureInfo = {};
|
GFXTextureCreateInfo cubeTextureInfo = {};
|
||||||
|
cubeTextureInfo.label = "Point Light Array";
|
||||||
cubeTextureInfo.type = GFXTextureType::CubemapArray;
|
cubeTextureInfo.type = GFXTextureType::CubemapArray;
|
||||||
cubeTextureInfo.width = render_options.shadow_resolution;
|
cubeTextureInfo.width = render_options.shadow_resolution;
|
||||||
cubeTextureInfo.height = render_options.shadow_resolution;
|
cubeTextureInfo.height = render_options.shadow_resolution;
|
||||||
|
@ -76,6 +78,7 @@ void ShadowPass::create_scene_resources(Scene& scene) {
|
||||||
// spot lights
|
// spot lights
|
||||||
{
|
{
|
||||||
GFXTextureCreateInfo spotTextureInfo = {};
|
GFXTextureCreateInfo spotTextureInfo = {};
|
||||||
|
spotTextureInfo.label = "Spot Light Array";
|
||||||
spotTextureInfo.type = GFXTextureType::Array2D;
|
spotTextureInfo.type = GFXTextureType::Array2D;
|
||||||
spotTextureInfo.width = render_options.shadow_resolution;
|
spotTextureInfo.width = render_options.shadow_resolution;
|
||||||
spotTextureInfo.height = render_options.shadow_resolution;
|
spotTextureInfo.height = render_options.shadow_resolution;
|
||||||
|
@ -374,6 +377,7 @@ void ShadowPass::create_offscreen_resources() {
|
||||||
auto gfx = engine->get_gfx();
|
auto gfx = engine->get_gfx();
|
||||||
|
|
||||||
GFXTextureCreateInfo textureInfo = {};
|
GFXTextureCreateInfo textureInfo = {};
|
||||||
|
textureInfo.label = "Shadow Color";
|
||||||
textureInfo.width = render_options.shadow_resolution;
|
textureInfo.width = render_options.shadow_resolution;
|
||||||
textureInfo.height = render_options.shadow_resolution;
|
textureInfo.height = render_options.shadow_resolution;
|
||||||
textureInfo.format = GFXPixelFormat::R_32F;
|
textureInfo.format = GFXPixelFormat::R_32F;
|
||||||
|
@ -383,6 +387,7 @@ void ShadowPass::create_offscreen_resources() {
|
||||||
offscreen_color_texture = gfx->create_texture(textureInfo);
|
offscreen_color_texture = gfx->create_texture(textureInfo);
|
||||||
|
|
||||||
GFXTextureCreateInfo depthTextureInfo = {};
|
GFXTextureCreateInfo depthTextureInfo = {};
|
||||||
|
depthTextureInfo.label = "Shadow Depth";
|
||||||
depthTextureInfo.width = render_options.shadow_resolution;
|
depthTextureInfo.width = render_options.shadow_resolution;
|
||||||
depthTextureInfo.height = render_options.shadow_resolution;
|
depthTextureInfo.height = render_options.shadow_resolution;
|
||||||
depthTextureInfo.format = GFXPixelFormat::DEPTH_32F;
|
depthTextureInfo.format = GFXPixelFormat::DEPTH_32F;
|
||||||
|
|
|
@ -73,6 +73,7 @@ void SMAAPass::create_textures() {
|
||||||
|
|
||||||
//load area image
|
//load area image
|
||||||
GFXTextureCreateInfo areaInfo = {};
|
GFXTextureCreateInfo areaInfo = {};
|
||||||
|
areaInfo.label = "SMAA Area";
|
||||||
areaInfo.width = AREATEX_WIDTH;
|
areaInfo.width = AREATEX_WIDTH;
|
||||||
areaInfo.height = AREATEX_HEIGHT;
|
areaInfo.height = AREATEX_HEIGHT;
|
||||||
areaInfo.format = GFXPixelFormat::R8G8_UNORM;
|
areaInfo.format = GFXPixelFormat::R8G8_UNORM;
|
||||||
|
@ -85,6 +86,7 @@ void SMAAPass::create_textures() {
|
||||||
|
|
||||||
// load search image
|
// load search image
|
||||||
GFXTextureCreateInfo searchInfo = {};
|
GFXTextureCreateInfo searchInfo = {};
|
||||||
|
searchInfo.label = "SMAA Search";
|
||||||
searchInfo.width = SEARCHTEX_WIDTH;
|
searchInfo.width = SEARCHTEX_WIDTH;
|
||||||
searchInfo.height = SEARCHTEX_HEIGHT;
|
searchInfo.height = SEARCHTEX_HEIGHT;
|
||||||
searchInfo.format = GFXPixelFormat::R8_UNORM;
|
searchInfo.format = GFXPixelFormat::R8_UNORM;
|
||||||
|
@ -138,12 +140,15 @@ void SMAAPass::create_offscreen_resources() {
|
||||||
auto gfx = engine->get_gfx();
|
auto gfx = engine->get_gfx();
|
||||||
|
|
||||||
GFXTextureCreateInfo textureInfo = {};
|
GFXTextureCreateInfo textureInfo = {};
|
||||||
|
textureInfo.label = "SMAA Edge";
|
||||||
textureInfo.width = extent.width;
|
textureInfo.width = extent.width;
|
||||||
textureInfo.height = extent.height;
|
textureInfo.height = extent.height;
|
||||||
textureInfo.format = GFXPixelFormat::R16G16B16A16_SFLOAT;
|
textureInfo.format = GFXPixelFormat::R16G16B16A16_SFLOAT;
|
||||||
textureInfo.usage = GFXTextureUsage::Attachment | GFXTextureUsage::Sampled;
|
textureInfo.usage = GFXTextureUsage::Attachment | GFXTextureUsage::Sampled;
|
||||||
|
|
||||||
edge_texture = gfx->create_texture(textureInfo);
|
edge_texture = gfx->create_texture(textureInfo);
|
||||||
|
|
||||||
|
textureInfo.label = "SMAA Blend";
|
||||||
blend_texture = gfx->create_texture(textureInfo);
|
blend_texture = gfx->create_texture(textureInfo);
|
||||||
|
|
||||||
GFXFramebufferCreateInfo framebufferInfo = {};
|
GFXFramebufferCreateInfo framebufferInfo = {};
|
||||||
|
|
|
@ -763,6 +763,7 @@ bool material_readable(const file::Path path) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void cacheAssetFilesystem() {
|
void cacheAssetFilesystem() {
|
||||||
|
#ifndef PLATFORM_WINDOWS
|
||||||
asset_files.clear();
|
asset_files.clear();
|
||||||
|
|
||||||
auto data_directory = "../../../data";
|
auto data_directory = "../../../data";
|
||||||
|
@ -777,6 +778,7 @@ void cacheAssetFilesystem() {
|
||||||
}
|
}
|
||||||
|
|
||||||
filesystem_cached = true;
|
filesystem_cached = true;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void CommonEditor::drawAssets() {
|
void CommonEditor::drawAssets() {
|
||||||
|
@ -863,6 +865,7 @@ GFXTexture* CommonEditor::get_texture_preview(Texture& texture) {
|
||||||
auto gfx = engine->get_gfx();
|
auto gfx = engine->get_gfx();
|
||||||
|
|
||||||
GFXTextureCreateInfo texture_create_info = {};
|
GFXTextureCreateInfo texture_create_info = {};
|
||||||
|
texture_create_info.label = "Preview of " + texture.path;
|
||||||
texture_create_info.width = thumbnail_resolution;
|
texture_create_info.width = thumbnail_resolution;
|
||||||
texture_create_info.height = thumbnail_resolution;
|
texture_create_info.height = thumbnail_resolution;
|
||||||
texture_create_info.format = GFXPixelFormat::RGBA8_UNORM;
|
texture_create_info.format = GFXPixelFormat::RGBA8_UNORM;
|
||||||
|
@ -1103,6 +1106,7 @@ void CommonEditor::load_thumbnail_cache() {
|
||||||
thumbnail_cache->read(image.data(), thumbnail_resolution * thumbnail_resolution * 4);
|
thumbnail_cache->read(image.data(), thumbnail_resolution * thumbnail_resolution * 4);
|
||||||
|
|
||||||
GFXTextureCreateInfo info;
|
GFXTextureCreateInfo info;
|
||||||
|
info.label = "Preview of " + filename;
|
||||||
info.width = thumbnail_resolution;
|
info.width = thumbnail_resolution;
|
||||||
info.height = thumbnail_resolution;
|
info.height = thumbnail_resolution;
|
||||||
info.format = GFXPixelFormat::RGBA8_UNORM;
|
info.format = GFXPixelFormat::RGBA8_UNORM;
|
||||||
|
|
|
@ -177,6 +177,7 @@ void DebugPass::createOffscreenResources() {
|
||||||
// selection resources
|
// selection resources
|
||||||
{
|
{
|
||||||
GFXTextureCreateInfo textureInfo = {};
|
GFXTextureCreateInfo textureInfo = {};
|
||||||
|
textureInfo.label = "Select Color";
|
||||||
textureInfo.width = extent.width;
|
textureInfo.width = extent.width;
|
||||||
textureInfo.height = extent.height;
|
textureInfo.height = extent.height;
|
||||||
textureInfo.format = GFXPixelFormat::R8G8B8A8_UNORM;
|
textureInfo.format = GFXPixelFormat::R8G8B8A8_UNORM;
|
||||||
|
@ -185,6 +186,7 @@ void DebugPass::createOffscreenResources() {
|
||||||
|
|
||||||
selectTexture = engine->get_gfx()->create_texture(textureInfo);
|
selectTexture = engine->get_gfx()->create_texture(textureInfo);
|
||||||
|
|
||||||
|
textureInfo.label = "Select Depth";
|
||||||
textureInfo.format = GFXPixelFormat::DEPTH_32F;
|
textureInfo.format = GFXPixelFormat::DEPTH_32F;
|
||||||
|
|
||||||
selectDepthTexture = engine->get_gfx()->create_texture(textureInfo);
|
selectDepthTexture = engine->get_gfx()->create_texture(textureInfo);
|
||||||
|
@ -201,6 +203,7 @@ void DebugPass::createOffscreenResources() {
|
||||||
// sobel
|
// sobel
|
||||||
{
|
{
|
||||||
GFXTextureCreateInfo textureInfo = {};
|
GFXTextureCreateInfo textureInfo = {};
|
||||||
|
textureInfo.label = "Sobel";
|
||||||
textureInfo.width = extent.width;
|
textureInfo.width = extent.width;
|
||||||
textureInfo.height = extent.height;
|
textureInfo.height = extent.height;
|
||||||
textureInfo.format = GFXPixelFormat::R8_UNORM;
|
textureInfo.format = GFXPixelFormat::R8_UNORM;
|
||||||
|
|
Reference in a new issue