File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
renderdoc/driver/shaders/dxbc Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -1192,7 +1192,15 @@ State State::GetNext(GlobalState &global, State quad[4]) const
1192
1192
{
1193
1193
unsigned char found = BitScanReverse ((DWORD *)&ret.value .uv [i], srcOpers[0 ].value .uv [i]);
1194
1194
if (found == 0 )
1195
+ {
1195
1196
ret.value .uv [i] = ~0U ;
1197
+ }
1198
+ else
1199
+ {
1200
+ // firstbit_hi counts index 0 as the MSB, BitScanReverse counts index 0 as the LSB. So we
1201
+ // need to invert
1202
+ ret.value .uv [i] = 31 - ret.value .uv [i];
1203
+ }
1196
1204
}
1197
1205
1198
1206
s.SetDst (op.operands [0 ], op, ret);
@@ -1225,7 +1233,15 @@ State State::GetNext(GlobalState &global, State quad[4]) const
1225
1233
unsigned char found = BitScanReverse ((DWORD *)&ret.value .uv [i], u);
1226
1234
1227
1235
if (found == 0 )
1236
+ {
1228
1237
ret.value .uv [i] = ~0U ;
1238
+ }
1239
+ else
1240
+ {
1241
+ // firstbit_shi counts index 0 as the MSB, BitScanReverse counts index 0 as the LSB. So we
1242
+ // need to invert
1243
+ ret.value .uv [i] = 31 - ret.value .uv [i];
1244
+ }
1229
1245
}
1230
1246
1231
1247
s.SetDst (op.operands [0 ], op, ret);
You can’t perform that action at this time.
0 commit comments