mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 23:32:09 +00:00
[vulkan] Attempt to load the render info spec
It fails due to not supporting labeled arrays yet. I'm currently thinking about the design for vkgen.
This commit is contained in:
parent
c94e691e7e
commit
9e050ebf9a
7 changed files with 38 additions and 12 deletions
|
@ -165,5 +165,6 @@ typedef struct qfv_renderpass_s_ {
|
|||
} qfv_renderpass_t_;
|
||||
|
||||
void QFV_RunRenderPass (qfv_renderpass_t_ *rp, struct vulkan_ctx_s *ctx);
|
||||
void QFV_LoadRenderPass (struct vulkan_ctx_s *ctx);
|
||||
|
||||
#endif//__QF_Vulkan_render_h
|
||||
|
|
|
@ -201,6 +201,8 @@ rp_deferred_src = libs/video/renderer/vulkan/rp_deferred.plist
|
|||
rp_deferred_gen = libs/video/renderer/vulkan/rp_deferred.plc
|
||||
rp_forward_src = libs/video/renderer/vulkan/rp_forward.plist
|
||||
rp_forward_gen = libs/video/renderer/vulkan/rp_forward.plc
|
||||
rp_main_def_src = libs/video/renderer/vulkan/rp_main_def.plist
|
||||
rp_main_def_gen = libs/video/renderer/vulkan/rp_main_def.plc
|
||||
rp_output_src = libs/video/renderer/vulkan/rp_output.plist
|
||||
rp_output_gen = libs/video/renderer/vulkan/rp_output.plc
|
||||
rp_shadow_src = libs/video/renderer/vulkan/rp_shadow.plist
|
||||
|
@ -266,6 +268,7 @@ libs/video/renderer/vulkan/vkparse.lo: \
|
|||
${rp_defcube_gen} \
|
||||
${rp_deferred_gen} \
|
||||
$(rp_forward_gen) \
|
||||
$(rp_main_def_gen) \
|
||||
$(rp_output_gen) \
|
||||
${rp_shadow_gen}
|
||||
|
||||
|
@ -525,6 +528,7 @@ EXTRA_DIST += \
|
|||
$(rp_defcube_src) \
|
||||
$(rp_deferred_src) \
|
||||
$(rp_forward_src) \
|
||||
$(rp_main_def_src) \
|
||||
$(rp_output_src) \
|
||||
$(rp_shadow_src) \
|
||||
$(pl_quake_def_src) \
|
||||
|
|
|
@ -66,6 +66,7 @@
|
|||
#include "QF/Vulkan/image.h"
|
||||
#include "QF/Vulkan/instance.h"
|
||||
#include "QF/Vulkan/projection.h"
|
||||
#include "QF/Vulkan/render.h"
|
||||
#include "QF/Vulkan/staging.h"
|
||||
#include "QF/Vulkan/swapchain.h"
|
||||
#include "QF/ui/view.h"
|
||||
|
@ -98,6 +99,7 @@ vulkan_R_Init (void)
|
|||
Vulkan_CreateSwapchain (vulkan_ctx);
|
||||
Vulkan_CreateCapture (vulkan_ctx);
|
||||
|
||||
QFV_LoadRenderPass (vulkan_ctx);
|
||||
Vulkan_CreateRenderPasses (vulkan_ctx);
|
||||
Vulkan_Output_Init (vulkan_ctx);
|
||||
|
||||
|
|
|
@ -45,6 +45,9 @@
|
|||
#include "QF/Vulkan/pipeline.h"
|
||||
#include "vid_vulkan.h"
|
||||
|
||||
#include "QF/Vulkan/qf_renderpass.h"//FIXME
|
||||
#include "vkparse.h"
|
||||
|
||||
static void
|
||||
run_pipeline (qfv_pipeline_t *pipeline, VkCommandBuffer cmd, vulkan_ctx_t *ctx)
|
||||
{
|
||||
|
@ -120,3 +123,11 @@ QFV_RunRenderPass (qfv_renderpass_t_ *rp, vulkan_ctx_t *ctx)
|
|||
}
|
||||
QFV_CmdEndLabel (device, cmd);
|
||||
}
|
||||
|
||||
void
|
||||
QFV_LoadRenderPass (vulkan_ctx_t *ctx)
|
||||
{
|
||||
plitem_t *item = Vulkan_GetConfig (ctx, "main_def");
|
||||
__auto_type ri = QFV_ParseRenderInfo (ctx, item);
|
||||
printf ("%p\n", ri);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
properties {
|
||||
{
|
||||
properties = {
|
||||
color = {
|
||||
bsp = "[0, 0.5, 0.6, 1]";
|
||||
alias = "[0.6, 0.5, 0, 1]";
|
||||
|
@ -171,7 +172,7 @@ renderpasses = {
|
|||
format = $images.output.format;
|
||||
loadOp = clear;
|
||||
storeOp = store;
|
||||
$output.finalLayout;
|
||||
finalLayout = $output.finalLayout;
|
||||
};
|
||||
};
|
||||
framebuffer = {
|
||||
|
@ -226,7 +227,7 @@ renderpasses = {
|
|||
color = "[ 0.25, 0.25, 0.6, 1]";
|
||||
dependencies = {
|
||||
depth = $depth_dependency;
|
||||
}
|
||||
};
|
||||
attachments = {
|
||||
depth = depth_stencil_read_only_optimal;
|
||||
preserve = (color, emission, normal, position, output);
|
||||
|
@ -251,10 +252,12 @@ renderpasses = {
|
|||
params = (main, turbulent); },
|
||||
);
|
||||
};
|
||||
particles:trans {
|
||||
particles:trans = {
|
||||
color = $color.particles;
|
||||
pipline = partdraw;
|
||||
{ func = particles_draw; },
|
||||
tasks = (
|
||||
{ func = particles_draw; },
|
||||
);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -262,7 +265,7 @@ renderpasses = {
|
|||
color = "[ 0.3, 0.7, 0.3, 1]";
|
||||
dependencies = {
|
||||
depth = $depth_dependency;
|
||||
}
|
||||
};
|
||||
attachments = {
|
||||
color = {
|
||||
color = color_attachment_optimal;
|
||||
|
@ -311,7 +314,7 @@ renderpasses = {
|
|||
color = "[ 0.8, 0.8, 0.8, 1]";
|
||||
dependencies = {
|
||||
gbuffer = $color_dependency;
|
||||
}
|
||||
};
|
||||
attachments = {
|
||||
input = {
|
||||
depth = shader_read_only_optimal;
|
||||
|
@ -327,7 +330,7 @@ renderpasses = {
|
|||
};
|
||||
pipelines = {
|
||||
lights = {
|
||||
color = $color.lights
|
||||
color = $color.lights;
|
||||
pipeline = lighting;
|
||||
tasks = (
|
||||
{ func = "lights_draw"; },
|
||||
|
@ -339,7 +342,7 @@ renderpasses = {
|
|||
color = "[ 0.7, 0.3, 0.3, 1]";
|
||||
dependencies = {
|
||||
lighting = $color_dependency;
|
||||
}
|
||||
};
|
||||
attachments = {
|
||||
input = {
|
||||
opaque = shader_read_only_optimal;
|
||||
|
@ -351,7 +354,7 @@ renderpasses = {
|
|||
};
|
||||
pipelines = {
|
||||
compose = {
|
||||
color = $color.compose
|
||||
color = $color.compose;
|
||||
pipeline = compose;
|
||||
tasks = (
|
||||
{ func = "lights_draw"; },
|
||||
|
@ -369,3 +372,4 @@ renderpasses = {
|
|||
});
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1757,6 +1757,10 @@ static exprsym_t builtin_plist_syms[] = {
|
|||
.value = (void *)
|
||||
#include "libs/video/renderer/vulkan/rp_forward.plc"
|
||||
},
|
||||
{ .name = "main_def",
|
||||
.value = (void *)
|
||||
#include "libs/video/renderer/vulkan/rp_main_def.plc"
|
||||
},
|
||||
{ .name = "output",
|
||||
.value = (void *)
|
||||
#include "libs/video/renderer/vulkan/rp_output.plc"
|
||||
|
@ -2063,7 +2067,7 @@ QFV_ParseRenderInfo (vulkan_ctx_t *ctx, plitem_t *item)
|
|||
.type = &cexpr_plitem,
|
||||
.value = pl_items + i,
|
||||
};
|
||||
pl_items[i] = PL_ObjectForKey (properties, var_syms[i + 6].name);
|
||||
pl_items[i] = PL_ObjectForKey (properties, var_syms[i].name);
|
||||
}
|
||||
pl_items[num_keys + 0] = PL_ObjectForKey (item, "images");
|
||||
pl_items[num_keys + 1] = PL_ObjectForKey (item, "views");
|
||||
|
|
|
@ -533,7 +533,7 @@
|
|||
};
|
||||
qfv_renderinfo_s = {
|
||||
.name = qfv_renderinfo_t;
|
||||
//properties = auto;
|
||||
properties = ignore;
|
||||
images = {
|
||||
type = (array, qfv_imageinfo_t);
|
||||
size = num_images;
|
||||
|
|
Loading…
Reference in a new issue