@@ -1120,7 +1120,7 @@ fn glenum_to_transform_feedback_mode(value: gl::types::GLenum) -> TransformFeedb
1120
1120
}
1121
1121
1122
1122
/// Contains all subroutine data of a program.
1123
- #[ derive( Debug , Clone ) ]
1123
+ #[ derive( Debug , Default , Clone ) ]
1124
1124
pub struct SubroutineData {
1125
1125
/// Number of subroutine uniform locations per shader stage.
1126
1126
/// This is *not* equal to the number of subroutine uniforms per stage,
@@ -1215,21 +1215,22 @@ pub unsafe fn reflect_subroutine_data(ctxt: &mut CommandContext<'_>, program: Ha
1215
1215
-> SubroutineData
1216
1216
{
1217
1217
if !program:: is_subroutine_supported ( ctxt) {
1218
- return SubroutineData {
1219
- location_counts : HashMap :: with_hasher ( Default :: default ( ) ) ,
1220
- subroutine_uniforms : HashMap :: with_hasher ( Default :: default ( ) ) ,
1221
- }
1218
+ return Default :: default ( ) ;
1222
1219
}
1223
1220
1224
1221
let program = match program {
1225
1222
// subroutines not supported.
1226
- Handle :: Handle ( _) => return SubroutineData {
1227
- location_counts : HashMap :: with_hasher ( Default :: default ( ) ) ,
1228
- subroutine_uniforms : HashMap :: with_hasher ( Default :: default ( ) ) ,
1229
- } ,
1223
+ Handle :: Handle ( _) => return Default :: default ( ) ,
1230
1224
Handle :: Id ( id) => id
1231
1225
} ;
1232
1226
1227
+ // Compute shader programs are not handled: #1718
1228
+ let mut shader_count = 0 ;
1229
+ ctxt. gl . GetProgramiv ( program, gl:: ATTACHED_SHADERS , & mut shader_count) ;
1230
+ if shader_count < 2 {
1231
+ return Default :: default ( ) ;
1232
+ }
1233
+
1233
1234
let shader_stages = get_shader_stages ( has_geometry_shader,
1234
1235
has_tessellation_control_shader,
1235
1236
has_tessellation_evaluation_shader) ;
0 commit comments