1- /* Copyright (c) 2024-2025 LunarG, Inc.
1+ /* Copyright (c) 2024-2026 LunarG, Inc.
22 *
33 * Licensed under the Apache License, Version 2.0 (the "License");
44 * you may not use this file except in compliance with the License.
@@ -135,7 +135,7 @@ void RegisterDescriptorChecksValidation(Validator& gpuav, CommandBufferSubState&
135135 using namespace glsl ;
136136
137137 bool error_found = false ;
138- if (GetErrorGroup (error_record) != kErrorGroupInstDescriptorIndexingOOB ) {
138+ if (GetErrorGroup (error_record) != kErrorGroup_InstDescriptorIndexingOOB ) {
139139 return error_found;
140140 }
141141 error_found = true ;
@@ -152,25 +152,25 @@ void RegisterDescriptorChecksValidation(Validator& gpuav, CommandBufferSubState&
152152 desc_set_bindings.descriptor_set_binding_commands [descriptor_binding_index].bound_descriptor_sets ;
153153
154154 // Currently we only encode the descriptor index here and save the binding in a parameter slot
155- // The issue becomes if the user has kErrorSubCodeDescriptorIndexingBounds then we can't back track to the exact binding
156- // because they have gone over it
157- const uint32_t encoded_set_index = error_record[kInstDescriptorIndexingSetAndIndexOffset ];
158- const uint32_t set_num = encoded_set_index >> kInstDescriptorIndexingSetShift ;
159- const uint32_t descriptor_index = encoded_set_index & kInstDescriptorIndexingIndexMask ;
160- const uint32_t binding_num = error_record[kInstDescriptorIndexingParamOffset_1 ];
155+ // The issue becomes if the user has kErrorSubCode_DescriptorIndexing_Bounds then we can't back track to the exact
156+ // binding because they have gone over it
157+ const uint32_t encoded_set_index = error_record[kInst_LogError_ParameterOffset_0 ];
158+ const uint32_t set_num = encoded_set_index >> kInst_DescriptorIndexing_SetShift ;
159+ const uint32_t descriptor_index = encoded_set_index & kInst_DescriptorIndexing_IndexMask ;
160+ const uint32_t binding_num = error_record[kInst_LogError_ParameterOffset_2 ];
161161
162- const uint32_t array_length = error_record[kInstDescriptorIndexingParamOffset_0 ];
162+ const uint32_t array_length = error_record[kInst_LogError_ParameterOffset_1 ];
163163
164164 const uint32_t error_sub_code = GetSubError (error_record);
165165 switch (error_sub_code) {
166- case kErrorSubCodeDescriptorIndexingBounds : {
166+ case kErrorSubCode_DescriptorIndexing_Bounds : {
167167 strm << " (set = " << set_num << " , binding = " << binding_num << " ) Index of " << descriptor_index
168168 << " used to index descriptor array of length " << array_length << " ." ;
169169 out_vuid_msg = vuid.descriptor_index_oob_10068 ;
170170 error_found = true ;
171171 } break ;
172172
173- case kErrorSubCodeDescriptorIndexingUninitialized : {
173+ case kErrorSubCode_DescriptorIndexing_Uninitialized : {
174174 const auto & dsl = descriptor_sets[set_num]->Layout ();
175175 strm << " (set = " << set_num << " , binding = " << binding_num << " ) Descriptor index " << descriptor_index
176176 << " is uninitialized." ;
@@ -194,7 +194,7 @@ void RegisterDescriptorChecksValidation(Validator& gpuav, CommandBufferSubState&
194194 error_found = true ;
195195 } break ;
196196
197- case kErrorSubCodeDescriptorIndexingDestroyed : {
197+ case kErrorSubCode_DescriptorIndexing_Destroyed : {
198198 strm << " (set = " << set_num << " , binding = " << binding_num << " ) Descriptor index " << descriptor_index
199199 << " references a resource that was destroyed." ;
200200
@@ -233,7 +233,7 @@ void RegisterDescriptorChecksValidation(Validator& gpuav, CommandBufferSubState&
233233 std::string& out_vuid_msg) {
234234 using namespace glsl ;
235235 bool error_found = false ;
236- if (GetErrorGroup (error_record) != kErrorGroupInstDescriptorClass ) {
236+ if (GetErrorGroup (error_record) != kErrorGroup_InstDescriptorClass ) {
237237 return error_found;
238238 }
239239 error_found = true ;
@@ -248,9 +248,9 @@ void RegisterDescriptorChecksValidation(Validator& gpuav, CommandBufferSubState&
248248 const auto & descriptor_sets =
249249 desc_set_bindings.descriptor_set_binding_commands [descriptor_binding_index].bound_descriptor_sets ;
250250
251- const uint32_t encoded_set_index = error_record[kInstDescriptorIndexingSetAndIndexOffset ];
252- const uint32_t set_num = encoded_set_index >> kInstDescriptorIndexingSetShift ;
253- const uint32_t global_descriptor_index = encoded_set_index & kInstDescriptorIndexingIndexMask ;
251+ const uint32_t encoded_set_index = error_record[kInst_LogError_ParameterOffset_0 ];
252+ const uint32_t set_num = encoded_set_index >> kInst_DescriptorIndexing_SetShift ;
253+ const uint32_t global_descriptor_index = encoded_set_index & kInst_DescriptorIndexing_IndexMask ;
254254
255255 const auto descriptor_set_state = descriptor_sets[set_num];
256256 auto [binding_num, desc_index] = descriptor_set_state->GetBindingAndIndex (global_descriptor_index);
@@ -261,17 +261,17 @@ void RegisterDescriptorChecksValidation(Validator& gpuav, CommandBufferSubState&
261261
262262 const uint32_t error_sub_code = GetSubError (error_record);
263263 switch (error_sub_code) {
264- case kErrorSubCodeDescriptorClassGeneralBufferBounds :
265- case kErrorSubCodeDescriptorClassGeneralBufferCoopMatBounds : {
264+ case kErrorSubCode_DescriptorClass_GeneralBufferBounds :
265+ case kErrorSubCode_DescriptorClass_GeneralBufferCoopMatBounds : {
266266 if (binding_state->descriptor_class != vvl::DescriptorClass::GeneralBuffer) {
267267 assert (false );
268268 return false ;
269269 }
270270 const vvl::Buffer* buffer_state =
271271 static_cast <const vvl::BufferBinding*>(binding_state)->descriptors [desc_index].GetBufferState ();
272272 if (buffer_state) {
273- const uint32_t byte_offset = error_record[kInstDescriptorIndexingParamOffset_0 ];
274- const uint32_t resource_size = error_record[kInstDescriptorIndexingParamOffset_1 ];
273+ const uint32_t byte_offset = error_record[kInst_LogError_ParameterOffset_1 ];
274+ const uint32_t resource_size = error_record[kInst_LogError_ParameterOffset_2 ];
275275 strm << " access out of bounds. The descriptor buffer (" << gpuav.FormatHandle (buffer_state->Handle ())
276276 << " ) size is " << buffer_state->create_info .size << " bytes, " << resource_size
277277 << " bytes were bound, and the highest out of bounds access was at [" << byte_offset << " ] bytes" ;
@@ -281,7 +281,7 @@ void RegisterDescriptorChecksValidation(Validator& gpuav, CommandBufferSubState&
281281 " for "
282282 " this descriptor. " ;
283283 }
284- if (error_sub_code == kErrorSubCodeDescriptorClassGeneralBufferCoopMatBounds ) {
284+ if (error_sub_code == kErrorSubCode_DescriptorClass_GeneralBufferCoopMatBounds ) {
285285 strm << " \n For VK_KHR_cooperative_matrix this is invalid unless cooperativeMatrixRobustBufferAccess is "
286286 " enabled." ;
287287 }
@@ -294,7 +294,7 @@ void RegisterDescriptorChecksValidation(Validator& gpuav, CommandBufferSubState&
294294 }
295295 } break ;
296296
297- case kErrorSubCodeDescriptorClassTexelBufferBounds : {
297+ case kErrorSubCode_DescriptorClass_TexelBufferBounds : {
298298 if (binding_state->descriptor_class != vvl::DescriptorClass::TexelBuffer) {
299299 assert (false );
300300 return false ;
@@ -303,8 +303,8 @@ void RegisterDescriptorChecksValidation(Validator& gpuav, CommandBufferSubState&
303303 const vvl::BufferView* buffer_view_state =
304304 static_cast <const vvl::TexelBinding*>(binding_state)->descriptors [desc_index].GetBufferViewState ();
305305 if (buffer_view_state) {
306- const uint32_t byte_offset = error_record[kInstDescriptorIndexingParamOffset_0 ];
307- const uint32_t resource_size = error_record[kInstDescriptorIndexingParamOffset_1 ];
306+ const uint32_t byte_offset = error_record[kInst_LogError_ParameterOffset_1 ];
307+ const uint32_t resource_size = error_record[kInst_LogError_ParameterOffset_2 ];
308308
309309 strm << " access out of bounds. The descriptor texel buffer ("
310310 << gpuav.FormatHandle (buffer_view_state->Handle ()) << " ) size is " << resource_size
0 commit comments