@@ -254,17 +254,35 @@ void ShaderTextEditor::_load_theme_settings() {
254
254
}
255
255
}
256
256
257
- const Vector<ShaderLanguage::ModeInfo> &modes = ShaderTypes::get_singleton ()->get_modes (RenderingServer::ShaderMode (i));
257
+ {
258
+ const Vector<ShaderLanguage::ModeInfo> &render_modes = ShaderTypes::get_singleton ()->get_modes (RenderingServer::ShaderMode (i));
259
+
260
+ for (int j = 0 ; j < render_modes.size (); j++) {
261
+ const ShaderLanguage::ModeInfo &mode_info = render_modes[j];
262
+
263
+ if (!mode_info.options .is_empty ()) {
264
+ for (int k = 0 ; k < mode_info.options .size (); k++) {
265
+ built_ins.push_back (String (mode_info.name ) + " _" + String (mode_info.options [k]));
266
+ }
267
+ } else {
268
+ built_ins.push_back (String (mode_info.name ));
269
+ }
270
+ }
271
+ }
258
272
259
- for ( int j = 0 ; j < modes. size (); j++) {
260
- const ShaderLanguage::ModeInfo &mode_info = modes[j] ;
273
+ {
274
+ const Vector< ShaderLanguage::ModeInfo> &stencil_modes = ShaderTypes::get_singleton ()-> get_stencil_modes ( RenderingServer::ShaderMode (i)) ;
261
275
262
- if (!mode_info.options .is_empty ()) {
263
- for (int k = 0 ; k < mode_info.options .size (); k++) {
264
- built_ins.push_back (String (mode_info.name ) + " _" + String (mode_info.options [k]));
276
+ for (int j = 0 ; j < stencil_modes.size (); j++) {
277
+ const ShaderLanguage::ModeInfo &mode_info = stencil_modes[j];
278
+
279
+ if (!mode_info.options .is_empty ()) {
280
+ for (int k = 0 ; k < mode_info.options .size (); k++) {
281
+ built_ins.push_back (String (mode_info.name ) + " _" + String (mode_info.options [k]));
282
+ }
283
+ } else {
284
+ built_ins.push_back (String (mode_info.name ));
265
285
}
266
- } else {
267
- built_ins.push_back (String (mode_info.name ));
268
286
}
269
287
}
270
288
}
@@ -275,17 +293,35 @@ void ShaderTextEditor::_load_theme_settings() {
275
293
}
276
294
}
277
295
278
- const Vector<ShaderLanguage::ModeInfo> &modes = ShaderTypes::get_singleton ()->get_modes (RenderingServer::ShaderMode (shader->get_mode ()));
296
+ {
297
+ const Vector<ShaderLanguage::ModeInfo> &shader_modes = ShaderTypes::get_singleton ()->get_modes (RenderingServer::ShaderMode (shader->get_mode ()));
298
+
299
+ for (int i = 0 ; i < shader_modes.size (); i++) {
300
+ const ShaderLanguage::ModeInfo &mode_info = shader_modes[i];
301
+
302
+ if (!mode_info.options .is_empty ()) {
303
+ for (int j = 0 ; j < mode_info.options .size (); j++) {
304
+ built_ins.push_back (String (mode_info.name ) + " _" + String (mode_info.options [j]));
305
+ }
306
+ } else {
307
+ built_ins.push_back (String (mode_info.name ));
308
+ }
309
+ }
310
+ }
311
+
312
+ {
313
+ const Vector<ShaderLanguage::ModeInfo> &stencil_modes = ShaderTypes::get_singleton ()->get_stencil_modes (RenderingServer::ShaderMode (shader->get_mode ()));
279
314
280
- for (int i = 0 ; i < modes .size (); i++) {
281
- const ShaderLanguage::ModeInfo &mode_info = modes [i];
315
+ for (int i = 0 ; i < stencil_modes .size (); i++) {
316
+ const ShaderLanguage::ModeInfo &mode_info = stencil_modes [i];
282
317
283
- if (!mode_info.options .is_empty ()) {
284
- for (int j = 0 ; j < mode_info.options .size (); j++) {
285
- built_ins.push_back (String (mode_info.name ) + " _" + String (mode_info.options [j]));
318
+ if (!mode_info.options .is_empty ()) {
319
+ for (int j = 0 ; j < mode_info.options .size (); j++) {
320
+ built_ins.push_back (String (mode_info.name ) + " _" + String (mode_info.options [j]));
321
+ }
322
+ } else {
323
+ built_ins.push_back (String (mode_info.name ));
286
324
}
287
- } else {
288
- built_ins.push_back (String (mode_info.name ));
289
325
}
290
326
}
291
327
}
0 commit comments