dustinspace217andDustinspace217 8ca1ad9bbc P3: Vulkan: draw decals, and draw them like OpenGL does (#7879)
* Vulkan: bind all four model-matrix attribute locations for decals

The Vulkan shader input mask had one bit per listed attribute, so the
pipeline dropped the MATRIX4 attributes at locations 9-11 and the decal
vertex shader read three of its four instance-matrix columns from unbound
inputs. No decal was ever drawn in Vulkan.

The mask now covers four locations for VATTRIB_MODEL_MATRIX. It is built
by shader_vertex_input_mask() in shader_types so both Vulkan call sites
share it and a unit test covers it without a Vulkan build.

Fixes #7866

* Vulkan: build the decal pipeline with the material's shader flags

The decal pipeline config set the shader type but not the flags, so the
decal shader variant was always compiled without USE_NORMAL_MAP and fell
back to screen-space derivative normals for angle rejection. Far more of
the decal volume passed the angle test than in OpenGL, which lit the
decals brighter and wider. The pipeline now takes the flags the material
reports, as the other draw paths already do.

* Review fixes: exact input-mask test, decal flag polarity test, mask width check

Pin the full mask per shader type instead of the presence of the matrix
bits, so an expansion of any other attribute fails; pin that a decal
without a normal map is the one that reads the scene normal buffer; add a
compile-time bound on the mask width; trim two comments.

---------

Co-authored-by: Dustinspace217 <[email protected]>
2026-11-04 18:17:31 +01:00
2019-02-26 19:53:11 +01:00
2026-11-03 22:39:54 -05:00
2025-06-11 22:21:51 +09:00
2019-11-15 23:33:35 -05:00
2018-04-21 23:01:19 +02:00
2019-12-01 09:58:53 -02:00
2019-12-01 09:58:53 -02:00
2020-10-29 21:24:42 -06:00
2016-07-22 12:07:19 +02:00
2003-03-02 04:53:46 +00:00
2023-08-09 15:08:36 -04:00
2020-10-29 21:24:42 -06:00

FreeSpace2 Source Code Project

Coverity

Building

Before you do anything, make sure you have updated your git submodules, either by running git submodule update --init --recursive or by cloning the repository with the --recursive flag.

The main instructions for building can be found at our github wiki, on the Building page.

S
Description
Origin Repository for SCP FreeSpace 2 Open
Readme
305 MiB
0 Stars 1 Watchers 0 Forks
2026-11-07 08:08:28 -10:00
Languages
C++ 75.7%
C 22%
CMake 1%
HTML 0.5%
Objective-C++ 0.3%
Other 0.2%