@@ -99,10 +99,12 @@ struct RtSurface {
99
99
writeGPUHelperExplicit<2 >(data, offset, indexBufferIndex);
100
100
writeGPUHelperExplicit<2 >(data, offset, color0BufferIndex);
101
101
102
- writeGPUHelperExplicit<1 >(data, offset, normalFormat == VK_FORMAT_R32_UINT ? 1 : 0 );
102
+ uint16_t flags0 = 0 ;
103
+ flags0 |= normalFormat == VK_FORMAT_R32_UINT ? 1 : 0 ;
104
+ flags0 |= isVertexColorBakedLighting ? (1 << 1 ) : 0 ;
105
+ // NOTE: Spare flags bits here
103
106
104
- // 1 unused bytes here.
105
- writeGPUPadding<1 >(data, offset);
107
+ writeGPUHelper (data, offset, flags0);
106
108
107
109
const uint16_t packedHash =
108
110
(uint16_t ) (associatedGeometryHash >> 48 ) ^
@@ -131,32 +133,32 @@ struct RtSurface {
131
133
assert (static_cast <uint32_t >(alphaState.alphaTestReferenceValue ) < (1 << 8 ));
132
134
assert (static_cast <uint32_t >(alphaState.blendType ) < (1 << 4 ));
133
135
134
- uint32_t flags = 0 ;
136
+ uint32_t flags1 = 0 ;
135
137
136
- flags |= isEmissive ? (1 << 0 ) : 0 ;
137
- flags |= alphaState.isFullyOpaque ? (1 << 1 ) : 0 ;
138
- flags |= isStatic ? (1 << 2 ) : 0 ;
139
- flags |= static_cast <uint32_t >(alphaState.alphaTestType ) << 3 ;
138
+ flags1 |= isEmissive ? (1 << 0 ) : 0 ;
139
+ flags1 |= alphaState.isFullyOpaque ? (1 << 1 ) : 0 ;
140
+ flags1 |= isStatic ? (1 << 2 ) : 0 ;
141
+ flags1 |= static_cast <uint32_t >(alphaState.alphaTestType ) << 3 ;
140
142
// Note: No mask needed as masking of this value to be 8 bit is done elsewhere.
141
- flags |= static_cast <uint32_t >(alphaState.alphaTestReferenceValue ) << 6 ;
142
- flags |= static_cast <uint32_t >(alphaState.blendType ) << 14 ;
143
- flags |= alphaState.invertedBlend ? (1 << 18 ) : 0 ;
144
- flags |= alphaState.isBlendingDisabled ? (1 << 19 ) : 0 ;
145
- flags |= alphaState.emissiveBlend ? (1 << 20 ) : 0 ;
146
- flags |= alphaState.isParticle ? (1 << 21 ) : 0 ;
147
- flags |= alphaState.isDecal ? (1 << 22 ) : 0 ;
148
- flags |= hasMaterialChanged ? (1 << 23 ) : 0 ;
149
- flags |= isAnimatedWater ? (1 << 24 ) : 0 ;
150
- flags |= isClipPlaneEnabled ? (1 << 25 ) : 0 ;
151
- flags |= isMatte ? (1 << 26 ) : 0 ;
152
- flags |= isTextureFactorBlend ? (1 << 27 ) : 0 ;
153
- flags |= isMotionBlurMaskOut ? (1 << 28 ) : 0 ;
154
- flags |= skipSurfaceInteractionSpritesheetAdjustment ? (1 << 29 ) : 0 ;
155
- flags |= ignoreTransparencyLayer ? (1 << 30 ) : 0 ;
143
+ flags1 |= static_cast <uint32_t >(alphaState.alphaTestReferenceValue ) << 6 ;
144
+ flags1 |= static_cast <uint32_t >(alphaState.blendType ) << 14 ;
145
+ flags1 |= alphaState.invertedBlend ? (1 << 18 ) : 0 ;
146
+ flags1 |= alphaState.isBlendingDisabled ? (1 << 19 ) : 0 ;
147
+ flags1 |= alphaState.emissiveBlend ? (1 << 20 ) : 0 ;
148
+ flags1 |= alphaState.isParticle ? (1 << 21 ) : 0 ;
149
+ flags1 |= alphaState.isDecal ? (1 << 22 ) : 0 ;
150
+ flags1 |= hasMaterialChanged ? (1 << 23 ) : 0 ;
151
+ flags1 |= isAnimatedWater ? (1 << 24 ) : 0 ;
152
+ flags1 |= isClipPlaneEnabled ? (1 << 25 ) : 0 ;
153
+ flags1 |= isMatte ? (1 << 26 ) : 0 ;
154
+ flags1 |= isTextureFactorBlend ? (1 << 27 ) : 0 ;
155
+ flags1 |= isMotionBlurMaskOut ? (1 << 28 ) : 0 ;
156
+ flags1 |= skipSurfaceInteractionSpritesheetAdjustment ? (1 << 29 ) : 0 ;
157
+ flags1 |= ignoreTransparencyLayer ? (1 << 30 ) : 0 ;
156
158
// Note: This flag is purely for debug view purpose. If we need to add more functional flags and running out of bits, we should move this flag to other place.
157
- flags |= isInsideFrustum ? (1 << 31 ) : 0 ;
159
+ flags1 |= isInsideFrustum ? (1 << 31 ) : 0 ;
158
160
159
- writeGPUHelper (data, offset, flags );
161
+ writeGPUHelper (data, offset, flags1 );
160
162
161
163
// Note: Matricies are stored on the cpu side in column-major order, the same as the GPU.
162
164
@@ -289,6 +291,7 @@ struct RtSurface {
289
291
bool isAnimatedWater = false ;
290
292
bool isClipPlaneEnabled = false ;
291
293
bool isTextureFactorBlend = false ;
294
+ bool isVertexColorBakedLighting = false ;
292
295
bool isMotionBlurMaskOut = false ;
293
296
bool skipSurfaceInteractionSpritesheetAdjustment = false ;
294
297
bool isInsideFrustum = false ;
@@ -1597,6 +1600,7 @@ struct LegacyMaterialData {
1597
1600
uint32_t tFactor = 0xffffffff ; // Value for D3DRS_TEXTUREFACTOR, default value of is opaque white
1598
1601
D3DMATERIAL9 d3dMaterial = {};
1599
1602
bool isTextureFactorBlend = false ;
1603
+ bool isVertexColorBakedLighting = false ;
1600
1604
1601
1605
void setHashOverride (XXH64_hash_t hash) {
1602
1606
m_cachedHash = hash;
0 commit comments