From c869223690fc4d4609109c19d8cdf22951adb014 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Thu, 2 Nov 2023 11:46:30 -0400 Subject: [PATCH] vk: fix compilation after upstream merge --- ref/vk/TODO.md | 9 +++++++++ ref/vk/common_geometry.c | 18 ++++++++---------- ref/vk/vk_rmain.c | 2 +- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/ref/vk/TODO.md b/ref/vk/TODO.md index a99db2cd65..a864bfd658 100644 --- a/ref/vk/TODO.md +++ b/ref/vk/TODO.md @@ -1,3 +1,12 @@ +# 2023-11-02 E323 +- [x] lol meta: read and sort issues +- [x] merge from upstream +- [ ] hevsuit glitches +- [ ] massage shaders: consolidate all bindings explicitly +- [ ] skip sorting-by-texture when loading brush models (=> geometry count explosion; i.e. kusochki count will explode too) +- [ ] kusochki-vs-materials +- [ ] -vkverbose arg for turning all debug logs before detailed cvars are read + # 2023-10-31 E322 - [x] load png blue noise files - [-] translucent animated thing -> needs shader rework diff --git a/ref/vk/common_geometry.c b/ref/vk/common_geometry.c index 85fa522b81..bce827a977 100644 --- a/ref/vk/common_geometry.c +++ b/ref/vk/common_geometry.c @@ -31,7 +31,7 @@ static void BoundPoly( int numverts, float *verts, vec3_t mins, vec3_t maxs ) } } -static void SubdividePolygon_r( msurface_t *warpface, int numverts, float *verts ) +static void SubdividePolygon_r( model_t *loadmodel, msurface_t *warpface, int numverts, float *verts ) { vec3_t front[SUBDIVIDE_SIZE], back[SUBDIVIDE_SIZE]; mextrasurf_t *warpinfo = warpface->info; @@ -41,7 +41,6 @@ static void SubdividePolygon_r( msurface_t *warpface, int numverts, float *verts float sample_size; vec3_t mins, maxs; glpoly_t *poly; - model_t *loadmodel = gEngine.Mod_GetCurrentLoadingModel(); if( numverts > ( SUBDIVIDE_SIZE - 4 )) gEngine.Host_Error( "Mod_SubdividePolygon: too many vertexes on face ( %i )\n", numverts ); @@ -96,13 +95,13 @@ static void SubdividePolygon_r( msurface_t *warpface, int numverts, float *verts } } - SubdividePolygon_r( warpface, f, front[0] ); - SubdividePolygon_r( warpface, b, back[0] ); + SubdividePolygon_r( loadmodel, warpface, f, front[0] ); + SubdividePolygon_r( loadmodel, warpface, b, back[0] ); return; } if( numverts != 4 ) - ClearBits( warpface->flags, SURF_DRAWTURB_QUADS ); + ClearBits( warpface->flags, SURF_DRAWTURB_QUADS ); // add a point in the center to help keep warp valid poly = Mem_Calloc( loadmodel->mempool, sizeof( glpoly_t ) + (numverts - 4) * VERTEXSIZE * sizeof( float )); @@ -124,8 +123,8 @@ static void SubdividePolygon_r( msurface_t *warpface, int numverts, float *verts { s = DotProduct( verts, warpface->texinfo->vecs[0] ) + warpface->texinfo->vecs[0][3]; t = DotProduct( verts, warpface->texinfo->vecs[1] ) + warpface->texinfo->vecs[1][3]; - s /= warpface->texinfo->texture->width; - t /= warpface->texinfo->texture->height; + s /= warpface->texinfo->texture->width; + t /= warpface->texinfo->texture->height; } poly->verts[i][3] = s; @@ -162,13 +161,12 @@ boundaries so that turbulent and sky warps can be done reasonably. ================ */ -void GL_SubdivideSurface( msurface_t *fa ) +void GL_SubdivideSurface( model_t *loadmodel, msurface_t *fa ) { vec3_t verts[SUBDIVIDE_SIZE]; int numverts; int i, lindex; float *vec; - model_t *loadmodel = gEngine.Mod_GetCurrentLoadingModel(); // convert edges back to a normal polygon numverts = 0; @@ -185,5 +183,5 @@ void GL_SubdivideSurface( msurface_t *fa ) SetBits( fa->flags, SURF_DRAWTURB_QUADS ); // predict state // do subdivide - SubdividePolygon_r( fa, numverts, verts[0] ); + SubdividePolygon_r( loadmodel, fa, numverts, verts[0] ); } diff --git a/ref/vk/vk_rmain.c b/ref/vk/vk_rmain.c index 9e29538728..c63e696963 100644 --- a/ref/vk/vk_rmain.c +++ b/ref/vk/vk_rmain.c @@ -112,7 +112,7 @@ static void R_InitSkyClouds( struct mip_s *mt, struct texture_s *tx, qboolean cu PRINT_NOT_IMPLEMENTED(); } -extern void GL_SubdivideSurface( msurface_t *fa ); +extern void GL_SubdivideSurface( model_t *loadmodel, msurface_t *fa ); static void Mod_UnloadTextures( model_t *mod ) {