@@ -132,7 +132,7 @@ def hasUniform(self, draw, uniform):
132
132
constants = self .getVertexShaderConstants (draw )
133
133
return uniform in constants ['$Globals' ]
134
134
135
- def extractRelevantCalls (self , drawcalls , _strategy = 0 ):
135
+ def extractRelevantCalls (self , drawcalls , _strategy = 4 ):
136
136
"""List the drawcalls related to drawing the 3D meshes thank to a ad hoc heuristic
137
137
It may different in RenderDoc UI and in Python module, for some reason
138
138
"""
@@ -160,9 +160,12 @@ def extractRelevantCalls(self, drawcalls, _strategy=0):
160
160
last_call = ""
161
161
drawcall_prefix = "DrawIndexed"
162
162
capture_type = "Google Earth"
163
- skipped_drawcalls , min_drawcall = self .findDrawcallBatch (drawcalls , first_call , drawcall_prefix , last_call )
164
- if not skipped_drawcalls or not self .hasUniform (skipped_drawcalls [0 ], "_uProjModelviewMatrix" ):
165
- first_call = "INVALID CASE, SKIP ME"
163
+ min_drawcall = 0
164
+ while True :
165
+ skipped_drawcalls , new_min_drawcall = self .findDrawcallBatch (drawcalls [min_drawcall :], first_call , drawcall_prefix , last_call )
166
+ if self .hasUniform (skipped_drawcalls [0 ], "_uMeshToWorldMatrix" ):
167
+ break
168
+ min_drawcall += new_min_drawcall
166
169
elif _strategy == 6 :
167
170
# Actually sometimes there's only one batch
168
171
first_call = "DrawIndexed"
@@ -181,7 +184,7 @@ def extractRelevantCalls(self, drawcalls, _strategy=0):
181
184
print ("Error: Could not find the beginning of the relevant 3D draw calls" )
182
185
return [], "none"
183
186
184
- print (f"Trying scrapping strategy #{ _strategy } ..." )
187
+ print (f"Trying scraping strategy #{ _strategy } ..." )
185
188
relevant_drawcalls , _ = self .findDrawcallBatch (
186
189
drawcalls [min_drawcall :],
187
190
first_call ,
@@ -200,13 +203,19 @@ def extractRelevantCalls(self, drawcalls, _strategy=0):
200
203
else :
201
204
capture_type = "Google Earth"
202
205
206
+ if capture_type == "Google Earth" :
207
+ relevant_drawcalls = [
208
+ call for call in relevant_drawcalls
209
+ if self .hasUniform (call , "_uMeshToWorldMatrix" )
210
+ ]
211
+
203
212
return relevant_drawcalls , capture_type
204
213
205
214
def run (self ):
206
215
controller = self .controller
207
216
drawcalls = controller .GetDrawcalls ()
208
217
relevant_drawcalls , capture_type = self .extractRelevantCalls (drawcalls )
209
- print (f"Scrapping capture from { capture_type } ..." )
218
+ print (f"Scraping capture from { capture_type } ..." )
210
219
211
220
if MAX_BLOCKS <= 0 :
212
221
max_drawcall = len (relevant_drawcalls )
0 commit comments