WO2022231230A1 - 전자 장치 및 전자 장치의 api 변환 방법 - Google Patents

전자 장치 및 전자 장치의 api 변환 방법 Download PDF

Info

Publication number
WO2022231230A1
WO2022231230A1 PCT/KR2022/005846 KR2022005846W WO2022231230A1 WO 2022231230 A1 WO2022231230 A1 WO 2022231230A1 KR 2022005846 W KR2022005846 W KR 2022005846W WO 2022231230 A1 WO2022231230 A1 WO 2022231230A1
Authority
WO
WIPO (PCT)
Prior art keywords
api
type
electronic device
graphic
buffer
Prior art date
Application number
PCT/KR2022/005846
Other languages
English (en)
French (fr)
Inventor
김현희
이삭
이상민
김정우
박찬민
Original Assignee
삼성전자 주식회사
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 삼성전자 주식회사 filed Critical 삼성전자 주식회사
Publication of WO2022231230A1 publication Critical patent/WO2022231230A1/ko

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/20Processor architectures; Processor configuration, e.g. pipelining
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4411Configuring for operating with peripheral devices; Loading of device drivers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/60Memory management

Definitions

  • Embodiments disclosed in this document relate to a technology for converting an application program interface (API).
  • API application program interface
  • An application program interface has a language or message format used when an application program communicates with a system program such as an operating system or database management system. It can be implemented by calling
  • An application included in the electronic device may use a designated type of API when performing a rendering function. If you want to use an API of a different type other than the API of the type specified in the application, a technology for converting the API is required.
  • An object of the present disclosure is to provide an electronic device and a method for converting an API of the electronic device.
  • An electronic device includes a memory and a processor operatively coupled to the memory, wherein the memory, when executed, causes the processor to generate a first type of graphics from an application.
  • the second type of graphic API-based data and commands stored in the virtual command buffer are reconfigured into the optimized second type of graphic API-based data and commands,
  • the reconstructed second type of graphic API-based data and instructions may be stored in a command buffer based on the second type of graphic API.
  • the method for converting an application program interface (API) of an electronic device includes the operation of receiving a function execution request based on a first type of graphic API from an application, based on the request, An operation of translating data and commands based on a graphic API of a first type into data and commands based on a graphic API of a second type, and storing the data and commands based on a graphic API of the second type in a virtual command buffer Based on at least one of an operation, rendering target information related to data based on the first type of graphic API, depth state information, and an attribute of the first type of graphic API, stored in the virtual command buffer An operation of reconfiguring the data and instructions based on the second type of graphics API into data and instructions based on the second type of optimized graphics API, and converting the reconstructed data and instructions based on the graphic API of the second type to the second type of graphics It may include an operation of storing the API-based command buffer, and an operation of rendering at least one object based on the second type of graphic API
  • cache when converting the first type of graphic API into the second type of graphic API, cache, memory bandwidth, and render pass may be optimized.
  • the performance of the electronic device may be improved and memory usage may be reduced by performing optimization of memory, buffer, and API command (function).
  • the optimized API may be reconstructed by analyzing the converted API before being transferred to the GPU and executed.
  • FIG. 1 illustrates an electronic device in a network environment according to various embodiments of the present disclosure.
  • FIG. 2 is a block diagram illustrating a program according to various embodiments.
  • FIG. 3 is a block diagram of an electronic device according to an exemplary embodiment.
  • FIG. 4 is a diagram schematically illustrating a configuration of an electronic device according to an exemplary embodiment.
  • FIG. 5 is a diagram for explaining API conversion operations of an electronic device according to an embodiment.
  • 6A to 6F are diagrams for explaining an operation of optimizing an index buffer of an electronic device according to an exemplary embodiment.
  • FIG. 7 is a flowchart of an API conversion method of an electronic device according to an embodiment.
  • FIG. 8 is a flowchart of an API conversion method of an electronic device according to an embodiment.
  • FIG. 9 is a flowchart of instruction optimization operations of an electronic device according to an exemplary embodiment.
  • FIG. 1 is a block diagram of an electronic device 101 in a network environment 100, according to various embodiments.
  • an electronic device 101 communicates with an electronic device 102 through a first network 198 (eg, a short-range wireless communication network) or a second network 199 . It may communicate with at least one of the electronic device 104 and the server 108 through (eg, a long-distance wireless communication network). According to an embodiment, the electronic device 101 may communicate with the electronic device 104 through the server 108 .
  • a first network 198 eg, a short-range wireless communication network
  • a second network 199 e.g., a second network 199
  • the electronic device 101 may communicate with the electronic device 104 through the server 108 .
  • the electronic device 101 includes a processor 120 , a memory 130 , an input module 150 , a sound output module 155 , a display module 160 , an audio module 170 , and a sensor module ( 176), interface 177, connection terminal 178, haptic module 179, camera module 180, power management module 188, battery 189, communication module 190, subscriber identification module 196 , or an antenna module 197 .
  • at least one of these components eg, the connection terminal 178
  • some of these components are integrated into one component (eg, display module 160 ). can be
  • the processor 120 for example, executes software (eg, a program 140) to execute at least one other component (eg, a hardware or software component) of the electronic device 101 connected to the processor 120. It can control and perform various data processing or operations. According to one embodiment, as at least part of data processing or operation, the processor 120 converts commands or data received from other components (eg, the sensor module 176 or the communication module 190 ) to the volatile memory 132 . may be stored in , process commands or data stored in the volatile memory 132 , and store the result data in the non-volatile memory 134 .
  • software eg, a program 140
  • the processor 120 converts commands or data received from other components (eg, the sensor module 176 or the communication module 190 ) to the volatile memory 132 .
  • the volatile memory 132 may be stored in , process commands or data stored in the volatile memory 132 , and store the result data in the non-volatile memory 134 .
  • the processor 120 is a main processor 121 (eg, a central processing unit or an application processor) or a secondary processor 123 (eg, a graphic processing unit, a neural network processing unit) a neural processing unit (NPU), an image signal processor, a sensor hub processor, or a communication processor).
  • a main processor 121 eg, a central processing unit or an application processor
  • a secondary processor 123 eg, a graphic processing unit, a neural network processing unit
  • NPU neural processing unit
  • an image signal processor e.g., a sensor hub processor, or a communication processor.
  • the secondary processor 123 may, for example, act on behalf of the main processor 121 while the main processor 121 is in an inactive (eg, sleep) state, or when the main processor 121 is active (eg, executing an application). ), together with the main processor 121, at least one of the components of the electronic device 101 (eg, the display module 160, the sensor module 176, or the communication module 190) It is possible to control at least some of the related functions or states.
  • the coprocessor 123 eg, an image signal processor or a communication processor
  • may be implemented as part of another functionally related component eg, the camera module 180 or the communication module 190. have.
  • the auxiliary processor 123 may include a hardware structure specialized for processing an artificial intelligence model.
  • Artificial intelligence models can be created through machine learning. Such learning may be performed, for example, in the electronic device 101 itself on which the artificial intelligence model is performed, or may be performed through a separate server (eg, the server 108).
  • the learning algorithm may include, for example, supervised learning, unsupervised learning, semi-supervised learning, or reinforcement learning, but in the above example not limited
  • the artificial intelligence model may include a plurality of artificial neural network layers.
  • Artificial neural networks include deep neural networks (DNNs), convolutional neural networks (CNNs), recurrent neural networks (RNNs), restricted boltzmann machines (RBMs), deep belief networks (DBNs), bidirectional recurrent deep neural networks (BRDNNs), It may be one of deep Q-networks or a combination of two or more of the above, but is not limited to the above example.
  • the artificial intelligence model may include, in addition to, or alternatively, a software structure in addition to the hardware structure.
  • the memory 130 may store various data used by at least one component (eg, the processor 120 or the sensor module 176 ) of the electronic device 101 .
  • the data may include, for example, input data or output data for software (eg, the program 140 ) and instructions related thereto.
  • the memory 130 may include a volatile memory 132 or a non-volatile memory 134 .
  • the program 140 may be stored as software in the memory 130 , and may include, for example, an operating system 142 , middleware 144 , or an application 146 .
  • the input module 150 may receive a command or data to be used by a component (eg, the processor 120 ) of the electronic device 101 from the outside (eg, a user) of the electronic device 101 .
  • the input module 150 may include, for example, a microphone, a mouse, a keyboard, a key (eg, a button), or a digital pen (eg, a stylus pen).
  • the sound output module 155 may output a sound signal to the outside of the electronic device 101 .
  • the sound output module 155 may include, for example, a speaker or a receiver.
  • the speaker can be used for general purposes such as multimedia playback or recording playback.
  • the receiver can be used to receive incoming calls. According to one embodiment, the receiver may be implemented separately from or as part of the speaker.
  • the display module 160 may visually provide information to the outside (eg, a user) of the electronic device 101 .
  • the display module 160 may include, for example, a control circuit for controlling a display, a hologram device, or a projector and a corresponding device.
  • the display module 160 may include a touch sensor configured to sense a touch or a pressure sensor configured to measure the intensity of a force generated by the touch.
  • the audio module 170 may convert a sound into an electric signal or, conversely, convert an electric signal into a sound. According to an embodiment, the audio module 170 acquires a sound through the input module 150 or an external electronic device (eg, a sound output module 155 ) directly or wirelessly connected to the electronic device 101 .
  • the electronic device 102) eg, a speaker or headphones
  • the sensor module 176 detects an operating state (eg, power or temperature) of the electronic device 101 or an external environmental state (eg, a user state), and generates an electrical signal or data value corresponding to the sensed state. can do.
  • the sensor module 176 may include, for example, a gesture sensor, a gyro sensor, a barometric pressure sensor, a magnetic sensor, an acceleration sensor, a grip sensor, a proximity sensor, a color sensor, an IR (infrared) sensor, a biometric sensor, It may include a temperature sensor, a humidity sensor, or an illuminance sensor.
  • the interface 177 may support one or more specified protocols that may be used by the electronic device 101 to directly or wirelessly connect with an external electronic device (eg, the electronic device 102 ).
  • the interface 177 may include, for example, a high definition multimedia interface (HDMI), a universal serial bus (USB) interface, an SD card interface, or an audio interface.
  • the connection terminal 178 may include a connector through which the electronic device 101 can be physically connected to an external electronic device (eg, the electronic device 102 ).
  • the connection terminal 178 may include, for example, an HDMI connector, a USB connector, an SD card connector, or an audio connector (eg, a headphone connector).
  • the haptic module 179 may convert an electrical signal into a mechanical stimulus (eg, vibration or movement) or an electrical stimulus that the user can perceive through tactile or kinesthetic sense.
  • the haptic module 179 may include, for example, a motor, a piezoelectric element, or an electrical stimulation device.
  • the camera module 180 may capture still images and moving images. According to an embodiment, the camera module 180 may include one or more lenses, image sensors, image signal processors, or flashes.
  • the power management module 188 may manage power supplied to the electronic device 101 .
  • the power management module 188 may be implemented as, for example, at least a part of a power management integrated circuit (PMIC).
  • PMIC power management integrated circuit
  • the battery 189 may supply power to at least one component of the electronic device 101 .
  • battery 189 may include, for example, a non-rechargeable primary cell, a rechargeable secondary cell, or a fuel cell.
  • the communication module 190 is a direct (eg, wired) communication channel or a wireless communication channel between the electronic device 101 and an external electronic device (eg, the electronic device 102, the electronic device 104, or the server 108). It can support establishment and communication performance through the established communication channel.
  • the communication module 190 may include one or more communication processors that operate independently of the processor 120 (eg, an application processor) and support direct (eg, wired) communication or wireless communication.
  • the communication module 190 is a wireless communication module 192 (eg, a cellular communication module, a short-range wireless communication module, or a global navigation satellite system (GNSS) communication module) or a wired communication module 194 (eg, : It may include a local area network (LAN) communication module, or a power line communication module).
  • a wireless communication module 192 eg, a cellular communication module, a short-range wireless communication module, or a global navigation satellite system (GNSS) communication module
  • GNSS global navigation satellite system
  • wired communication module 194 eg, : It may include a local area network (LAN) communication module, or a power line communication module.
  • a corresponding communication module among these communication modules is a first network 198 (eg, a short-range communication network such as Bluetooth, wireless fidelity (WiFi) direct, or infrared data association (IrDA)) or a second network 199 (eg, legacy It may communicate with the external electronic device 104 through a cellular network, a 5G network, a next-generation communication network, the Internet, or a computer network (eg, a telecommunication network such as a LAN or a WAN).
  • a first network 198 eg, a short-range communication network such as Bluetooth, wireless fidelity (WiFi) direct, or infrared data association (IrDA)
  • a second network 199 eg, legacy It may communicate with the external electronic device 104 through a cellular network, a 5G network, a next-generation communication network, the Internet, or a computer network (eg, a telecommunication network such as a LAN or a WAN).
  • a telecommunication network
  • the wireless communication module 192 uses subscriber information (eg, International Mobile Subscriber Identifier (IMSI)) stored in the subscriber identification module 196 within a communication network such as the first network 198 or the second network 199 .
  • subscriber information eg, International Mobile Subscriber Identifier (IMSI)
  • IMSI International Mobile Subscriber Identifier
  • the electronic device 101 may be identified or authenticated.
  • the wireless communication module 192 may support a 5G network after a 4G network and a next-generation communication technology, for example, a new radio access technology (NR).
  • NR access technology includes high-speed transmission of high-capacity data (eMBB (enhanced mobile broadband)), minimization of terminal power and access to multiple terminals (mMTC (massive machine type communications)), or high reliability and low latency (URLLC (ultra-reliable and low-latency) -latency communications)).
  • eMBB enhanced mobile broadband
  • mMTC massive machine type communications
  • URLLC ultra-reliable and low-latency
  • the wireless communication module 192 may support a high frequency band (eg, mmWave band) to achieve a high data rate, for example.
  • a high frequency band eg, mmWave band
  • the wireless communication module 192 uses various techniques for securing performance in a high-frequency band, for example, beamforming, massive multiple-input and multiple-output (MIMO), all-dimensional multiplexing. It may support technologies such as full dimensional MIMO (FD-MIMO), an array antenna, analog beam-forming, or a large scale antenna.
  • the wireless communication module 192 may support various requirements defined in the electronic device 101 , an external electronic device (eg, the electronic device 104 ), or a network system (eg, the second network 199 ).
  • the wireless communication module 192 may include a peak data rate (eg, 20 Gbps or more) for realizing eMBB, loss coverage (eg, 164 dB or less) for realizing mMTC, or U-plane latency for realizing URLLC ( Example: Downlink (DL) and uplink (UL) each 0.5 ms or less, or round trip 1 ms or less) can be supported.
  • a peak data rate eg, 20 Gbps or more
  • loss coverage eg, 164 dB or less
  • U-plane latency for realizing URLLC
  • the antenna module 197 may transmit or receive a signal or power to the outside (eg, an external electronic device).
  • the antenna module 197 may include an antenna including a conductor formed on a substrate (eg, a PCB) or a radiator formed of a conductive pattern.
  • the antenna module 197 may include a plurality of antennas (eg, an array antenna). In this case, at least one antenna suitable for a communication method used in a communication network such as the first network 198 or the second network 199 is connected from the plurality of antennas by, for example, the communication module 190 . can be selected. A signal or power may be transmitted or received between the communication module 190 and an external electronic device through the selected at least one antenna.
  • other components eg, a radio frequency integrated circuit (RFIC)
  • RFIC radio frequency integrated circuit
  • the antenna module 197 may form a mmWave antenna module.
  • the mmWave antenna module comprises a printed circuit board, an RFIC disposed on or adjacent to a first side (eg, underside) of the printed circuit board and capable of supporting a designated high frequency band (eg, mmWave band); and a plurality of antennas (eg, an array antenna) disposed on or adjacent to a second side (eg, top or side) of the printed circuit board and capable of transmitting or receiving signals of the designated high frequency band. can do.
  • peripheral devices eg, a bus, general purpose input and output (GPIO), serial peripheral interface (SPI), or mobile industry processor interface (MIPI)
  • GPIO general purpose input and output
  • SPI serial peripheral interface
  • MIPI mobile industry processor interface
  • the command or data may be transmitted or received between the electronic device 101 and the external electronic device 104 through the server 108 connected to the second network 199 .
  • Each of the external electronic devices 102 or 104 may be the same as or different from the electronic device 101 .
  • all or part of the operations performed by the electronic device 101 may be executed by one or more external electronic devices 102 , 104 , or 108 .
  • the electronic device 101 may perform the function or service itself instead of executing the function or service itself.
  • one or more external electronic devices may be requested to perform at least a part of the function or the service.
  • One or more external electronic devices that have received the request may execute at least a part of the requested function or service, or an additional function or service related to the request, and transmit a result of the execution to the electronic device 101 .
  • the electronic device 101 may process the result as it is or additionally and provide it as at least a part of a response to the request.
  • cloud computing, distributed computing, mobile edge computing (MEC), or client-server computing technology may be used.
  • the electronic device 101 may provide an ultra-low latency service using, for example, distributed computing or mobile edge computing.
  • the external electronic device 104 may include an Internet of things (IoT) device.
  • the server 108 may be an intelligent server using machine learning and/or neural networks.
  • the external electronic device 104 or the server 108 may be included in the second network 199 .
  • the electronic device 101 may be applied to an intelligent service (eg, smart home, smart city, smart car, or health care) based on 5G communication technology and IoT-related technology.
  • FIG. 2 is a block diagram 200 illustrating a program 140 in accordance with various embodiments.
  • the program 140 executes an operating system 142 , middleware 144 , or an application 146 executable in the operating system 142 for controlling one or more resources of the electronic device 101 .
  • may include Operating system 142 may include, for example, AndroidTM, iOSTM, WindowsTM, SymbianTM, TizenTM, or BadaTM.
  • At least some of the programs 140 are, for example, preloaded into the electronic device 101 at the time of manufacture, or an external electronic device (eg, the electronic device 102 or 104 ), or a server (eg, the electronic device 102 or 104 ) when used by a user ( 108)), or may be updated.
  • the operating system 142 may control management (eg, allocation or retrieval) of one or more system resources (eg, a process, memory, or power) of the electronic device 101 .
  • the operating system 142 may additionally or alternatively include other hardware devices of the electronic device 101 , for example, the input module 150 , the sound output module 155 , the display module 160 , and the audio module 170 . , sensor module 176 , interface 177 , haptic module 179 , camera module 180 , power management module 188 , battery 189 , communication module 190 , subscriber identification module 196 , or It may include one or more driver programs for driving the antenna module 197 .
  • the middleware 144 may provide various functions to the application 146 so that functions or information provided from one or more resources of the electronic device 101 may be used by the application 146 .
  • the middleware 144 includes, for example, an application manager 201 , a window manager 203 , a multimedia manager 205 , a resource manager 207 , a power manager 209 , a database manager 211 , and a package manager 213 . ), a connectivity manager 215 , a notification manager 217 , a location manager 219 , a graphics manager 221 , a security manager 223 , a call manager 225 , or a voice recognition manager 227 .
  • an application manager 201 includes, for example, an application manager 201 , a window manager 203 , a multimedia manager 205 , a resource manager 207 , a power manager 209 , a database manager 211 , and a package manager 213 .
  • a connectivity manager 215 a notification manager 217 , a
  • the application manager 201 may manage the life cycle of the application 146 , for example.
  • the window manager 203 may manage one or more GUI resources used in the screen, for example.
  • the multimedia manager 205 for example, identifies one or more formats required for playback of media files, and encodes or decodes a corresponding media file among the media files using a codec suitable for the selected format. can be done
  • the resource manager 207 may manage the space of the source code of the application 146 or the memory of the memory 130 , for example.
  • the power manager 209 may, for example, manage the capacity, temperature, or power of the battery 189 , and determine or provide related information required for the operation of the electronic device 101 by using the corresponding information. . According to an embodiment, the power manager 209 may interwork with a basic input/output system (BIOS) (not shown) of the electronic device 101 .
  • BIOS basic input/output system
  • the database manager 211 may create, retrieve, or change a database to be used by the application 146 , for example.
  • the package manager 213 may manage installation or update of an application distributed in the form of a package file, for example.
  • the connectivity manager 215 may manage, for example, a wireless connection or a direct connection between the electronic device 101 and an external electronic device.
  • the notification manager 217 may provide, for example, a function for notifying the user of the occurrence of a specified event (eg, an incoming call, a message, or an alarm).
  • the location manager 219 may manage location information of the electronic device 101 , for example.
  • the graphic manager 221 may manage, for example, one or more graphic effects to be provided to a user or a user interface related thereto.
  • Security manager 223 may provide, for example, system security or user authentication.
  • the telephony manager 225 may manage, for example, a voice call function or a video call function provided by the electronic device 101 .
  • the voice recognition manager 227 for example, transmits the user's voice data to the server 108, and based at least in part on the voice data, a command corresponding to a function to be performed in the electronic device 101; Alternatively, the converted text data may be received from the server 108 based at least in part on the voice data.
  • the middleware 244 may dynamically delete some existing components or add new components.
  • at least a portion of the middleware 144 may be included as a part of the operating system 142 or implemented as software separate from the operating system 142 .
  • Application 146 includes, for example, home 251 , dialer 253 , SMS/MMS 255 , instant message (IM) 257 , browser 259 , camera 261 , alarm 263 . , contacts 265, voice recognition 267, email 269, calendar 271, media player 273, album 275, watch 277, health 279 (such as exercise or blood sugar) measuring biometric information), or environmental information 281 (eg, measuring atmospheric pressure, humidity, or temperature information).
  • the application 146 may further include an information exchange application (not shown) capable of supporting information exchange between the electronic device 101 and an external electronic device.
  • the information exchange application may include, for example, a notification relay application configured to transmit specified information (eg, call, message, or alarm) to an external electronic device, or a device management application configured to manage the external electronic device.
  • the notification relay application for example, transmits notification information corresponding to a specified event (eg, mail reception) generated in another application (eg, the email application 269 ) of the electronic device 101 to the external electronic device.
  • the notification relay application may receive notification information from the external electronic device and provide it to the user of the electronic device 101 .
  • the device management application is, for example, a power source (eg, turn-on or turn-off) of an external electronic device that communicates with the electronic device 101 or some components thereof (eg, a display module or a camera module of the external electronic device). ) or a function (eg brightness, resolution, or focus).
  • the device management application may additionally or alternatively support installation, deletion, or update of an application operating in an external electronic device.
  • FIG. 3 is a block diagram of an electronic device according to an exemplary embodiment.
  • the electronic device 300 may include a memory 310 (eg, the memory 130 of FIG. 1 ) and a processor 320 (eg, the processor 120 of FIG. 1 ).
  • a memory 310 eg, the memory 130 of FIG. 1
  • a processor 320 eg, the processor 120 of FIG. 1 .
  • the memory 310 may store instructions for controlling the operation of the electronic device 300 when executed by the processor 320 .
  • the processor 320 optimizes a first type of graphic API (application program interface) to perform operations for converting it into a second type of graphic API.
  • the first type of graphics API may include an Open GL API or an Open GLES API
  • the second type of graphics API may include a Vulkan API.
  • the memory 310 stores various types of API-based data (eg, API-based format, state information, resources, and/or commands). At least temporarily.
  • memory 310 may include a command buffer to store API commands or a virtual command buffer to temporarily store API commands to optimize API commands.
  • the memory 310 may include a vertex buffer for storing a vertex for rendering at least one object and/or an index buffer for storing an index value for the vertex. .
  • the memory 310 may include a frame buffer that stores rendering values.
  • the frame buffer may include a color buffer for storing a color value, a depth buffer for storing a depth value, and a stencil buffer.
  • the memory 310 may store at least one application. According to an embodiment, each of the at least one application may perform a function using an API of a specified type.
  • the processor 320 may receive a function execution request based on the first type of graphic API from an application (eg, the application 146 of FIG. 1 ).
  • the function based on the first type of graphic API may include a function for rendering a screen (or at least one object).
  • the processor 320 may perform an index buffer optimization operation. For example, when the first type of graphic API uses an index buffer, the processor 320 is configured to convert the graphic API-based data of the first type into the graphic API-based data of the second type. You can optimize the index buffer by reorganizing the index buffer. For example, the electronic device 300 may reconfigure the index buffer by deleting or aligning index values of at least one vertex stored in the index buffer.
  • the index buffer optimization operation will be described in more detail below with reference to FIGS. 4 and 6 .
  • the processor 320 may convert the first type of graphic API-based data and commands into the second type of graphic API-based data and commands based on the request.
  • the first type of graphic API-based data includes at least one of a format, state information, and resources of the first type of graphic API
  • the second type of graphic API-based data The data of the second type may include at least one of a format, state information, and a resource of the second type of graphic API.
  • the processor 320 may convert the format of the first type graphics API into the format of the second type graphics API.
  • the processor 320 may set the state information of the second type graphic API based on the state information of the first type graphic API.
  • the processor 320 may allocate a resource to the second type graphics API.
  • the processor 320 may convert the command of the first type graphic API into the command of the second type graphic API.
  • the processor 320 may store the second type of graphic API-based data and/or instructions in the virtual instruction buffer.
  • the second-type graphics API transmitted through the second-type graphics API-based driver is applied to the GPU. (not shown) (eg, the auxiliary processors 320 and 122 of FIG. 1 ) may directly execute the execution. In this case, unnecessary operations and use of the memory 310 may occur because unnecessary second type-based instructions are also processed.
  • the electronic device 300 stores the converted second type of graphic API-based data and/or commands in a virtual command buffer, and stores the converted second type graphic API-based data and/or commands in the virtual command buffer. Alternatively, an optimization operation can be performed before the instruction is directly executed by the GPU.
  • the GPU may be configured separately from the processor 320 or integrally (ie, one processor 320 ).
  • the processor 320 stores the data in the virtual command buffer based on at least one of the rendering target information related to the first type of graphic API-based data, the depth state information, and the attribute of the first type of graphic API.
  • the stored data and commands based on the second type of graphic API may be reconfigured into the optimized data and commands based on the second type of graphic API.
  • the processor 320 may select at least some necessary for actual rendering from among the second type of graphic API-based commands stored in the virtual command buffer and reconfigure it as an optimized graphic API of the second type.
  • the rendering target information may include information indicating whether a target in which a rendering result is to be stored will be used in the future.
  • the processor 320 determines whether the rendering target will be used in the future, and when the rendering target is not used in the future, some operations (eg, fragment shader operations) in the graphics pipeline are performed. It can be omitted.
  • the graphics pipeline may be a task of changing 3D coordinates into a 2D form that can be output to a monitor.
  • the graphic pipeline may be a series of tasks that receive points and colors of a specific object (Mesh) as inputs and display them in units of pixels.
  • the graphics pipeline uses an input assembler, a vertex shader, a tessellation, a geometry shader, a raster, based on data stored in a vertex buffer and/or an index buffer. It may be an operation of finally storing data for rendering in a frame buffer through rasterization, fragment shader, and color blending operations.
  • an input assembler operation is an operation of collecting user input (eg, vertex data), for example, a triangle that composes a mesh for rendering. It may include the operation of collecting vertex or index data for drawing.
  • the operation of a vertex shader may include an operation of changing vertex data into a 2D screen.
  • vertex data coming in as input is usually composed of 3D (X, Y, Z), but the screen viewed by the user is composed of 2D.
  • an operation of a vertex shader may include an operation of modifying 3D vertex data into 2D data.
  • the tessellation operation may include an operation of dividing the mesh (object) into smaller triangles according to a specific rule in order to increase the image quality.
  • the tessellation operation may include an operation of dividing a large triangle into a plurality of smaller unit triangles.
  • the operation of the geometry shader may include an operation of deleting or adding all primitives (triangles, lines, and points).
  • the rasterization operation may include an operation of dividing a mesh (object) into fragments using a position changed to a 2D screen space.
  • the rasterization operation may include an operation of removing a portion that is not displayed on the screen or a fragment invisible by another mesh (object).
  • an operation of a fragment shader may include an operation of calculating color and depth values of a fragment.
  • the fragment shader operation may include an operation of calculating a value of each pixel to be rendered and storing the result in the memory 310 .
  • the color blending operation may include an operation of determining a final color by comparing colors of the fragments.
  • the color blending operation may include an operation of determining a color of a pixel based on the plurality of pieces of information when a plurality of pieces of fragment information exist for one pixel point.
  • the operation of calculating and storing the pixel value by performing the fragment shader operation may be unnecessary.
  • the processor 320 may optimize rendering performance by omitting unnecessary fragment shader operations.
  • the processor 320 may determine whether a depth value is required during rendering based on depth state information related to the first type of graphic API-based data. For example, the processor 320 may deactivate the depth buffer when a depth value is unnecessary during rendering. For example, the processor 320 disables a buffer (eg, a depth buffer) unnecessary for rendering, thereby loading and/or storing unnecessary memory 310 at a point where a render pass starts and ends. ) can be prevented from occurring.
  • a buffer eg, a depth buffer
  • the processor 320 may generate a second type of graphic API-based command based on information related to the designated API. It is possible to set the area to be rendered based on , and not to save unnecessary rendering result values.
  • a designated API eg, glScissor API
  • the processor 320 may perform at least one of the above-mentioned operations to optimize the second type of graphic API-based data and/or instructions.
  • the electronic device 300 may configure an effective second-type graphic API-based command (ie, an optimized second-type graphic API-based command) through an optimization operation.
  • the processor 320 may store a valid second-type graphics API-based instruction buffer in a second-type graphics API-based instruction buffer.
  • the processor 320 may store the optimized command based on the second type of API in the command buffer based on the graphic API of the second type.
  • the processor 320 may render at least one object based on a second type of graphic API-based command stored in the command buffer. For example, when the second type graphic API-based command stored in the second type graphic API command buffer is submitted to the GPU, the processor 320 may execute the second type graphic API-based command through the GPU. Based on the rendering function (action) can be performed.
  • FIG. 4 is a diagram schematically illustrating a configuration of an electronic device according to an exemplary embodiment.
  • the electronic device 400 (eg, the electronic device 101 of FIG. 1 or the electronic device 300 of FIG. 3 ) is the first type graphic API application 410 (eg, FIG. 1 or FIG. 2 ). of the application 146 ), the optimization framework 420 , the second type graphics API driver 430 (driver), and the GPU 440 (graphic processing unit).
  • the first-type graphics API application 410 may be an application 410 that uses the first-type graphics API to perform a rendering function.
  • the first type of graphics API may include an OpenGL API (hereinafter, the term 'GL API' is used interchangeably) and/or an Open GL ES API (hereinafter, the term 'GLES API' is used interchangeably).
  • the first type graphic API application 410 may perform a function using the GLES API.
  • the first type graphic API application 410 may call the first type graphic API.
  • the optimization framework 420 may perform optimization while converting the first type of graphic API into the second type of graphic API.
  • the second type of graphics API may include a Vulkan API.
  • the optimization framework 420 may include an index buffer optimization module 421 , an API translation module, and an instruction optimization module 425 . For example, when there is a first type graphic API-based function execution request from the first type graphic API application 410, the optimization framework 420 converts the first type graphic API into the second type graphic API. can be converted
  • the index buffer optimization module 421 is configured to optimize the index buffer by reconfiguring the index buffer when the first type of graphic API-based application 410 uses the index buffer (or vertex buffer).
  • the index buffer optimization module 421 may reconfigure the index buffer by deleting or aligning index values of at least one vertex stored in the index buffer.
  • the API conversion module 423 may convert a graphic API of a first type into a graphic API of a second type.
  • the API conversion module 423 may provide a first type of graphics API-based data (eg, a state, a format, and/or a resource of the first type graphics API) and/or A command may be converted into data and/or a command based on the second type of graphic API.
  • the converted second type graphic API-based data and/or command may be stored in the virtual command buffer.
  • the instruction optimization module 425 analyzes the converted second type of graphic API-based data and/or instruction to be reconstructed into an optimized second type of graphic API-based data and/or instruction.
  • the instruction optimization module 425 may analyze the second type of graphic API-based data and/or instructions stored in the virtual instruction buffer.
  • the command optimization module 425 may discard at least some operations of the graphic pipeline based on rendering target information related to the first type of graphic API-based data.
  • the instruction optimization module 425 may determine whether a target in which a rendering result is stored will be used in the future, and may omit unnecessary graphic pipeline work (eg, fragment shader work).
  • the command optimization module 425 does not store unnecessary second API-based commands in the second type graphic API command buffer, but reconstructs only valid second API-based commands to be stored in the second type graphic API command buffer.
  • the instruction optimization module 425 may deactivate the depth buffer among the frame buffers based on depth state information related to the first type of graphic API-based data. For example, when the depth value is unnecessary during rendering, the instruction optimization module 425 may optimize the memory bandwidth by inactivating the depth buffer of the frame buffer.
  • the command optimization module 425 when the first type of graphic API is a specified API related to setting of a screen area, the command optimization module 425 is configured to perform a graphic API of the second type based on information related to the specified API. Based on the command, you can set the area to be rendered and remove unnecessary rendering results.
  • the designated API may include a scissor API (eg, glScissor API).
  • the command optimization module 425 sets a rendering area when generating a render pass so that unnecessary values are not stored in the memory. have.
  • the instruction optimization module 425 performs the above-mentioned optimization operations using a virtual instruction buffer before storing the data converted by the API conversion module 423 in the instruction buffer of the second type graphic API. This may be performed to delete unnecessary data and/or commands, reconstruct valid second type graphic API data and/or commands, and store them in the command buffer of the second type graphic API. For example, the instruction optimization module 425 selects instructions effective for subsequent rendering from among the second type of graphics API-based instructions stored in the virtual instruction buffer to configure the optimized second type of graphics API-based instructions. can For example, the instruction optimization module 425 may reconstruct the second type of graphics API-based data (eg, format, state information, and/or resources) to be suitable for the optimized second type of graphics API-based instruction. can
  • the second-type graphics API driver 430 may receive the converted and optimized second-type graphics API and transmit it to the GPU 440 .
  • the second type graphics API driver 430 may transfer data between the optimization framework 420 and the GPU 440 .
  • the second-type graphics API driver 430 transmits the optimized second-type graphics API instruction stored in the second-type instruction buffer to the GPU 440 through the operation of the optimization framework 420 .
  • the GPU 440 may perform a rendering operation based on the second type of graphics API.
  • the GPU 440 may be a main processor (eg, the main processor 121 of FIG. 1 ) or a secondary processor (eg, the auxiliary processor 123 of FIG. 1 ) of the electronic device 400 ,
  • the main processor and the auxiliary processor may be implemented as one integrated processor (eg, the processor 120 of FIG. 1 ).
  • At least some of the operations of the optimization framework 420 , the second type graphics API driver 430 , and/or the GPU 440 are performed by the processor of the electronic device 400 (eg, as shown in FIG. 1 ). processor 120).
  • FIG. 5 is a diagram for explaining API conversion operations of an electronic device according to an embodiment.
  • the electronic device receives the first type of graphic API.
  • receives the first type of graphic API may perform a dispatch operation of .
  • the electronic device may call the first type of graphic API.
  • the electronic device may convert the first type graphic API format into the second type graphic API format through a translator 520 .
  • the first type graphics API may include the Open GLES API
  • the second type graphics API may include the Vulkan API.
  • the electronic device may convert state information of the first type graphic API into state information of the second type graphic API through the converter 520 .
  • the electronic device may set the state information of the second type graphic API based on the state information of the first type graphic API.
  • the electronic device allocates a resource of the second type graphic API through the converter 520 .
  • the electronic device may allocate a resource of the second type graphic API required to perform a function corresponding to the first type graphic API.
  • the electronic device may convert the first type graphic API function into the second type graphic API function through the converter 520 .
  • the electronic device may convert a first type graphic API command into a second type graphic API command.
  • the electronic device may at least temporarily store data and/or commands related to the second type graphic API acquired through operations 521 to 527 in the virtual command buffer 530 .
  • the electronic device stores second-type graphic API-based data and/or command-related information stored in the virtual command buffer 530 (eg, second-type graphic API state information and/or resources). information) can be collected.
  • the electronic device may analyze and optimize data and/or commands related to the second type graphic API stored in the virtual command buffer 530 . For example, the electronic device determines whether a target in which a rendering result is to be stored will be used in the future based on rendering target information related to the first type of graphic API, and when it is determined that the target will not be used in the future, the graphic pipeline ( At least some operations of the graphic pipeline (eg, fragment shader operations) may be discarded. For example, the electronic device may determine whether a depth value is required during rendering based on depth state information related to data of the first type of graphic API. For example, when a depth value is unnecessary during rendering, the electronic device may deactivate the depth buffer among the frame buffers.
  • the graphic pipeline At least some operations of the graphic pipeline (eg, fragment shader operations) may be discarded.
  • the electronic device may determine whether a depth value is required during rendering based on depth state information related to data of the first type of graphic API. For example, when a depth value is unnecessary during rendering, the electronic device may
  • the electronic device may use the graphic API-based command of the second type based on information related to the designated API. You can set the area to be rendered and remove unnecessary rendering results.
  • a designated API eg, glScissor API
  • the electronic device may reconfigure the function of the second type graphic API in operation 533 .
  • the electronic device may configure an optimized second type graphic API-based command by selecting a valid second type graphic API command.
  • the electronic device may reconfigure the data based on the second type of graphic API to be suitable for the optimized command based on the second type of graphic API.
  • the electronic device may optimize the second type graphic API commands converted through operations 521 to 527 and reconfigure them into (effective) second type graphic API commands required for rendering.
  • the electronic device may store the reconfigured second type graphic API function (eg, the reconfigured second type graphic API command) in the second type graphic API command buffer 540 .
  • the reconfigured second type graphic API function eg, the reconfigured second type graphic API command
  • the electronic device uses the second type graphic API command buffer 540 through the second type graphic API driver 550 (eg, the second type graphic API driver 430 of FIG. 4 ).
  • the second type graphics API command stored in the GPU 560 may be transmitted to the GPU 560 (eg, the coprocessor 122 of FIG. 1 or the GPU 440 of FIG. 4 ).
  • the electronic device may perform a rendering operation of at least one object based on the second type graphic API command through the GPU 560 .
  • the electronic device may execute the second type graphics API command through the GPU 560 .
  • At least some of operations 510 , 521 to 527 , and 531 to 535 , 540 , 550 , and 560 are performed by a processor of an electronic device (eg, the processor 120 of FIG. 1 or FIG. 1 ). 3, the processor 320).
  • the virtual command buffer 530 and/or the second type graphics API command buffer 540 are stored in a memory (eg, the memory 130 of FIG. 1 and the memory 310 of FIG. 3 ) of the electronic device. may be included.
  • the electronic device directly stores the second type graphic API-based data and/or command converted through the converter 520 in the second type graphic API command buffer 540, a virtual command buffer Optimizes the converted second-type graphics API-based data and/or commands through 530, and stores valid (optimized) second-type graphics API-based data and commands required for rendering into the second-type graphics API command buffer ( 540) can be stored.
  • a virtual command buffer Optimizes the converted second-type graphics API-based data and/or commands through 530, and stores valid (optimized) second-type graphics API-based data and commands required for rendering into the second-type graphics API command buffer ( 540) can be stored.
  • a virtual command buffer Optimizes the converted second-type graphics API-based data and/or commands through 530, and stores valid (optimized) second-type graphics API-based data and commands required for rendering into the second-type graphics API command buffer ( 540) can be stored.
  • unnecessary operation and memory allocation may be reduced and the efficiency of the rendering function may be increased.
  • 6A to 6F are diagrams for explaining an operation of optimizing an index buffer of an electronic device according to an exemplary embodiment.
  • FIG. 6A shows the shape of a mesh 600a for rendering.
  • each vertex constituting each mesh 600a may mean vertices 620 , 621 , 622 , 623 , 624. 625. 626 , 627 , 628 , and 629 .
  • three vertices may be connected to form a triangle.
  • the vertices are a 0th triangle 610 , a first triangle 611 , a second triangle 612 , a third triangle 613 , a fourth triangle 614 , and a fifth triangle.
  • a case in which 615 , a sixth triangle 616 , and a seventh triangle 617 are formed is shown.
  • the electronic device draws the mesh 600a
  • the seventh triangle 617 is sequentially drawn in the order of the 0th triangle 610, the 7th triangle 617, the first triangle 611, the 6th triangle 616, ...
  • a cache-hit rate may increase and memory performance may be improved due to vertex locality, rather than drawing in a jumbled order.
  • the electronic device eg, the electronic device 101 of FIG. 1 , the electronic device 300 of FIG. 3 , or the electronic device 400 of FIG.
  • the electronic device may draw the zeroth triangle 610 using the zeroth vertex 620 , the first vertex 621 , and the second vertex 622 , and the first vertex 621 and the second vertex 622 .
  • the first triangle 611 can be drawn using the second vertex 622 and the third vertex 623 , and the second vertex 622 , the third vertex 623 , and the fourth vertex 624 are used.
  • the second triangle 612 may be drawn (rendered).
  • the electronic device may sequentially draw triangles constituting the mesh 600a. For example, if triangles are drawn sequentially, vertex locality may be increased to improve the cache hit ratio.
  • the API uses an index buffer for vertices, if the values stored in the index buffer are not aligned, triangles of the mesh 600a cannot be drawn sequentially, or the triangle itself cannot be drawn.
  • FIG. 6B shows the case of the index buffer 600b storing sequential vertex indexes
  • FIG. 6C shows the case of the index buffer 600c storing the indexes so that the order of the vertices is mixed
  • 6D shows the case of the index buffer 600d storing an index set that cannot make a triangle.
  • the index buffer 600b is n, n+1, n+2, ... , n+10, n+11, ...
  • Indices of vertices may be sequentially stored in order.
  • the first index set 621 , the second index set 622 , the third index set 623 , and the fourth index set 624 may each form a triangle.
  • the electronic device may sequentially draw triangles constituting the mesh 600a.
  • n, n+1, n+2, n+100, n+101, n+102, n+3, n+4, n+5, n are stored in the index buffer 600c. +103, n+104, n+105, ...
  • the index order of the vertices may be stored in a mixed order.
  • the electronic device uses the mesh ( It may not be possible to sequentially draw the triangles constituting 600a).
  • the index buffer 600c of FIG. 6C when the index buffer 600c of FIG. 6C is used, the memory area of the vertices used by the electronic device changes relatively significantly, so that the advantage of the cache cannot be used, and the rendering performance is lower than that of FIG. 6B . can be
  • the index buffer 600d is the ninth index set 641 , the tenth index set 642 that cannot form a triangle constituting the mesh 600a, and the eleventh index set ( 643) may be included.
  • the tenth index set 642 does not form a triangle, the operation of index values may be performed in the electronic device, which may be disadvantageous in memory and/or operation cost than in the case of FIG. 6B , Rendering performance may be degraded.
  • the electronic device may reconfigure the index buffer before converting the API. For example, the electronic device may optimize the index buffer by deleting or aligning index values of at least one vertex stored in the index buffer and reconfiguring the index buffer.
  • the API uses an index buffer for a vertex
  • memory performance can be optimized when values stored in the index buffer are arranged so that triangles of the mesh can be sequentially drawn.
  • the electronic device stores indices 3k, 3k+1, 3k+2 that cannot generate a triangle constituting the mesh 600a in the index buffer 600e in the index buffer ( 600e) can be removed.
  • the corresponding vertex set ie, the twelfth index set 650
  • the electronic device may reconfigure and optimize the index buffer 600e by removing the twelfth index set 650 from the index buffer 600e.
  • the order of indices 3k, 3k+1, 3k+2, ..., 3k+10, 3k+11, ...) included in the index buffer 600f can be sorted.
  • the electronic device determines an index set capable of generating a triangle in order to align the order of indices included in the index buffer, and sorts the indexes based on a first value (content) of each of the determined index sets.
  • the electronic device sets the indexes (3k, 3k+1, 3k+2, ..., 3k+10, 3k+11, ...) stored in the index buffer to 3 Index sets (eg, a thirteenth index set 661 , a fourteenth index set 662 , a fifteenth index set 663 , and a sixteenth index set 664 ) including the indexes may be grouped.
  • 3 Index sets eg, a thirteenth index set 661 , a fourteenth index set 662 , a fifteenth index set 663 , and a sixteenth index set 664 ) including the indexes may be grouped.
  • the electronic device determines the value (content) of the first index (3k, 3k+3, 3k+6, 3k+9) (6611, 6621, Based on 6631 and 6641 , the index sets 661 , 662 , 663 , and 664 of the index buffer 600f may be sorted. For example, the electronic device may optimize the index buffer by reconfiguring the index buffer in the order of the fourteenth index set 662 , the fifteenth index set 663 , the thirteenth index set 661 , and the sixteenth index set 664 . can
  • An electronic device includes a memory and a processor operatively connected to the memory, wherein the memory, when executed, causes the processor to execute a graphics application program (API) of a first type from an application. interface)-based function execution request, and, based on the request, converts the first type of graphic API-based data and commands into a second type of graphic API-based data and commands, and Storing two types of graphic API-based data and commands in a virtual command buffer, and rendering target information related to the first type of graphic API-based data, depth state information, and the first type of graphic API Based on at least one of the properties of , the second type of graphic API-based data and commands stored in the virtual command buffer are reconfigured into the optimized second type of graphic API-based data and commands, and the reconstructed second It is possible to store instructions for storing data and commands based on the graphic API of the second type in the command buffer based on the graphic API of the second type.
  • API graphics application program
  • the first type of graphics API may include an open graphics library (OpenGL) API or an OpenGL for embedded systems (OpenGL ES) API
  • the second type of graphics API may include a Vulkan API.
  • the data based on the first type of graphic API includes at least one of a format, state information, and resources of the graphic API of the first type, and the graphic API of the second type
  • the base data may include at least one of a format of the second type of graphic API, state information, and a resource.
  • the processor when the instructions are executed, the processor, when the graphic API of the first type is a graphic API using an index buffer, data and instructions based on the graphic API of the first type. before converting to the second type of graphic API-based data and commands, the index buffer may be reconstructed.
  • the processor may reconfigure the index buffer by deleting or aligning index values of at least one vertex stored in the index buffer.
  • the instructions when executed, may cause the processor to render at least one object based on a second type of graphic API-based instruction stored in the instruction buffer.
  • the processor may omit at least some of the plurality of tasks included in a graphic pipeline based on the rendering target information.
  • At least some of the plurality of tasks include a fragment shader operation.
  • the memory stores a rendering result and may include a frame buffer including a color buffer, a depth buffer, and a stencil buffer.
  • the processor may inactivate a depth buffer among frame buffers based on the depth state information.
  • the second type of the instructions when the instructions are executed, when the first type of graphic API is a designated API related to setting of a screen area, the second type of the instructions is based on information related to the designated API. Based on the graphic API-based command, it is possible to set an area to be rendered and to remove unnecessary rendering result values.
  • the designated API may include a glScissor API among openGL APIs.
  • the processor when the instructions are executed, converts the format of the first type of graphics API into the format of the second type of graphics API, and states information of the first type of graphics API. sets state information of the second type of graphic API based on , allocates resources based on the second type of graphic API of the first type, It can be converted to a command based on the graphic API of
  • FIG. 7 is a flowchart of an API conversion method of an electronic device according to an embodiment.
  • the electronic device receives the first type of information from the application. It is possible to receive a function execution request based on the graphic API.
  • the first type of graphics API may include an Open GL API or an Open GLES API.
  • the electronic device may convert the first type of graphic API-based data and/or command to the second type of graphic API-based data and/or command based on the request.
  • the second type of graphics API may include a Vulkan API.
  • the first type of graphics API-based data includes at least one of a format, state information, resources, and commands of the first type of graphics API, and the second type of graphics
  • the API-based data may include at least one of a format, state information, and a resource of the second type of graphic API.
  • the electronic device may convert the format of the first type graphic API into the format of the second type graphic API.
  • the electronic device may set state information of the second type graphic API based on state information of the first type graphic API. For example, the electronic device may allocate a resource to the second type graphic API. For example, the electronic device may convert a command of the first type graphic API into a command of the second type graphic API.
  • the electronic device may store the second type of graphic API-based data and/or commands in the virtual command buffer.
  • the second-type graphics API transmitted through the second-type graphics API-based driver is applied to the GPU. can be run immediately. In this case, unnecessary second type-based instructions are also processed, so unnecessary operations and memory usage may occur.
  • the electronic device stores the converted second-type graphic API-based data and/or command in a virtual command buffer and performs optimization, thereby initially converting the second type of graphic API-based data and/or It is possible to prevent all instructions from being directly executed (or used) by the GPU.
  • the electronic device performs a virtual command based on at least one of rendering target information related to data based on the first type of graphic API, depth state information, and a property of the first type of graphic API.
  • the second type of graphic API-based data and/or command stored in the buffer may be reconfigured into an optimized second type of graphic API-based command.
  • the electronic device may select at least some of the second type of graphic API based commands stored in the virtual command buffer to configure an optimized second type graphic API based command.
  • the electronic device may reconstruct data based on the second type of graphic API based on the optimized command based on the second type of graphic API.
  • the rendering target information may include information indicating whether a target in which a rendering result is to be stored will be used in the future.
  • the electronic device may determine whether the render target will be used in the future, and when the render target is not used in the future, some operations (eg, fragment shader operations) in the graphics pipeline may be discarded. have.
  • the fragment shader operation may include an operation of calculating a value of each pixel to be rendered and storing the result in a memory.
  • the operation of calculating and storing pixel values by performing the fragment shader operation may be unnecessary.
  • the electronic device may optimize rendering performance by omitting unnecessary fragment shader operations.
  • the electronic device may determine whether a depth value is required during rendering based on depth state information related to data based on the first type of graphic API. For example, when a depth value is unnecessary during rendering, the electronic device may deactivate a depth buffer among a color buffer, a depth buffer, and a stencil buffer included in the frame buffer. For example, the electronic device disables buffers unnecessary for rendering (eg, depth buffers), so that unnecessary memory load and/or store operations occur at the point where a render pass starts and ends. it can be prevented
  • the electronic device when the first type of API is a designated API (eg, glScissor API) related to setting of a screen area, the electronic device responds to a second type of graphic API-based command based on information related to the designated API. Based on this, you can set the area to be rendered and remove unnecessary rendering results.
  • a designated API eg, glScissor API
  • the electronic device may optimize the data based on the second type of graphic API (eg, the command based on the graphic API of the second type) by performing at least one of the operations mentioned in the description of operation 740 .
  • the electronic device may configure the optimized second type graphic API-based command through an optimization operation (at least one of the aforementioned operations).
  • the electronic device may store the command and/or data based on the second type of graphic API in a command buffer based on the second type of graphic API.
  • the electronic device may store the optimized second-type API-based command and/or data in operation 740 in the second-type graphic API-based command buffer.
  • the electronic device may render at least one object based on a second type of graphic API-based command and/or data stored in the command buffer. For example, the electronic device submits the second type graphics API-based command stored in the second-type graphics API command buffer to the GPU through the second type graphics API-based driver, and the GPU submits the received second-type graphics API-based command to the GPU.
  • a rendering function (operation) can be performed based on a command based on the 2-type graphics API.
  • FIG. 8 is a flowchart of an API conversion method of an electronic device according to an embodiment.
  • the electronic device may call the GLES API.
  • the electronic device may recognize a request to perform a rendering function based on the GLES API of the application.
  • the electronic device may perform a buffer optimization operation.
  • the electronic device may determine whether the GLES API is an API for uploading vertex buffer or index buffer data. According to an embodiment, the electronic device performs operation 823 when the GLES API is an API for uploading vertex buffer or index buffer data, and performs operation 823 when the GLES API is not an API for uploading vertex buffer or index buffer data.
  • the index buffer optimization operation may be omitted and operation 830 may be performed.
  • the electronic device may perform an index buffer optimization operation.
  • the index buffer optimization operation may include the operation of the electronic device described with reference to FIGS. 6A to 6F .
  • the electronic device may optimize the index buffer by reconfiguring the index buffer.
  • the electronic device may reconfigure the index buffer by deleting or aligning index values of at least one vertex stored in the index buffer.
  • the electronic device may translate the GLES API into a Vulkan API.
  • the electronic device may convert the GLES API format to the Vulkan API format.
  • the electronic device may convert state information of the GLES API into state information of the Vulkan API.
  • the electronic device may set the state information of the Vulkan API to correspond to the state information of the GLES API.
  • the electronic device may determine or collect a resource related to the Vulkan API, and allocate the resource.
  • the electronic device may convert a GLES API command into a Vulkan API command.
  • the electronic device may store the converted Vulkan API in a virtual command buffer.
  • the electronic device stores the converted Vulkan API in the virtual command buffer instead of directly in the Vulkan command buffer, thereby preventing the converted Vulkan command from being directly executed by the GPU and converting the Vulakn command in operation 840.
  • the electronic device may perform an instruction optimization operation on the Vulkan instruction stored in the virtual instruction buffer.
  • the electronic device may determine whether a specified optimization condition is satisfied. According to an embodiment, if the specified optimization condition is satisfied, the electronic device may perform operation 843 , and if the specified optimization condition is not satisfied, the electronic device may omit the Vulkan instruction optimization operation of operation 843 and perform operation 850 .
  • the specified optimization condition is when a rendering target in which a rendering result is stored is not used in the future, when depth state information among state information of the GLES API or Vulkan API is deactivated, and GLES May contain at least one of the cases where the API is a specified API (eg glScissor API).
  • the electronic device may perform a Vulkan instruction optimization operation.
  • the electronic device may reconfigure the Vulkan instruction converted in operation 830 into an optimized Vulkan instruction.
  • the electronic device may discard at least some operations of a graphic pipeline (eg, a fragment shader operation).
  • the electronic device when depth state information among state information of the GLES API or Vulkan API is inactivated, the electronic device includes a color buffer, a depth buffer, and a stencil. buffer) among the frame buffers including the depth buffer.
  • the electronic device may prevent unnecessary values from being stored in the memory by setting a rendering area when setting a Vulkan render pass.
  • a designated API eg, glScissor API
  • the electronic device may store the optimized Vulkan instruction in the Vulkan instruction buffer.
  • the electronic device may submit the optimized Vulkan instruction stored in the Vulkan instruction buffer to the GPU through the Vulkan driver.
  • the electronic device may perform a rendering function based on an optimized Vulkan instruction through the GPU.
  • FIG. 9 is a flowchart of instruction optimization operations of an electronic device according to an exemplary embodiment.
  • the electronic device (eg, the electronic device 101 of FIG. 1 , the electronic device 300 of FIG. 3 , or the electronic device 400 of FIG. 4 ) is set to a Vulkan state and / or collect resource information.
  • the electronic device may collect information related to the Vulkan API after converting the GLES API to the Vulkan API.
  • the electronic device may determine whether the rendering target will be used in the future based on the information collected in operation 910 .
  • a fragment shader operation in a graphics pipeline may include an operation of calculating a value of each pixel and storing the result in a memory.
  • the electronic device may perform operation 925 , and if it is determined that the rendering target will be used in the future, the electronic device may perform operation 930 .
  • the electronic device may discard the fragment shader operation from the graphics pipeline without performing the fragment shader operation. For example, the electronic device may optimize rendering performance by omitting an unnecessary fragment operation.
  • the electronic device may determine whether a depth state is an active state based on the information collected in operation 910 .
  • the Vulkan API may designate information on a frame buffer in which a rendering result is to be stored.
  • the frame buffer may include a color buffer storing a color value, a depth buffer storing a depth value, and a stencil buffer.
  • the Vulkan render pass includes information determining whether the frame buffer (ie, color buffer, depth buffer, and stencil buffer) is loaded and/or stored into memory, and Based on this, load and/or store operations in memory may occur at the point where the render pass starts and ends.
  • the electronic device may perform operation 935 when the depth state is an inactive state, and may perform operation 940 when the depth state is an active state.
  • the electronic device may deactivate the depth buffer.
  • the electronic device may optimize memory bandwidth and rendering performance by inactivating the depth buffer when unnecessary to prevent unnecessary memory load and/or storage operations from occurring.
  • the electronic device may determine whether the GLES API is a designated API related to screen area setting.
  • the glScissor API is a GLES API that allows you to set the rendering area to show only a part of the screen. For example, when the rendering area is set, it may not be necessary to store the rendering result of the entire screen in the memory, and it may be efficient to store the rendering result of the set area in the memory.
  • the electronic device may perform operation 945 if the GLES API is a designated API, and may perform operation 950 if it is not the designated API.
  • the electronic device may set a rendering area. For example, when generating a Vulkan render pass, the electronic device may set a rendering area based on information of a previously called specified API (eg, glScissor API). For example, the electronic device may optimize rendering performance by setting a rendering area so that unnecessary rendering result values are not stored in the memory.
  • a previously called specified API eg, glScissor API
  • the electronic device may recognize an optimized Vulkan function (eg, a valid Vulkan command). For example, the electronic device may reconfigure the Vulkan API command converted from the GLES API into a valid Vulkan command through optimization. For example, the electronic device may remove unnecessary Vulkan commands through operations 920 to 945 and selectively determine Vulkan commands suitable for performing a rendering function.
  • an optimized Vulkan function eg, a valid Vulkan command.
  • the electronic device may reconfigure the Vulkan API command converted from the GLES API into a valid Vulkan command through optimization.
  • the electronic device may remove unnecessary Vulkan commands through operations 920 to 945 and selectively determine Vulkan commands suitable for performing a rendering function.
  • the electronic device may store an optimized Vulkan function (eg, a valid Vulkan instruction) in a Vulkan instruction buffer.
  • a Vulkan command stored in the Vulkan command buffer may be submitted to the GPU through a Vulkan driver, and the electronic device may execute the Vulkan command by the GPU to perform a rendering function.
  • An application program interface (API) conversion method of an electronic device includes an operation of receiving a function execution request based on a graphic API of a first type from an application, and based on the graphic API of the first type based on the request converting data and commands of a second type of graphic API into data and commands based on the graphic API of the second type, storing the data and commands based on the graphic API of the second type in a virtual command buffer; Based on at least one of rendering target information related to graphic API-based data, depth state information, and properties of the first type of graphic API, the second type of graphic API stored in the virtual command buffer is based operation of reconstructing the data and commands of the second type of optimized graphics API-based data and commands, and storing the reconstructed second type of graphics API-based data and commands in the command buffer based on the second type of graphics API and rendering at least one object based on a second type of graphic API-based data and command stored in the command buffer.
  • API application program interface
  • the first type of graphics API may include an open graphics library (OpenGL) API or an OpenGL ES API
  • the second type of graphics API may include a Vulkan API.
  • the data based on the first type of graphic API includes at least one of a format, state information, and resources of the graphic API of the first type, and the graphic API of the second type
  • the base data may include at least one of a format of the second type of graphic API, state information, and a resource.
  • the method includes: when the first type of graphic API is a graphic API using an index buffer, data and commands based on the first type of graphic API are transferred to the second type of graphic. Prior to conversion into API-based data and commands, the method may further include reconfiguring the index buffer.
  • the operation of reconstructing the index buffer may include the operation of reconstructing the index buffer by deleting or aligning index values of at least one vertex stored in the index buffer.
  • the reconfiguration may include omitting a fragment shader operation from among a plurality of tasks included in a graphic pipeline based on the rendering target information. have.
  • the reconfiguration includes: based on the depth state information, a depth buffer among frame buffers including a color buffer, a depth buffer, and a stencil buffer. Deactivation may be included.
  • the reconfiguration may include, when the first type of graphic API is a designated API related to setting of a screen area, a command based on the second type of graphic API based on information related to the designated API. It may include an operation of setting an area to be rendered based on , and removing unnecessary rendering result values.
  • the electronic device may have various types of devices.
  • the electronic device may include, for example, a portable communication device (eg, a smart phone), a computer device, a portable multimedia device, a portable medical device, a camera, a wearable device, or a home appliance device.
  • a portable communication device eg, a smart phone
  • a computer device e.g., a smart phone
  • a portable multimedia device e.g., a portable medical device
  • a camera e.g., a portable medical device
  • a camera e.g., a portable medical device
  • a camera e.g., a portable medical device
  • a wearable device e.g., a smart bracelet
  • a home appliance device e.g., a home appliance
  • first, second, or first or second may simply be used to distinguish an element from other elements in question, and may refer elements to other aspects (e.g., importance or order) is not limited. It is said that one (eg, first) component is “coupled” or “connected” to another (eg, second) component, with or without the terms “functionally” or “communicatively”. When referenced, it means that one component can be connected to the other component directly (eg by wire), wirelessly, or through a third component.
  • module used in various embodiments of this document may include a unit implemented in hardware, software, or firmware, and is interchangeable with terms such as, for example, logic, logic block, component, or circuit.
  • a module may be an integrally formed part or a minimum unit or a part of the part that performs one or more functions.
  • the module may be implemented in the form of an application-specific integrated circuit (ASIC).
  • ASIC application-specific integrated circuit
  • Various embodiments of the present document include one or more instructions stored in a storage medium (eg, internal memory 136 or external memory 138) readable by a machine (eg, electronic device 101).
  • a storage medium eg, internal memory 136 or external memory 138
  • the processor eg, the processor 120
  • the device eg, the electronic device 101
  • the one or more instructions may include code generated by a compiler or code executable by an interpreter.
  • the device-readable storage medium may be provided in the form of a non-transitory storage medium.
  • 'non-transitory' only means that the storage medium is a tangible device and does not contain a signal (eg, electromagnetic wave), and this term is used in cases where data is semi-permanently stored in the storage medium and It does not distinguish between temporary storage cases.
  • a signal eg, electromagnetic wave
  • the method according to various embodiments disclosed in this document may be provided in a computer program product (computer program product).
  • Computer program products may be traded between sellers and buyers as commodities.
  • the computer program product is distributed in the form of a device-readable storage medium (eg compact disc read only memory (CD-ROM)), or via an application store (eg Play StoreTM) or on two user devices ( It can be distributed (eg downloaded or uploaded) directly, online between smartphones (eg: smartphones).
  • a portion of the computer program product may be temporarily stored or temporarily created in a machine-readable storage medium such as a memory of a server of a manufacturer, a server of an application store, or a relay server.
  • each component eg, a module or a program of the above-described components may include a singular or a plurality of entities, and some of the plurality of entities may be separately disposed in other components. have.
  • one or more components or operations among the above-described corresponding components may be omitted, or one or more other components or operations may be added.
  • a plurality of components eg, a module or a program
  • the integrated component may perform one or more functions of each component of the plurality of components identically or similarly to those performed by the corresponding component among the plurality of components prior to the integration. .
  • operations performed by a module, program, or other component are executed sequentially, in parallel, repeatedly, or heuristically, or one or more of the operations are executed in a different order, or omitted. , or one or more other operations may be added.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Computer Security & Cryptography (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

일 실시예에 따른 전자 장치는, 메모리, 및 상기 메모리에 작동적으로(operatively) 연결된 프로세서를 포함하고, 상기 메모리는, 실행 시, 상기 프로세서가, 어플리케이션으로부터 제1 타입의 그래픽 API(graphics application program interface) 기반의 기능 수행 요청을 수신하고, 상기 요청에 기반하여, 상기 제1 타입의 그래픽 API 기반의 데이터 및 명령어를 제2 타입의 그래픽 API 기반의 데이터 및 명령어로 변환(translate)하고, 상기 제2 타입의 그래픽 API 기반의 데이터 및 명령어를 가상 명령어 버퍼에 저장하고, 상기 제1 타입의 그래픽 API 기반의 데이터와 관련된 렌더링 타겟 정보, 뎁스 상태(depth state) 정보, 및 상기 제1 타입의 그래픽 API의 속성 중 적어도 하나에 기반하여, 상기 가상 명령어 버퍼에 저장한 제2 타입의 그래픽 API 기반의 데이터 및 명령어를 최적화된 제2 타입의 그래픽 API 기반의 데이터 및 명령어로 재구성하고, 상기 재구성된 제2 타입의 그래픽 API 기반의 데이터 및 명령어를 제2 타입의 그래픽 API 기반의 명령어 버퍼에 저장하도록 하는 인스트럭션들(instructions)을 저장할 수 있다. 이 외에도 명세서를 통해 파악되는 다양한 실시 예가 가능하다.

Description

전자 장치 및 전자 장치의 API 변환 방법
본 문서에서 개시되는 실시 예들은, API(application program interface)를 변환하는 기술과 관련된다.
API(application program interface)는 응용 프로그램이 운영체제나 데이터베이스 관리 시스템과 같은 시스템 프로그램과 통신할 때 사용되는 언어나 메시지 형식을 가지며, API는 프로그램 내에서 실행을 위해 특정 서브루틴에 연결을 제공하는 함수를 호출하는 것으로 구현될 수 있다.
전자 장치에 포함된 어플리케이션은 렌더링 기능을 수행함에 있어서, 지정된 타입의 API를 이용할 수 있다. 어플리케이션에 지정된 타입의 API가 아닌 상이한 타입의 API를 이용하려는 경우, API를 변환하는 기술이 필요하다.
본 개시의 다양한 실시예들은, 제1 타입의 그래픽 API를 제2 타입의 그래픽 API로 변환 시, 렌더링 상황에 따라 최적화된 변환을 제공하고, 그래픽 드라이버(graphic driver)의 오버헤드(overheard)를 감소시킬 수 있는 전자 장치 및 전자 장치의 API 변환 방법을 제공하고자 한다.
본 문서에 개시되는 일 실시예에 따른 전자 장치는, 메모리, 및 상기 메모리에 작동적으로(operatively) 연결된 프로세서를 포함하고, 상기 메모리는, 실행 시, 상기 프로세서가, 어플리케이션으로부터 제1 타입의 그래픽 API(graphics application program interface) 기반의 기능 수행 요청을 수신하고, 상기 요청에 기반하여, 상기 제1 타입의 그래픽 API 기반의 데이터 및 명령어를 제2 타입의 그래픽 API 기반의 데이터 및 명령어로 변환(translate)하고, 상기 제2 타입의 그래픽 API 기반의 데이터 및 명령어를 가상 명령어 버퍼에 저장하고, 상기 제1 타입의 그래픽 API 기반의 데이터와 관련된 렌더링 타겟 정보, 뎁스 상태(depth state) 정보, 및 상기 제1 타입의 그래픽 API의 속성 중 적어도 하나에 기반하여, 상기 가상 명령어 버퍼에 저장한 제2 타입의 그래픽 API 기반의 데이터 및 명령어를 최적화된 제2 타입의 그래픽 API 기반의 데이터 및 명령어로 재구성하고, 상기 재구성된 제2 타입의 그래픽 API 기반의 데이터 및 명령어를 제2 타입의 그래픽 API 기반의 명령어 버퍼에 저장하도록 하는 인스트럭션들(instructions)을 저장할 수 있다.
또한, 본 문서에 개시되는 일 실시예에 따른 전자 장치의 API(application program interface) 변환 방법은, 어플리케이션으로부터 제1 타입의 그래픽 API 기반의 기능 수행 요청을 수신하는 동작, 상기 요청에 기반하여, 상기 제1 타입의 그래픽 API 기반의 데이터 및 명령어를 제2 타입의 그래픽 API 기반의 데이터 및 명령어로 변환(translate)하는 동작, 상기 제2 타입의 그래픽 API 기반의 데이터 및 명령어를 가상 명령어 버퍼에 저장하는 동작, 상기 제1 타입의 그래픽 API 기반의 데이터와 관련된 렌더링 타겟 정보, 뎁스 상태(depth state) 정보, 및 상기 제1 타입의 그래픽 API의 속성 중 적어도 하나에 기반하여, 상기 가상 명령어 버퍼에 저장한 제2 타입의 그래픽 API 기반의 데이터 및 명령어를 최적화된 제2 타입의 그래픽 API 기반의 데이터 및 명령어로 재구성하는 동작, 상기 재구성된 제2 타입의 그래픽 API 기반의 데이터 및 명령어를 제2 타입의 그래픽 API 기반의 명령어 버퍼에 저장하는 동작, 및 상기 명령어 버퍼에 저장된 제2 타입의 그래픽 API 기반의 데이터 및 명령어에 기반하여 적어도 하나의 오브젝트를 렌더링하는 동작을 포함할 수 있다.
본 문서에 개시되는 실시 예들에 따르면, 제1 타입의 그래픽 API(graphics API)를 제2 타입의 그래픽 API로 변환 시, 렌더링 상황에 따라 최적화된 변환을 제공하고, 그래픽 드라이버(graphic driver)의 오버헤드(overheard)를 감소시킬 수 있다.
본 문서에 개시되는 실시 예들에 따르면, 제1 타입의 그래픽 API를 제2 타입의 그래픽 API로 변환 시, 캐시(cache), 메모리 대역폭, 렌더 패스(render pass)를 최적화할 수 있다.
API 변환 시, 메모리, 버퍼, 및 API 명령어(기능)의 최적화를 수행하여 전자 장치의 성능을 향상시키고 메모리 사용량을 감소시킬 수 있다.
본 문서에 개시되는 실시 예들에 따르면, GPU에 전달되어 수행되기 이전에 변환된 API를 분석하여 최적화된 API를 재구성할 수 있다.
이 외에, 본 문서를 통해 직접적 또는 간접적으로 파악되는 다양한 효과들이 제공될 수 있다.
도 1은 다양한 실시예들에 따른 네트워크 환경 내의 전자 장치를 나타낸다.
도 2은 다양한 실시예에 따른 프로그램을 예시하는 블록도이다.
도 3은 일 실시예에 따른 전자 장치의 블록도이다.
도 4는 일 실시예에 따른 전자 장치의 구성을 개략적으로 도시한 도면이다.
도 5는 일 실시예에 따른 전자 장치의 API 변환 동작들을 설명하기 위한 도면이다.
도 6a 내지 6f는 일 실시예에 따른 전자 장치의 인덱스 버퍼를 최적화하는 동작을 설명하기 위한 도면이다.
도 7은 일 실시예에 따른 전자 장치의 API 변환 방법의 흐름도이다.
도 8은 일 실시예에 따른 전자 장치의 API 변환 방법의 흐름도이다.
도 9는 일 실시예에 따른 전자 장치의 명령어 최적화 동작들의 흐름도이다.
도면의 설명과 관련하여, 동일 또는 유사한 구성요소에 대해서는 동일 또는 유사한 참조 부호가 사용될 수 있다.
도 1은, 다양한 실시예들에 따른, 네트워크 환경(100) 내의 전자 장치(101)의 블록도이다. 도 1을 참조하면, 네트워크 환경(100)에서 전자 장치(101)는 제 1 네트워크(198)(예: 근거리 무선 통신 네트워크)를 통하여 전자 장치(102)와 통신하거나, 또는 제 2 네트워크(199)(예: 원거리 무선 통신 네트워크)를 통하여 전자 장치(104) 또는 서버(108) 중 적어도 하나와 통신할 수 있다. 일 실시예에 따르면, 전자 장치(101)는 서버(108)를 통하여 전자 장치(104)와 통신할 수 있다. 일 실시예에 따르면, 전자 장치(101)는 프로세서(120), 메모리(130), 입력 모듈(150), 음향 출력 모듈(155), 디스플레이 모듈(160), 오디오 모듈(170), 센서 모듈(176), 인터페이스(177), 연결 단자(178), 햅틱 모듈(179), 카메라 모듈(180), 전력 관리 모듈(188), 배터리(189), 통신 모듈(190), 가입자 식별 모듈(196), 또는 안테나 모듈(197)을 포함할 수 있다. 어떤 실시예에서는, 전자 장치(101)에는, 이 구성요소들 중 적어도 하나(예: 연결 단자(178))가 생략되거나, 하나 이상의 다른 구성요소가 추가될 수 있다. 어떤 실시예에서는, 이 구성요소들 중 일부들(예: 센서 모듈(176), 카메라 모듈(180), 또는 안테나 모듈(197))은 하나의 구성요소(예: 디스플레이 모듈(160))로 통합될 수 있다.
프로세서(120)는, 예를 들면, 소프트웨어(예: 프로그램(140))를 실행하여 프로세서(120)에 연결된 전자 장치(101)의 적어도 하나의 다른 구성요소(예: 하드웨어 또는 소프트웨어 구성요소)를 제어할 수 있고, 다양한 데이터 처리 또는 연산을 수행할 수 있다. 일 실시예에 따르면, 데이터 처리 또는 연산의 적어도 일부로서, 프로세서(120)는 다른 구성요소(예: 센서 모듈(176) 또는 통신 모듈(190))로부터 수신된 명령 또는 데이터를 휘발성 메모리(132)에 저장하고, 휘발성 메모리(132)에 저장된 명령 또는 데이터를 처리하고, 결과 데이터를 비휘발성 메모리(134)에 저장할 수 있다. 일 실시예에 따르면, 프로세서(120)는 메인 프로세서(121)(예: 중앙 처리 장치 또는 어플리케이션 프로세서) 또는 이와는 독립적으로 또는 함께 운영 가능한 보조 프로세서(123)(예: 그래픽 처리 장치, 신경망 처리 장치(NPU: neural processing unit), 이미지 시그널 프로세서, 센서 허브 프로세서, 또는 커뮤니케이션 프로세서)를 포함할 수 있다. 예를 들어, 전자 장치(101)가 메인 프로세서(121) 및 보조 프로세서(123)를 포함하는 경우, 보조 프로세서(123)는 메인 프로세서(121)보다 저전력을 사용하거나, 지정된 기능에 특화되도록 설정될 수 있다. 보조 프로세서(123)는 메인 프로세서(121)와 별개로, 또는 그 일부로서 구현될 수 있다.
보조 프로세서(123)는, 예를 들면, 메인 프로세서(121)가 인액티브(예: 슬립) 상태에 있는 동안 메인 프로세서(121)를 대신하여, 또는 메인 프로세서(121)가 액티브(예: 어플리케이션 실행) 상태에 있는 동안 메인 프로세서(121)와 함께, 전자 장치(101)의 구성요소들 중 적어도 하나의 구성요소(예: 디스플레이 모듈(160), 센서 모듈(176), 또는 통신 모듈(190))와 관련된 기능 또는 상태들의 적어도 일부를 제어할 수 있다. 일 실시예에 따르면, 보조 프로세서(123)(예: 이미지 시그널 프로세서 또는 커뮤니케이션 프로세서)는 기능적으로 관련 있는 다른 구성요소(예: 카메라 모듈(180) 또는 통신 모듈(190))의 일부로서 구현될 수 있다. 일 실시예에 따르면, 보조 프로세서(123)(예: 신경망 처리 장치)는 인공지능 모델의 처리에 특화된 하드웨어 구조를 포함할 수 있다. 인공지능 모델은 기계 학습을 통해 생성될 수 있다. 이러한 학습은, 예를 들어, 인공지능 모델이 수행되는 전자 장치(101) 자체에서 수행될 수 있고, 별도의 서버(예: 서버(108))를 통해 수행될 수도 있다. 학습 알고리즘은, 예를 들어, 지도형 학습(supervised learning), 비지도형 학습(unsupervised learning), 준지도형 학습(semi-supervised learning) 또는 강화 학습(reinforcement learning)을 포함할 수 있으나, 전술한 예에 한정되지 않는다. 인공지능 모델은, 복수의 인공 신경망 레이어들을 포함할 수 있다. 인공 신경망은 심층 신경망(DNN: deep neural network), CNN(convolutional neural network), RNN(recurrent neural network), RBM(restricted boltzmann machine), DBN(deep belief network), BRDNN(bidirectional recurrent deep neural network), 심층 Q-네트워크(deep Q-networks) 또는 상기 중 둘 이상의 조합 중 하나일 수 있으나, 전술한 예에 한정되지 않는다. 인공지능 모델은 하드웨어 구조 이외에, 추가적으로 또는 대체적으로, 소프트웨어 구조를 포함할 수 있다.
메모리(130)는, 전자 장치(101)의 적어도 하나의 구성요소(예: 프로세서(120) 또는 센서 모듈(176))에 의해 사용되는 다양한 데이터를 저장할 수 있다. 데이터는, 예를 들어, 소프트웨어(예: 프로그램(140)) 및, 이와 관련된 명령에 대한 입력 데이터 또는 출력 데이터를 포함할 수 있다. 메모리(130)는, 휘발성 메모리(132) 또는 비휘발성 메모리(134)를 포함할 수 있다.
프로그램(140)은 메모리(130)에 소프트웨어로서 저장될 수 있으며, 예를 들면, 운영 체제(142), 미들 웨어(144) 또는 어플리케이션(146)을 포함할 수 있다.
입력 모듈(150)은, 전자 장치(101)의 구성요소(예: 프로세서(120))에 사용될 명령 또는 데이터를 전자 장치(101)의 외부(예: 사용자)로부터 수신할 수 있다. 입력 모듈(150)은, 예를 들면, 마이크, 마우스, 키보드, 키(예: 버튼), 또는 디지털 펜(예: 스타일러스 펜)을 포함할 수 있다.
음향 출력 모듈(155)은 음향 신호를 전자 장치(101)의 외부로 출력할 수 있다. 음향 출력 모듈(155)은, 예를 들면, 스피커 또는 리시버를 포함할 수 있다. 스피커는 멀티미디어 재생 또는 녹음 재생과 같이 일반적인 용도로 사용될 수 있다. 리시버는 착신 전화를 수신하기 위해 사용될 수 있다. 일 실시예에 따르면, 리시버는 스피커와 별개로, 또는 그 일부로서 구현될 수 있다.
디스플레이 모듈(160)은 전자 장치(101)의 외부(예: 사용자)로 정보를 시각적으로 제공할 수 있다. 디스플레이 모듈(160)은, 예를 들면, 디스플레이, 홀로그램 장치, 또는 프로젝터 및 해당 장치를 제어하기 위한 제어 회로를 포함할 수 있다. 일 실시예에 따르면, 디스플레이 모듈(160)은 터치를 감지하도록 설정된 터치 센서, 또는 상기 터치에 의해 발생되는 힘의 세기를 측정하도록 설정된 압력 센서를 포함할 수 있다.
오디오 모듈(170)은 소리를 전기 신호로 변환시키거나, 반대로 전기 신호를 소리로 변환시킬 수 있다. 일 실시예에 따르면, 오디오 모듈(170)은, 입력 모듈(150)을 통해 소리를 획득하거나, 음향 출력 모듈(155), 또는 전자 장치(101)와 직접 또는 무선으로 연결된 외부 전자 장치(예: 전자 장치(102))(예: 스피커 또는 헤드폰)를 통해 소리를 출력할 수 있다.
센서 모듈(176)은 전자 장치(101)의 작동 상태(예: 전력 또는 온도), 또는 외부의 환경 상태(예: 사용자 상태)를 감지하고, 감지된 상태에 대응하는 전기 신호 또는 데이터 값을 생성할 수 있다. 일 실시예에 따르면, 센서 모듈(176)은, 예를 들면, 제스처 센서, 자이로 센서, 기압 센서, 마그네틱 센서, 가속도 센서, 그립 센서, 근접 센서, 컬러 센서, IR(infrared) 센서, 생체 센서, 온도 센서, 습도 센서, 또는 조도 센서를 포함할 수 있다.
인터페이스(177)는 전자 장치(101)가 외부 전자 장치(예: 전자 장치(102))와 직접 또는 무선으로 연결되기 위해 사용될 수 있는 하나 이상의 지정된 프로토콜들을 지원할 수 있다. 일 실시예에 따르면, 인터페이스(177)는, 예를 들면, HDMI(high definition multimedia interface), USB(universal serial bus) 인터페이스, SD카드 인터페이스, 또는 오디오 인터페이스를 포함할 수 있다.
연결 단자(178)는, 그를 통해서 전자 장치(101)가 외부 전자 장치(예: 전자 장치(102))와 물리적으로 연결될 수 있는 커넥터를 포함할 수 있다. 일 실시예에 따르면, 연결 단자(178)는, 예를 들면, HDMI 커넥터, USB 커넥터, SD 카드 커넥터, 또는 오디오 커넥터(예: 헤드폰 커넥터)를 포함할 수 있다.
햅틱 모듈(179)은 전기적 신호를 사용자가 촉각 또는 운동 감각을 통해서 인지할 수 있는 기계적인 자극(예: 진동 또는 움직임) 또는 전기적인 자극으로 변환할 수 있다. 일 실시예에 따르면, 햅틱 모듈(179)은, 예를 들면, 모터, 압전 소자, 또는 전기 자극 장치를 포함할 수 있다.
카메라 모듈(180)은 정지 영상 및 동영상을 촬영할 수 있다. 일 실시예에 따르면, 카메라 모듈(180)은 하나 이상의 렌즈들, 이미지 센서들, 이미지 시그널 프로세서들, 또는 플래시들을 포함할 수 있다.
전력 관리 모듈(188)은 전자 장치(101)에 공급되는 전력을 관리할 수 있다. 일 실시예에 따르면, 전력 관리 모듈(188)은, 예를 들면, PMIC(power management integrated circuit)의 적어도 일부로서 구현될 수 있다.
배터리(189)는 전자 장치(101)의 적어도 하나의 구성요소에 전력을 공급할 수 있다. 일 실시예에 따르면, 배터리(189)는, 예를 들면, 재충전 불가능한 1차 전지, 재충전 가능한 2차 전지 또는 연료 전지를 포함할 수 있다.
통신 모듈(190)은 전자 장치(101)와 외부 전자 장치(예: 전자 장치(102), 전자 장치(104), 또는 서버(108)) 간의 직접(예: 유선) 통신 채널 또는 무선 통신 채널의 수립, 및 수립된 통신 채널을 통한 통신 수행을 지원할 수 있다. 통신 모듈(190)은 프로세서(120)(예: 어플리케이션 프로세서)와 독립적으로 운영되고, 직접(예: 유선) 통신 또는 무선 통신을 지원하는 하나 이상의 커뮤니케이션 프로세서를 포함할 수 있다. 일 실시예에 따르면, 통신 모듈(190)은 무선 통신 모듈(192)(예: 셀룰러 통신 모듈, 근거리 무선 통신 모듈, 또는 GNSS(global navigation satellite system) 통신 모듈) 또는 유선 통신 모듈(194)(예: LAN(local area network) 통신 모듈, 또는 전력선 통신 모듈)을 포함할 수 있다. 이들 통신 모듈 중 해당하는 통신 모듈은 제 1 네트워크(198)(예: 블루투스, WiFi(wireless fidelity) direct 또는 IrDA(infrared data association)와 같은 근거리 통신 네트워크) 또는 제 2 네트워크(199)(예: 레거시 셀룰러 네트워크, 5G 네트워크, 차세대 통신 네트워크, 인터넷, 또는 컴퓨터 네트워크(예: LAN 또는 WAN)와 같은 원거리 통신 네트워크)를 통하여 외부의 전자 장치(104)와 통신할 수 있다. 이런 여러 종류의 통신 모듈들은 하나의 구성요소(예: 단일 칩)로 통합되거나, 또는 서로 별도의 복수의 구성요소들(예: 복수 칩들)로 구현될 수 있다. 무선 통신 모듈(192)은 가입자 식별 모듈(196)에 저장된 가입자 정보(예: 국제 모바일 가입자 식별자(IMSI))를 이용하여 제 1 네트워크(198) 또는 제 2 네트워크(199)와 같은 통신 네트워크 내에서 전자 장치(101)를 확인 또는 인증할 수 있다.
무선 통신 모듈(192)은 4G 네트워크 이후의 5G 네트워크 및 차세대 통신 기술, 예를 들어, NR 접속 기술(new radio access technology)을 지원할 수 있다. NR 접속 기술은 고용량 데이터의 고속 전송(eMBB(enhanced mobile broadband)), 단말 전력 최소화와 다수 단말의 접속(mMTC(massive machine type communications)), 또는 고신뢰도와 저지연(URLLC(ultra-reliable and low-latency communications))을 지원할 수 있다. 무선 통신 모듈(192)은, 예를 들어, 높은 데이터 전송률 달성을 위해, 고주파 대역(예: mmWave 대역)을 지원할 수 있다. 무선 통신 모듈(192)은 고주파 대역에서의 성능 확보를 위한 다양한 기술들, 예를 들어, 빔포밍(beamforming), 거대 배열 다중 입출력(massive MIMO(multiple-input and multiple-output)), 전차원 다중입출력(FD-MIMO: full dimensional MIMO), 어레이 안테나(array antenna), 아날로그 빔형성(analog beam-forming), 또는 대규모 안테나(large scale antenna)와 같은 기술들을 지원할 수 있다. 무선 통신 모듈(192)은 전자 장치(101), 외부 전자 장치(예: 전자 장치(104)) 또는 네트워크 시스템(예: 제 2 네트워크(199))에 규정되는 다양한 요구사항을 지원할 수 있다. 일 실시예에 따르면, 무선 통신 모듈(192)은 eMBB 실현을 위한 Peak data rate(예: 20Gbps 이상), mMTC 실현을 위한 손실 Coverage(예: 164dB 이하), 또는 URLLC 실현을 위한 U-plane latency(예: 다운링크(DL) 및 업링크(UL) 각각 0.5ms 이하, 또는 라운드 트립 1ms 이하)를 지원할 수 있다.
안테나 모듈(197)은 신호 또는 전력을 외부(예: 외부의 전자 장치)로 송신하거나 외부로부터 수신할 수 있다. 일 실시예에 따르면, 안테나 모듈(197)은 서브스트레이트(예: PCB) 위에 형성된 도전체 또는 도전성 패턴으로 이루어진 방사체를 포함하는 안테나를 포함할 수 있다. 일 실시예에 따르면, 안테나 모듈(197)은 복수의 안테나들(예: 어레이 안테나)을 포함할 수 있다. 이런 경우, 제 1 네트워크(198) 또는 제 2 네트워크(199)와 같은 통신 네트워크에서 사용되는 통신 방식에 적합한 적어도 하나의 안테나가, 예를 들면, 통신 모듈(190)에 의하여 상기 복수의 안테나들로부터 선택될 수 있다. 신호 또는 전력은 상기 선택된 적어도 하나의 안테나를 통하여 통신 모듈(190)과 외부의 전자 장치 간에 송신되거나 수신될 수 있다. 어떤 실시예에 따르면, 방사체 이외에 다른 부품(예: RFIC(radio frequency integrated circuit))이 추가로 안테나 모듈(197)의 일부로 형성될 수 있다.
다양한 실시예에 따르면, 안테나 모듈(197)은 mmWave 안테나 모듈을 형성할 수 있다. 일 실시예에 따르면, mmWave 안테나 모듈은 인쇄 회로 기판, 상기 인쇄 회로 기판의 제 1 면(예: 아래 면)에 또는 그에 인접하여 배치되고 지정된 고주파 대역(예: mmWave 대역)을 지원할 수 있는 RFIC, 및 상기 인쇄 회로 기판의 제 2 면(예: 윗 면 또는 측 면)에 또는 그에 인접하여 배치되고 상기 지정된 고주파 대역의 신호를 송신 또는 수신할 수 있는 복수의 안테나들(예: 어레이 안테나)을 포함할 수 있다.
상기 구성요소들 중 적어도 일부는 주변 기기들간 통신 방식(예: 버스, GPIO(general purpose input and output), SPI(serial peripheral interface), 또는 MIPI(mobile industry processor interface))을 통해 서로 연결되고 신호(예: 명령 또는 데이터)를 상호간에 교환할 수 있다.
일 실시예에 따르면, 명령 또는 데이터는 제 2 네트워크(199)에 연결된 서버(108)를 통해서 전자 장치(101)와 외부의 전자 장치(104)간에 송신 또는 수신될 수 있다. 외부의 전자 장치(102, 또는 104) 각각은 전자 장치(101)와 동일한 또는 다른 종류의 장치일 수 있다. 일 실시예에 따르면, 전자 장치(101)에서 실행되는 동작들의 전부 또는 일부는 외부의 전자 장치들(102, 104, 또는 108) 중 하나 이상의 외부의 전자 장치들에서 실행될 수 있다. 예를 들면, 전자 장치(101)가 어떤 기능이나 서비스를 자동으로, 또는 사용자 또는 다른 장치로부터의 요청에 반응하여 수행해야 할 경우에, 전자 장치(101)는 기능 또는 서비스를 자체적으로 실행시키는 대신에 또는 추가적으로, 하나 이상의 외부의 전자 장치들에게 그 기능 또는 그 서비스의 적어도 일부를 수행하라고 요청할 수 있다. 상기 요청을 수신한 하나 이상의 외부의 전자 장치들은 요청된 기능 또는 서비스의 적어도 일부, 또는 상기 요청과 관련된 추가 기능 또는 서비스를 실행하고, 그 실행의 결과를 전자 장치(101)로 전달할 수 있다. 전자 장치(101)는 상기 결과를, 그대로 또는 추가적으로 처리하여, 상기 요청에 대한 응답의 적어도 일부로서 제공할 수 있다. 이를 위하여, 예를 들면, 클라우드 컴퓨팅, 분산 컴퓨팅, 모바일 에지 컴퓨팅(MEC: mobile edge computing), 또는 클라이언트-서버 컴퓨팅 기술이 이용될 수 있다. 전자 장치(101)는, 예를 들어, 분산 컴퓨팅 또는 모바일 에지 컴퓨팅을 이용하여 초저지연 서비스를 제공할 수 있다. 다른 실시예에 있어서, 외부의 전자 장치(104)는 IoT(internet of things) 기기를 포함할 수 있다. 서버(108)는 기계 학습 및/또는 신경망을 이용한 지능형 서버일 수 있다. 일 실시예에 따르면, 외부의 전자 장치(104) 또는 서버(108)는 제 2 네트워크(199) 내에 포함될 수 있다. 전자 장치(101)는 5G 통신 기술 및 IoT 관련 기술을 기반으로 지능형 서비스(예: 스마트 홈, 스마트 시티, 스마트 카, 또는 헬스 케어)에 적용될 수 있다.
도 2은 다양한 실시예에 따른 프로그램(140)을 예시하는 블록도(200)이다. 일 실시예에 따르면, 프로그램(140)은 전자 장치(101)의 하나 이상의 리소스들을 제어하기 위한 운영 체제(142), 미들웨어(144), 또는 상기 운영 체제(142)에서 실행 가능한 어플리케이션(146)을 포함할 수 있다. 운영 체제(142)는, 예를 들면, AndroidTM, iOSTM, WindowsTM, SymbianTM, TizenTM, 또는 BadaTM를 포함할 수 있다. 프로그램(140) 중 적어도 일부 프로그램은, 예를 들면, 제조 시에 전자 장치(101)에 프리로드되거나, 또는 사용자에 의해 사용 시 외부 전자 장치(예: 전자 장치(102 또는 104), 또는 서버(108))로부터 다운로드되거나 갱신 될 수 있다.
운영 체제(142)는 전자 장치(101)의 하나 이상의 시스템 리소스들(예: 프로세스, 메모리, 또는 전원)의 관리(예: 할당 또는 회수)를 제어할 수 있다. 운영 체제(142)는, 추가적으로 또는 대체적으로, 전자 장치(101)의 다른 하드웨어 디바이스, 예를 들면, 입력 모듈(150), 음향 출력 모듈(155), 디스플레이 모듈(160), 오디오 모듈(170), 센서 모듈(176), 인터페이스(177), 햅틱 모듈(179), 카메라 모듈(180), 전력 관리 모듈(188), 배터리(189), 통신 모듈(190), 가입자 식별 모듈(196), 또는 안테나 모듈(197)을 구동하기 위한 하나 이상의 드라이버 프로그램들을 포함할 수 있다.
미들웨어(144)는 전자 장치(101)의 하나 이상의 리소스들로부터 제공되는 기능 또는 정보가 어플리케이션(146)에 의해 사용될 수 있도록 다양한 기능들을 어플리케이션(146)으로 제공할 수 있다. 미들웨어(144)는, 예를 들면, 어플리케이션 매니저(201), 윈도우 매니저(203), 멀티미디어 매니저(205), 리소스 매니저(207), 파워 매니저(209), 데이터베이스 매니저(211), 패키지 매니저(213), 커넥티비티 매니저(215), 노티피케이션 매니저(217), 로케이션 매니저(219), 그래픽 매니저(221), 시큐리티 매니저(223), 통화 매니저(225), 또는 음성 인식 매니저(227)를 포함할 수 있다.
어플리케이션 매니저(201)는, 예를 들면, 어플리케이션(146)의 생명 주기를 관리할 수 있다. 윈도우 매니저(203)는, 예를 들면, 화면에서 사용되는 하나 이상의 GUI 자원들을 관리할 수 있다. 멀티미디어 매니저(205)는, 예를 들면, 미디어 파일들의 재생에 필요한 하나 이상의 포맷들을 파악하고, 그 중 선택된 해당하는 포맷에 맞는 코덱을 이용하여 상기 미디어 파일들 중 해당하는 미디어 파일의 인코딩 또는 디코딩을 수행할 수 있다. 리소스 매니저(207)는, 예를 들면, 어플리케이션(146)의 소스 코드 또는 메모리(130)의 메모리의 공간을 관리할 수 있다. 파워 매니저(209)는, 예를 들면, 배터리(189)의 용량, 온도 또는 전원을 관리하고, 이 중 해당 정보를 이용하여 전자 장치(101)의 동작에 필요한 관련 정보를 결정 또는 제공할 수 있다. 일 실시예에 따르면, 파워 매니저(209)는 전자 장치(101)의 바이오스(BIOS: basic input/output system)(미도시)와 연동할 수 있다.
데이터베이스 매니저(211)는, 예를 들면, 어플리케이션(146)에 의해 사용될 데이터베이스를 생성, 검색, 또는 변경할 수 있다. 패키지 매니저(213)는, 예를 들면, 패키지 파일의 형태로 배포되는 어플리케이션의 설치 또는 갱신을 관리할 수 있다. 커넥티비티 매니저(215)는, 예를 들면, 전자 장치(101)와 외부 전자 장치 간의 무선 연결 또는 직접 연결을 관리할 수 있다. 노티피케이션 매니저(217)는, 예를 들면, 지정된 이벤트(예: 착신 통화, 메시지, 또는 알람)의 발생을 사용자에게 알리기 위한 기능을 제공할 수 있다. 로케이션 매니저(219)는, 예를 들면, 전자 장치(101)의 위치 정보를 관리할 수 있다. 그래픽 매니저(221)는, 예를 들면, 사용자에게 제공될 하나 이상의 그래픽 효과들 또는 이와 관련된 사용자 인터페이스를 관리할 수 있다.
시큐리티 매니저(223)는, 예를 들면, 시스템 보안 또는 사용자 인증을 제공할 수 있다. 통화(telephony) 매니저(225)는, 예를 들면, 전자 장치(101)에 의해 제공되는 음성 통화 기능 또는 영상 통화 기능을 관리할 수 있다. 음성 인식 매니저(227)는, 예를 들면, 사용자의 음성 데이터를 서버(108)로 전송하고, 그 음성 데이터에 적어도 일부 기반하여 전자 장치(101)에서 수행될 기능에 대응하는 명령어(command), 또는 그 음성 데이터에 적어도 일부 기반하여 변환된 문자 데이터를 서버(108)로부터 수신할 수 있다. 일 실시예에 따르면, 미들웨어(244)는 동적으로 기존의 구성요소를 일부 삭제하거나 새로운 구성요소들을 추가할 수 있다. 일 실시예에 따르면, 미들웨어(144)의 적어도 일부는 운영 체제(142)의 일부로 포함되거나, 또는 운영 체제(142)와는 다른 별도의 소프트웨어로 구현될 수 있다.
어플리케이션(146)은, 예를 들면, 홈(251), 다이얼러(253), SMS/MMS(255), IM(instant message)(257), 브라우저(259), 카메라(261), 알람(263), 컨택트(265), 음성 인식(267), 이메일(269), 달력(271), 미디어 플레이어(273), 앨범(275), 와치(277), 헬스(279)(예: 운동량 또는 혈당과 같은 생체 정보를 측정), 또는 환경 정보(281)(예: 기압, 습도, 또는 온도 정보 측정) 어플리케이션을 포함할 수 있다. 일 실시예에 따르면, 어플리케이션(146)은 전자 장치(101)와 외부 전자 장치 사이의 정보 교환을 지원할 수 있는 정보 교환 어플리케이션(미도시)을 더 포함할 수 있다. 정보 교환 어플리케이션은, 예를 들면, 외부 전자 장치로 지정된 정보 (예: 통화, 메시지, 또는 알람)를 전달하도록 설정된 노티피케이션 릴레이 어플리케이션, 또는 외부 전자 장치를 관리하도록 설정된 장치 관리 어플리케이션을 포함할 수 있다. 노티피케이션 릴레이 어플리케이션은, 예를 들면, 전자 장치(101)의 다른 어플리케이션(예: 이메일 어플리케이션(269))에서 발생된 지정된 이벤트(예: 메일 수신)에 대응하는 알림 정보를 외부 전자 장치로 전달할 수 있다. 추가적으로 또는 대체적으로, 노티피케이션 릴레이 어플리케이션은 외부 전자 장치로부터 알림 정보를 수신하여 전자 장치(101)의 사용자에게 제공할 수 있다.
장치 관리 어플리케이션은, 예를 들면, 전자 장치(101)와 통신하는 외부 전자 장치 또는 그 일부 구성 요소(예: 외부 전자장치의 디스플레이 모듈 또는 카메라 모듈)의 전원(예: 턴-온 또는 턴-오프) 또는 기능(예: 밝기, 해상도, 또는 포커스)을 제어할 수 있다. 장치 관리 어플리케이션은, 추가적으로 또는 대체적으로, 외부 전자 장치에서 동작하는 어플리케이션의 설치, 삭제, 또는 갱신을 지원할 수 있다.
도 3은 일 실시예에 따른 전자 장치의 블록도이다.
일 실시예에 따르면, 전자 장치(300)는 메모리(310) (예: 도 1의 메모리(130)) 및 프로세서(320)(예: 도 1의 프로세서(120))를 포함할 수 있다.
일 실시예에 따르면, 메모리(310) 는 프로세서(320)에 의해 실행 시 전자 장치(300)의 동작을 제어하는 인스트럭션들을 저장할 수 있다. 예를 들어, 메모리(310)는, 실행 시, 프로세서(320)에 의해 제1 타입의 그래픽 API(application program interface)를 최적화하여 제2 타입의 그래픽 API로 변환하기 위한 동작들을 수행하도록 하는 인스트럭션들을 저장할 수 있다. 일 실시예에 따르면, 제1 타입의 그래픽 API는 Open GL API 또는 Open GLES API를 포함할 수 있고, 제2 타입의 그래픽 API는 Vulkan API를 포함할 수 있다. 일 실시예에 따르면, 메모리(310)는, 다양한 타입의 API 기반의 데이터(예: API 기반의 포맷(format), 상태 정보(states), 리소스(resource), 및/또는 명령어(command))를 적어도 일시적으로 저장할 수 있다. 예를 들어, 메모리(310)는 API 명령어를 저장하기 위한 명령어 버퍼 또는 API 명령어를 최적화하기 위하여 일시적으로 API 명령어들을 저장하는 가상 명령어 버퍼를 포함할 수 있다. 일 실시예에 따르면, 메모리(310)는 적어도 하나의 오브젝트를 렌더링하기 위한 버텍스(vertex)를 저장하는 버텍스 버퍼 및/또는 버텍스에 대한 인덱스(index) 값을 저장하기 위한 인덱스 버퍼를 포함할 수 있다. 일 실시예에 따르면, 메모리(310)는 렌더링 값들을 저장하는 프레임 버퍼를 포함할 수 있다. 일 실시예에 따르면, 프레임 버퍼는 색상 값을 저장하는 칼라 버퍼(color buffer), 뎁스 값을 저장하는 뎁스 버퍼(depth buffer), 및 스텐실 버퍼(stencil buffer)를 포함할 수 있다. 일 실시예에 따르면, 메모리(310)는 적어도 하나의 어플리케이션을 저장할 수 있다. 일 실시예에 따르면, 적어도 하나의 어플리케이션 각각은 지정된 타입의 API를 이용하여 기능을 수행할 수 있다.
일 실시예에 따르면, 프로세서(320)는 어플리케이션(예: 도 1의 어플리케이션(146))으로부터 제1 타입의 그래픽 API 기반의 기능 수행 요청을 수신할 수 있다. 일 실시예에 따르면, 제1 타입의 그래픽 API 기반의 기능은 화면(또는, 적어도 하나의 오브젝트)를 렌더링하기 위한 기능을 포함할 수 있다.
일 실시예에 따르면, 프로세서(320)는 인덱스 버퍼 최적화 동작을 수행할 수 있다. 예를 들어, 프로세서(320)는, 제1 타입의 그래픽 API가 인덱스 버퍼(index buffer)를 이용하는 경우, 제1 타입의 그래픽 API 기반의 데이터를 제2 타입의 그래픽 API 기반의 데이터로 변환하기 전에 인덱스 버퍼를 재구성하여 인덱스 버퍼를 최적화할 수 있다. 예를 들어, 전자 장치(300)는 인덱스 버퍼에 저장된 적어도 하나의 버텍스(vertex)의 인덱스 값을 삭제 또는 정렬하여 상기 인덱스 버퍼를 재구성할 수 있다. 인덱스 버퍼 최적화 동작은 이하의 도 4 및 도 6에서 보다 상세히 후술한다.
일 실시예에 따르면, 프로세서(320)는 요청에 기반하여, 제1 타입의 그래픽 API 기반의 데이터 및 명령어를 제2 타입의 그래픽 API 기반의 데이터 및 명령어로 변환할 수 있다. 일 실시예에 따르면, 제1 타입의 그래픽 API 기반의 데이터는 제1 타입의 그래픽 API의 포맷(format), 상태(state) 정보, 및 리소스 중 적어도 하나를 포함하고, 제2 타입의 그래픽 API 기반의 데이터는 제2 타입의 그래픽 API의 포맷, 상태 정보, 및 리소스 중 적어도 하나를 포함할 수 있다. 예를 들어, 프로세서(320)는 제1 타입 그래픽 API의 포맷을 제2 타입 그래픽 API 포맷으로 변환할 수 있다. 예를 들어, 프로세서(320)는 제1 타입 그래픽 API의 상태(state) 정보를 기반으로 제2 타입 그래픽 API의 상태 정보를 설정할 수 있다. 예를 들어, 프로세서(320)는 제2 타입 그래픽 API에 리소스를 할당할 수 있다. 예를 들어, 프로세서(320)는 제1 타입 그래픽 API의 명령어를 제2 타입 그래픽 API의 명령어로 변환할 수 있다.
일 실시예에 따르면, 프로세서(320)는 제2 타입의 그래픽 API 기반의 데이터 및/또는 명령어를 가상 명령어 버퍼에 저장할 수 있다. 예를 들어, 변환한 제2 타입의 그래픽 API 명령어를 바로 제2 타입의 그래픽 API 기반의 명령어 버퍼에 저장하는 경우, 제2 타입 그래픽 API 기반의 드라이버를 통하여 전달된 제2 타입의 그래픽 API를 GPU(미도시)(예: 도 1의 보조 프로세서(320)(122))가 바로 실행할 수 있다. 이 경우, 불필요한 제2 타입 기반의 명령어 역시 처리하게 됨으로써, 불필요한 연산 및 메모리(310) 사용이 발생할 수 있다. 일 실시예에 따른 전자 장치(300)는 변환한 제2 타입의 그래픽 API 기반의 데이터 및/또는 명령어를 가상 명령어 버퍼에 저장하고, 가상 명령어 버퍼에 저장된 제2 타입의 그래픽 API 기반의 데이터 및/또는 명령어가 GPU에 의해 바로 실행되기 전에 최적화 동작을 수행할 수 있다. 일 실시예에 따르면, GPU는 프로세서(320)와 별도로 구성되거나, 또는 일체로(즉, 하나의 프로세서(320)로) 구성될 수도 있다.
일 실시예에 따르면, 프로세서(320)는 제1 타입의 그래픽 API 기반의 데이터와 관련된 렌더링 타겟 정보, 뎁스 상태 정보, 및 제1 타입의 그래픽 API의 속성 중 적어도 하나에 기반하여, 가상 명령어 버퍼에 저장한 제2 타입의 그래픽 API 기반의 데이터 및 명령어를 최적화된 제2 타입의 그래픽 API 기반의 데이터 및 명령어로 재구성할 수 있다. 예를 들어, 프로세서(320)는 가상 명령어 버퍼에 저장된 제2 타입의 그래픽 API 기반의 명령어들 중에서 실제 렌더링에 필요한 적어도 일부를 선별하여 최적화된 제2 타입의 그래픽 API로 재구성할 수 있다.
일 실시예에 따르면, 렌더링 타겟 정보는 렌더링 결과가 저장될 타겟이 향후 사용될지 여부를 나타내는 정보를 포함할 수 있다. 예를 들어, 프로세서(320)는 렌더링 타겟이 향후 사용될지 여부를 판단하고, 렌더링 타겟이 향후 사용되지 않는 경우 그래픽 파이프라인(graphic pipeline) 중에서 일부 동작(예: 프래그먼트 셰이더(fragment shader) 동작)을 생략(discard)할 수 있다.
일 실시예에 따르면, 그래픽 파이프라인은 3D 좌표를 모니터에 출력 가능한 2D 형태로 변경하는 작업일 수 있다. 예를 들어, 그래픽 파이프라인은 특정 물체 (Mesh)의 포인트 및 색감(Texture)등을 입력으로 받아서 픽셀(Pixel) 단위로 표시하는 일련의 작업일 수 있다. 일 실시예에 따르면, 그래픽 파이프라인은 버텍스 버퍼 및/또는 인덱스 버퍼에 저장된 데이터를 기반으로 입력 어셈블러(input assembler), 버텍스 셰이더(vertex shader), 테셀레이션(tessellation), 기하 셰이더(geometry shader), 래스터화(rasterization), 프레그먼트 셰이더(fragment shader), 및 칼라 블렌딩(color blending) 동작들을 통하여 최종적으로 프레임 버퍼에 렌더링을 위한 데이터를 저장하는 작업일 수 있다. 일 실시예에 따르면, 입력 어셈블러(input assembler) 동작은 사용자의 입력(예: 버텍스(vertex) 데이터)을 정리(Collect)하는 동작으로, 예를 들어, 렌더링을 위한 메시(mesh)를 구성하는 트라이앵글을 그리기 위한 버텍스 또는 인덱스 데이터를 수집하는 동작을 포함할 수 있다. 일 실시예에 따르면, 버텍스 셰이더(vertex shader) 동작은, 버텍스 데이터를 2D 화면으로 변경하는 동작을 포함할 수 있다. 예를 들어, 입력으로 들어오는 버텍스 데이터는 보통 3차원(X, Y, Z)로 구성되나, 사용자가 눈으로 보는 화면은 2D로 구성된다. 예를 들어, 버텍스 셰이더(vertex shader) 동작은, 3D 버텍스 데이터를 2D로 데이터로 수정하는 동작을 포함할 수 있다. 일 실시예에 따르면, 테셀레이션(tessellation) 동작은, 메시(오브젝트)의 화질을 높이기 위해서 특정 룰(Rule)에 따라 더 작은 트라이앵글로 나누는 동작을 포함할 수 있다. 예를 들어, 테셀레이션(tessellation) 동작은 큰 트라이앵글을 복수 개의 더 작은 단위의 트라이앵글로 나누는 동작을 포함할 수 있다. 일 실시예에 따르면, 기하 셰이더(geometry shader) 동작은, 모든 Primitive (삼각형, 선, 점)을 지우거나 추가하는 동작을 포함할 수 있다. 일 실시예에 따르면, 래스터화(rasterization) 동작은, 2D 화면 공간(screen space)로 변경된 포지션을 사용하여 메시(오브젝트)를 프래그먼트로 구분하는 동작을 포함할 수 있다. 일 실시예에 따르면, 래스터화 동작은 화면에 표시되지 않는 부분이나, 다른 메시(오브젝트)에 의해 보이지 않는 프래그먼트를 제거하는 동작을 포함할 수 있다. 일 실시예에 따르면, 프레그먼트 셰이더(fragment shader) 동작은, 프래그먼트의 색상 및 뎁스 값을 연산하는 동작을 포함할 수 있다. 예를 들어, 프래그먼트 셰이더 동작은 렌더링할 각 픽셀의 값을 연산하고, 그 결과를 메모리(310)에 저장하는 동작을 포함할 수 있다. 일 실시예에 따르면, 칼라 블렌딩(color blending) 동작은 프래그먼트의 색상들을 비교하여 최종 색을 결정하는 동작을 포함할 수 있다. 예를 들어, 칼라 블렌딩 동작은, 한 픽셀 포인트에 대해 복수 개의 프레그먼트 정보가 존재하면, 복수 개의 정보를 기준으로 픽셀의 색상을 결정하는 동작을 포함할 수 있다.
일 실시예에 따르면, 렌더링 타겟이 향후 사용되지 않는 경우 프래그먼트 셰이더 동작을 수행하여 픽셀 값을 연산하여 저장하는 동작은 불필요할 수 있다. 일 실시예에 따르면, 프로세서(320)는 불필요한 프래그먼트 셰이더 동작을 생략함으로써, 렌더링 성능을 최적화할 수 있다.
일 실시예에 따르면, 프로세서(320)는 제1 타입의 그래픽 API 기반의 데이터와 관련된 뎁스 상태 정보(depth state)를 기반으로 렌더링 시 뎁스 값이 필요한지 여부를 판단할 수 있다. 예를 들어, 프로세서(320)는 렌더링 시 뎁스 값이 불필요한 경우 뎁스 버퍼를 비활성화할 수 있다. 예를 들어, 프로세서(320)는 렌더링에 불필요한 버퍼(예: 뎁스 버퍼)를 비활성화함으로써, 렌더 패스(render pass)가 시작되고 끝나는 지점에서 불필요한 메모리(310) 로드(load) 및/또는 저장(store) 동작이 발생하는 것을 방지할 수 있다.
일 실시예에 따르면, 프로세서(320)는 1 타입의 API가 화면 영역의 설정과 관련된 지정된 API(예: glScissor API)인 경우, 지정된 API와 관련된 정보를 기반으로 제2 타입의 그래픽 API 기반의 명령어에 기반하여 렌더링할 영역을 설정하고 불필요한 렌더링 결과값을 저장하지 않을 수 있다.
일 실시예에 따르면, 프로세서(320)는 상기 언급한 동작들 중 적어도 하나를 수행하여 제2 타입의 그래픽 API 기반의 데이터 및/또는 명령어를 최적화할 수 있다. 예를 들어, 전자 장치(300)는 최적화 동작을 통하여 유효한 제2 타입의 그래픽 API 기반의 명령어(즉, 최적화된 제2 타입의 그래픽 API 기반의 명령어)를 구성할 수 있다.
일 실시예에 따르면, 프로세서(320)는 유효한 제2 타입의 그래픽 API 기반의 명령어를 제2 타입의 그래픽 API 기반의 명령어 버퍼에 저장할 수 있다. 예를 들어, 프로세서(320)는 최적화된 제2 타입의 API 기반의 명령어를 제2 타입의 그래픽 API 기반의 명령어 버퍼에 저장할 수 있다.
일 실시예에 따르면, 프로세서(320)는 명령어 버퍼에 저장된 제2 타입의 그래픽 API 기반의 명령어에 기반하여 적어도 하나의 오브젝트를 렌더링할 수 있다. 예를 들어, 프로세서(320)는 제2 타입의 그래픽 API 명령어 버퍼에 저장된 제2 타입 그래픽 API 기반의 명령어가 GPU에 써미션(submission)되는 경우, GPU를 통하여 제2 타입 그래픽 API 기반의 명령어를 기반으로 렌더링 기능(동작)을 수행할 수 있다.
도 4는 일 실시예에 따른 전자 장치의 구성을 개략적으로 도시한 도면이다.
일 실시예에 따르면, 전자 장치(400)(예: 도 1의 전자 장치(101) 또는 도 3의 전자 장치(300))는 제1 타입 그래픽 API 어플리케이션(410)(예: 도 1 또는 도 2의 어플리케이션(146)), 최적화 프레임워크(420), 제2 타입 그래픽 API 드라이버(430)(driver), 및 GPU(440)(graphic processing unit)를 포함할 수 있다.
일 실시예에 따르면, 제1 타입 그래픽 API 어플리케이션(410)은 렌더링 기능을 수행하기 위하여 제1 타입의 그래픽 API를 이용하는 어플리케이션(410)일 수 있다. 일 실시예에 따르면, 제1 타입의 그래픽 API는 OpenGL API(이하, ‘GL API’ 용어를 혼용한다) 및/또는 Open GL ES API(이하, ‘GLES API’ 용어를 혼용한다.)를 포함할 수 있다. 예를 들어, 제1 타입 그래픽 API 어플리케이션(410)은 GLES API를 이용하여 기능을 수행할 수 있다. 예를 들어, 제1 타입 그래픽 API 어플리케이션(410)은 제1 타입의 그래픽 API를 호출할 수 있다.
일 실시예에 따르면, 최적화 프레임워크(420)는 제1 타입의 그래픽 API를 제2 타입의 그래픽 API로 변환하면서, 최적화를 수행할 수 있다. 일 실시예에 따르면, 제2 타입의 그래픽 API는 Vulkan API를 포함할 수 있다. 일 실시예에 따르면, 최적화 프레임워크(420)는 인덱스 버퍼 최적화 모듈(421), API 변환(translation) 모듈, 및 명령어 최적화 모듈(425)을 포함할 수 있다. 예를 들어, 최적화 프레임워크(420)는 제1 타입 그래픽 API 어플리케이션(410)으로부터 제1 타입의 그래픽 API 기반의 기능 수행 요청이 있는 경우, 제1 타입의 그래픽 API를 제2 타입의 그래픽 API로 변환할 수 있다.
일 실시예에 따르면, 인덱스 버퍼 최적화 모듈(421)은 제1 타입의 그래픽 API 기반의 어플리케이션(410)이 인덱스 버퍼(또는, 버텍스 버퍼)를 사용하는 경우, 인덱스 버퍼를 재구성하여 인덱스 버퍼를 최적화할 수 있다. 예를 들어, 인덱스 버퍼 최적화 모듈(421)은 인덱스 버퍼에 저장된 적어도 하나의 버텍스(vertex)의 인덱스 값을 삭제 또는 정렬하여 상기 인덱스 버퍼를 재구성할 수 있다.
일 실시예에 따르면, API 변환 모듈(423)은 제1 타입의 그래픽 API를 제2 타입의 그래픽 API로 변환할 수 있다. 예를 들어, API 변환 모듈(423)은 제1 타입의 그래픽 API 기반의 데이터(예: 제1 타입 그래픽 API의 상태(state), 포맷(format), 및/또는 리소스(resource)) 및/또는 명령어(command)를 제2 타입의 그래픽 API 기반의 데이터 및/또는 명령어로 변환할 수 있다. 일 실시예에 따르면, 변환한 제2 타입의 그래픽 API 기반의 데이터 및/또는 명령어를 가상 명령어 버퍼에 저장할 수 있다.
일 실시예에 따르면, 명령어 최적화 모듈(425)은, 변환한 제2 타입의 그래픽 API 기반의 데이터 및/또는 명령어를 분석하여 최적화된 제2 타입의 그래픽 API 기반의 데이터 및/또는 명령어로 재구성할 수 있다. 예를 들어, 명령어 최적화 모듈(425)은 가상 명령어 버퍼에 저장된 제2 타입의 그래픽 API 기반의 데이터 및/또는 명령어를 분석할 수 있다. 예를 들어, 명령어 최적화 모듈(425)은 제1 타입의 그래픽 API 기반의 데이터와 관련된 렌더링 타겟 정보를 기반으로 그래픽 파이프라인(graphic pipeline)의 적어도 일부 작업을 생략(discard)할 수 있다. 예를 들어, 명령어 최적화 모듈(425)은 렌더링 결과가 저장될 타겟이 향후에 사용될지 여부를 판단하고, 불필요한 그래픽 파이프라인의 작업(예: 프래그먼트 셰이더(fragment shader) 작업)을 생략할 수 있다. 예를 들어, 명령어 최적화 모듈(425)은 불필요한 제2 API 기반의 명령어를 제2 타입 그래픽 API 명령어 버퍼에 저장하지 않고, 유효한 제2 API 기반의 명령어만을 재구성하여 제2 타입 그래픽 API 명령어 버퍼에 저장할 수 있다.
일 실시예에 따르면, 명령어 최적화 모듈(425)은 제1 타입의 그래픽 API 기반의 데이터와 관련된 뎁스 상태 정보(depth state)를 기반으로 프레임 버퍼 중 뎁스 버퍼를 비활성화할 수 있다. 예를 들어, 렌더링 시 뎁스 값이 불필요한 경우, 명령어 최적화 모듈(425)은 프레임 버퍼의 뎁스 버퍼를 비활성화하여 메모리 대역폭을 최적화할 수 있다.
일 실시예에 따르면, 명령어 최적화 모듈(425)은 상기 제1 타입의 그래픽 API가 화면 영역의 설정과 관련된 지정된 API인 경우, 상기 지정된 API와 관련된 정보를 기반으로 상기 제2 타입의 그래픽 API 기반의 명령어에 기반하여 렌더링할 영역을 설정하고 불필요한 렌더링 결과값을 제거할 수 있다. 일 실시예에 따르면, 지정된 API는 시저 API(scissor API)(예: glScissor API)를 포함할 수 있다. 예를 들어, 명령어 최적화 모듈(425)은 전체 화면의 렌더링 결과를 메모리에 저장할 필요가 없는 경우, 렌더 패스(render pass)를 생성 시, 렌더링 영역을 설정하여 불필요한 값을 메모리에 저장하지 않도록 할 수 있다.
일 실시예에 따르면, 명령어 최적화 모듈(425)은 API 변환 모듈(423)에서 변환한 데이터를 제2 타입 그래픽 API의 명령어 버퍼에 저장하기 이전에, 가상 명령어 버퍼를 이용하여 상기 언급한 최적화 동작들을 수행하여 불필요한 데이터 및/또는 명령어를 삭제하고 유효한 제2 타입의 그래픽 API 데이터 및/ 명령어를 재구성하여 제2 타입 그래픽 API의 명령어 버퍼에 저장할 수 있다. 예를 들어, 명령어 최적화 모듈(425)은 가상 명령어 버퍼에 저장된 제2 타입의 그래픽 API 기반의 명령어들 중에서 이후의 렌더링에 유효한 명령어들을 선별하여 최적화된 제2 타입의 그래픽 API 기반의 명령어를 구성할 수 있다. 예를 들어, 명령어 최적화 모듈(425)는 최적화된 제2 타입의 그래픽 API 기반의 명령어에 적합하도록 제2 타입의 그래픽 API 기반의 데이터(예: 포맷, 상태 정보, 및/또는 리소스)를 재구성할 수 있다.
일 실시예에 따르면, 제2 타입 그래픽 API 드라이버(430)(예: Vulkan 드라이버)는 변환 및 최적화된 제2 타입의 그래픽 API를 수신하여 GPU(440)에 전달할 수 있다. 예를 들어, 제2 타입 그래픽 API 드라이버(430)는 최적화 프레임워크(420)와 GPU(440) 사이의 데이터를 전달할 수 있다. 예를 들어, 제2 타입 그래픽 API 드라이버(430)는 최적화 프레임워크(420)의 동작을 통하여 제2 타입의 명령어 버퍼에 저장된, 최적화된 제2 타입의 그래픽 API의 명령어를 GPU(440)에 전달할 수 있다.
일 실시예에 따르면, GPU(440)는 제2 타입의 그래픽 API에 기반하여 렌더링 동작을 수행할 수 있다. 일 실시예에 따르면, GPU(440)는 전자 장치(400)의 메인 프로세서(예: 도1 의 메인 프로세서(121)) 또는 보조 프로세서(예: 도 1의 보조 프로세서(123))일 수 있고, 메인 프로세서 및 보조 프로세서가 통합된 하나의 프로세서(예: 도 1의 프로세서(120))로 구현될 수도 있다.
다양한 실시예에 따르면, 최적화 프레임워크(420), 제2 타입 그래픽 API 드라이버(430), 및/또는 GPU(440)의 동작들 중 적어도 일부는 전자 장치(400)의 프로세서(예: 도 1의 프로세서(120))에 의해 수행될 수 있다.
도 5는 일 실시예에 따른 전자 장치의 API 변환 동작들을 설명하기 위한 도면이다.
일 실시예에 따르면, 510 동작에서, 전자 장치(예: 도 1의 전자 장치(101), 도 3의 전자 장치(300), 또는 도 4의 전자 장치(400))는 제1 타입의 그래픽 API의 디스패치(dispatch) 동작을 수행할 수 있다. 예를 들어, 전자 장치는 제1 타입의 그래픽 API를 호출할 수 있다.
일 실시예에 따르면, 521 동작에서, 전자 장치는 변환기(520)(translator)를 통하여 제1 타입 그래픽 API 포맷을 제2 타입 그래픽 API 포맷으로 변환할 수 있다. 일 실시예에 따르면, 제1 타입 그래픽 API는 Open GLES API를 포함하고, 제2 타입 그래픽 API는 Vulkan API를 포함할 수 있다,
일 실시예에 따르면, 523 동작에서, 전자 장치는 변환기(520)를 통하여 제1 타입 그래픽 API의 상태(state) 정보를 제2 타입 그래픽 API의 상태 정보로 변환할 수 있다. 예를 들어, 전자 장치는 제1 타입 그래픽 API의 상태 정보를 기반으로 제2 타입 그래픽 API의 상태 정보를 설정할 수 있다.
일 실시예에 따르면, 525 동작에서, 전자 장치는 변환기(520)를 통하여 제2 타입 그래픽 API의 리소스를 할당할 수 있다. 예를 들어, 전자 장치는 제1 타입 그래픽 API에 대응하는 기능을 수행하기 위하여 필요한 제2 타입 그래픽 API의 리소스를 할당할 수 있다.
일 실시예에 따르면, 527 동작에서, 전자 장치는 변환기(520)를 통하여 제1 타입 그래픽 API 기능을 제2 타입 그래픽 API 기능으로 변환할 수 있다. 예를 들어, 전자 장치는 제1 타입 그래픽 API 명령어를 제2 타입 그래픽 API 명령어로 변환할 수 있다.
일 실시예에 따르면, 531 동작에서, 전자 장치는 가상 명령어 버퍼(530)에 521 내지 527 동작을 통하여 획득한 제2 타입 그래픽 API와 관련된 데이터 및/또는 명령어를 적어도 일시적으로 저장할 수 있다. 일 실시예에 따르면, 전자 장치는 가상 명령어 버퍼(530)에 저장된 제2 타입 그래픽 API 기반의 데이터 및/또는 명령어와 관련된 정보(예: 제2 타입 그래픽 API의 상태(state) 정보 및/또는 리소스 정보)를 수집할 수 있다.
일 실시예에 따르면, 533 동작에서, 전자 장치는 가상 명령어 버퍼(530)에 저장된 제2 타입 그래픽 API와 관련된 데이터 및/또는 명령어를 분석 및 최적화할 수 있다. 예를 들어, 전자 장치는 제1 타입의 그래픽 API와 관련된 렌더링 타겟 정보를 기반으로 렌더링 결과가 저장될 타겟이 향후에 사용될지 여부를 판단하고, 타겟이 향후 사용되지 않는다고 판단하는 경우 그래픽 파이프라인(graphic pipeline)의 적어도 일부 작업(예: 프래그먼트 셰어디(fragment shader) 작업)을 생략(discard)할 수 있다. 예를 들어, 전자 장치는 제1 타입의 그래픽 API의 데이터와 관련된 뎁스 상태 정보(depth state)를 기반으로 렌더링 시 뎁스 값이 필요한지 여부를 판단할 수 있다. 예를 들어, 전자 장치는 렌더링 시 뎁스 값이 불필요한 경우 프레임 버퍼 중 뎁스 버퍼를 비활성화할 수 있다. 예를 들어, 전자 장치는 1 타입의 API가 화면 영역의 설정과 관련된 지정된 API(예: glScissor API)인 경우, 상기 지정된 API와 관련된 정보를 기반으로 제2 타입의 그래픽 API 기반의 명령어에 기반하여 렌더링할 영역을 설정하고 불필요한 렌더링 결과값을 제거할 수 있다.
일 실시예에 따르면, 535 동작에서, 전자 장치는 533 동작을 통하여 제2 타입 그래픽 API의 기능을 재구성할 수 있다. 예를 들어, 전자 장치는 유효한 제2 타입 그래픽 API 명령어를 선별하여 최적화된 제2 타입의 그래픽 API 기반의 명령어를 구성할 수 있다. 예를 들어, 전자 장치는 최적화된 제2 타입의 그래픽 API 기반의 명령어에 적합하도록 제2 타입의 그래픽 API 기반의 데이터를 재구성할 수 있다. 예를 들어, 전자 장치는 521 내지 527 동작을 통하여 변환된 제2 타입 그래픽 API 명령어들을 최적화하여 렌더링에 필요한(유효한) 제2 타입 그래픽 API 명령어로 재구성할 수 있다.
일 실시예에 따르면, 540 동작에서, 전자 장치는 재구성된 제2 타입 그래픽 API 기능(예: 재구성된 제2 타입 그래픽 API 명령어)를 제2 타입 그래픽 API 명령어 버퍼(540)에 저장할 수 있다.
일 실시예에 따르면, 550 동작에서, 전자 장치는 제2 타입 그래픽 API 드라이버(550)(예: 도 4의 제2 타입 그래픽 API 드라이버(430))를 통하여 제2 타입 그래픽 API 명령어 버퍼(540)에 저장된 제2 타입 그래픽 API 명령어를 GPU(560)(예: 도 1의 보조 프로세서(122) 또는 도 4의 GPU(440))에 전달할 수 있다.
일 실시예에 따르면, 560 동작에서, 전자 장치는 GPU(560) 를 통하여 제2 타입 그래픽 API 명령어에 기반하여 적어도 하나의 오브젝트의 렌더링 동작을 수행할 수 있다. 예를 들어, 전자 장치는 GPU(560)를 통하여 제2 타입 그래픽 API 명령어를 실행할 수 있다.
일 실시예에 따르면, 510 동작, 521 내지 527 동작, 및 531 내지 535 동작, 540 동작, 550 동작, 및 560 동작 중 적어도 일부 동작은 전자 장치의 프로세서(예: 도 1의 프로세서(120) 또는 도 3의 프로세서(320))에 의하여 수행될 수 있다. 일 실시예에 따르면, 가상 명령어 버퍼(530) 및/또는 제2 타입 그래픽 API 명령어 버퍼(540)는 전자 장치의 메모리(예: 도 1의 메모리(130), 도 3의 메모리(310))에 포함될 수 있다.
일 실시예에 따르면, 전자 장치는 변환기(520)를 통하여 변환한 제2 타입 그래픽 API 기반의 데이터 및/또는 명령어를 바로 제2 타입 그래픽 API 명령어 버퍼(540)에 저장하기 이전에, 가상 명령어 버퍼(530)를 통하여 변환한 제2 타입 그래픽 API 기반의 데이터 및/또는 명령어를 최적화하고, 렌더링에 필요한 유효한(최적화된)제2 타입 그래픽 API 기반의 데이터 및 명령어를 제2 타입 그래픽 API 명령어 버퍼(540)에 저장할 수 있다. 예를 들어, 전자 장치가 가상 명령어 버퍼(530)를 통하여 제2 타입 그래픽 API 기반의 데이터에 대한 최적화 동작을 수행함으로써, 불필요한 연산 및 메모리 할당을 감소시키고 렌더링 기능의 효율을 증가시킬 수 있다.
도 6a 내지 6f는 일 실시예에 따른 전자 장치의 인덱스 버퍼를 최적화하는 동작을 설명하기 위한 도면이다.
일 실시예에 따르면, 도 6a는 렌더링을 위한 메시(mesh)(600a)의 형태를 도시한다. 일 실시예에 따르면, 각 메시(600a)를 구성하는 각 꼭지점은 버텍스(vertex)(620, 621, 622, 623, 624. 625. 626, 627, 628, 629)를 의미할 수 있다. 예를 들어, 메시(600a) 구조를 참고하면, 세 개의 버텍스들이 연결되어 트라이앵글(triangle)을 형성할 수 있다. 예를 들어, 도 6a를 참고하면, 버텍스들이 제0 트라이앵글(610), 제1 트라이앵글(611), 제2 트라이앵글(612), 제3 트라이앵글(613), 제4 트라이앵글(614), 제5 트라이앵글(615), 제6 트라이앵글(616), 및 제7 트라이앵글(617)을 형성한 경우를 도시한다. 예를 들어, 전자 장치가 메시(600a)를 그리는(draw) 경우, 제1 트라이앵글(611), 제2 트라이앵글(612), …, 제7 트라이앵글(617) 순으로 순차적으로 그리는 경우가 제0 트라이앵글(610), 제7 트라이앵글(617), 제1 트라이앵글(611), 제6 트라이앵글(616), … 순으로 뒤죽박죽인 순서로 그리는 경우보다 버텍스 로컬리티(vertex locality)로 인하여 캐시 적중률(cache-hit rate)이 증가하고 메모리 성능을 향상시킬 수 있다. 일 실시예에 따르면, 전자 장치(예: 도 1의 전자 장치(101), 도 3의 전자 장치(300), 또는 도 4의 전자 장치(400))는 인접한 트라이앵글을 순차적으로 그릴 수 있도록 버텍스의 인덱스를 재정렬할 수 있다. 예를 들어, 전자 장치는 제0 버텍스(620), 제1 버텍스(621), 및 제2 버텍스(622)를 이용하여 제0 트라이앵글(610)을 그릴 수 있고, 제1 버텍스(621), 제2 버텍스(622), 및 제3 버텍스(623)를 이용하여 제1 트라이앵글(611)을 그릴 수 있고, 제2 버텍스(622), 제3 버텍스(623), 및 제4 버텍스(624)를 이용하여 제2 트라이앵글(612)를 그릴 수(렌더링할 수) 있다. 이와 마찬가지로, 버텍스의 인덱스가 정렬된 상태인 경우, 전자 장치는 메시(600a)를 구성하는 트라이앵글을 순차적으로 그릴 수 있다. 예를 들어, 트라이앵글을 순차적으로 그리는 경우 버텍스 로컬리티(vertex locality)가 증가하여 캐시 적중률을 향상시킬 수 있다.
예를 들어, API가 버텍스에 대한 인덱스 버퍼를 이용하는 경우, 인덱스 버퍼에 저장된 값들이 정렬되어 있지 않은 경우, 메시(600a)의 트라이앵글을 순차적으로 그릴 수 없거나, 또는 트라이앵글 자체를 그릴 수 없는 경우가 발생할 수 있다.
일 실시예에 따르면, 도 6b는 순차적인 버텍스 인덱스를 저장하고 있는 인덱스 버퍼(600b)의 경우를 도시하며, 도 6c는 버텍스의 순서가 뒤섞이도록 인덱스를 저장하고 있는 인덱스 버퍼(600c)의 경우를 도시하며, 도 6d는 트라이앵글을 만들 수 없는 인덱스 세트(set)를 저장하고 있는 인덱스 버퍼(600d)의 경우를 도시한다.
예를 들어, 도 6b의 경우, 인덱스 버퍼(600b)는 n, n+1, n+2, …, n+10, n+11, … 순으로 버텍스의 인덱스가 순차적으로 저장되어 있을 수 있다. 예를 들어, 제1 인덱스 세트(621), 제2 인덱스 세트(622), 제3 인덱스 세트(623), 및 제4 인덱스 세트(624)는 각각 트라이앵글을 형성할 수 있다. 이 경우, 인덱스 세트(621, 622, 623, 624)이 순차적으로 정렬되어 있기 때문에, 전자 장치는 메시(600a)를 구성하는 트라이앵글을 순차적으로 그릴 수 있다.
예를 들어, 도 6c의 경우, 인덱스 버퍼(600c)에 n, n+1, n+2, n+100, n+101, n+102, n+3, n+4, n+5, n+103, n+104, n+105, … 순으로 버텍스의 인덱스 순서가 뒤섞여서 저장되어 있을 수 있다. 예를 들어, 제5 인덱스 세트(631), 제6 인덱스 세트(622), 제7 인덱스 세트(623), 및 제8 인덱스 세트(624)가 순차적으로 정렬되어 있지 않기 때문에, 전자 장치는 메시(600a)를 구성하는 트라이앵글을 순차적으로 그리지 못할 수 있다. 예를 들어, 도 6c의 인덱스 버퍼(600c)를 이용할 경우, 전자 장치가 사용하는 버텍스의 메모리 영역이 상대적으로 크게 변동되어 캐시(cache)의 이점을 사용할 수 없고 도 6b의 경우보다 렌더링 성능이 저하될 수 있다.
예를 들어, 도 6d의 경우, 인덱스 버퍼(600d)가 제9 인덱스 세트(641), 메시(600a)를 구성하는 트라이앵글을 형성할 수 없는 제10 인덱스 세트(642), 및 제11 인덱스 세트(643)를 포함할 수 있다. 예를 들어, 제10 인덱스 세트(642)는 트라이앵글을 형성하지는 못하나 전자 장치에서 인덱스 값들의 연산은 수행될 수 있어서, 도 6b의 경우보다 메모리 및/또는 연산 코스트(cost)에 불리할 수 있으며, 렌더링 성능이 저하될 수 있다.
일 실시예에 따르면, 전자 장치는 API를 변환하기 이전에 인덱스 버퍼를 재구성할 수 있다. 예를 들어, 전자 장치는 인덱스 버퍼에 저장된 적어도 하나의 버텍스(vertex)의 인덱스 값을 삭제 또는 정렬하여 상기 인덱스 버퍼를 재구성함으로써, 인덱스 버퍼를 최적화할 수 있다. 일 실시예에 따르면, API가 버텍스에 대한 인덱스 버퍼를 이용하는 경우, 인덱스 버퍼에 저장된 값들이 메시의 트라이앵글을 순차적으로 그릴 수 있도록 정렬되는 경우 메모리 성능을 최적화시킬 수 있다.
도 6e를 참고하면, 일 실시예에 따른, 전자 장치는 인덱스 버퍼(600e)에서 메시(600a)를 구성하는 트라이앵글을 생성할 수 없는 인덱스(3k, 3k+1, 3k+2)를 인덱스 버퍼(600e)에 제거할 수 있다. 예를 들어, 인덱스 버퍼(600e)의 컨텐츠들 중 두 개 이상이 같은 값을 가지는 경우, 해당 버텍스 세트(즉, 제12 인덱스 세트(650))는 트라이앵글을 생성할 수 없을 수 있다. 예를 들어, 제12 인덱스 세트(650)에 포함된 3k, 3k+1, 3k+2 인덱스가 나타내는 컨텐츠의 값이 100으로 동일한 경우, 해당되는 제12 인덱스 세트(650)는 트라이앵글을 생성할 수 없는 인덱스 세트일 수 있다. 예를 들어, 전자 장치는 인덱스 버퍼(600e)로부터 제12 인덱스 세트(650)를 제거하여 인덱스 버퍼(600e)를 재구성 및 최적화할 수 있다.
도 6f를 참고하면, 일 실시예에 따른, 전자 장치는 인덱스 버퍼(600f)에 포함된 인덱스들(3k, 3k+1, 3k+2, …, 3k+10, 3k+11, …)의 순서를 정렬할 수 있다. 예를 들어, 인덱스 버퍼(600f)에 포함된 인덱스 순서를 정렬하는 경우, 인덱스 버퍼(600f)의 값들을 단순히 오름차순 또는 내림차순으로 정렬할 수 없을 수 있다. 예를 들어, 전자 장치는 인덱스 버퍼에 포함된 인덱스들의 순서를 정렬하기 위해서 트라이앵글을 생성할 수 있는 인덱스 세트를 결정하고, 결정된 인덱스 세트들 각각의 첫 번째 값(컨텐츠)을 기준으로 인덱스들을 정렬할 수 있다. 예를 들어, 트라이앵글을 생성하기 위해서는 3개의 버텍스가 필요하므로, 전자 장치는 인덱스 버퍼에 저장된 인덱스들(3k, 3k+1, 3k+2, …, 3k+10, 3k+11, …)을 3개의 인덱스를 포함하는 인덱스 세트(예: 제13 인덱스 세트(661), 제14 인덱스 세트(662), 제 15 인덱스 세트(663), 제16 인덱스 세트(664))로 그룹화할 수 있다. 예를 들어, 전자 장치는 그룹화한 인덱스 세트(661, 662, 663, 664) 각각의 첫 번째 인덱스(3k, 3k+3, 3k+6, 3k+9)의 값(컨텐츠)(6611, 6621, 6631, 6641)을 기반으로 인덱스 버퍼(600f)의 인덱스 세트들(661, 662, 663, 664)을 정렬할 수 있다. 예를 들어, 전자 장치는 제14 인덱스 세트(662), 제15 인덱스 세트(663), 제13 인덱스 세트(661) 및 제16 인덱스 세트(664) 순서로 인덱스 버퍼를 재구성하여 인덱스 버퍼를 최적화할 수 있다.
일 실시예에 따른 전자 장치는, 메모리, 및 상기 메모리에 작동적으로(operatively) 연결된 프로세서를 포함하고, 상기 메모리는, 실행 시, 상기 프로세서가, 어플리케이션으로부터 제1 타입의 그래픽 API(graphics application program interface) 기반의 기능 수행 요청을 수신하고, 상기 요청에 기반하여, 상기 제1 타입의 그래픽 API 기반의 데이터 및 명령어를 제2 타입의 그래픽 API 기반의 데이터 및 명령어로 변환(translate)하고, 상기 제2 타입의 그래픽 API 기반의 데이터 및 명령어를 가상 명령어 버퍼에 저장하고, 상기 제1 타입의 그래픽 API 기반의 데이터와 관련된 렌더링 타겟 정보, 뎁스 상태(depth state) 정보, 및 상기 제1 타입의 그래픽 API의 속성 중 적어도 하나에 기반하여, 상기 가상 명령어 버퍼에 저장한 제2 타입의 그래픽 API 기반의 데이터 및 명령어를 최적화된 제2 타입의 그래픽 API 기반의 데이터 및 명령어로 재구성하고, 상기 재구성된 제2 타입의 그래픽 API 기반의 데이터 및 명령어를 제2 타입의 그래픽 API 기반의 명령어 버퍼에 저장하도록 하는 인스트럭션들(instructions)을 저장할 수 있다.
일 실시예에 따르면, 상기 제1 타입의 그래픽 API는 OpenGL(open graphics library) API 또는 OpenGL ES(OpenGL for embedded systems) API를 포함하고, 상기 제2 타입의 그래픽 API는 Vulkan API를 포함할 수 있다.
일 실시예에 따르면, 상기 제1 타입의 그래픽 API 기반의 데이터는, 상기 제1 타입의 그래픽 API의 포맷(format), 상태 정보, 및 리소스 중 적어도 하나를 포함하고, 상기 제2 타입의 그래픽 API 기반의 데이터는, 상기 제2 타입의 그래픽 API의 포맷, 상태 정보, 및 리소스 중 적어도 하나를 포함할 수 있다.
일 실시예에 따르면, 상기 인스트럭션들은, 실행 시, 상기 프로세서가, 상기 제1 타입의 그래픽 API가 인덱스 버퍼(index buffer)를 이용하는 그래픽 API인 경우, 상기 제1 타입의 그래픽 API 기반의 데이터 및 명령어를 상기 제2 타입의 그래픽 API 기반의 데이터 및 명령어로 변환하기 이전에, 상기 인덱스 버퍼를 재구성하도록 할 수 있다.
일 실시예에 따르면, 상기 인스트럭션들은, 실행 시, 상기 프로세서가, 상기 인덱스 버퍼에 저장된 적어도 하나의 버텍스(vertex)의 인덱스 값을 삭제 또는 정렬하여 상기 인덱스 버퍼를 재구성하도록 할 수 있다.
일 실시예에 따르면, 상기 인스트럭션들은, 실행 시, 상기 프로세서가, 상기 명령어 버퍼에 저장된 제2 타입의 그래픽 API 기반의 명령어에 기반하여 적어도 하나의 오브젝트를 렌더링하도록 할 수 있다.
일 실시예에 따르면, 상기 인스트럭션들은, 실행 시, 상기 프로세서가, 상기 렌더링 타겟 정보를 기반으로, 그래픽 파이프라인(graphic pipeline)에 포함된 복수 개의 작업들 중에서 적어도 일부를 생략하도록 할 수 있다.
일 실시예에 따르면, 상기 복수 개의 작업들 중에서 적어도 일부는 프래그먼트 셰이더(fragment shader) 동작을 포함하는 전자 장치.
일 실시예에 따르면, 상기 메모리는 렌더링 결과를 저장하고, 칼라 버퍼(color buffer), 뎁스 버퍼(depth buffer), 및 스텐실 버퍼(stencil buffer)를 포함하는 프레임 버퍼를 포함할 수 있다.
일 실시예에 따르면, 상기 인스트럭션들은, 실행 시, 상기 프로세서가, 상기 뎁스 상태 정보를 기반으로 프레임 버퍼 중 뎁스 버퍼를 비활성화하도록 할 수 있다.
일 실시예에 따르면, 상기 인스트럭션들은, 실행 시, 상기 프로세서가, 상기 제1 타입의 그래픽 API가 화면 영역의 설정과 관련된 지정된 API인 경우, 상기 지정된 API와 관련된 정보를 기반으로 상기 제2 타입의 그래픽 API 기반의 명령어에 기반하여 렌더링할 영역을 설정하고 불필요한 렌더링 결과값을 제거하도록 할 수 있다.
일 실시예에 따르면, 상기 지정된 API는 openGL API 중 glScissor API를 포함할 수 있다.
일 실시예에 따르면, 상기 인스트럭션들은, 실행 시, 상기 프로세서가, 상기 제1 타입의 그래픽 API의 포맷을 상기 제2 타입의 그래픽 API의 포맷으로 변환하고, 상기 제1 타입의 그래픽 API의 상태 정보를 기반으로 상기 제2 타입의 그래픽 API의 상태 정보를 설정하고, 상기 제1 타입의 상기 제2 타입의 그래픽 API 기반의 리소스를 할당하고, 제1 타입의 그래픽 API 기반의 명령어를 상기 제2 타입의 그래픽 API 기반의 명령어로 변환하도록 할 수 있다.
도 7은 일 실시예에 따른 전자 장치의 API 변환 방법의 흐름도이다.
일 실시예에 따르면, 710 동작에서, 전자 장치(예: 도 1의 전자 장치(101), 도 3의 전자 장치(300), 또는 도 4의 전자 장치(400))는 어플리케이션으로부터 제1 타입의 그래픽 API 기반의 기능 수행 요청을 수신할 수 있다. 일 실시예에 따르면, 제1 타입의 그래픽 API는 Open GL API 또는 Open GLES API를 포함할 수 있다.
일 실시예에 따르면, 720 동작에서, 전자 장치는 요청에 기반하여, 제1 타입의 그래픽 API 기반의 데이터 및/또는 명령어를 제2 타입의 그래픽 API 기반의 데이터 및/또는 명령어로 변환할 수 있다. 일 실시예에 따르면, 제2 타입의 그래픽 API는 Vulkan API를 포함할 수 있다. 일 실시예에 따르면, 제1 타입의 그래픽 API 기반의 데이터는 제1 타입의 그래픽 API의 포맷(format), 상태(state) 정보, 리소스, 및 명령어 중 적어도 하나를 포함하고, 제2 타입의 그래픽 API 기반의 데이터는 제2 타입의 그래픽 API의 포맷, 상태 정보, 및 리소스 중 적어도 하나를 포함할 수 있다. 예를 들어, 전자 장치는 제1 타입 그래픽 API의 포맷을 제2 타입 그래픽 API 포맷으로 변환할 수 있다. 예를 들어, 전자 장치는 제1 타입 그래픽 API의 상태(state) 정보를 기반으로 제2 타입 그래픽 API의 상태 정보를 설정할 수 있다. 예를 들어, 전자 장치는 제2 타입 그래픽 API에 리소스를 할당할 수 있다. 예를 들어, 전자 장치는 제1 타입 그래픽 API의 명령어를 제2 타입 그래픽 API의 명령어로 변환할 수 있다.
일 실시예에 따르면, 730 동작에서, 전자 장치는 제2 타입의 그래픽 API 기반의 데이터 및/또는 명령어를 가상 명령어 버퍼에 저장할 수 있다. 예를 들어, 변환한 제2 타입의 그래픽 API 명령어를 바로 제2 타입의 그래픽 API 기반의 명령어 버퍼에 저장하는 경우, 제2 타입 그래픽 API 기반의 드라이버를 통하여 전달된 제2 타입의 그래픽 API를 GPU가 바로 실행할 수 있다. 이 경우, 불필요한 제2 타입 기반의 명령어 역시 처리하게 됨으로써, 불필요한 연산 및 메모리 사용이 발생할 수 있다. 일 실시예에 따른 전자 장치는 변환한 제2 타입의 그래픽 API 기반의 데이터 및/또는 명령어를 가상 명령어 버퍼에 저장하고 최적화를 수행함으로써, 최초 변환된 제2 타입의 그래픽 API 기반의 데이터 및/또는 명령어 전부가 GPU에 의해 바로 실행(또는, 사용)되는 것을 방지할 수 있다.
일 실시예에 따르면, 740 동작에서, 전자 장치는 제1 타입의 그래픽 API 기반의 데이터와 관련된 렌더링 타겟 정보, 뎁스 상태 정보, 및 제1 타입의 그래픽 API의 속성 중 적어도 하나에 기반하여, 가상 명령어 버퍼에 저장한 제2 타입의 그래픽 API 기반의 데이터 및/또는 명령어를 최적화된 제2 타입의 그래픽 API 기반의 명령어로 재구성할 수 있다. 예를 들어, 전자 장치는 가상 명령어 버퍼에 저장된 제2 타입의 그래픽 API 기반의 명령어들 중 적어도 일부를 선별하여 최적화된 제2 타입의 그래픽 API 기반의 명령어를 구성할 수 있다. 예를 들어, 전자 장치는 최적화된 제2 타입의 그래픽 API 기반의 명령어에 기반하여 제2 타입의 그래픽 API 기반의 데이터를 재구성할 수 있다.
일 실시예에 따르면, 렌더링 타겟 정보는 렌더링 결과가 저장될 타겟이 향후 사용될지 여부를 나타내는 정보를 포함할 수 있다. 예를 들어, 전자 장치는 렌더링 타겟이 향후 사용될지 여부를 판단하고, 렌더링 타겟이 향후 사용되지 않는 경우 그래픽 파이프라인 중에서 일부 동작(예: 프래그먼트 셰이더(fragment shader) 동작)을 생략(discard)할 수 있다. 일 실시예에 따르면, 프래그먼트 셰이더 동작은 렌더링할 각 픽셀의 값을 연산하고, 그 결과를 메모리에 저장하는 동작을 포함할 수 있다. 예를 들어, 렌더링 타겟이 향후 사용되지 않는 경우 프래그먼트 셰이더 동작을 수행하여 픽셀 값을 연산하여 저장하는 동작은 불필요할 수 있다. 예를 들어, 전자 장치는 불필요한 프래그먼트 셰이더 동작을 생략함으로써, 렌더링 성능을 최적화할 수 있다.
일 실시예에 따르면, 전자 장치는 제1 타입의 그래픽 API 기반의 데이터와 관련된 뎁스 상태 정보(depth state)를 기반으로 렌더링 시 뎁스 값이 필요한지 여부를 판단할 수 있다. 예를 들어, 전자 장치는 렌더링 시 뎁스 값이 불필요한 경우 프레임 버퍼에 포함된 칼라 버퍼(color buffer), 뎁스 버퍼(depth buffer), 및 스텐실 버퍼(stencil buffer) 중 뎁스 버퍼를 비활성화할 수 있다. 예를 들어, 전자 장치는 렌더링에 불필요한 버퍼(예: 뎁스 버퍼)를 비활성화함으로써, 렌더 패스(render pass)가 시작되고 끝나는 지점에서 불필요한 메모리 로드(load) 및/또는 저장(store) 동작이 발생하는 것을 방지할 수 있다.
일 실시예에 따르면, 전자 장치는 1 타입의 API가 화면 영역의 설정과 관련된 지정된 API(예: glScissor API)인 경우, 상기 지정된 API와 관련된 정보를 기반으로 제2 타입의 그래픽 API 기반의 명령어에 기반하여 렌더링할 영역을 설정하고 불필요한 렌더링 결과값을 제거할 수 있다.
일 실시예에 따르면, 전자 장치는 상기 740 동작 설명에서 언급한 동작들 중 적어도 하나를 수행하여 제2 타입의 그래픽 API 기반의 데이터(예: 제2 타입의 그래픽 API 기반의 명령어)를 최적화할 수 있다. 예를 들어, 전자 장치는 최적화 동작(상기 언급한 동작들 중 적어도 하나)을 통하여 최적화된 제2 타입의 그래픽 API 기반의 명령어를 구성할 수 있다.
일 실시예에 따르면, 750 동작에서, 전자 장치는 제2 타입의 그래픽 API 기반의 명령어 및/또는 데이터를 제2 타입의 그래픽 API 기반의 명령어 버퍼에 저장할 수 있다. 예를 들어, 전자 장치는 740 동작을 통하여 최적화된 제2 타입이 API 기반의 명령어 및/또는 데이터를 제2 타입의 그래픽 API 기반의 명령어 버퍼에 저장할 수 있다.
일 실시예에 따르면, 760 동작에서, 전자 장치는 명령어 버퍼에 저장된 제2 타입의 그래픽 API 기반의 명령어 및/또는 데이터에 기반하여 적어도 하나의 오브젝트를 렌더링할 수 있다. 예를 들어, 전자 장치는 제2 타입 그래픽 API 기반의 드라이버를 통하여 제2 타입의 그래픽 API 명령어 버퍼에 저장된 제2 타입 그래픽 API 기반의 명령어를 GPU에 써미션(submission)하고, GPU는 수신한 제2 타입 그래픽 API 기반의 명령어를 기반으로 렌더링 기능(동작)을 수행할 수 있다.
도 8은 일 실시예에 따른 전자 장치의 API 변환 방법의 흐름도이다.
일 실시예에 따르면, 810 동작에서, 전자 장치(예: 도 1의 전자 장치(101), 도 3의 전자 장치(300), 또는 도 4의 전자 장치(400))는 GLES API를 호출할 수 있다. 예를 들어, 전자 장치는 어플리케이션의 GLES API 기반의 렌더링 기능 수행 요청을 인식할 수 있다.
일 실시예에 따르면, 820 동작에서, 전자 장치는 버퍼 최적화 동작을 수행할 수 있다.
일 실시예에 따르면, 821 동작에서, 전자 장치는 GLES API가 버텍스 버퍼 또는 인덱스 버퍼 데이터를 업로드하는 API인지 여부를 판단할 수 있다. 일 실시예에 따르면, 전자 장치는 GLES API가 버텍스 버퍼 또는 인덱스 버퍼 데이터를 업로드하는 API인 경우 823 동작을 수행하고, GLES API가 버텍스 버퍼 또는 인덱스 버퍼 데이터를 업로드하는 API가 아닌 경우, 823 동작의 인덱스 버퍼 최적화 동작을 생략하고 830 동작을 수행할 수 있다.
일 실시예에 따르면, 823 동작에서, 전자 장치는 인덱스 버퍼 최적화 동작을 수행할 수 있다. 일 실시예에 따르면, 인덱스 버퍼 최적화 동작은 도 6a 내지 도 6f에서 설명한 전자 장치의 동작을 포함할 수 있다. 예를 들어, 전자 장치는 인덱스 버퍼를 재구성하여 인덱스 버퍼를 최적화할 수 있다. 예를 들어, 전자 장치는 인덱스 버퍼에 저장된 적어도 하나의 버텍스(vertex)의 인덱스 값을 삭제 또는 정렬하여 상기 인덱스 버퍼를 재구성할 수 있다.
일 실시예에 따르면, 830 동작에서, 전자 장치는 GLES API를 Vulkan API로 변환(translate)할 수 있다. 예를 들어, 전자 장치는 GLES API 포맷을 Vulkan API 포맷으로 변환할 수 있다. 예를 들어, 전자 장치는 GLES API의 상태(state) 정보를 Vulkan API의 상태 정보로 변환할 수 있다. 예를 들어, 전자 장치는 GLES API의 상태 정보에 대응하도록 Vulkan API의 상태 정보를 설정할 수 있다. 예를 들어, 전자 장치는 Vulkan API와 관련된 리소스를 결정 또는 수집하고, 리소스를 할당할 수 있다. 예를 들어, 전자 장치는 GLES API 명령어를 Vulkan API 명령어로 변환할 수 있다.
일 실시예에 따르면, 835 동작에서, 전자 장치는 변환한 Vulkan API를 가상 명령어 버퍼에 저장할 수 있다. 일 실시예에 따르면, 전자 장치는 변환한 Vulkan API를 Vulkan 명령어 버퍼에 바로 저장하지 않고 가상 명령어 버퍼에 저장함으로써, 변환한 Vulkan 명령어가 바로 GPU에 의해 실행되는 것을 방지하고 840 동작에서 변환한 Vulakn 명령어에 대한 명령어 최적화 동작을 수행할 수 있다.
일 실시예에 따르면, 840 동작에서, 전자 장치는 가상 명령어 버퍼에 저장된 Vulkan 명령어에 대하여 명령어 최적화 동작을 수행할 수 있다.
일 실시예에 따르면, 841 동작에서, 전자 장치는 지정된 최적화 조건을 만족하는지 여부를 판단할 수 있다. 일 실시예에 따르면, 전자 장치는 지정된 최적화 조건을 만족하는 경우 843 동작을 수행하고, 지정된 최적화 조건을 만족하지 않는 경우, 843 동작의 Vulkan 명령어 최적화 동작을 생략하고 850 동작을 수행할 수 있다. 일 실시예에 따르면, 지정된 최적화 조건은 렌더링 결과가 저장될 렌더링 타겟이 향후 사용되지 않는 경우, GLES API 또는 Vulkan API의 상태(state) 정보 중 뎁스 상태(depth state) 정보가 비활성화된 경우, 및 GLES API가 지정된 API(예: glScissor API)인 경우 중 적어도 하나를 포함할 수 있다.
일 실시예에 따르면, 843 동작에서, 전자 장치는 Vulkan 명령어 최적화 동작을 수행할 수 있다. 예를 들어, 전자 장치는 830 동작에서 변환한 Vulkan 명령어를 최적화된 Vulkan 명령어로 재구성할 수 있다.
예를 들어, 전자 장치는, 렌더링 결과가 저장될 렌더링 타겟이 향후 사용되지 않는 경우, 그래픽 파이프라인(graphic pipeline)의 적어도 일부 작업(예: 프래그먼트 셰이더(fragment shader) 작업)을 생략(discard)할 수 있다.
예를 들어, 전자 장치는, GLES API 또는 Vulkan API의 상태(state) 정보 중 뎁스 상태(depth state) 정보가 비활성화된 경우, 칼라 버퍼(color buffer), 뎁스 버퍼(depth vuffer), 및 스텐실(stencil buffer)를 포함하는 프레임 버퍼 중 뎁스 버퍼를 비활성화할 수 있다.
예를 들어, 전자 장치는, LES API가 지정된 API(예: glScissor API)인 경우, Vulkan 렌더 패스(render pass)를 설정할 때 렌더링 영역을 설정하여 불필요한 값을 메모리에 저장하지 않도록 할 수 있다.
이하의 도 9에서 명령어 최적화 동작에 대하여 보다 상세히 후술한다.
일 실시예에 따르면, 850 동작에서, 전자 장치는 최적화된 Vulkan 명령어를 Vulkan 명령어 버퍼에 저장할 수 있다.
일 실시예에 따르면, 860 동작에서, 전자 장치는 Vulkan 드라이버를 통하여 Vulkan 명령어 버퍼에 저장된 최적화된 Vulkan 명령어를 GPU에 써미션(submission)할 수 있다.
일 실시예에 따르면, 870 동작에서, 전자 장치는 GPU를 통하여 최적화된 Vulkan 명령어를 기반으로 렌더링 기능을 수행할 수 있다,
도 9는 일 실시예에 따른 전자 장치의 명령어 최적화 동작들의 흐름도이다.
일 실시예에 따르면, 910 동작에서, 전자 장치(예: 도 1의 전자 장치(101), 도 3의 전자 장치(300), 또는 도 4의 전자 장치(400))는 Vulkan 상태(state) 및/또는 리소스 정보를 수집할 수 있다. 예를 들어, 전자 장치는 GLES API를 Vulkan API로 변환 후 Vulkan API와 관련된 정보를 수집할 수 있다.
일 실시예에 따르면, 920 동작에서, 전자 장치는 910 동작에서 수집한 정보를 기반으로 렌더링 타겟이 향후 사용되는지 여부를 판단할 수 있다. 예를 들어, 그래픽 파이프라인에서 프래그먼트 셰이더 동작은 각 픽셀의 값을 연산하고, 그 결과를 메모리에 저장하는 동작을 포함할 수 있다. 예를 들어, 렌더링 결과가 저장될 타겟이 향후에 사용되지 않는 경우, 프래그먼트 셰이더 동작은 수행할 필요가 없을 수 있다. 예를 들어, 전자 장치는 렌더링 타겟이 향후 사용되지 않는다고 판단되는 경우 925 동작을 수행하고, 렌더링 타겟이 향후 사용된다고 판단되는 경우 930 동작을 수행할 수 있다.
일 실시예에 따르면, 925 동작에서, 전자 장치는 그래픽 파이프라인 중에서 프래그먼트 셰이더 동작을 수행하지 않고 생략(discard)할 수 있다. 예를 들어, 전자 장치는 불필요한 프래그먼트 동작을 생략함으로써 렌더링 성능을 최적화할 수 있다.
일 실시예에 따르면, 930 동작에서, 전자 장치는 910 동작에서 수집한 정보를 기반으로 뎁스 상태(depth state)가 활성화 상태인지 판단할 수 있다. 일 실시예에 따르면, Vulkan API는 렌더링 결과가 저장될 프레임 버퍼의 정보를 지정해 줄 수 있다. 일 실시예에 따르면, 프레임 버퍼는 색상 값을 저장하는 칼라 버퍼, 뎁스 값을 저장하는 뎁스 버퍼, 및 스텐실 버퍼를 포함할 수 있다. 일 실시예에 따르면, Vulkan 렌더 패스(render pass)는 상기 프레임 버퍼(즉, 칼라 버퍼, 뎁스 버퍼, 및 스텐실 버퍼)가 메모리로 로드 및/또는 저장될지 결정하는 정보를 포함하고 있으며, 해당 정보를 기반으로 렌더 패스가 시작되고 끝나는 지점에서 메모리의 로드 및/또는 저장 동작이 발생할 수 있다. 예를 들어, 그래픽 파이프라인에서 뎁스 상태가 비활성화된 경우, 해당 렌더 패스에서는 뎁스 버퍼를 메모리로 로드하거나 또는 저장할 필요가 없을 수 있다. 일 실시예에 따르면, 전자 장치는 뎁스 상태가 비활성화 상태인 경우 935 동작을 수행하고, 뎁스 상태가 활성화 상태인 경우 940 동작을 수행할 수 있다.
일 실시예에 따르면, 935 동작에서, 전자 장치는 뎁스 버퍼를 비활성화할 수 있다. 예를 들어, 전자 장치는 불필요한 경우에 뎁스 버퍼를 비활성화하여 불필요한 메모리 로드 및/또는 저장 동작이 발생하지 않도록 함으로써, 메모리 대역폭 및 렌더링 성능을 최적화할 수 있다.
일 실시예에 따르면, 940 동작에서, 전자 장치는 GLES API가 화면 영역 설정과 관련된 지정된 API인지 판단할 수 있다. 예를 들어, glScissor API는 화면의 일부만 보여지도록 렌더링 영역을 설정할 수 있도록 하는 GLES API이다. 예를 들어, 렌더링 영역이 설정되는 경우, 전체 화면의 렌더링 결과를 메모리에 저장할 필요가 없을 수 있고, 설정된 영역의 렌더링 결과를 메모리에 저장하는 것이 효율적일 수 있다. 일 실시예에 따르면, 전자 장치는 GLES API가 지정된 API인 경우 945 동작을 수행하고, 지정된 API가 아닌 경우 950 동작을 수행할 수 있다.
일 실시예에 따르면, 945 동작에서, 전자 장치는 렌더링 영역을 설정할 수 있다. 예를 들어, 전자 장치는 Vulkan 렌더 패스를 생성할 때, 이전에 호출된 지정된 API(예: glScissor API)의 정보를 기반으로 렌더링 영역을 설정할 수 있다. 예를 들어, 전자 장치는 렌더링 영역을 설정하여 불필요한 렌더링 결과 값들이 메모리에 저장되지 않도록 하여 렌더링 성능을 최적화할 수 있다.
일 실시예에 따르면, 950 동작에서, 전자 장치는 최적화된 Vulkan 기능(예: 유효한 Vulkan 명령어)을 인식할 수 있다. 예를 들어, 전자 장치는 GLES API를 변환한 Vulkan API 명령어를 최적화를 통하여 유효한 Vulkan 명령어로 재구성할 수 있다. 예를 들어, 전자 장치는 920 내지 945 동작을 통하여 불필요한 Vulkan 명령어를 제거하고, 렌더링 기능 수행에 적합한 Vulkan 명령어를 선택적으로 결정할 수 있다.
일 실시예에 따르면, 전자 장치는 최적화된 Vulkan 기능(예: 유효한 Vulkan 명령어)를 Vulkan 명령어 버퍼에 저장할 수 있다. 예를 들어, Vulkan 명령어 버퍼에 저장된 Vulkan 명령어는 Vulkan 드라이버를 통해 GPU에 써미션(submission)되고, 전자 장치는 GPU에 의해 Vulkan 명령어를 실행하여 렌더링 기능을 수행할 수 있다.
일 실시예에 따른 전자 장치의 API(application program interface) 변환 방법은, 어플리케이션으로부터 제1 타입의 그래픽 API 기반의 기능 수행 요청을 수신하는 동작, 상기 요청에 기반하여, 상기 제1 타입의 그래픽 API 기반의 데이터 및 명령어를 제2 타입의 그래픽 API 기반의 데이터 및 명령어로 변환(translate)하는 동작, 상기 제2 타입의 그래픽 API 기반의 데이터 및 명령어를 가상 명령어 버퍼에 저장하는 동작, 상기 제1 타입의 그래픽 API 기반의 데이터와 관련된 렌더링 타겟 정보, 뎁스 상태(depth state) 정보, 및 상기 제1 타입의 그래픽 API의 속성 중 적어도 하나에 기반하여, 상기 가상 명령어 버퍼에 저장한 제2 타입의 그래픽 API 기반의 데이터 및 명령어를 최적화된 제2 타입의 그래픽 API 기반의 데이터 및 명령어로 재구성하는 동작, 상기 재구성된 제2 타입의 그래픽 API 기반의 데이터 및 명령어를 제2 타입의 그래픽 API 기반의 명령어 버퍼에 저장하는 동작, 및 상기 명령어 버퍼에 저장된 제2 타입의 그래픽 API 기반의 데이터 및 명령어에 기반하여 적어도 하나의 오브젝트를 렌더링하는 동작을 포함할 수 있다.
일 실시예에 따르면, 상기 제1 타입의 그래픽 API는 OpenGL(open graphics library) API 또는 OpenGL ES API를 포함하고, 상기 제2 타입의 그래픽 API는 Vulkan API를 포함할 수 있다.
일 실시예에 따르면, 상기 제1 타입의 그래픽 API 기반의 데이터는, 상기 제1 타입의 그래픽 API의 포맷(format), 상태 정보, 및 리소스 중 적어도 하나를 포함하고, 상기 제2 타입의 그래픽 API 기반의 데이터는, 상기 제2 타입의 그래픽 API의 포맷, 상태 정보, 및 리소스 중 적어도 하나를 포함할 수 있다.
일 실시예에 따르면, 상기 방법은, 상기 제1 타입의 그래픽 API가 인덱스 버퍼(index buffer)를 이용하는 그래픽 API인 경우, 상기 제1 타입의 그래픽 API 기반의 데이터 및 명령어를 상기 제2 타입의 그래픽 API 기반의 데이터 및 명령어로 변환하기 이전에, 상기 인덱스 버퍼를 재구성하는 동작을 더 포함할 수 있다.
일 실시예에 따르면, 상기 인덱스 버퍼를 재구성하는 동작은, 상기 인덱스 버퍼에 저장된 적어도 하나의 버텍스(vertex)의 인덱스 값을 삭제 또는 정렬하여 상기 인덱스 버퍼를 재구성하는 동작을 포함할 수 있다.
일 실시예에 따르면, 상기 재구성하는 동작은, 상기 렌더링 타겟 정보를 기반으로, 그래픽 파이프라인(graphic pipeline)에 포함된 복수 개의 작업들 중에서 프래그먼트 셰이더(fragment shader) 동작을 생략하는 것을 특징으로 할 수 있다.
일 실시예에 따르면, 상기 재구성하는 동작은, 상기 뎁스 상태 정보를 기반으로, 칼라 버퍼(color buffer), 뎁스 버퍼(depth buffer), 및 스텐실 버퍼(stencil buffer)를 포함하는 프레임 버퍼 중 뎁스 버퍼를 비활성화하는 동작을 포함할 수 있다.
일 실시예에 따르면, 상기 재구성하는 동작은, 상기 제1 타입의 그래픽 API가 화면 영역의 설정과 관련된 지정된 API인 경우, 상기 지정된 API와 관련된 정보를 기반으로 상기 제2 타입의 그래픽 API 기반의 명령어에 기반하여 렌더링할 영역을 설정하고 불필요한 렌더링 결과값을 제거하는 동작을 포함할 수 있다.
본 문서에 개시된 다양한 실시예들에 따른 전자 장치는 다양한 형태의 장치가 될 수 있다. 전자 장치는, 예를 들면, 휴대용 통신 장치(예: 스마트폰), 컴퓨터 장치, 휴대용 멀티미디어 장치, 휴대용 의료 기기, 카메라, 웨어러블 장치, 또는 가전 장치를 포함할 수 있다. 본 문서의 실시예에 따른 전자 장치는 전술한 기기들에 한정되지 않는다.
본 문서의 다양한 실시예들 및 이에 사용된 용어들은 본 문서에 기재된 기술적 특징들을 특정한 실시예들로 한정하려는 것이 아니며, 해당 실시예의 다양한 변경, 균등물, 또는 대체물을 포함하는 것으로 이해되어야 한다. 도면의 설명과 관련하여, 유사한 또는 관련된 구성요소에 대해서는 유사한 참조 부호가 사용될 수 있다. 아이템에 대응하는 명사의 단수 형은 관련된 문맥상 명백하게 다르게 지시하지 않는 한, 상기 아이템 한 개 또는 복수 개를 포함할 수 있다. 본 문서에서, "A 또는 B", "A 및 B 중 적어도 하나", "A 또는 B 중 적어도 하나", "A, B 또는 C", "A, B 및 C 중 적어도 하나", 및 "A, B, 또는 C 중 적어도 하나"와 같은 문구들 각각은 그 문구들 중 해당하는 문구에 함께 나열된 항목들 중 어느 하나, 또는 그들의 모든 가능한 조합을 포함할 수 있다. "제 1", "제 2", 또는 "첫째" 또는 "둘째"와 같은 용어들은 단순히 해당 구성요소를 다른 해당 구성요소와 구분하기 위해 사용될 수 있으며, 해당 구성요소들을 다른 측면(예: 중요성 또는 순서)에서 한정하지 않는다. 어떤(예: 제 1) 구성요소가 다른(예: 제 2) 구성요소에, "기능적으로" 또는 "통신적으로"라는 용어와 함께 또는 이런 용어 없이, "커플드" 또는 "커넥티드"라고 언급된 경우, 그것은 상기 어떤 구성요소가 상기 다른 구성요소에 직접적으로(예: 유선으로), 무선으로, 또는 제 3 구성요소를 통하여 연결될 수 있다는 것을 의미한다.
본 문서의 다양한 실시예들에서 사용된 용어 "모듈"은 하드웨어, 소프트웨어 또는 펌웨어로 구현된 유닛을 포함할 수 있으며, 예를 들면, 로직, 논리 블록, 부품, 또는 회로와 같은 용어와 상호 호환적으로 사용될 수 있다. 모듈은, 일체로 구성된 부품 또는 하나 또는 그 이상의 기능을 수행하는, 상기 부품의 최소 단위 또는 그 일부가 될 수 있다. 예를 들면, 일 실시예에 따르면, 모듈은 ASIC(application-specific integrated circuit)의 형태로 구현될 수 있다.
본 문서의 다양한 실시예들은 기기(machine)(예: 전자 장치(101)) 의해 읽을 수 있는 저장 매체(storage medium)(예: 내장 메모리(136) 또는 외장 메모리(138))에 저장된 하나 이상의 명령어들을 포함하는 소프트웨어(예: 프로그램(140))로서 구현될 수 있다. 예를 들면, 기기(예: 전자 장치(101))의 프로세서(예: 프로세서(120))는, 저장 매체로부터 저장된 하나 이상의 명령어들 중 적어도 하나의 명령을 호출하고, 그것을 실행할 수 있다. 이것은 기기가 상기 호출된 적어도 하나의 명령어에 따라 적어도 하나의 기능을 수행하도록 운영되는 것을 가능하게 한다. 상기 하나 이상의 명령어들은 컴파일러에 의해 생성된 코드 또는 인터프리터에 의해 실행될 수 있는 코드를 포함할 수 있다. 기기로 읽을 수 있는 저장 매체는, 비일시적(non-transitory) 저장 매체의 형태로 제공될 수 있다. 여기서, ‘비일시적’은 저장 매체가 실재(tangible)하는 장치이고, 신호(signal)(예: 전자기파)를 포함하지 않는다는 것을 의미할 뿐이며, 이 용어는 데이터가 저장 매체에 반영구적으로 저장되는 경우와 임시적으로 저장되는 경우를 구분하지 않는다.
일 실시예에 따르면, 본 문서에 개시된 다양한 실시예들에 따른 방법은 컴퓨터 프로그램 제품(computer program product)에 포함되어 제공될 수 있다. 컴퓨터 프로그램 제품은 상품으로서 판매자 및 구매자 간에 거래될 수 있다. 컴퓨터 프로그램 제품은 기기로 읽을 수 있는 저장 매체(예: compact disc read only memory(CD-ROM))의 형태로 배포되거나, 또는 어플리케이션 스토어(예: 플레이 스토어™)를 통해 또는 두 개의 사용자 장치들(예: 스마트 폰들) 간에 직접, 온라인으로 배포(예: 다운로드 또는 업로드)될 수 있다. 온라인 배포의 경우에, 컴퓨터 프로그램 제품의 적어도 일부는 제조사의 서버, 어플리케이션 스토어의 서버, 또는 중계 서버의 메모리와 같은 기기로 읽을 수 있는 저장 매체에 적어도 일시 저장되거나, 임시적으로 생성될 수 있다.
다양한 실시예들에 따르면, 상기 기술한 구성요소들의 각각의 구성요소(예: 모듈 또는 프로그램)는 단수 또는 복수의 개체를 포함할 수 있으며, 복수의 개체 중 일부는 다른 구성요소에 분리 배치될 수도 있다. 다양한 실시예들에 따르면, 전술한 해당 구성요소들 중 하나 이상의 구성요소들 또는 동작들이 생략되거나, 또는 하나 이상의 다른 구성요소들 또는 동작들이 추가될 수 있다. 대체적으로 또는 추가적으로, 복수의 구성요소들(예: 모듈 또는 프로그램)은 하나의 구성요소로 통합될 수 있다. 이런 경우, 통합된 구성요소는 상기 복수의 구성요소들 각각의 구성요소의 하나 이상의 기능들을 상기 통합 이전에 상기 복수의 구성요소들 중 해당 구성요소에 의해 수행되는 것과 동일 또는 유사하게 수행할 수 있다. 다양한 실시예들에 따르면, 모듈, 프로그램 또는 다른 구성요소에 의해 수행되는 동작들은 순차적으로, 병렬적으로, 반복적으로, 또는 휴리스틱하게 실행되거나, 상기 동작들 중 하나 이상이 다른 순서로 실행되거나, 생략되거나, 또는 하나 이상의 다른 동작들이 추가될 수 있다.

Claims (15)

  1. 전자 장치에 있어서,
    메모리; 및
    상기 메모리에 작동적으로(operatively) 연결된 프로세서를 포함하고,
    상기 메모리는, 실행 시, 상기 프로세서가,
    어플리케이션으로부터 제1 타입의 그래픽 API(graphics application program interface) 기반의 기능 수행 요청을 수신하고,
    상기 요청에 기반하여, 상기 제1 타입의 그래픽 API 기반의 데이터 및 명령어를 제2 타입의 그래픽 API 기반의 데이터 및 명령어로 변환(translate)하고,
    상기 제2 타입의 그래픽 API 기반의 데이터 및 명령어를 가상 명령어 버퍼에 저장하고,
    상기 제1 타입의 그래픽 API 기반의 데이터와 관련된 렌더링 타겟 정보, 뎁스 상태(depth state) 정보, 및 상기 제1 타입의 그래픽 API의 속성 중 적어도 하나에 기반하여, 상기 가상 명령어 버퍼에 저장한 제2 타입의 그래픽 API 기반의 데이터 및 명령어를 최적화된 제2 타입의 그래픽 API 기반의 데이터 및 명령어로 재구성하고,
    상기 재구성된 제2 타입의 그래픽 API 기반의 데이터 및 명령어를 제2 타입의 그래픽 API 기반의 명령어 버퍼에 저장하도록 하는 인스트럭션들(instructions)을 저장하는 전자 장치.
  2. 청구항 1에 있어서,
    상기 제1 타입의 그래픽 API는 OpenGL(open graphics library) API 또는 OpenGL ES(OpenGL for embedded systems) API를 포함하고, 상기 제2 타입의 그래픽 API는 Vulkan API를 포함하는 전자 장치.
  3. 청구항 1에 있어서,
    상기 제1 타입의 그래픽 API 기반의 데이터는, 상기 제1 타입의 그래픽 API의 포맷(format), 상태 정보, 및 리소스 중 적어도 하나를 포함하고, 상기 제2 타입의 그래픽 API 기반의 데이터는, 상기 제2 타입의 그래픽 API의 포맷, 상태 정보, 및 리소스 중 적어도 하나를 포함하는 전자 장치.
  4. 청구항 1에 있어서,
    상기 인스트럭션들은, 실행 시, 상기 프로세서가,
    상기 제1 타입의 그래픽 API가 인덱스 버퍼(index buffer)를 이용하는 그래픽 API인 경우, 상기 제1 타입의 그래픽 API 기반의 데이터 및 명령어를 상기 제2 타입의 그래픽 API 기반의 데이터 및 명령어로 변환하기 이전에, 상기 인덱스 버퍼를 재구성하도록 하는 전자 장치.
  5. 청구항 4에 있어서,
    상기 인스트럭션들은, 실행 시, 상기 프로세서가,
    상기 인덱스 버퍼에 저장된 적어도 하나의 버텍스(vertex)의 인덱스 값을 삭제 또는 정렬하여 상기 인덱스 버퍼를 재구성하도록 하는 전자 장치.
  6. 청구항 1에 있어서,
    상기 인스트럭션들은, 실행 시, 상기 프로세서가,
    상기 명령어 버퍼에 저장된 제2 타입의 그래픽 API 기반의 명령어에 기반하여 적어도 하나의 오브젝트를 렌더링하도록 하는 전자 장치.
  7. 청구항 6에 있어서,
    상기 인스트럭션들은, 실행 시, 상기 프로세서가,
    상기 렌더링 타겟 정보를 기반으로, 그래픽 파이프라인(graphic pipeline)에 포함된 복수 개의 작업들 중에서 적어도 일부를 생략하도록 하는 전자 장치.
  8. 청구항 7에 있어서,
    상기 복수 개의 작업들 중에서 적어도 일부는 프래그먼트 셰이더(fragment shader) 동작을 포함하는 전자 장치.
  9. 청구항 6에 있어서,
    상기 메모리는 렌더링 결과를 저장하고, 칼라 버퍼(color buffer), 뎁스 버퍼(depth buffer), 및 스텐실 버퍼(stencil buffer)를 포함하는 프레임 버퍼를 포함하고,
    상기 인스트럭션들은, 실행 시, 상기 프로세서가,
    상기 뎁스 상태 정보를 기반으로 프레임 버퍼 중 뎁스 버퍼를 비활성화하도록 하는 전자 장치.
  10. 청구항 6에 있어서,
    상기 인스트럭션들은, 실행 시, 상기 프로세서가,
    상기 제1 타입의 그래픽 API가 화면 영역의 설정과 관련된 지정된 API인 경우, 상기 지정된 API와 관련된 정보를 기반으로 상기 제2 타입의 그래픽 API 기반의 명령어에 기반하여 렌더링할 영역을 설정하고 불필요한 렌더링 결과값을 제거하도록 하는 전자 장치.
  11. 청구항 10에 있어서,
    상기 지정된 API는 openGL API 중 glScissor API를 포함하는 전자 장치.
  12. 청구항 1에 있어서,
    상기 인스트럭션들은, 실행 시, 상기 프로세서가,
    상기 제1 타입의 그래픽 API의 포맷을 상기 제2 타입의 그래픽 API의 포맷으로 변환하고,
    상기 제1 타입의 그래픽 API의 상태 정보를 기반으로 상기 제2 타입의 그래픽 API의 상태 정보를 설정하고,
    상기 제1 타입의 상기 제2 타입의 그래픽 API 기반의 리소스를 할당하고,
    제1 타입의 그래픽 API 기반의 명령어를 상기 제2 타입의 그래픽 API 기반의 명령어로 변환하도록 하는 전자 장치.
  13. 전자 장치의 API(application program interface) 변환 방법에 있어서,
    어플리케이션으로부터 제1 타입의 그래픽 API 기반의 기능 수행 요청을 수신하는 동작;
    상기 요청에 기반하여, 상기 제1 타입의 그래픽 API 기반의 데이터 및 명령어를 제2 타입의 그래픽 API 기반의 데이터 및 명령어로 변환(translate)하는 동작;
    상기 제2 타입의 그래픽 API 기반의 데이터 및 명령어를 가상 명령어 버퍼에 저장하는 동작;
    상기 제1 타입의 그래픽 API 기반의 데이터와 관련된 렌더링 타겟 정보, 뎁스 상태(depth state) 정보, 및 상기 제1 타입의 그래픽 API의 속성 중 적어도 하나에 기반하여, 상기 가상 명령어 버퍼에 저장한 제2 타입의 그래픽 API 기반의 데이터 및 명령어를 최적화된 제2 타입의 그래픽 API 기반의 데이터 및 명령어로 재구성하는 동작;
    상기 재구성된 제2 타입의 그래픽 API 기반의 데이터 및 명령어를 제2 타입의 그래픽 API 기반의 명령어 버퍼에 저장하는 동작; 및
    상기 명령어 버퍼에 저장된 제2 타입의 그래픽 API 기반의 데이터 및 명령어에 기반하여 적어도 하나의 오브젝트를 렌더링하는 동작을 포함하는 전자 장치의 API 변환 방법.
  14. 청구항 13에 있어서,
    상기 제1 타입의 그래픽 API가 인덱스 버퍼(index buffer)를 이용하는 그래픽 API인 경우, 상기 제1 타입의 그래픽 API 기반의 데이터 및 명령어를 상기 제2 타입의 그래픽 API 기반의 데이터 및 명령어로 변환하기 이전에, 상기 인덱스 버퍼를 재구성하는 동작을 더 포함하는 전자 장치의 API 변환 방법.
  15. 청구항 13에 있어서,
    상기 재구성하는 동작은,
    상기 뎁스 상태 정보를 기반으로, 칼라 버퍼(color buffer), 뎁스 버퍼(depth buffer), 및 스텐실 버퍼(stencil buffer)를 포함하는 프레임 버퍼 중 뎁스 버퍼를 비활성화하는 동작을 포함하는 전자 장치의 API 변환 방법.
PCT/KR2022/005846 2021-04-26 2022-04-25 전자 장치 및 전자 장치의 api 변환 방법 WO2022231230A1 (ko)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR10-2021-0053645 2021-04-26
KR1020210053645A KR20220146863A (ko) 2021-04-26 2021-04-26 전자 장치 및 전자 장치의 api 변환 방법

Publications (1)

Publication Number Publication Date
WO2022231230A1 true WO2022231230A1 (ko) 2022-11-03

Family

ID=83848226

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2022/005846 WO2022231230A1 (ko) 2021-04-26 2022-04-25 전자 장치 및 전자 장치의 api 변환 방법

Country Status (2)

Country Link
KR (1) KR20220146863A (ko)
WO (1) WO2022231230A1 (ko)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8347275B2 (en) * 2006-04-20 2013-01-01 Stmicroelectronics, Inc. OpenGL to OpenGL/ES translator and OpenGL/ES simulator
KR101566508B1 (ko) * 2008-12-18 2015-11-05 삼성전자주식회사 메모리 가상화를 구현한 그래픽 처리 방법 및 그 장치
KR101770299B1 (ko) * 2011-01-18 2017-09-05 삼성전자주식회사 데이터 전송 방법 및 장치와 데이터 처리 방법 및 장치
KR20180023326A (ko) * 2016-08-25 2018-03-07 삼성전자주식회사 전자 장치 및 이미지 센서로부터 획득된 이미지를 어플리케이션으로 전달하기 위한 방법
US20200126177A1 (en) * 2015-10-21 2020-04-23 Channel One Holdings Inc. Systems and methods for using an opengl api with a vulkan graphics driver

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8347275B2 (en) * 2006-04-20 2013-01-01 Stmicroelectronics, Inc. OpenGL to OpenGL/ES translator and OpenGL/ES simulator
KR101566508B1 (ko) * 2008-12-18 2015-11-05 삼성전자주식회사 메모리 가상화를 구현한 그래픽 처리 방법 및 그 장치
KR101770299B1 (ko) * 2011-01-18 2017-09-05 삼성전자주식회사 데이터 전송 방법 및 장치와 데이터 처리 방법 및 장치
US20200126177A1 (en) * 2015-10-21 2020-04-23 Channel One Holdings Inc. Systems and methods for using an opengl api with a vulkan graphics driver
KR20180023326A (ko) * 2016-08-25 2018-03-07 삼성전자주식회사 전자 장치 및 이미지 센서로부터 획득된 이미지를 어플리케이션으로 전달하기 위한 방법

Also Published As

Publication number Publication date
KR20220146863A (ko) 2022-11-02

Similar Documents

Publication Publication Date Title
WO2021206415A1 (en) Electronic device for communicating in augmented reality and method thereof
WO2022108192A1 (ko) 전자 장치 및 전자 장치의 멀티윈도우 제어방법
WO2022119276A1 (ko) 플렉서블 디스플레이 전자 장치 및 그 동작 방법
WO2022231230A1 (ko) 전자 장치 및 전자 장치의 api 변환 방법
WO2022177162A1 (ko) 어플리케이션의 모델 파일을 초기화하는 프로세서 및 이를 포함하는 전자 장치
WO2022154264A1 (ko) 전자 장치 및 전자 장치의 동작 방법
WO2022196939A1 (ko) 대체 컨텐츠를 제공하는 전자 장치 및 그의 동작 방법
WO2022154337A1 (ko) 이미지를 업스케일하는 전자 장치 및 이의 제어 방법
WO2022103019A1 (ko) 전자 장치 및 전자 장치의 어플리케이션 실행 방법
WO2022030890A1 (ko) 다중 윈도우 이미지 캡쳐 방법 및 이를 위한 전자 장치
WO2022086272A1 (ko) 사용자 인터페이스를 제공하는 전자 장치 및 그 방법
WO2021256800A1 (ko) 전자 장치 및 전자 장치에서 이미지 생성 방법
WO2024014695A1 (ko) 상호작용에 의해 획득된 순서에 기반하여 패키지들을 컴파일하는 전자 장치 및 방법
WO2023113167A1 (ko) 전자 장치 및 이의 동작 방법
WO2022010092A1 (ko) 컨텐츠 공유를 지원하는 전자 장치
WO2023287012A1 (ko) 외부 장치의 성능에 기반하여 컨텐츠 생성 방법 및 전자 장치
WO2022181949A1 (ko) Ar/vr 환경을 제공하는 전자 장치 및 그 운용 방법
WO2021256717A1 (ko) 데이터 스와핑 방법 및 이를 지원하는 전자 장치
WO2022177120A1 (ko) 전자 장치 및 전자 장치의 제어 방법
WO2022080652A1 (ko) 저널 파일을 관리하는 전자 장치 및 이의 동작 방법
WO2022025375A1 (ko) 오디오의 채널의 수를 변환하는 전자 장치 및 전자 장치의 동작 방법
WO2022211307A1 (ko) 올웨이즈 온 디스플레이 컨텐트를 표시를 지원하는 전자 장치 및 이의 제어 방법
WO2022119110A1 (ko) 하이퍼바이저를 이용한 가상 머신 모니터링 방법 및 이를 지원하는 전자 장치
WO2024025194A1 (ko) 알림과 관련된 동작을 수행하기 위한 방법 및 이를 지원하는 전자 장치
WO2023146077A1 (ko) 가상 키보드 상의 터치 입력으로부터 사용자 의도를 인식하기 위한 전자 장치, 방법, 및 비일시적 컴퓨터 판독가능 저장 매체

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22796063

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22796063

Country of ref document: EP

Kind code of ref document: A1