GPU/SW: Use no_unique_address for potentially-unused varyings

This commit is contained in:
Stenzek 2025-01-16 22:03:12 +10:00
parent 804b8ff777
commit c4a7456689
No known key found for this signature in database
2 changed files with 13 additions and 6 deletions

View File

@ -100,6 +100,13 @@ char (&__countof_ArraySizeHelper(T (&array)[N]))[N];
#define RESTRICT __restrict__
#endif
// msvc requires a different attribute, of course
#ifdef _MSC_VER
#define NO_UNIQUE_ADDRESS [[msvc::no_unique_address]]
#else
#define NO_UNIQUE_ADDRESS [[no_unique_address]]
#endif
// disable warnings that show up at warning level 4
// TODO: Move to build system instead
#ifdef _MSC_VER

View File

@ -477,12 +477,12 @@ struct PixelVectors
GSVectorNi mask_and;
GSVectorNi mask_or;
typename std::conditional_t<texture_enable, GSVectorNi, UnusedField> texture_window_and_x;
typename std::conditional_t<texture_enable, GSVectorNi, UnusedField> texture_window_or_x;
typename std::conditional_t<texture_enable, GSVectorNi, UnusedField> texture_window_and_y;
typename std::conditional_t<texture_enable, GSVectorNi, UnusedField> texture_window_or_y;
typename std::conditional_t<texture_enable, GSVectorNi, UnusedField> texture_base_x;
typename std::conditional_t<texture_enable, GSVectorNi, UnusedField> texture_base_y;
NO_UNIQUE_ADDRESS typename std::conditional_t<texture_enable, GSVectorNi, UnusedField> texture_window_and_x;
NO_UNIQUE_ADDRESS typename std::conditional_t<texture_enable, GSVectorNi, UnusedField> texture_window_or_x;
NO_UNIQUE_ADDRESS typename std::conditional_t<texture_enable, GSVectorNi, UnusedField> texture_window_and_y;
NO_UNIQUE_ADDRESS typename std::conditional_t<texture_enable, GSVectorNi, UnusedField> texture_window_or_y;
NO_UNIQUE_ADDRESS typename std::conditional_t<texture_enable, GSVectorNi, UnusedField> texture_base_x;
NO_UNIQUE_ADDRESS typename std::conditional_t<texture_enable, GSVectorNi, UnusedField> texture_base_y;
PixelVectors(const GPUBackendDrawCommand* cmd)
{