[vulkan] Use correct vertex shader for skys

This gets skys rendering again, but their depth is incorrect.
This commit is contained in:
Bill Currie 2021-03-23 08:25:56 +09:00
parent de581501fb
commit 81956095f1
3 changed files with 15 additions and 14 deletions

View file

@ -36,7 +36,7 @@
#include <vulkan/vulkan.h>
//FIXME location
enum {
typedef enum {
QFV_passDepth, // geometry
QFV_passGBuffer, // geometry
QFV_passLighting, // single quad
@ -44,7 +44,7 @@ enum {
QFV_passCompose, // single quad
QFV_NumPasses
};
} QFV_Subpass;
enum {
QFV_attachDepth,

View file

@ -719,12 +719,12 @@
//renderPass = renderpass;
};
bsp_skysheet = {
subpass = 2;
subpass = 3;
stages = (
{
stage = vertex;
name = main;
module = $builtin/bsp_gbuf.vert;
module = $builtin/quakebsp.vert;
},
{
stage = fragment;

View file

@ -75,6 +75,12 @@ static const char *bsp_pass_names[] = {
"translucent",
};
static QFV_Subpass subpass_map[] = {
QFV_passDepth, // QFV_bspDepth
QFV_passGBuffer, // QFV_bspGBuffer
QFV_passTranslucent, // QFV_bspTranslucent
};
static float identity[] = {
1, 0, 0, 0,
0, 1, 0, 0,
@ -872,7 +878,7 @@ bsp_begin_subpass (QFV_BspSubpass subpass, VkPipeline pipeline,
dfunc->vkResetCommandBuffer (cmd, 0);
VkCommandBufferInheritanceInfo inherit = {
VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO, 0,
ctx->renderpass, subpass,
ctx->renderpass, subpass_map[subpass],
cframe->framebuffer,
0, 0, 0,
};
@ -883,6 +889,9 @@ bsp_begin_subpass (QFV_BspSubpass subpass, VkPipeline pipeline,
};
dfunc->vkBeginCommandBuffer (cmd, &beginInfo);
QFV_duCmdBeginLabel (device, cmd, bsp_pass_names[subpass],
{0, 0.5, 0.6, 1});
dfunc->vkCmdBindPipeline (cmd, VK_PIPELINE_BIND_POINT_GRAPHICS,
pipeline);
VkViewport viewport = {0, 0, vid.width, vid.height, 0, 1};
@ -914,6 +923,7 @@ bsp_end_subpass (VkCommandBuffer cmd, vulkan_ctx_t *ctx)
qfv_device_t *device = ctx->device;
qfv_devfuncs_t *dfunc = device->funcs;
QFV_duCmdEndLabel (device, cmd);
dfunc->vkEndCommandBuffer (cmd);
}
@ -1274,15 +1284,6 @@ Vulkan_DrawSky (vulkan_ctx_t *ctx)
fragconst_t frag_constants = { time: vr_data.realtime };
push_fragconst (&frag_constants, bctx->layout, dfunc,
bframe->cmdSet.a[QFV_bspTranslucent]);
bind_view (qfv_bsp_texture, ctx->default_black->view, bframe,
bframe->cmdSet.a[QFV_bspTranslucent],//FIXME
bctx->layout, dfunc);
bind_view (qfv_bsp_glowmap, ctx->default_black->view, bframe,
bframe->cmdSet.a[QFV_bspTranslucent],//FIXME
bctx->layout, dfunc);
bind_view (qfv_bsp_lightmap, ctx->default_black->view, bframe,
bframe->cmdSet.a[QFV_bspTranslucent],//FIXME
bctx->layout, dfunc);
for (is = bctx->sky_chain; is; is = is->tex_chain) {
surf = is->surface;
if (tex != surf->texinfo->texture->render) {