[vulkan] Move 2d to the output render pass

This separates 2d UI rendering from 3d world rendering, making way for
various post-processing effects on the 3d render.
This commit is contained in:
Bill Currie 2022-11-27 09:51:01 +09:00
parent 85d40123e7
commit 22615f25ab
4 changed files with 20 additions and 30 deletions

View file

@ -1124,31 +1124,10 @@
inputAssembly = $properties.inputAssembly.alias;
layout = sprite_layout;
};
twod_depth = {
@inherit = $properties.pipelines.depth_base;
stages = (
{
stage = vertex;
name = main;
module = $builtin/twod.vert;
},
{
stage = fragment;
name = main;
module = $builtin/twod_depth.frag;
},
);
vertexInput = $properties.vertexInput.twod;
inputAssembly = $properties.inputAssembly.twod;
rasterization = $properties.rasterization.counter_cw_cull_back;
colorBlend = {
logicOpEnable = false;
attachments = ($properties.attachmentBlendOp.alpha_blend);
};
layout = twod_layout;
};
twod = {
@inherit = $properties.pipelines.trans_base;//FIXME should be sparate
@inherit = $properties.pipelines.trans_base;
renderPass = output;
subpass = 0;
stages = (
{
stage = vertex;
@ -1172,7 +1151,9 @@
layout = twod_layout;
};
slice = {
@inherit = $properties.pipelines.trans_base;//FIXME should be sparate
@inherit = $properties.pipelines.trans_base;
renderPass = output;
subpass = 0;
stages = (
{ stage = vertex; name = main; module = $builtin/slice.vert; },
{ stage = fragment; name = main; module = $builtin/glyph.frag; },
@ -1191,7 +1172,9 @@
layout = glyph_layout;//slices use the same descriptors as glyphs
};
glyph = {
@inherit = $properties.pipelines.trans_base;//FIXME should be sparate
@inherit = $properties.pipelines.trans_base;
renderPass = output;
subpass = 0;
stages = (
{ stage = vertex; name = main; module = $builtin/glyph.vert; },
{ stage = fragment; name = main; module = $builtin/glyph.frag; },

View file

@ -78,7 +78,7 @@ static const char * __attribute__((used)) draw_pass_names[] = {
};
static QFV_Subpass subpass_map[] = {
[QFV_draw2d] = QFV_passTranslucent,
[QFV_draw2d] = 0,
};
typedef struct descbatch_s {

View file

@ -50,7 +50,6 @@
#include "QF/Vulkan/qf_alias.h"
#include "QF/Vulkan/qf_bsp.h"
#include "QF/Vulkan/qf_compose.h"
#include "QF/Vulkan/qf_draw.h"
#include "QF/Vulkan/qf_iqm.h"
#include "QF/Vulkan/qf_lighting.h"
#include "QF/Vulkan/qf_lightmap.h"
@ -168,7 +167,6 @@ main_draw (qfv_renderframe_t *rFrame)
{
Vulkan_Matrix_Draw (rFrame);
Vulkan_RenderView (rFrame);
Vulkan_FlushText (rFrame);//FIXME delayed by a frame?
Vulkan_Lighting_Draw (rFrame);
Vulkan_Compose_Draw (rFrame);
}

View file

@ -42,6 +42,7 @@
#include "QF/render.h"
#include "QF/sys.h"
#include "QF/Vulkan/qf_draw.h"
#include "QF/Vulkan/qf_matrices.h"
#include "QF/Vulkan/qf_output.h"
#include "QF/Vulkan/qf_renderpass.h"
@ -135,7 +136,7 @@ preoutput_draw (qfv_renderframe_t *rFrame)
}
static void
output_draw (qfv_renderframe_t *rFrame)
process_input (qfv_renderframe_t *rFrame)
{
vulkan_ctx_t *ctx = rFrame->vulkan_ctx;
qfv_device_t *device = ctx->device;
@ -179,6 +180,14 @@ output_draw (qfv_renderframe_t *rFrame)
QFV_duCmdEndLabel (device, cmd);
dfunc->vkEndCommandBuffer (cmd);
}
static void
output_draw (qfv_renderframe_t *rFrame)
{
process_input (rFrame);
Vulkan_FlushText (rFrame);
}
void