Bug 65513 - In TGSI module, replace string arrays with functions
Summary: In TGSI module, replace string arrays with functions
Status: RESOLVED MOVED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: git
Hardware: Other All
: medium trivial
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-07 15:41 UTC by Brian Paul
Modified: 2019-09-18 20:23 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Brian Paul 2013-06-07 15:41:16 UTC
This is another relatively simple code clean-up project.

In the tgsi_string.[ch] files we have arrays such as tgsi_semantic_names[] and tgsi_texture_names[] which are used to map TGSI enums to strings.  In the .c file we have static assertions to check that the number of strings in the array matches the TGSI_x_COUNT values.  But the assertions are useless since the arrays are explicitly dimensioned.  The point of the assertions is to make sure that when we add a new TGSI enum that we also update the array of strings used for TGSI parsing/printing.

In commit 14541dacab218cbe82310d999d44130ebc3f6526 we replaced the tgsi_file_names[] array with a new tgsi_file_name() function.  The static assertion now works properly, and it's probably a better solution anyway.  This task is to do the same transformation for the other string arrays.

Please do one patch for each array->function transformation.
Comment 1 GitLab Migration User 2019-09-18 20:23:14 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/977.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.