Abstract
With the modern 3D graphics libraries, the support for the error reports and other debugging features are much important. For the famous OpenGL (Open Graphics Library) family, they introduce the KHR debug extension. In this paper, we present the details of adding full features of KHR debug extension to the OpenGL SC (Safety Critical profile) 2.0. This enhancement to the OpenGL SC 2.0 engine shows more up-to-date debugging features with traditional graphics drivers.
Similar content being viewed by others
Keywords
1 Introduction
Currently, OpenGL family is one of the most widely used three-dimensional graphics library [1, 2]. This library is used on various platforms including personal computers, workstations, mainframes, tablets, smartphones, and others. Many commercial and non-commercial implementations are available. For three-dimensional graphics output, the single board computing devices typically use OpenGL ES (Open Graphics Library for Embedded Systems) [2]. Khronos Group, the de facto standard organization, consistently manages all the standard specifications and various extensions.
From the programming point of view, the emphasis on the debugging supports are one of the most important trends. In contrast, OpenGL graphics library was originally designed in 1990s, when there is no sufficient requirements on the debugging functionalities [3]. Thus, many existing drivers and implementations of OpenGL provides only the classical error checking feature: When an error occurred, OpenGL system set the internal error flag, and it is the duty of application programmers to periodically check the error flag and process its error handling.
OpenGL SC (OpenGL for Safety Critical) is conceptually a safety critical variation of the famous OpenGL standard. This graphics API library is designed to meet the needs of safety critical markets for avionics, industrial, military, medical and automotive applications. In the case of safety-critical markets, OpenGL SC plays the major role for the graphical interfaces. The need for this 3D graphics API is rapidly increasing with the growth of the safety-critical market [4, 5]. For the medical and automotive applications, consumer electronics markets start to strongly need this standard [6].
In the year of 2015, the Khronos Group, the fundamental standard management body of the OpenGL family, established the new OpenGL SC 2.0 specification [7]. It originally aims to a safety critical subset of OpenGL ES 2.0 [8]. The Khronos Group is also developing cross-API guidelines to aid in the development of open technology standards for safety critical systems.
For the safety critical profiles, they also emphasize the security-critical features. To fully support these safety and security features, the debug output extensions are highly recommended. In this paper, we show our design and implementation of the debug output extension for OpenGL SC 2.0 library. Our implementation shows that it works well and helpful for the safety-critical supports. Details are followed in the following sections.
2 Design Analysis
For more convenient error processing and debugging features, the new KHR debug extension [9] to the OpenGL is introduced in 2012. With this debugging extension, the OpenGL system generates more detailed internal error messages and automatically calls the pre-registered callback function when an error occurred. This new extension is actually a big improvement to the debugging of the OpenGL application programs. From OpenGL version 4.3 [10], this debugging extension is now the core feature of the OpenGL standard specification.
With KHR_debug extension, the OpenGL system automatically calls the pre-registered callback function, for every internal errors. We can use the function to pre-register the user-specifiable callback function. Additionally, application programmers can generate his/her own messages to the error stream, even without any OpenGL errors. We can use function for this purpose. The followings are the details of those functions.
specifies a callback function to receive debugging messages from the OpenGL. Each time a debug message is generated the debug callback function will be invoked with source, type, id, and severity associated with the message.
injects an application-supplied message into the debug message queue.
When the OpenGL system works in the server-client model, the OpenGL functions may be called with remote calls. In this case, since the physical memory regions are isolated to each side, the OpenGL system cannot call the pre-registered callback function. For those situations, the OpenGL system generates the debugging message to its internal message log area. Application programmers can access the internal message log area and get the log messages using the following function:
retrieves messages from the debug message log.
We applied the KHR debug extension to the new OpenGL SC 2.0 standard specification. To support the debug extension, we first need API function implementation. To support full features, actually we need internal engine modifications, to support debug features. In our case, we succeeded to add all the features to the OpenGL SC 2.0 engine internals.
3 Implementation Results
To test the KHR debug extension features, we make a set of example programs. As a typical example, one of our example source code contains the following code segment:
Since our shader programs do not contain any variable of the name “unspecified”, these code segments generate a warning and an error, according to the OpenGL SC 2.0 standard specification.
In our OpenGL SC 2.0 engine implementation, each API function will check any warning conditions and error conditions. For the warning case of function, our engine contains the following code segment:
where is the internal debug output function. This will generate the corresponding OpenGL SC warning debug message.
Additionally, our OpenGL SC 2.0 engine also contains error check as follows:
Finally, these warning and error checks generate the debug output messages on the screen as follows:
As shown here, these debug output messages contain the API kind, severity level, and identification numbers, as the details of the debug messages. All these details are not required for the basic-level OpenGL SC engines, while those should be implemented for the KHR debug extension support.
4 Conclusion
In these days, the debugging features become more important to the development process. In this paper, we aimed to add the KHR debug extension to the newly released OpenGL SC 2.0 graphics library. We designed to support all the debug output features in the existing OpenGL SC 2.0 engine. The final check programs show that our OpenGL SC 2.0 engine now fully support KHR debug extensions. This is the first literature report of the debug extension to the OpenGL Security Critical profile, at least to the best of our knowledge.
References
Khronos Group (2015) OpenGL 4.5 core profile
Khronos Group (2012) OpenGL ES version 3.0
Segal M, Akeley K (1994) The OpenGL graphics system: a specification (version 1.0), silicon grpahics
Cole P (2005) OpenGL ES SC—open standard embedded graphics API for safety critical applications. In: 24th digital avionics systems conference
Snyder M (2005) Solving the embedded OpenGL puzzle—making standards, tools, and APIs work together in highly embedded and safety critical environments. In: 24th digital avionics systems conference
Baek N, Baeck GJ (2010) Design of OpenGL SC emulation library over the desktop OpenGL 1.3. In: 29th digital avionics systems conference
Fabius A, Viggers S (2016) OpenGL SC, version 2.0.0 full specification
Munshi A, Leech J (2010) OpenGL ES common profile specification, version 2.0.25 (Full specification)
Riccio C (2012) KHR_debug extension. Khronos Group
Khronos Group (2012) OpenGL 4.3 core specification
Acknowledgements
This research was supported by Basic Science Research Program through the National Research Foundation of Korea (NRF) funded by the Ministry of Education, Science and Technology (Grant 2016R1D1A3B03935488).
This study was also supported by the BK21 Plus project (SW Human Resource Development Program for Supporting Smart Life) funded by the Ministry of Education, School of Computer Science and Engineering, Kyungpook National University, Korea (21A20131600005).
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2019 Springer Nature Singapore Pte Ltd.
About this paper
Cite this paper
Shin, W., Baek, N. (2019). Debug Output Features for OpenGL SC 2.0 Safety Critical Profile. In: Kim, K., Baek, N. (eds) Information Science and Applications 2018. ICISA 2018. Lecture Notes in Electrical Engineering, vol 514. Springer, Singapore. https://doi.org/10.1007/978-981-13-1056-0_18
Download citation
DOI: https://doi.org/10.1007/978-981-13-1056-0_18
Published:
Publisher Name: Springer, Singapore
Print ISBN: 978-981-13-1055-3
Online ISBN: 978-981-13-1056-0
eBook Packages: EngineeringEngineering (R0)