mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-04-08 10:21:40 +00:00
[vulkan] "Fix" view model check in rendering loop
The check for the entity being the view model was checking only the view model id, which is not sufficient when the view model is invalid by never being set to other than 0s. A better system for dealing with the view model is needed.
This commit is contained in:
parent
6952f6860d
commit
169c282187
1 changed files with 4 additions and 2 deletions
|
@ -72,6 +72,8 @@ Vulkan_RenderEntities (entqueue_t *queue, qfv_renderframe_t *rFrame)
|
|||
{
|
||||
if (!r_drawentities)
|
||||
return;
|
||||
//FIXME need a better way (components? but HasComponent isn't free)
|
||||
int vmod = Entity_Valid (vr_data.view_model);
|
||||
#define RE_LOOP(type_name, Type) \
|
||||
do { \
|
||||
int begun = 0; \
|
||||
|
@ -84,12 +86,12 @@ Vulkan_RenderEntities (entqueue_t *queue, qfv_renderframe_t *rFrame)
|
|||
} \
|
||||
/* FIXME hack the depth range to prevent view model */\
|
||||
/* from poking into walls */\
|
||||
if (ent.id == vr_data.view_model.id) { \
|
||||
if (vmod && ent.id == vr_data.view_model.id) { \
|
||||
Vulkan_AliasDepthRange (rFrame, 0, 0.3); \
|
||||
} \
|
||||
Vulkan_Draw##Type (ent, rFrame); \
|
||||
/* unhack in case the view_model is not the last */\
|
||||
if (ent.id == vr_data.view_model.id) { \
|
||||
if (vmod && ent.id == vr_data.view_model.id) { \
|
||||
Vulkan_AliasDepthRange (rFrame, 0, 1); \
|
||||
} \
|
||||
} \
|
||||
|
|
Loading…
Reference in a new issue