• Home
  • Raw
  • Download

Lines Matching refs:res

44 program_resource_location(struct gl_program_resource *res,
52 const type * RESOURCE_ ## name (gl_program_resource *res) { \
53 assert(res->Data); \
54 return (type *) res->Data; \
152 struct gl_program_resource *res = in _mesa_GetActiveAttrib() local
157 if (!res) { in _mesa_GetActiveAttrib()
162 const gl_shader_variable *const var = RESOURCE_VAR(res); in _mesa_GetActiveAttrib()
169 _mesa_program_resource_prop(shProg, res, desired_index, GL_ARRAY_SIZE, in _mesa_GetActiveAttrib()
173 _mesa_program_resource_prop(shProg, res, desired_index, GL_TYPE, in _mesa_GetActiveAttrib()
203 struct gl_program_resource *res = in _mesa_GetAttribLocation() local
207 if (!res) in _mesa_GetAttribLocation()
210 return program_resource_location(res, array_index); in _mesa_GetAttribLocation()
221 struct gl_program_resource *res = shProg->data->ProgramResourceList; in _mesa_count_active_attribs() local
224 j++, res++) { in _mesa_count_active_attribs()
225 if (res->Type == GL_PROGRAM_INPUT && in _mesa_count_active_attribs()
226 res->StageReferences & (1 << MESA_SHADER_VERTEX)) in _mesa_count_active_attribs()
241 struct gl_program_resource *res = shProg->data->ProgramResourceList; in _mesa_longest_attribute_name_length() local
244 j++, res++) { in _mesa_longest_attribute_name_length()
245 if (res->Type == GL_PROGRAM_INPUT && in _mesa_longest_attribute_name_length()
246 res->StageReferences & (1 << MESA_SHADER_VERTEX)) { in _mesa_longest_attribute_name_length()
248 const size_t length = strlen(RESOURCE_VAR(res)->name); in _mesa_longest_attribute_name_length()
416 struct gl_program_resource *res = in _mesa_GetFragDataLocation() local
420 if (!res) in _mesa_GetFragDataLocation()
423 return program_resource_location(res, array_index); in _mesa_GetFragDataLocation()
427 _mesa_program_resource_name(struct gl_program_resource *res) in _mesa_program_resource_name() argument
429 switch (res->Type) { in _mesa_program_resource_name()
432 return RESOURCE_UBO(res)->Name; in _mesa_program_resource_name()
434 return RESOURCE_XFV(res)->Name; in _mesa_program_resource_name()
437 return RESOURCE_VAR(res)->name; in _mesa_program_resource_name()
440 return RESOURCE_UNI(res)->name; in _mesa_program_resource_name()
447 return RESOURCE_UNI(res)->name + MESA_SUBROUTINE_PREFIX_LEN; in _mesa_program_resource_name()
454 return RESOURCE_SUB(res)->name; in _mesa_program_resource_name()
463 _mesa_program_resource_array_size(struct gl_program_resource *res) in _mesa_program_resource_array_size() argument
465 switch (res->Type) { in _mesa_program_resource_array_size()
467 return RESOURCE_XFV(res)->Size > 1 ? in _mesa_program_resource_array_size()
468 RESOURCE_XFV(res)->Size : 0; in _mesa_program_resource_array_size()
471 return RESOURCE_VAR(res)->type->length; in _mesa_program_resource_array_size()
479 return RESOURCE_UNI(res)->array_elements; in _mesa_program_resource_array_size()
482 if (RESOURCE_UNI(res)->array_stride > 0 && in _mesa_program_resource_array_size()
483 RESOURCE_UNI(res)->array_elements == 0) in _mesa_program_resource_array_size()
486 return RESOURCE_UNI(res)->array_elements; in _mesa_program_resource_array_size()
529 struct gl_program_resource *res = shProg->data->ProgramResourceList; in _mesa_program_resource_find_name() local
531 i++, res++) { in _mesa_program_resource_find_name()
532 if (res->Type != programInterface) in _mesa_program_resource_find_name()
536 const char *rname = _mesa_program_resource_name(res); in _mesa_program_resource_find_name()
589 return res; in _mesa_program_resource_find_name()
608 return res; in _mesa_program_resource_find_name()
614 return res; in _mesa_program_resource_find_name()
617 return res; in _mesa_program_resource_find_name()
630 struct gl_program_resource *res) in calc_resource_index() argument
635 if (&shProg->data->ProgramResourceList[i] == res) in calc_resource_index()
637 if (shProg->data->ProgramResourceList[i].Type == res->Type) in calc_resource_index()
648 struct gl_program_resource *res) in _mesa_program_resource_index() argument
650 if (!res) in _mesa_program_resource_index()
653 switch (res->Type) { in _mesa_program_resource_index()
655 return RESOURCE_ATC(res) - shProg->data->AtomicBuffers; in _mesa_program_resource_index()
662 return RESOURCE_SUB(res)->index; in _mesa_program_resource_index()
668 return calc_resource_index(shProg, res); in _mesa_program_resource_index()
678 struct gl_program_resource *res = shProg->data->ProgramResourceList; in program_resource_find_data() local
680 i++, res++) { in program_resource_find_data()
681 if (res->Data == data) in program_resource_find_data()
682 return res; in program_resource_find_data()
693 struct gl_program_resource *res = shProg->data->ProgramResourceList; in _mesa_program_resource_find_index() local
697 i++, res++) { in _mesa_program_resource_find_index()
698 if (res->Type != programInterface) in _mesa_program_resource_find_index()
701 switch (res->Type) { in _mesa_program_resource_find_index()
706 if (_mesa_program_resource_index(shProg, res) == index) in _mesa_program_resource_find_index()
707 return res; in _mesa_program_resource_find_index()
727 return res; in _mesa_program_resource_find_index()
754 add_index_to_name(struct gl_program_resource *res) in add_index_to_name() argument
759 return res->Type != GL_TRANSFORM_FEEDBACK_VARYING; in add_index_to_name()
766 _mesa_program_resource_name_len(struct gl_program_resource *res) in _mesa_program_resource_name_len() argument
768 unsigned length = strlen(_mesa_program_resource_name(res)); in _mesa_program_resource_name_len()
769 if (_mesa_program_resource_array_size(res) && add_index_to_name(res)) in _mesa_program_resource_name_len()
785 struct gl_program_resource *res = in _mesa_get_program_resource_name() local
792 if (!res) { in _mesa_get_program_resource_name()
807 _mesa_copy_string(name, bufSize, length, _mesa_program_resource_name(res)); in _mesa_get_program_resource_name()
809 if (_mesa_program_resource_array_size(res) && add_index_to_name(res)) { in _mesa_get_program_resource_name()
825 program_resource_location(struct gl_program_resource *res, unsigned array_index) in program_resource_location() argument
827 switch (res->Type) { in program_resource_location()
829 const gl_shader_variable *var = RESOURCE_VAR(res); in program_resource_location()
843 if (RESOURCE_VAR(res)->location == -1) in program_resource_location()
848 && array_index >= RESOURCE_VAR(res)->type->length) { in program_resource_location()
851 return RESOURCE_VAR(res)->location + array_index; in program_resource_location()
854 if (RESOURCE_UNI(res)->builtin) in program_resource_location()
862 if (RESOURCE_UNI(res)->type->without_array()->is_record()) in program_resource_location()
872 if (RESOURCE_UNI(res)->block_index != -1 || in program_resource_location()
873 RESOURCE_UNI(res)->atomic_buffer_index != -1) in program_resource_location()
885 && array_index >= RESOURCE_UNI(res)->array_elements) { in program_resource_location()
890 return RESOURCE_UNI(res)->remap_location + array_index; in program_resource_location()
905 struct gl_program_resource *res = in _mesa_program_resource_location() local
910 if (!res) in _mesa_program_resource_location()
913 return program_resource_location(res, array_index); in _mesa_program_resource_location()
924 struct gl_program_resource *res = in _mesa_program_resource_location_index() local
928 if (!res || !(res->StageReferences & (1 << MESA_SHADER_FRAGMENT))) in _mesa_program_resource_location_index()
936 if (RESOURCE_VAR(res)->location == -1) in _mesa_program_resource_location_index()
938 return RESOURCE_VAR(res)->index; in _mesa_program_resource_location_index()
969 struct gl_program_resource *res, in is_resource_referenced() argument
976 if (res->Type == GL_ATOMIC_COUNTER_BUFFER) in is_resource_referenced()
977 return RESOURCE_ATC(res)->StageReferences[stage]; in is_resource_referenced()
979 if (res->Type == GL_UNIFORM_BLOCK) in is_resource_referenced()
982 if (res->Type == GL_SHADER_STORAGE_BLOCK) in is_resource_referenced()
985 return res->StageReferences & (1 << stage); in is_resource_referenced()
990 struct gl_program_resource *res, const GLenum prop, in get_buffer_property() argument
994 if (res->Type != GL_UNIFORM_BLOCK && in get_buffer_property()
995 res->Type != GL_ATOMIC_COUNTER_BUFFER && in get_buffer_property()
996 res->Type != GL_SHADER_STORAGE_BLOCK && in get_buffer_property()
997 res->Type != GL_TRANSFORM_FEEDBACK_BUFFER) in get_buffer_property()
1000 if (res->Type == GL_UNIFORM_BLOCK) { in get_buffer_property()
1003 *val = RESOURCE_UBO(res)->Binding; in get_buffer_property()
1006 *val = RESOURCE_UBO(res)->UniformBufferSize; in get_buffer_property()
1010 for (unsigned i = 0; i < RESOURCE_UBO(res)->NumUniforms; i++) { in get_buffer_property()
1011 const char *iname = RESOURCE_UBO(res)->Uniforms[i].IndexName; in get_buffer_property()
1022 for (unsigned i = 0; i < RESOURCE_UBO(res)->NumUniforms; i++) { in get_buffer_property()
1023 const char *iname = RESOURCE_UBO(res)->Uniforms[i].IndexName; in get_buffer_property()
1036 } else if (res->Type == GL_SHADER_STORAGE_BLOCK) { in get_buffer_property()
1039 *val = RESOURCE_UBO(res)->Binding; in get_buffer_property()
1042 *val = RESOURCE_UBO(res)->UniformBufferSize; in get_buffer_property()
1046 for (unsigned i = 0; i < RESOURCE_UBO(res)->NumUniforms; i++) { in get_buffer_property()
1047 const char *iname = RESOURCE_UBO(res)->Uniforms[i].IndexName; in get_buffer_property()
1058 for (unsigned i = 0; i < RESOURCE_UBO(res)->NumUniforms; i++) { in get_buffer_property()
1059 const char *iname = RESOURCE_UBO(res)->Uniforms[i].IndexName; in get_buffer_property()
1072 } else if (res->Type == GL_ATOMIC_COUNTER_BUFFER) { in get_buffer_property()
1075 *val = RESOURCE_ATC(res)->Binding; in get_buffer_property()
1078 *val = RESOURCE_ATC(res)->MinimumSize; in get_buffer_property()
1081 *val = RESOURCE_ATC(res)->NumUniforms; in get_buffer_property()
1084 for (unsigned i = 0; i < RESOURCE_ATC(res)->NumUniforms; i++) { in get_buffer_property()
1089 unsigned idx = RESOURCE_ATC(res)->Uniforms[i]; in get_buffer_property()
1096 return RESOURCE_ATC(res)->NumUniforms; in get_buffer_property()
1098 } else if (res->Type == GL_TRANSFORM_FEEDBACK_BUFFER) { in get_buffer_property()
1101 *val = RESOURCE_XFB(res)->Binding; in get_buffer_property()
1104 *val = RESOURCE_XFB(res)->NumVaryings; in get_buffer_property()
1116 if (res == buf_res) { in get_buffer_property()
1120 return RESOURCE_XFB(res)->NumVaryings; in get_buffer_property()
1127 _mesa_enum_to_string(res->Type), in get_buffer_property()
1135 struct gl_program_resource *res, GLuint index, in _mesa_program_resource_prop() argument
1141 if (res->Type != type)\ in _mesa_program_resource_prop()
1145 if (res->Type != type1 && res->Type != type2)\ in _mesa_program_resource_prop()
1150 switch (res->Type) { in _mesa_program_resource_prop()
1156 *val = _mesa_program_resource_name_len(res) + 1; in _mesa_program_resource_prop()
1160 switch (res->Type) { in _mesa_program_resource_prop()
1163 *val = RESOURCE_UNI(res)->type->gl_type; in _mesa_program_resource_prop()
1167 *val = RESOURCE_VAR(res)->type->gl_type; in _mesa_program_resource_prop()
1170 *val = RESOURCE_XFV(res)->Type; in _mesa_program_resource_prop()
1176 switch (res->Type) { in _mesa_program_resource_prop()
1189 if (RESOURCE_UNI(res)->is_shader_storage && in _mesa_program_resource_prop()
1190 RESOURCE_UNI(res)->array_stride > 0) in _mesa_program_resource_prop()
1191 *val = RESOURCE_UNI(res)->array_elements; in _mesa_program_resource_prop()
1193 *val = MAX2(RESOURCE_UNI(res)->array_elements, 1); in _mesa_program_resource_prop()
1197 *val = MAX2(_mesa_program_resource_array_size(res), 1); in _mesa_program_resource_prop()
1200 *val = RESOURCE_XFV(res)->Size; in _mesa_program_resource_prop()
1206 switch (res->Type) { in _mesa_program_resource_prop()
1209 *val = RESOURCE_UNI(res)->offset; in _mesa_program_resource_prop()
1212 *val = RESOURCE_XFV(res)->Offset; in _mesa_program_resource_prop()
1219 *val = RESOURCE_UNI(res)->block_index; in _mesa_program_resource_prop()
1223 *val = RESOURCE_UNI(res)->array_stride; in _mesa_program_resource_prop()
1227 *val = RESOURCE_UNI(res)->matrix_stride; in _mesa_program_resource_prop()
1231 *val = RESOURCE_UNI(res)->row_major; in _mesa_program_resource_prop()
1235 *val = RESOURCE_UNI(res)->atomic_buffer_index; in _mesa_program_resource_prop()
1241 return get_buffer_property(shProg, res, prop, val, caller); in _mesa_program_resource_prop()
1251 switch (res->Type) { in _mesa_program_resource_prop()
1259 *val = is_resource_referenced(shProg, res, index, in _mesa_program_resource_prop()
1266 switch (res->Type) { in _mesa_program_resource_prop()
1276 *val = program_resource_location(res, 0); in _mesa_program_resource_prop()
1282 switch (res->Type) { in _mesa_program_resource_prop()
1285 *val = RESOURCE_VAR(res)->component; in _mesa_program_resource_prop()
1292 if (res->Type != GL_PROGRAM_OUTPUT) in _mesa_program_resource_prop()
1294 tmp = program_resource_location(res, 0); in _mesa_program_resource_prop()
1298 *val = _mesa_program_resource_location_index(shProg, res->Type, in _mesa_program_resource_prop()
1299 RESOURCE_VAR(res)->name); in _mesa_program_resource_prop()
1303 if (res->Type != GL_VERTEX_SUBROUTINE_UNIFORM && in _mesa_program_resource_prop()
1304 res->Type != GL_FRAGMENT_SUBROUTINE_UNIFORM && in _mesa_program_resource_prop()
1305 res->Type != GL_GEOMETRY_SUBROUTINE_UNIFORM && in _mesa_program_resource_prop()
1306 res->Type != GL_COMPUTE_SUBROUTINE_UNIFORM && in _mesa_program_resource_prop()
1307 res->Type != GL_TESS_CONTROL_SUBROUTINE_UNIFORM && in _mesa_program_resource_prop()
1308 res->Type != GL_TESS_EVALUATION_SUBROUTINE_UNIFORM) in _mesa_program_resource_prop()
1310 *val = RESOURCE_UNI(res)->num_compatible_subroutines; in _mesa_program_resource_prop()
1318 if (res->Type != GL_VERTEX_SUBROUTINE_UNIFORM && in _mesa_program_resource_prop()
1319 res->Type != GL_FRAGMENT_SUBROUTINE_UNIFORM && in _mesa_program_resource_prop()
1320 res->Type != GL_GEOMETRY_SUBROUTINE_UNIFORM && in _mesa_program_resource_prop()
1321 res->Type != GL_COMPUTE_SUBROUTINE_UNIFORM && in _mesa_program_resource_prop()
1322 res->Type != GL_TESS_CONTROL_SUBROUTINE_UNIFORM && in _mesa_program_resource_prop()
1323 res->Type != GL_TESS_EVALUATION_SUBROUTINE_UNIFORM) in _mesa_program_resource_prop()
1325 uni = RESOURCE_UNI(res); in _mesa_program_resource_prop()
1327 p = shProg->_LinkedShaders[_mesa_shader_stage_from_subroutine_uniform(res->Type)]->Program; in _mesa_program_resource_prop()
1343 *val = RESOURCE_UNI(res)->top_level_array_size; in _mesa_program_resource_prop()
1348 *val = RESOURCE_UNI(res)->top_level_array_stride; in _mesa_program_resource_prop()
1353 switch (res->Type) { in _mesa_program_resource_prop()
1356 *val = RESOURCE_VAR(res)->patch; in _mesa_program_resource_prop()
1364 *val = RESOURCE_XFV(res)->BufferIndex; in _mesa_program_resource_prop()
1368 *val = RESOURCE_XFB(res)->Stride * 4; in _mesa_program_resource_prop()
1380 _mesa_enum_to_string(res->Type), in _mesa_program_resource_prop()
1386 _mesa_enum_to_string(res->Type), in _mesa_program_resource_prop()
1402 struct gl_program_resource *res = in _mesa_get_program_resourceiv() local
1406 if (!res || bufSize < 0) { in _mesa_get_program_resourceiv()
1416 _mesa_program_resource_prop(shProg, res, index, *prop, val, in _mesa_get_program_resourceiv()
1473 struct gl_program_resource *res = in validate_io() local
1476 if (res->Type != GL_PROGRAM_OUTPUT) in validate_io()
1479 gl_shader_variable const *const var = RESOURCE_VAR(res); in validate_io()
1494 struct gl_program_resource *res = in validate_io() local
1497 if (res->Type != GL_PROGRAM_INPUT) in validate_io()
1500 gl_shader_variable const *const consumer_var = RESOURCE_VAR(res); in validate_io()