• Home
  • Raw
  • Download

Lines Matching refs:res

43 program_resource_location(struct gl_program_resource *res,
51 const type * RESOURCE_ ## name (gl_program_resource *res) { \
52 assert(res->Data); \
53 return (type *) res->Data; \
151 struct gl_program_resource *res = in _mesa_GetActiveAttrib() local
156 if (!res) { in _mesa_GetActiveAttrib()
161 const gl_shader_variable *const var = RESOURCE_VAR(res); in _mesa_GetActiveAttrib()
168 _mesa_program_resource_prop(shProg, res, desired_index, GL_ARRAY_SIZE, in _mesa_GetActiveAttrib()
172 _mesa_program_resource_prop(shProg, res, desired_index, GL_TYPE, in _mesa_GetActiveAttrib()
202 struct gl_program_resource *res = in _mesa_GetAttribLocation() local
206 if (!res) in _mesa_GetAttribLocation()
209 return program_resource_location(res, array_index); in _mesa_GetAttribLocation()
220 struct gl_program_resource *res = shProg->data->ProgramResourceList; in _mesa_count_active_attribs() local
223 j++, res++) { in _mesa_count_active_attribs()
224 if (res->Type == GL_PROGRAM_INPUT && in _mesa_count_active_attribs()
225 res->StageReferences & (1 << MESA_SHADER_VERTEX)) in _mesa_count_active_attribs()
240 struct gl_program_resource *res = shProg->data->ProgramResourceList; in _mesa_longest_attribute_name_length() local
243 j++, res++) { in _mesa_longest_attribute_name_length()
244 if (res->Type == GL_PROGRAM_INPUT && in _mesa_longest_attribute_name_length()
245 res->StageReferences & (1 << MESA_SHADER_VERTEX)) { in _mesa_longest_attribute_name_length()
254 const size_t length = RESOURCE_VAR(res)->name != NULL ? in _mesa_longest_attribute_name_length()
255 strlen(RESOURCE_VAR(res)->name) : 0; in _mesa_longest_attribute_name_length()
424 struct gl_program_resource *res = in _mesa_GetFragDataLocation() local
428 if (!res) in _mesa_GetFragDataLocation()
431 return program_resource_location(res, array_index); in _mesa_GetFragDataLocation()
435 _mesa_program_resource_name(struct gl_program_resource *res) in _mesa_program_resource_name() argument
437 switch (res->Type) { in _mesa_program_resource_name()
440 return RESOURCE_UBO(res)->Name; in _mesa_program_resource_name()
442 return RESOURCE_XFV(res)->Name; in _mesa_program_resource_name()
445 return RESOURCE_VAR(res)->name; in _mesa_program_resource_name()
448 return RESOURCE_UNI(res)->name; in _mesa_program_resource_name()
455 return RESOURCE_UNI(res)->name + MESA_SUBROUTINE_PREFIX_LEN; in _mesa_program_resource_name()
462 return RESOURCE_SUB(res)->name; in _mesa_program_resource_name()
471 _mesa_program_resource_array_size(struct gl_program_resource *res) in _mesa_program_resource_array_size() argument
473 switch (res->Type) { in _mesa_program_resource_array_size()
475 return RESOURCE_XFV(res)->Size > 1 ? in _mesa_program_resource_array_size()
476 RESOURCE_XFV(res)->Size : 0; in _mesa_program_resource_array_size()
479 return RESOURCE_VAR(res)->type->length; in _mesa_program_resource_array_size()
487 return RESOURCE_UNI(res)->array_elements; in _mesa_program_resource_array_size()
490 if (RESOURCE_UNI(res)->array_stride > 0 && in _mesa_program_resource_array_size()
491 RESOURCE_UNI(res)->array_elements == 0) in _mesa_program_resource_array_size()
494 return RESOURCE_UNI(res)->array_elements; in _mesa_program_resource_array_size()
563 struct gl_program_resource *res = (struct gl_program_resource *) in search_resource_hash() local
569 if (res && array_index) in search_resource_hash()
572 return res; in search_resource_hash()
582 struct gl_program_resource *res = NULL; in _mesa_program_resource_find_name() local
589 res = search_resource_hash(shProg, programInterface, name, array_index); in _mesa_program_resource_find_name()
591 if (res) in _mesa_program_resource_find_name()
592 return res; in _mesa_program_resource_find_name()
594 res = shProg->data->ProgramResourceList; in _mesa_program_resource_find_name()
595 for (unsigned i = 0; i < shProg->data->NumProgramResourceList; i++, res++) { in _mesa_program_resource_find_name()
596 if (res->Type != programInterface) in _mesa_program_resource_find_name()
600 const char *rname = _mesa_program_resource_name(res); in _mesa_program_resource_find_name()
658 return res; in _mesa_program_resource_find_name()
677 return res; in _mesa_program_resource_find_name()
683 return res; in _mesa_program_resource_find_name()
686 return res; in _mesa_program_resource_find_name()
726 struct gl_program_resource *res = shProg->data->ProgramResourceList; in program_resource_find_binding_offset() local
733 for (unsigned i = 0; i < shProg->data->NumProgramResourceList; i++, res++) { in program_resource_find_binding_offset()
734 if (res->Type != blockInterface) in program_resource_find_binding_offset()
741 const struct gl_uniform_block *block = RESOURCE_UBO(res); in program_resource_find_binding_offset()
760 res = shProg->data->ProgramResourceList; in program_resource_find_binding_offset()
761 for (unsigned i = 0; i < shProg->data->NumProgramResourceList; i++, res++) { in program_resource_find_binding_offset()
762 if (res->Type != programInterface) in program_resource_find_binding_offset()
765 const struct gl_uniform_storage *uniform = RESOURCE_UNI(res); in program_resource_find_binding_offset()
768 return res; in program_resource_find_binding_offset()
790 struct gl_program_resource *res; in _mesa_program_resource_find_active_variable() local
797 res = _mesa_program_resource_find_name(shProg, programInterface, uni.IndexName, in _mesa_program_resource_find_active_variable()
803 res = program_resource_find_binding_offset(shProg, programInterface, in _mesa_program_resource_find_active_variable()
807 return res; in _mesa_program_resource_find_active_variable()
812 struct gl_program_resource *res) in calc_resource_index() argument
817 if (&shProg->data->ProgramResourceList[i] == res) in calc_resource_index()
819 if (shProg->data->ProgramResourceList[i].Type == res->Type) in calc_resource_index()
830 struct gl_program_resource *res) in _mesa_program_resource_index() argument
832 if (!res) in _mesa_program_resource_index()
835 switch (res->Type) { in _mesa_program_resource_index()
837 return RESOURCE_ATC(res) - shProg->data->AtomicBuffers; in _mesa_program_resource_index()
844 return RESOURCE_SUB(res)->index; in _mesa_program_resource_index()
850 return calc_resource_index(shProg, res); in _mesa_program_resource_index()
860 struct gl_program_resource *res = shProg->data->ProgramResourceList; in program_resource_find_data() local
862 i++, res++) { in program_resource_find_data()
863 if (res->Data == data) in program_resource_find_data()
864 return res; in program_resource_find_data()
875 struct gl_program_resource *res = shProg->data->ProgramResourceList; in _mesa_program_resource_find_index() local
879 i++, res++) { in _mesa_program_resource_find_index()
880 if (res->Type != programInterface) in _mesa_program_resource_find_index()
883 switch (res->Type) { in _mesa_program_resource_find_index()
888 if (_mesa_program_resource_index(shProg, res) == index) in _mesa_program_resource_find_index()
889 return res; in _mesa_program_resource_find_index()
909 return res; in _mesa_program_resource_find_index()
936 add_index_to_name(struct gl_program_resource *res) in add_index_to_name() argument
941 return res->Type != GL_TRANSFORM_FEEDBACK_VARYING; in add_index_to_name()
948 _mesa_program_resource_name_len(struct gl_program_resource *res) in _mesa_program_resource_name_len() argument
950 const char* name = _mesa_program_resource_name(res); in _mesa_program_resource_name_len()
959 if (_mesa_program_resource_array_size(res) && add_index_to_name(res)) in _mesa_program_resource_name_len()
975 struct gl_program_resource *res = in _mesa_get_program_resource_name() local
982 if (!res) { in _mesa_get_program_resource_name()
997 _mesa_copy_string(name, bufSize, length, _mesa_program_resource_name(res)); in _mesa_get_program_resource_name()
1003 _mesa_program_resource_array_size(res) && add_index_to_name(res)) { in _mesa_get_program_resource_name()
1019 program_resource_location(struct gl_program_resource *res, unsigned array_index) in program_resource_location() argument
1021 switch (res->Type) { in program_resource_location()
1023 const gl_shader_variable *var = RESOURCE_VAR(res); in program_resource_location()
1037 if (RESOURCE_VAR(res)->location == -1) in program_resource_location()
1042 && array_index >= RESOURCE_VAR(res)->type->length) { in program_resource_location()
1045 return RESOURCE_VAR(res)->location + array_index; in program_resource_location()
1048 if (RESOURCE_UNI(res)->builtin) in program_resource_location()
1056 if (RESOURCE_UNI(res)->type->without_array()->is_struct()) in program_resource_location()
1066 if (RESOURCE_UNI(res)->block_index != -1 || in program_resource_location()
1067 RESOURCE_UNI(res)->atomic_buffer_index != -1) in program_resource_location()
1079 && array_index >= RESOURCE_UNI(res)->array_elements) { in program_resource_location()
1084 return RESOURCE_UNI(res)->remap_location + array_index; in program_resource_location()
1099 struct gl_program_resource *res = in _mesa_program_resource_location() local
1104 if (!res) in _mesa_program_resource_location()
1107 return program_resource_location(res, array_index); in _mesa_program_resource_location()
1111 _get_resource_location_index(struct gl_program_resource *res) in _get_resource_location_index() argument
1114 if (!res || !(res->StageReferences & (1 << MESA_SHADER_FRAGMENT))) in _get_resource_location_index()
1122 if (RESOURCE_VAR(res)->location == -1) in _get_resource_location_index()
1124 return RESOURCE_VAR(res)->index; in _get_resource_location_index()
1135 struct gl_program_resource *res = in _mesa_program_resource_location_index() local
1138 return _get_resource_location_index(res); in _mesa_program_resource_location_index()
1169 struct gl_program_resource *res, in is_resource_referenced() argument
1176 if (res->Type == GL_ATOMIC_COUNTER_BUFFER) in is_resource_referenced()
1177 return RESOURCE_ATC(res)->StageReferences[stage]; in is_resource_referenced()
1179 if (res->Type == GL_UNIFORM_BLOCK) in is_resource_referenced()
1182 if (res->Type == GL_SHADER_STORAGE_BLOCK) in is_resource_referenced()
1185 return res->StageReferences & (1 << stage); in is_resource_referenced()
1190 struct gl_program_resource *res, const GLenum prop, in get_buffer_property() argument
1194 if (res->Type != GL_UNIFORM_BLOCK && in get_buffer_property()
1195 res->Type != GL_ATOMIC_COUNTER_BUFFER && in get_buffer_property()
1196 res->Type != GL_SHADER_STORAGE_BLOCK && in get_buffer_property()
1197 res->Type != GL_TRANSFORM_FEEDBACK_BUFFER) in get_buffer_property()
1200 if (res->Type == GL_UNIFORM_BLOCK) { in get_buffer_property()
1203 *val = RESOURCE_UBO(res)->Binding; in get_buffer_property()
1206 *val = RESOURCE_UBO(res)->UniformBufferSize; in get_buffer_property()
1210 for (unsigned i = 0; i < RESOURCE_UBO(res)->NumUniforms; i++) { in get_buffer_property()
1215 RESOURCE_UBO(res), in get_buffer_property()
1225 for (unsigned i = 0; i < RESOURCE_UBO(res)->NumUniforms; i++) { in get_buffer_property()
1230 RESOURCE_UBO(res), in get_buffer_property()
1242 } else if (res->Type == GL_SHADER_STORAGE_BLOCK) { in get_buffer_property()
1245 *val = RESOURCE_UBO(res)->Binding; in get_buffer_property()
1248 *val = RESOURCE_UBO(res)->UniformBufferSize; in get_buffer_property()
1252 for (unsigned i = 0; i < RESOURCE_UBO(res)->NumUniforms; i++) { in get_buffer_property()
1257 RESOURCE_UBO(res), in get_buffer_property()
1267 for (unsigned i = 0; i < RESOURCE_UBO(res)->NumUniforms; i++) { in get_buffer_property()
1272 RESOURCE_UBO(res), in get_buffer_property()
1284 } else if (res->Type == GL_ATOMIC_COUNTER_BUFFER) { in get_buffer_property()
1287 *val = RESOURCE_ATC(res)->Binding; in get_buffer_property()
1290 *val = RESOURCE_ATC(res)->MinimumSize; in get_buffer_property()
1293 *val = RESOURCE_ATC(res)->NumUniforms; in get_buffer_property()
1296 for (unsigned i = 0; i < RESOURCE_ATC(res)->NumUniforms; i++) { in get_buffer_property()
1301 unsigned idx = RESOURCE_ATC(res)->Uniforms[i]; in get_buffer_property()
1308 return RESOURCE_ATC(res)->NumUniforms; in get_buffer_property()
1310 } else if (res->Type == GL_TRANSFORM_FEEDBACK_BUFFER) { in get_buffer_property()
1313 *val = RESOURCE_XFB(res)->Binding; in get_buffer_property()
1316 *val = RESOURCE_XFB(res)->NumVaryings; in get_buffer_property()
1328 if (res == buf_res) { in get_buffer_property()
1332 return RESOURCE_XFB(res)->NumVaryings; in get_buffer_property()
1339 _mesa_enum_to_string(res->Type), in get_buffer_property()
1347 struct gl_program_resource *res, GLuint index, in _mesa_program_resource_prop() argument
1353 if (res->Type != type)\ in _mesa_program_resource_prop()
1357 if (res->Type != type1 && res->Type != type2)\ in _mesa_program_resource_prop()
1362 switch (res->Type) { in _mesa_program_resource_prop()
1368 *val = _mesa_program_resource_name_len(res) + 1; in _mesa_program_resource_prop()
1372 switch (res->Type) { in _mesa_program_resource_prop()
1375 *val = RESOURCE_UNI(res)->type->gl_type; in _mesa_program_resource_prop()
1379 *val = RESOURCE_VAR(res)->type->gl_type; in _mesa_program_resource_prop()
1382 *val = RESOURCE_XFV(res)->Type; in _mesa_program_resource_prop()
1388 switch (res->Type) { in _mesa_program_resource_prop()
1401 if (RESOURCE_UNI(res)->is_shader_storage && in _mesa_program_resource_prop()
1402 RESOURCE_UNI(res)->array_stride > 0) in _mesa_program_resource_prop()
1403 *val = RESOURCE_UNI(res)->array_elements; in _mesa_program_resource_prop()
1405 *val = MAX2(RESOURCE_UNI(res)->array_elements, 1); in _mesa_program_resource_prop()
1409 *val = MAX2(_mesa_program_resource_array_size(res), 1); in _mesa_program_resource_prop()
1412 *val = RESOURCE_XFV(res)->Size; in _mesa_program_resource_prop()
1418 switch (res->Type) { in _mesa_program_resource_prop()
1421 *val = RESOURCE_UNI(res)->offset; in _mesa_program_resource_prop()
1424 *val = RESOURCE_XFV(res)->Offset; in _mesa_program_resource_prop()
1431 *val = RESOURCE_UNI(res)->block_index; in _mesa_program_resource_prop()
1435 *val = RESOURCE_UNI(res)->array_stride; in _mesa_program_resource_prop()
1439 *val = RESOURCE_UNI(res)->matrix_stride; in _mesa_program_resource_prop()
1443 *val = RESOURCE_UNI(res)->row_major; in _mesa_program_resource_prop()
1447 *val = RESOURCE_UNI(res)->atomic_buffer_index; in _mesa_program_resource_prop()
1453 return get_buffer_property(shProg, res, prop, val, caller); in _mesa_program_resource_prop()
1463 switch (res->Type) { in _mesa_program_resource_prop()
1471 *val = is_resource_referenced(shProg, res, index, in _mesa_program_resource_prop()
1478 switch (res->Type) { in _mesa_program_resource_prop()
1488 *val = program_resource_location(res, 0); in _mesa_program_resource_prop()
1494 switch (res->Type) { in _mesa_program_resource_prop()
1497 *val = RESOURCE_VAR(res)->component; in _mesa_program_resource_prop()
1504 if (res->Type != GL_PROGRAM_OUTPUT) in _mesa_program_resource_prop()
1506 tmp = program_resource_location(res, 0); in _mesa_program_resource_prop()
1510 *val = _get_resource_location_index(res); in _mesa_program_resource_prop()
1514 if (res->Type != GL_VERTEX_SUBROUTINE_UNIFORM && in _mesa_program_resource_prop()
1515 res->Type != GL_FRAGMENT_SUBROUTINE_UNIFORM && in _mesa_program_resource_prop()
1516 res->Type != GL_GEOMETRY_SUBROUTINE_UNIFORM && in _mesa_program_resource_prop()
1517 res->Type != GL_COMPUTE_SUBROUTINE_UNIFORM && in _mesa_program_resource_prop()
1518 res->Type != GL_TESS_CONTROL_SUBROUTINE_UNIFORM && in _mesa_program_resource_prop()
1519 res->Type != GL_TESS_EVALUATION_SUBROUTINE_UNIFORM) in _mesa_program_resource_prop()
1521 *val = RESOURCE_UNI(res)->num_compatible_subroutines; in _mesa_program_resource_prop()
1529 if (res->Type != GL_VERTEX_SUBROUTINE_UNIFORM && in _mesa_program_resource_prop()
1530 res->Type != GL_FRAGMENT_SUBROUTINE_UNIFORM && in _mesa_program_resource_prop()
1531 res->Type != GL_GEOMETRY_SUBROUTINE_UNIFORM && in _mesa_program_resource_prop()
1532 res->Type != GL_COMPUTE_SUBROUTINE_UNIFORM && in _mesa_program_resource_prop()
1533 res->Type != GL_TESS_CONTROL_SUBROUTINE_UNIFORM && in _mesa_program_resource_prop()
1534 res->Type != GL_TESS_EVALUATION_SUBROUTINE_UNIFORM) in _mesa_program_resource_prop()
1536 uni = RESOURCE_UNI(res); in _mesa_program_resource_prop()
1538 p = shProg->_LinkedShaders[_mesa_shader_stage_from_subroutine_uniform(res->Type)]->Program; in _mesa_program_resource_prop()
1554 *val = RESOURCE_UNI(res)->top_level_array_size; in _mesa_program_resource_prop()
1559 *val = RESOURCE_UNI(res)->top_level_array_stride; in _mesa_program_resource_prop()
1564 switch (res->Type) { in _mesa_program_resource_prop()
1567 *val = RESOURCE_VAR(res)->patch; in _mesa_program_resource_prop()
1575 *val = RESOURCE_XFV(res)->BufferIndex; in _mesa_program_resource_prop()
1579 *val = RESOURCE_XFB(res)->Stride * 4; in _mesa_program_resource_prop()
1591 _mesa_enum_to_string(res->Type), in _mesa_program_resource_prop()
1597 _mesa_enum_to_string(res->Type), in _mesa_program_resource_prop()
1613 struct gl_program_resource *res = in _mesa_get_program_resourceiv() local
1617 if (!res || bufSize < 0) { in _mesa_get_program_resourceiv()
1627 _mesa_program_resource_prop(shProg, res, index, *prop, val, in _mesa_get_program_resourceiv()
1684 struct gl_program_resource *res = in validate_io() local
1687 if (res->Type != GL_PROGRAM_OUTPUT) in validate_io()
1690 gl_shader_variable const *const var = RESOURCE_VAR(res); in validate_io()
1705 struct gl_program_resource *res = in validate_io() local
1708 if (res->Type != GL_PROGRAM_INPUT) in validate_io()
1711 gl_shader_variable const *const consumer_var = RESOURCE_VAR(res); in validate_io()
1919 struct gl_program_resource *res = shProg->data->ProgramResourceList; in _mesa_create_program_resource_hash() local
1920 for (unsigned i = 0; i < shProg->data->NumProgramResourceList; i++, res++) { in _mesa_create_program_resource_hash()
1921 const char *name = _mesa_program_resource_name(res); in _mesa_create_program_resource_hash()
1923 uint32_t key = compute_resource_key(res->Type, name); in _mesa_create_program_resource_hash()
1925 res); in _mesa_create_program_resource_hash()