WO2022103225A1 - 전자 장치 및 전자 장치의 이미지 렌더링 방법 - Google Patents

전자 장치 및 전자 장치의 이미지 렌더링 방법 Download PDF

Info

Publication number
WO2022103225A1
WO2022103225A1 PCT/KR2021/016648 KR2021016648W WO2022103225A1 WO 2022103225 A1 WO2022103225 A1 WO 2022103225A1 KR 2021016648 W KR2021016648 W KR 2021016648W WO 2022103225 A1 WO2022103225 A1 WO 2022103225A1
Authority
WO
WIPO (PCT)
Prior art keywords
frame
electronic device
thread
display
time
Prior art date
Application number
PCT/KR2021/016648
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
Priority claimed from KR1020210052642A external-priority patent/KR20220065650A/ko
Application filed by 삼성전자 주식회사 filed Critical 삼성전자 주식회사
Priority to US17/544,411 priority Critical patent/US11935149B2/en
Publication of WO2022103225A1 publication Critical patent/WO2022103225A1/ko

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/25Output arrangements for video game devices
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/52Controlling the output signals based on the game progress involving aspects of the displayed game scene
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/80Special adaptations for executing a specific game genre or game mode
    • A63F13/837Shooting of targets

Definitions

  • This document relates to an electronic device, for example, an electronic device capable of adjusting a frame rate when rendering image content, and an image rendering method of the electronic device.
  • an electronic device represented by a smart phone
  • the electronic device may provide various user experiences to users by installing and executing various applications.
  • An application such as a game may generate image content in real time and provide it on a display.
  • the electronic device may render image content generated by an application using various graphic application programming interfaces (APIs) and display it on a display.
  • the electronic device may schedule an output timing of each frame of the image content to output the image content on the display according to a given frame rate.
  • APIs graphic application programming interfaces
  • the graphic API may provide the vertical synchronization signal provided from the display subsystem to the application, and the application may perform frame pacing.
  • the application may adjust the output timing of the image frame according to the target frame rate, but it may be difficult to accurately match the timing at which the corresponding image frame is output on the display.
  • Some of the graphic APIs usable in the electronic device may provide a function of setting timing for when the currently rendered image frame is output on the display. However, even if the corresponding graphic API is used, it may be difficult to schedule an accurate output timing of an image frame to be rendered in the future because information on a frame currently being rendered cannot be obtained because information on frames that have already been output in the past is provided.
  • An electronic device may include a display, a memory, and a processor operatively connected to the display and the memory.
  • the processor in response to the execution of the application, a main thread related to user input and data processing on the application, and a render thread that renders image data in units of frames based on data processed in the main thread ( render thread), set a target frame rate for displaying the execution screen of the application on the display, and expected processing of the current frame based on the processing time of at least one previous frame output through the display calculating a time, determining a time margin based on the target frame rate and the calculated expected processing time, and after the main thread sleeps for the time margin, the user input and It can be set to perform data processing.
  • An image rendering method of an electronic device includes a main thread related to a user input and data processing in the application in response to execution of an application, and a frame unit based on data processed in the main thread
  • An operation of creating a render thread for rendering raw image data, an operation of setting a target frame rate for displaying the execution screen of the application on the display, and processing of at least one previous frame output through the display calculating an expected processing time of the current frame based on time, determining a time margin based on the target frame rate and the calculated expected processing time, and causing the main thread to execute the time margin It may include an operation of performing the user input and data processing after waiting in the sleep state for a while.
  • an electronic device capable of outputting image content at a stable and uniform frame interval according to a target frame rate and an image rendering method of the electronic device when rendering image content.
  • FIG. 1 is a block diagram of an electronic device in a network environment, according to various embodiments of the present disclosure
  • FIG. 2 is a block diagram of an electronic device according to various embodiments of the present disclosure.
  • FIG. 3 is a block diagram of a configuration used for image rendering according to various embodiments of the present disclosure.
  • FIG. 4 is a diagram illustrating processing of each frame in an embodiment in which the timing extension function of the graphic API is not used.
  • FIG. 5 is a diagram illustrating a process of processing each frame in an embodiment using the timing extension function of the graphic API.
  • FIG. 6 is a diagram illustrating a process of processing each frame in an embodiment in which the timing extension function of the graphic API is used and the present timing is adjusted.
  • FIG. 7 illustrates a processing process of each frame in an embodiment in which the present operation is processed by the render thread of the CPU.
  • FIG. 8 shows the processing process of each frame in an embodiment in which the present operation is processed by the swap chain thread.
  • FIG. 9 shows a processing process of each frame in an embodiment in which GPU vertex processing and fragment processing are processed in parallel.
  • FIG. 10 illustrates an example of a thread executed in a game engine before using a sync frame end (SFE).
  • SFE sync frame end
  • FIG. 11 illustrates an example of a thread executed in a game engine after using SFE.
  • FIG. 12 is a flowchart of an image rendering method of an electronic device according to various embodiments of the present disclosure.
  • 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 may be included.
  • at least one of these components eg, the connection terminal 178
  • may be omitted or one or more other components may be added to the electronic device 101 .
  • 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 the volatile memory 132 , and may 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 the volatile memory 132 , and may 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 the 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).
  • the main processor 121 e.g, 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 main processor 121 e.g, 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 main processor 121 e.g, a central processing unit or an application processor
  • a secondary processor 123
  • the auxiliary processor 123 is, for example, on behalf of the main processor 121 while the main processor 121 is in an inactive (eg, sleep) state, or 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 co-processor 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. there is.
  • 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 of the electronic device 101 (eg, the processor 120 or the sensor module 176 ).
  • 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 in 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 may be used to receive an incoming call. 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 ) connected directly or wirelessly with the electronic device 101 . A sound may be output through the electronic device 102 (eg, a speaker or headphones).
  • an external electronic device eg, a sound output module 155
  • a sound may be output through 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, 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 designated 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.
  • HDMI high definition multimedia interface
  • USB universal serial bus
  • SD card interface Secure Digital Card
  • 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 LAN (local area network) communication module, or a power line communication module).
  • GNSS global navigation satellite system
  • 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 the 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 .
  • 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 includes various technologies 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 specified 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).
  • 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, bottom side) 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 a part of operations executed in the electronic device 101 may be executed in 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.
  • 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.
  • 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 be used simply to distinguish the element from other elements in question, and may refer to elements in 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
  • one or more instructions stored in a storage medium may be implemented as software (eg, the program 140) including
  • a processor eg, processor 120
  • a device eg, 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 include 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 as included in a 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 machine-readable storage medium (eg compact disc read only memory (CD-ROM)), or via an application store (eg Play Store TM ) or on two user devices ( It can be distributed online (eg download or upload), directly between smartphones (eg smartphones).
  • a part of the computer program product may be temporarily stored or temporarily generated 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, module or 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. there is.
  • 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.
  • FIG. 2 is a block diagram of an electronic device according to various embodiments of the present disclosure.
  • the electronic device 200 may include a display 230 , a memory 220 , and a processor 210 . Some of the illustrated components may be omitted or substituted, or other components may be added.
  • the electronic device 200 may further include at least some of the configurations and/or functions of the electronic devices 200 and 101 of FIG. 1 . At least some of the respective components of the illustrated (or not illustrated) electronic device 200 may be operatively, functionally, and/or electrically connected.
  • the display 230 may be one of a liquid crystal display (LCD), a light-emitting diode (LED) display, and an organic light-emitting diode (OLED) display. Any one may be implemented, but is not limited thereto.
  • the display 230 may be configured as a touch screen that senses a touch and/or proximity touch (or hovering) input using a user's body part (eg, a finger) or an input device (eg, a stylus pen). At least a part of the display 230 may be flexible, and may be implemented as a foldable display or a rollable display.
  • the display 230 may include at least some of the configuration and/or functions of the display module 160 of FIG. 1 .
  • the memory 220 may temporarily or permanently store various data, including volatile memory and non-volatile memory.
  • the memory 220 may include at least some of the configuration and/or functions of the memory 130 of FIG. 1 , and may store the program 140 of FIG. 1 .
  • the memory 220 may store various instructions that may be executed by the processor 210 .
  • Such instructions may include control commands such as arithmetic and logical operations, data movement, and input/output that can be recognized by the processor 210 .
  • the processor 210 is a configuration capable of performing an operation or data processing related to control and/or communication of each component of the electronic device 200 , and may be composed of one or more processors 210 .
  • the processor 210 may include at least some of the configuration and/or functions of the processor 120 of FIG. 1 .
  • the electronic device 200 determines a target frame rate (or target fps).
  • a target frame rate or target fps.
  • Various embodiments related to a frame pacing operation in which each frame constituting an execution screen of an application is displayed at a uniform cycle according to (frame per second) will be described below. ) will describe the content related to graphic processing during operation of the game application, but various embodiments may be applied to various applications other than the game application.
  • the processor 210 may include a CPU and a GPU.
  • the central processing unit may perform various arithmetic processing operations defined in the application when the application is executed, and may perform processing corresponding to a user input on the display 230 .
  • a graphic processing unit may perform a rendering operation of image data processed on the display 230 .
  • the processor 210 may be designed as a single system on chip (SoC) including a CPU and a GPU, and at least some of the operations of the processor 210 to be described below are respectively performed by the CPU or the GPU, or divided between the CPU and the GPU. and can be performed.
  • SoC system on chip
  • a main thread and a render thread corresponding to the execution of an application may be generated.
  • the main thread and the render thread may be executed on a game engine or a framework.
  • the main thread may include various operation processing operations related to the operation of the game application, and the render thread may include an operation of rendering image data based on data processed in the main thread.
  • the main thread may be referred to as a game thread.
  • the processor 210 may generate image data generated by an application in units of frames. According to an embodiment, the processor 210 may acquire a frame, draw it, and then transmit a present command. For example, the processor 210 configures a front buffer and a back buffer through a multiple buffering method, draws an image in the back buffer, and then swaps the front buffer and the back buffer ( swap), outputting the image drawn in the swapped front buffer on the display 230, and repeating the process of drawing a new image frame in the back buffer again.
  • the present command is a process of exchanging the pointers of the back buffer and the front buffer, and according to the present command, the GPU can render the image frame stored in the swapped front buffer.
  • the GPU renders the received frame data according to the present command and transmits it to the surface flinger, which composes the data in the swapped front buffer and displays it (230). ) can be printed.
  • the display 230 may refresh the frame according to a predetermined refresh rate. For example, when the display 230 operates at 60 fps, it may be refreshed according to the vertical synchronization signal V-sync every about 16.6 ms, and the refresh rate may be variable.
  • the processor 210 may set a target frame rate when an image is output on the display 230 .
  • the target frame rate (or target fps) may be determined according to a running application, and may be changed according to an operation mode set by a user.
  • the electronic device 200 needs to display each frame of image data on the display 230 at equal intervals according to the target frame rate.
  • three embodiments related to a frame pacing operation for uniformly adjusting an output period of a frame to match a target frame rate will be described.
  • First to third embodiments to be described later are not mutually exclusive embodiments, and the electronic device 200 may use all of the first to third embodiments or only some of the first to third embodiments according to circumstances.
  • the processor 210 when the processor 210 (eg, CPU) receives present information for a specific frame from the game engine or the framework, it is received after the rendering operation for the previous frame of the specific frame is finished.
  • a present command corresponding to the displayed present information may be transmitted to the GPU.
  • the processor 210 may process the rendered frame after a predetermined delay time after the rendering operation of the GPU is completed.
  • the processor 210 may use a timing extension function of the graphics API.
  • the graphics API may be a Vulkan API
  • the timing extension function may be a Google display timing extension function of the Vulkan API.
  • the timing extension function may be a function of obtaining output timing information of the display 230 for rendering results of previous frames and setting when an image to be presented later is output to the display 230 .
  • the processor 210 uses the timing extension function, when the GPU finishes rendering the frame, the surface flinger synthesizes the rendered frame after a predetermined delay time, and then through the display 230 at the vertical synchronization timing. A corresponding frame may be output.
  • timing extension function it may be difficult to schedule an accurate output timing of an image to be rendered in the future because the delay time is determined according to the processing time of past frames. Accordingly, some frames may be output during a shorter or longer period than other frames.
  • the processor 210 does not perform the present immediately even when a present command is received from the game engine or the framework, and waits until the GPU rendering operation of the previous frame is finished. present can be performed.
  • the first embodiment will be described in more detail with reference to FIGS. 4 to 6 .
  • the processor 210 may perform an operation related to the present of a frame through a swap chain thread.
  • the swap chain thread may be a thread that swaps the front buffer and back buffer according to the present command.
  • the swap chain thread can be executed independently and in parallel with the main thread.
  • the main thread of the game engine or framework executes the present command, it can wait for the present of the next frame until the GPU rendering of the previous frame is completed. In this case, a specific frame may be displayed for a long period that does not fit the target fps.
  • the synchronization of interference between the main thread of the game engine or framework and the GPU is minimized when present is performed, so that the display 230 outputs each frame according to the target fps. can do.
  • the processor 210 calculates the expected processing time of the current frame based on the processing time of at least one previous frame output through the display 230 , and the target frame rate and the calculated expected processing time Based on , a time margin (or SyncFrameEnd (SFE)) may be determined, and the main thread may wait for the time margin in a sleep state and then process user input and data.
  • the processor 210 may calculate an expected processing time based on a difference between present times of at least one previous frame.
  • user input processing and execution of game logic may be completed on the main thread while image frames are being processed on the render thread.
  • the main thread may wait for the render thread to finish processing the frame.
  • the rendering procedure of the image since the work on the previous frame of the GPU may not be completed at the time of the acquire execution of the render thread, the rendering procedure of the image may be delayed.
  • the main thread may wait for the SFE period without immediately processing the user input.
  • the main thread may then process user input and perform game logic after the SFE has elapsed, thereby securing additional time for the render thread to process the previous frame, and shortening the execution time of ACQUIRE.
  • the third embodiment will be described in more detail with reference to FIGS. 10 to 11 .
  • FIG. 3 is a block diagram of a configuration used for image rendering according to various embodiments of the present disclosure.
  • the game engine 310 may use the graphics API 320 (eg, Vulkan API) to draw an image frame according to a target frame rate.
  • the graphics API 320 eg, Vulkan API
  • the frame pacer 340 performs an operation between the game engine 310 and the graphic API 320, and provides various action can be performed.
  • a present command corresponding to the present information received may be transmitted to the GPU 330 .
  • the frame pacer 340 may perform an operation related to the present of a frame through a swap chain thread.
  • the game engine 310 may transmit a present command to the frame pacer 340 instead of directly calling a function that draws an image (eg, vkQueuepresentKHR).
  • the frame pacer 340 does not perform the present immediately, but passes it to the swap chain thread 342, and the swap chain thread 342 waits until the GPU 330 rendering of the previous frame is completed before sending the present (eg vkQueuepresentKHR). can be done
  • the frame pacer 340 calculates an expected processing time of the current frame based on the processing time of at least one previous frame output through the display, and the target frame Based on the rate and the calculated expected processing time, a time margin (or SyncFrameEnd (SFE)) is determined, and a user input after the main thread (or game thread) 312 sleeps for the time margin and waits. and data processing.
  • the frame pacer 340 informs the main thread 312 and/or the render thread 314 of the frame start and end times of the game engine 310 that match the target fps, thereby providing smooth animation and frames. You can provide time.
  • FIG. 4 is a diagram illustrating processing of each frame in an embodiment in which the timing extension function of the graphic API is not used.
  • each period (t n - t n-1 ) is a refresh interval of the display, and when the display operates at 60 fps (frame per second), the refresh interval may be about 16.6 ms .
  • the display may output an image frame according to the vertical synchronization signal V-sync at t n timing, and one frame may be displayed for n periods.
  • V-sync vertical synchronization signal
  • the CPU 410 may start rendering according to the V-sync cycle from the application (or game engine) using a predetermined class (eg, choreographer). For example, while the CPU 410 is operating, the application may render each frame every two V-sync cycles t 1 , t 3 , and t 5 .
  • a predetermined class eg, choreographer
  • the GPU 420 when the GPU 420 transmits a present command from the CPU 410 , the GPU 420 starts rendering the corresponding frame, and the CPU 410 when the GPU 420 completes the rendering of the frame. can wait until
  • the surface flinger 430 composes the data stored in the back buffer in accordance with the immediately following V-sync signal when the present command of the CPU 410 is outputted to the display 440 .
  • the surface flinger 430 may wait until the rendering operation of the GPU 420 is completed, and then output frame data to the display 440 at the V-sync timing after the rendering operation is completed. For example, since the rendering operation of the first frame of the GPU 420 is completed between t 4 -t 5 in the surface flinger 430, the surface flinger 430 waits for a time during which the GPU 420 rendering is performed, and then composes the composition from the completion time.
  • An operation may be performed, and frame data may be output to the display 440 at t 5 .
  • the surface flinger 430 may perform a composition operation after the rendering operation of the second frame of the GPU 420 is completed, and may output frame data to the display 440 at t 6 .
  • frame 1 may be displayed for one period, and frames 2 and 3 may be displayed for two periods. Accordingly, in the present embodiment, a partial error may occur from the intended 30 fps.
  • FIG. 5 is a diagram illustrating a process of processing each frame in an embodiment using the timing extension function of the graphic API.
  • the surface flinger 530 may adjust the display timing of the rendered frame by applying a timing extension function (eg, Vulkan Google Display Timing Extension) of a graphics API (eg, Vulkan API).
  • the timing extension function may be a function of delaying the processing timing of the surface flanger 530 so that the presented frame is output at a time when it is actually output to the display 540 .
  • the GPU 520 performs rendering according to the present command for frame 1 of the CPU 510 , and the surface flinger 530 performs a composition operation immediately even when the GPU 520 rendering is finished. Instead, it can be performed just before the next V -sync, t5.
  • the output period of each frame may be equally adjusted using the timing extension function, but in the case of FIG. 5 , the delay time prediction of the surface flinger 530 may not be accurate.
  • the timing extension function provides timing information of past frames, but since the frame immediately preceding the current GPU 520 is rendering has not yet been output to the display 540, since there is no information about the frame, it is difficult to predict the correct frame start time. is difficult
  • frame 1 may be displayed for one period and frames 2 and 3 may be displayed for two periods as in FIG. 4 . Therefore, even in this embodiment, there may be some error from the intended 30 fps.
  • FIG. 6 is a diagram illustrating a process of processing each frame in an embodiment in which the timing extension function of the graphic API is used and the present timing is adjusted.
  • the present may be performed after waiting until the rendering operation of the GPU 620 of the previous frame is finished without performing the present immediately.
  • the CPU 610 may wait without presenting the second frame until the GPU 620 rendering of the first frame is completed.
  • the CPU 610 performs the present of the second frame, and accordingly, the rendering time of the GPU 620 of the second frame may be delayed.
  • the surface flinger 630 may perform the composition operation after a predetermined delay time without performing the composition operation immediately after rendering by the GPU 620 of each frame by using the timing extension function.
  • frame 1 is displayed on the display 640 during the period t 6 - t 8 2 can be displayed on the Thereafter, the second frame and the third frame may also be displayed for two periods, so that each frame may be displayed on the display 640 in accordance with the target fps of 30 fps.
  • the present operation since the present operation waits until the completion of the GPU 620 of the previous frame, it is possible to calculate the timing at which the previous frame is output to the display 640 at any time. In this way, when presenting is performed in the CPU 610 in consideration of timing information for the previous frame, more accurate and stable fps support may be possible.
  • the present standby operation of the CPU 610 may be performed using vkFence of the graphic API.
  • FIG. 7 illustrates a processing process of each frame in an embodiment in which the present operation is processed by the render thread of the CPU.
  • the present operation of each frame may be performed in the render thread of the CPU 710 .
  • the execution time of the second frame may be delayed.
  • the overall GPU 720 rendering timing may be delayed, and accordingly, the 1st frame is displayed on the display 740 for 2 cycles, while 2 Frame No. 1 may be displayed on the display 740 for three periods.
  • FIG. 8 shows the processing process of each frame in an embodiment in which the present operation is processed by the swap chain thread.
  • the electronic device may not perform the frame present operation in the CPU 810 render thread, but may perform the frame presenting operation in a swap chain thread separated therefrom.
  • a function to pass the current frame of the graphics API to the GPU 820 and surface flinger 830 e.g. vkQueuepresentKHR
  • a function to get the image of the next frame Example: vkacquireNextImageKHR.
  • the present of the next frame may be waited until the GPU 820 of the previous frame is rendered.
  • Such a present wait may cause a specific frame to be displayed for a long period that does not match the target fps, and particularly, may adversely affect the display timing of the image in a CPU 810-bound situation.
  • the electronic device performs the present through the swap chain thread
  • the synchronization of the interference between the thread of the game engine or framework and the GPU 820 is minimized when the present is performed, and the display 840 according to the target fps ) to output each frame.
  • the present of the first frame may be performed in the swap chain thread.
  • the GPU 820 renders the GPU 820 of frame 1 according to the present command, and the surface flinger 830 performs composition processing when the GPU 820 rendering is completed, and is displayed at the next V-sync timing t 4 .
  • Frame 1 may be displayed on the display 840 .
  • the render thread of the framework may perform the drawing operation of the next frame while performing the present operation in the swap chain thread, so that processing delay of the next frame may not occur.
  • FIG. 8 after the present command in frames 2 and 3, the delay time when the CPU 810 is rendered can be reduced, and frame 3 is displayed at t 8 , so that frames 1-3 are all for 2 cycles. can be displayed. In this way, as the present is performed in the swap chain thread, a more stable fps can be provided even in a CPU 810 bound situation.
  • FIG. 9 shows a processing process of each frame in an embodiment in which GPU vertex processing and fragment processing are processed in parallel.
  • the electronic device may concurrently execute vertex 922 processing and fragment 924 processing in the GPU pipeline.
  • a GPU vertex 922 process may be performed, and then a GPU fragment 924 process may be performed.
  • the GPU vertex 922 of the second frame can be performed even before the GPU fragment 924 of the first frame is completed.
  • the electronic device may present the frame through the swap chain thread. Accordingly, even when the present time of a frame drawn by the CPU 910 is long, each frame may be displayed on the display 940 for the same two cycles.
  • FIG. 10 illustrates an example of a thread executed in a game engine prior to using SFE.
  • the game thread 1010 may process a user input and perform game logic based on the user input.
  • the game thread 1010 may output data related to image update according to execution of game logic to the render thread 1020 .
  • the render thread 1020 may render image data in units of frames according to data received from the game thread 1010 .
  • Rendering operations of the render thread 1020 may include acquire, submit, and present operations.
  • the game thread 1010 may provide data for the next frame to the render thread 1020 .
  • execution of user input processing 1081 and game logic 1082 may be completed in game thread 1010 while image frames are processed in render thread 1020 .
  • the game thread 1010 may wait 1083 until the render thread 1020 completes the processing of the corresponding frame.
  • the acquire 1092 execution may be delayed.
  • the submit (1093) and present (1094) operations are also delayed, so that overall image data processing time can be increased.
  • FIG. 11 illustrates an example of a thread executed in a game engine after using SFE.
  • the game engine or framework may set a time margin for correcting the smooth operation of the GPU during the actual execution frame processing time in consideration of the target fps.
  • the time margin may be referred to as SyncFrameEnd (SFE).
  • the game thread 1110 sleeps during the SFE 1170 even when a user input is detected on the game application, and after the SFE 1170 elapses, it can process the user input and perform game logic. there is.
  • the SFE 1170 may be calculated as the difference between the allowable time of the target fps and the execution prediction time of the current frame.
  • the allowable time of the target fps may be determined as an average value of the time from the present of each frame to the output to the display in the target fps.
  • the predicted execution time of the current frame may be calculated as an average of differences in the time that the game thread 1110 presents the frame in previous frames.
  • the game thread 1110 may wait for the SFE 1170 period without immediately processing the user input. Game thread 1110 can then perform processing of user input 1181 and game logic 1182 after SFE 1170 elapses, so render thread 1120 processes previous frame 1191 .
  • the time to be performed is additionally secured, and the execution time of the acquire 1192 may be shortened.
  • an error may occur when calculating the sleep time of the game thread because it is calculated based on the predicted time for the current frame processing time.
  • the error may be corrected by increasing or decreasing the delay time of the surface flanger by the corresponding error.
  • the electronic device may accumulate and store an error correction time in the SFE time, and determine the SFE time to be applied to the next frame using the accumulated value.
  • the corrected SFE time it is possible to provide uniform rendering timing information for each frame, and it can be used to render an accurate animation position for each frame in the game engine or application.
  • the number of swap chain images may be increased.
  • 3 swapchain images are used in the render thread, and if you increase the swapchain images to 4, acquire execution time may be reduced in certain situations.
  • the GPU process may take a long time due to the load on the GPU.
  • a composition operation is waiting, and the other one may be performing a task in a GPU process.
  • the waiting time may be reduced. That is, the frame processing time from the input of the game thread to the present of the render thread can be shortened, and even if the processing of a specific frame takes a long time, time to correct it is secured, so that smooth frame pacing can be performed.
  • FIG. 12 is a flowchart of an image rendering method of an electronic device according to various embodiments of the present disclosure.
  • the game engine may start an operation for generating a frame constituting an execution screen of a game application, and in operation 1220, draw and present the frame.
  • the game engine may present as a frame pacer rather than as a graphic API.
  • the frame pacer may check the presence of the frame.
  • the main thread waits in a sleep state for a SyncFrameEnd (SFE) (or time margin), and then may process user input and data when the SFE time elapses.
  • SFE SyncFrameEnd
  • the SFE (or time margin) may be calculated as a difference between the allowable time of the target fps and the execution prediction time of the current frame.
  • the frame pacer may perform a present through a swap chain thread.
  • the swap chain thread checks whether GPU rendering of the previous frame is completed, and when GPU rendering is completed, in operation 1260 , presenting the graphics API (eg, vkQueuepresentKHR) may be performed.
  • the graphics API eg, vkQueuepresentKHR
  • An electronic device includes a display, a memory, and a processor operatively connected to the display and the memory, wherein the processor processes user input and data on the application in response to the execution of the application
  • the processor may be configured to calculate the expected processing time based on a present time of the at least one previous frame.
  • the processor may be configured such that the main thread processes a user input input before a time interval corresponding to the current frame after the sleep state ends.
  • the processor may include a central processing unit (CPU) that executes the main thread and the render thread, and a graphic processing unit (GPU) that renders a frame according to a present instruction of the CPU.
  • CPU central processing unit
  • GPU graphic processing unit
  • the CPU when the CPU receives the present information for a specific frame from the game engine or the framework, the present information is received after the rendering operation of the GPU for the previous frame of the specific frame is finished. It may be configured to transmit a present command corresponding to .
  • the frame rendered according to the present command is transmitted to a surface flinger, and the surface flinger may display the frame on the display according to a vertical synchronization signal.
  • the surface flinger may be set to process the rendered frame after a predetermined delay time after the rendering operation of the GPU is completed.
  • the processor may further execute a swap chain thread and perform a present command of the generated frame through the swap chain thread.
  • the swap chain thread may be configured to perform a function to transmit a current frame to the GPU and the surface flinger and a function to obtain a next frame.
  • the application may be a game application.
  • An image rendering method of an electronic device includes a main thread related to a user input and data processing in the application in response to execution of an application, and a frame unit based on data processed in the main thread
  • the calculating of the expected processing time may include calculating the expected processing time based on a present time of the at least one previous frame.
  • the processor may include an operation in which the main thread processes a user input input before a time interval corresponding to the current frame after the sleep state ends.
  • the electronic device may include a central processing unit (CPU) that executes the main thread and the render thread, and a graphic processing unit (GPU) that renders a frame according to a present command of the CPU.
  • CPU central processing unit
  • GPU graphic processing unit
  • the CPU when the CPU receives the present information for a specific frame from the game engine or the framework, the present information is received after the rendering operation of the GPU for the previous frame of the specific frame is finished. It may be configured to transmit a present command corresponding to .
  • the frame rendered according to the present command is transmitted to a surface flinger, and the surface flinger may display the frame on the display according to a vertical synchronization signal.
  • the method may include, by the surface flinger, processing the rendered frame after a predetermined delay time after the rendering operation of the GPU is completed.
  • it may include an operation of further executing a swap chain thread, and an operation of performing a present command of the generated frame through the swap chain thread.
  • the swap chain thread may perform a function to transmit the current frame to the GPU and the surface flinger and a function to obtain the next frame.
  • the application may be a game application.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

다양한 실시예에 따른 전자 장치는, 디스플레이, 메모리, 및 상기 디스플레이 및 상기 메모리와 작동적으로 연결되는 프로세서를 포함하고, 상기 프로세서는, 어플리케이션의 실행에 대응하여, 상기 어플리케이션 상에서 사용자의 입력 및 데이터 처리와 관련된 메인 스레드(main thread) 및 상기 메인 스레드에서 처리된 데이터를 기반으로 프레임 단위로 이미지 데이터를 렌더링 하는 렌더 스레드(render thread)를 생성하고, 상기 어플리케이션의 실행 화면을 상기 디스플레이 상에 표시하기 위한 타겟 프레임 레이트를 설정하고, 상기 디스플레이를 통해 출력된 적어도 하나의 이전 프레임의 처리 시간을 기반으로, 현재 프레임의 예상 처리 시간을 계산하고, 상기 타겟 프레임 레이트 및 상기 계산된 예상 처리 시간에 기초하여, 타임 마진(time margin)을 결정하고, 및 상기 메인 스레드가 상기 타임 마진 동안 슬립 상태로 대기한 후, 상기 사용자 입력 및 데이터 처리를 수행하도록 설정될 수 있다.

Description

전자 장치 및 전자 장치의 이미지 렌더링 방법
본 문서는 전자 장치에 관한 것이며, 예를 들어, 이미지 컨텐츠의 렌더링 시 프레임 레이트(frame rate)를 조정할 수 있는 전자 장치 및 전자 장치의 이미지 렌더링 방법에 대한 것이다.
이동통신 및 하드웨어/소프트웨어 기술의 발달에 따라, 스마트폰으로 대표되는 휴대용 전자 장치(이하, 전자 장치)는 진화를 거듭하여 다양한 기능들을 탑재할 수 있게 되었다. 전자 장치는 다양한 어플리케이션을 설치 및 실행하여 사용자에게 다양한 사용자 경험을 제공할 수 있다. 게임과 같은 어플리케이션은 실시간으로 이미지 컨텐츠를 생성하여 디스플레이 상에 제공할 수 있다.
전자 장치는 어플리케이션에서 생성한 이미지 컨텐츠를 다양한 그래픽 API(application programming interface)를 이용하여 렌더링 하여 디스플레이에 표시할 수 있다. 전자 장치는 디스플레이 상에 이미지 컨텐츠를 주어진 프레임 레이트(frame rate)에 따라 출력하기 위해, 이미지 컨텐츠의 각 프레임의 출력 타이밍을 스케줄링 할 수 있다.
전자 장치가 어플리케이션에서 제공되는 이미지 컨텐츠를 렌더링하는 경우, 그래픽 API는 디스플레이 서브 시스템에서 제공되는 수직 동기 신호를 어플리케이션에 제공하고, 어플리케이션은 이를 프레임 페이싱(frame pacing)을 수행할 수 있다. 이 경우, 타겟 프레임 레이트에 맞추어 어플리케이션이 이미지 프레임의 출력 타이밍을 조정할 수 있으나, 해당 이미지 프레임이 디스플레이 상에 출력되는 타이밍을 정확히 맞추는 것은 어려울 수 있다.
전자 장치에서 사용할 수 있는 그래픽 API 중 일부는 현재 렌더링 되는 이미지 프레임이 언제 디스플레이 상에 출력될 지에 대한 타이밍을 설정하는 기능을 제공할 수 있다. 하지만, 해당 그래픽 API를 사용 하더라도, 과거에 이미 출력된 프레임들의 정보를 제공하므로 현재 렌더링 중인 프레임의 정보는 얻을 수 없기 때문에, 향후 렌더링 할 이미지 프레임의 정확한 출력 타이밍을 스케줄링 하기 어려울 수 있다.
다양한 실시예에 따른 전자 장치는, 디스플레이, 메모리, 및 상기 디스플레이 및 상기 메모리와 작동적으로 연결되는 프로세서를 포함할 수 있다. 상기 프로세서는, 어플리케이션의 실행에 대응하여, 상기 어플리케이션 상에서 사용자의 입력 및 데이터 처리와 관련된 메인 스레드(main thread) 및 상기 메인 스레드에서 처리된 데이터를 기반으로 프레임 단위로 이미지 데이터를 렌더링 하는 렌더 스레드(render thread)를 생성하고, 상기 어플리케이션의 실행 화면을 상기 디스플레이 상에 표시하기 위한 타겟 프레임 레이트를 설정하고, 상기 디스플레이를 통해 출력된 적어도 하나의 이전 프레임의 처리 시간을 기반으로, 현재 프레임의 예상 처리 시간을 계산하고, 상기 타겟 프레임 레이트 및 상기 계산된 예상 처리 시간에 기초하여, 타임 마진(time margin)을 결정하고, 및 상기 메인 스레드가 상기 타임 마진 동안 슬립 상태로 대기한 후, 상기 사용자 입력 및 데이터 처리를 수행하도록 설정될 수 있다.
다양한 실시예에 따른 전자 장치의 이미지 렌더링 방법은, 어플리케이션의 실행에 대응하여, 상기 어플리케이션 상에서 사용자의 입력 및 데이터 처리와 관련된 메인 스레드(main thread) 및 상기 메인 스레드에서 처리된 데이터를 기반으로 프레임 단위로 이미지 데이터를 렌더링 하는 렌더 스레드(render thread)를 생성하는 동작, 상기 어플리케이션의 실행 화면을 상기 디스플레이 상에 표시하기 위한 타겟 프레임 레이트를 설정하는 동작, 디스플레이를 통해 출력된 적어도 하나의 이전 프레임의 처리 시간을 기반으로, 현재 프레임의 예상 처리 시간을 계산하는 동작, 상기 타겟 프레임 레이트 및 상기 계산된 예상 처리 시간에 기초하여, 타임 마진(time margin)을 결정하는 동작, 및 상기 메인 스레드가 상기 타임 마진 동안 슬립 상태로 대기한 후, 상기 사용자 입력 및 데이터 처리를 수행하는 동작을 포함할 수 있다.
본 문서의 다양한 실시예에 따르면, 이미지 컨텐츠의 렌더링 시에, 타겟 프레임 레이트에 따라 안정 적이고 균일한 프레임 간격에 의해 이미지 컨텐츠를 출력할 수 있는 전자 장치 및 전자 장치의 이미지 렌더링 방법을 제공할 수 있다.
도 1은 다양한 실시예들에 따른, 네트워크 환경 내의 전자 장치의 블록도이다.
도 2는 다양한 실시예에 따른 전자 장치의 블록도이다.
도 3은 다양한 실시예에 따른 이미지 렌더링에 사용되는 구성의 블록도이다.
도 4는 그래픽 API의 타이밍 확장 기능을 사용하지 않은 실시예에서 각 프레임의 처리 과정을 도시한 것이다.
도 5는 그래픽 API의 타이밍 확장 기능을 사용한 실시예에서 각 프레임의 처리 과정을 도시한 것이다.
도 6은 그래픽 API의 타이밍 확장 기능을 사용하고 present 타이밍을 조절한 실시예에서 각 프레임의 처리 과정을 도시한 것이다.
도 7은 present 동작을 CPU의 렌더 스레드에서 처리하는 실시예에서 각 프레임의 처리 과정을 도시한 것이다.
도 8은 present 동작을 스왑체인 스레드에서 처리하는 실시예에서 각 프레임의 처리 과정을 도시한 것이다.
도 9는 GPU vertex 처리와 fragment 처리를 병렬로 처리하는 실시예에서 각 프레임의 처리 과정을 도시한 것이다.
도 10은 SFE(sync frame end)를 사용하기 이전에 게임 엔진에서 수행되는 스레드의 일 예를 도시한 것이다.
도 11은 SFE를 사용한 이후 게임 엔진에서 수행되는 스레드의 일 예를 도시한 것이다.
도 12는 다양한 실시예에 따른 전자 장치의 이미지 렌더링 방법의 흐름도이다.
도 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 관련 기술을 기반으로 지능형 서비스(예: 스마트 홈, 스마트 시티, 스마트 카, 또는 헬스 케어)에 적용될 수 있다.
본 문서에 개시된 다양한 실시예들에 따른 전자 장치는 다양한 형태의 장치가 될 수 있다. 전자 장치는, 예를 들면, 휴대용 통신 장치(예: 스마트폰), 컴퓨터 장치, 휴대용 멀티미디어 장치, 휴대용 의료 기기, 카메라, 웨어러블 장치, 또는 가전 장치를 포함할 수 있다. 본 문서의 실시예에 따른 전자 장치는 전술한 기기들에 한정되지 않는다.
본 문서의 다양한 실시예들 및 이에 사용된 용어들은 본 문서에 기재된 기술적 특징들을 특정한 실시예들로 한정하려는 것이 아니며, 해당 실시예의 다양한 변경, 균등물, 또는 대체물을 포함하는 것으로 이해되어야 한다. 도면의 설명과 관련하여, 유사한 또는 관련된 구성요소에 대해서는 유사한 참조 부호가 사용될 수 있다. 아이템에 대응하는 명사의 단수 형은 관련된 문맥상 명백하게 다르게 지시하지 않는 한, 상기 아이템 한 개 또는 복수 개를 포함할 수 있다. 본 문서에서, "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))의 형태로 배포되거나, 또는 어플리케이션 스토어(예: 플레이 스토어TM)를 통해 또는 두 개의 사용자 장치들(예: 스마트 폰들) 간에 직접, 온라인으로 배포(예: 다운로드 또는 업로드)될 수 있다. 온라인 배포의 경우에, 컴퓨터 프로그램 제품의 적어도 일부는 제조사의 서버, 어플리케이션 스토어의 서버, 또는 중계 서버의 메모리와 같은 기기로 읽을 수 있는 저장 매체에 적어도 일시 저장되거나, 임시적으로 생성될 수 있다.
다양한 실시예들에 따르면, 상기 기술한 구성요소들의 각각의 구성요소(예: 모듈 또는 프로그램)는 단수 또는 복수의 개체를 포함할 수 있으며, 복수의 개체 중 일부는 다른 구성요소에 분리 배치될 수도 있다. 다양한 실시예들에 따르면, 전술한 해당 구성요소들 중 하나 이상의 구성요소들 또는 동작들이 생략되거나, 또는 하나 이상의 다른 구성요소들 또는 동작들이 추가될 수 있다. 대체적으로 또는 추가적으로, 복수의 구성요소들(예: 모듈 또는 프로그램)은 하나의 구성요소로 통합될 수 있다. 이런 경우, 통합된 구성요소는 상기 복수의 구성요소들 각각의 구성요소의 하나 이상의 기능들을 상기 통합 이전에 상기 복수의 구성요소들 중 해당 구성요소에 의해 수행되는 것과 동일 또는 유사하게 수행할 수 있다. 다양한 실시예들에 따르면, 모듈, 프로그램 또는 다른 구성요소에 의해 수행되는 동작들은 순차적으로, 병렬적으로, 반복적으로, 또는 휴리스틱하게 실행되거나, 상기 동작들 중 하나 이상이 다른 순서로 실행되거나, 생략되거나, 또는 하나 이상의 다른 동작들이 추가될 수 있다.
도 2는 다양한 실시예에 따른 전자 장치의 블록도이다.
도 2를 참조 하면, 전자 장치(200)는 디스플레이(230), 메모리(220) 및 프로세서(210)를 포함할 수 있다. 도시된 구성 중 일부가 생략 또는 치환 되거나 다른 구성들이 추가될 수도 있다. 전자 장치(200)는 도 1의 전자 장치(200)(101)의 구성 및/또는 기능 중 적어도 일부를 더 포함할 수 있다. 도시된(또는 도시되지 않은) 전자 장치(200)의 각 구성 중 적어도 일부는 상호 작동적으로(operatively), 기능적으로(functionally) 및/또는 전기적으로 (electrically) 연결될 수 있다.
다양한 실시예에 따르면, 디스플레이(230)는 액정 디스플레이(liquid crystal display(LCD)), 발광 다이오드(light-emitting diode(LED)) 디스플레이, 유기 발광 다이오드(organic light-emitting diode(OLED)) 디스플레이 중 어느 하나로 구현될 수 있으며, 이에 한정되지는 않는다. 디스플레이(230)는 사용자의 신체 일부(예: 손가락) 또는 입력 장치(예: 스타일러스 펜)를 이용한 터치 및/또는 근접 터치(또는 호버링) 입력을 감지하는 터치 스크린으로 구성될 수 있다. 디스플레이(230)는 적어도 일부가 플렉서블(flexible) 할 수 있으며, 폴더블(foldable) 디스플레이, 롤러블(rollable) 디스플레이로 구현될 수도 있다. 디스플레이(230)는 도 1의 디스플레이 모듈(160)의 구성 및/또는 기능 중 적어도 일부를 포함할 수 있다.
다양한 실시예에 따르면, 메모리(220)는 휘발성 메모리 및 비휘발성 메모리를 포함하여, 다양한 데이터들을 일시적 또는 영구적으로 저장할 수 있다. 메모리(220)는 도 1의 메모리(130)의 구성 및/또는 기능 중 적어도 일부를 포함하고, 도 1의 프로그램(140)을 저장할 수 있다.
다양한 실시예에 따르면, 메모리(220)는 프로세서(210)에서 수행될 수 있는 다양한 인스트럭션(instruction)들을 저장할 수 있다. 이와 같은 인스트럭션들은 프로세서(210)에 의해 인식될 수 있는 산술 및 논리 연산, 데이터 이동, 입출력 등의 제어 명령을 포함할 수 있다.
다양한 실시예에 따르면, 프로세서(210)는 전자 장치(200)의 각 구성 요소들의 제어 및/또는 통신에 관한 연산이나 데이터 처리를 수행할 수 있는 구성으로써, 하나 이상의 프로세서(210)들로 구성될 수 있다. 프로세서(210)는 도 1의 프로세서(120)의 구성 및/또는 기능 중 적어도 일부를 포함할 수 있다.
다양한 실시예에 따르면, 프로세서(210)가 전자 장치(200) 상에서 구현할 수 있는 연산 및 데이터 처리 기능에는 한정됨이 없을 것이나, 이하에서는 전자 장치(200)가 타겟 프레임 레이트(frame rate)(또는 타겟 fps(frame per second)에 따라 어플리케이션의 실행 화면을 구성하는 각 프레임이 균일한 주기로 표시되도록 하는 프레임 페이싱(frame pacing) 동작과 관련된 다양한 실시예들에 대해 설명하기로 한다. 이하에서는, 전자 장치(200)가 게임 어플리케이션의 동작 중 그래픽 처리에 관련된 내용을 설명하기로 하나, 게임 어플리케이션 외에 다양한 어플리케이션에도 다양한 실시예들이 적용될 수 있다.
다양한 실시예에 따르면, 프로세서(210)는 CPU 및 GPU를 포함할 수 있다. 다양한 실시예에 있어서, CPU(central processing unit)는 어플리케이션의 실행 시 어플리케이션에서 정의된 다양한 연산 처리 동작을 수행하고, 디스플레이(230) 상의 사용자 입력에 대응하는 처리를 수행할 수 있다. GPU(graphic processing unit)는 디스플레이(230) 상에 처리되는 이미지 데이터의 렌더링 동작을 수행할 수 있다. 프로세서(210)는 CPU 및 GPU를 포함하는 하나의 SoC(system on chip)로 설계될 수 있으며, 후술하는 프로세서(210)의 동작 중 적어도 일부는 CPU 또는 GPU에서 각각 수행되거나, CPU 및 GPU에서 분할되어 수행될 수 있다.
다양한 실시예에 따르면, 어플리케이션의 실행에 대응한 메인 스레드(main thread) 및 렌더 스레드(render thread)를 생성할 수 있다. 메인 스레드 및 렌더 스레드는 게임 엔진(game engine) 또는 프레임워크(framework) 상에서 수행될 수 있다. 메인 스레드는 게임 어플리케이션의 동작과 관련된 다양한 연산 처리 동작을 포함하며, 렌더 스레드는 메인 스레드에서 처리된 데이터를 기반으로 이미지 데이터를 렌더링 하는 동작을 포함할 수 있다. 이하에서 메인 스레드는 게임 스레드(game thread)로 지칭될 수도 있다.
다양한 실시예에 따르면, 프로세서(210)는 어플리케이션에서 생성되는 이미지 데이터를 프레임 단위로 생성할 수 있다. 일 실시예에 따르면, 프로세서(210)는 프레임을 획득(acquire)하고, 드로잉(drawing) 한 후, present 명령을 전달 할 수 있다. 예를 들어, 프로세서(210)는 다중 버퍼링(multiple buffering) 방식을 통해 프론트 버퍼(front buffer)와 백 버퍼(back buffer)를 구성하고, 백 버퍼에 이미지를 그린 후 프론트 버퍼와 백 버퍼를 스왑(swap) 하고, 스왑 된 프론트 버퍼에 그려진 이미지를 디스플레이(230) 상에 출력하고, 다시 백 버퍼에 새로운 이미지 프레임을 그리는 과정을 반복할 수 있다. 여기서, present 명령은 백 버퍼와 프론트 버퍼의 포인터를 교환하는 과정이며, present 명령에 따라 GPU는 스왑 된 프론트 버퍼에 저장된 이미지 프레임을 렌더링 할 수 있다.
다양한 실시예에 따르면, GPU는 present 명령에 따라 전달 받은 프레임 데이터를 렌더링 하여, 서피스 플린저(surface flinger)에 전달하고, 서피스 플린저는 스왑 된 프론트 버퍼에 있는 데이터를 합성(composition) 하여 디스플레이(230)를 통해 출력할 수 있다.
다양한 실시예에 따르면, 디스플레이(230)는 소정의 리프레시 레이트에 따라서 프레임을 리프레시 할 수 있다. 예를 들어, 디스플레이(230)가 60fps로 동작하는 경우, 약 16.6ms의 주기마다 수직 동기 신호(V-sync)에 따라 리프레시 될 수 있으며, 리프레시 레이트는 가변될 수 있다.
다양한 실시예에 따르면, 프로세서(210)는 디스플레이(230) 상에 이미지의 출력 시 타겟 프레임 레이트를 설정할 수 있다. 예를 들어, 타겟 프레임 레이트(또는 타겟 fps)는 실행 중인 어플리케이션에 따라 결정될 수 있으며, 사용자가 설정한 동작 모드에 따라 변경될 수 있다. 타겟 프레임 레이트가 설정된 경우, 전자 장치(200)는 타겟 프레임 레이트에 따라 균등한 간격으로 이미지 데이터의 각 프레임이 디스플레이(230)에 표시되도록 할 필요가 있다. 이하에서는, 타겟 프레임 레이트에 맞게 프레임의 출력 주기를 균등하게 조정하기 위한 프레임 페이싱(frame pacing) 동작에 관련된 3가지 실시예에 대해 설명하기로 한다. 후술할 제1 내지 제3실시예는 서로 배타적인 실시예가 아니며, 전자 장치(200)는 상황에 따라 제1 내지 제3실시예를 모두 사용할 수도 이 중 일부만 사용할 수도 있다.
제1실시예에 따르면, 프로세서(210)(예: CPU)는 게임 엔진 또는 프레임워크로부터 특정 프레임에 대한 present 정보를 수신하는 경우, 상기 특정 프레임의 이전 프레임에 대한 렌더링 동작이 종료된 이후에 수신되는 present 정보에 대응하는 present 명령을 GPU로 전달할 수 있다. 일 실시예에 따르면, 프로세서(210)는 GPU의 렌더링 동작이 완료된 후 소정의 딜레이 시간 이후에 렌더링 된 프레임을 처리할 수 있다.
일 실시예에 따르면, 프로세서(210)는 그래픽 API의 타이밍 확장 기능을 사용할 수 있다. 예를 들어, 그래픽 API는 Vulkan API일 수 있으며, 타이밍 확장 기능은 Vulkan API의 Google display timing extention 함수일 수 있다. 타이밍 확장 기능은 이전 프레임들의 렌더링 결과에 대한 디스플레이(230)의 출력 타이밍 정보를 얻어서, 이후에 present 할 이미지가 언제 디스플레이(230)에 출력될 지 설정할 수 있는 기능일 수 있다. 프로세서(210)가 타이밍 확장 기능을 사용하는 경우, GPU에서 프레임의 렌더링이 완료되는 경우, 서피스 플린저는 소정의 딜레이 시간 이후에 렌더링 프레임을 합성하고, 이 후의 수직 동기 타이밍에 디스플레이(230)를 통해 해당 프레임이 출력될 수 있다. 하지만, 이와 같이 타이밍 확장 기능을 사용 하더라도, 과거 프레임들의 처리 시간에 따라 딜레이 시간이 결정되기 때문에 향후 렌더링 할 이미지의 정확한 출력 타이밍을 스케줄링 하기 어려울 수 있다. 이에 따라, 일부 프레임의 경우 다른 프레임보다 짧은 주기 또는 긴 주기 동안 출력될 수 있다.
제1실시예에서는 이와 같은 문제를 해결하기 위해, 프로세서(210)는 게임 엔진 또는 프레임워크에서 present 명령을 전달 받더라도, 바로 present를 수행하지 않고, 이전 프레임의 GPU 렌더링 동작이 끝날 때까지 대기한 후 present를 수행할 수 있다.
제1실시예는 도 4 내지 도 6을 통해 보다 상세히 설명하기로 한다.
제2실시예에 따르면, 프로세서(210)는 프레임의 present와 관련된 동작을 스왑 체인(swap chain) 스레드를 통해 수행할 수 있다. 스왑 체인 스레드는 present 명령에 따라 프론트 버퍼와 백 버퍼를 스왑 하는 동작을 수행하는 스레드일 수 있다. 스왑 체인 스레드는 메인 스레드와 독립적, 병렬적으로 수행될 수 있다.
게임 엔진 또는 프레임워크의 메인 스레드에서 present 명령을 수행하는 경우, 이전 프레임의 GPU 렌더링 완료 시까지 다음 프레임의 present를 대기할 수 있다. 이 경우, 타겟 fps에 맞지 않게 특정 프레임이 긴 주기 동안 표시될 수 있다.
본 실시예에서는 스왑체인 스레드를 통해 present를 수행함에 따라, present 수행 시에 게임 엔진 또는 프레임워크의 메인 스레드와 GPU의 간섭 동기화를 최소화 하여, 타겟 fps에 따라 디스플레이(230)가 각 프레임을 출력하도록 할 수 있다.
제2실시예는 도 7 내지 도 9를 통해 보다 상세히 설명하기로 한다.
제3실시예에 따르면, 프로세서(210)는 디스플레이(230)를 통해 출력된 적어도 하나의 이전 프레임의 처리 시간을 기반으로 현재 프레임의 예상 처리 시간을 계산하고, 타겟 프레임 레이트 및 계산된 예상 처리 시간에 기초하여, 타임 마진(time margin)(또는 SFE(SyncFrameEnd))을 결정하고, 메인 스레드가 타임 마진 동안 슬립 상태로 대기한 후 사용자 입력 및 데이터의 처리를 수행하도록 할 수 있다. 프로세서(210)는 적어도 하나의 이전 프레임의 present 시간의 차이를 기반으로 예상 처리 시간을 계산할 수 있다.
예를 들어, 렌더 스레드에서 이미지 프레임이 처리되는 동안 메인 스레드에서 사용자 입력 처리 및 게임 로직의 실행이 완료될 수 있는데, 이 경우, 메인 스레드는 렌더 스레드가 해당 프레임의 처리를 완료할 때까지 대기할 수 있다. 이 경우, 렌더 스레드의 acquire 수행 시점에 GPU의 이전 프레임에 대한 작업이 완료되지 않을 수 있기 때문에, 이미지의 렌더링 절차가 지연될 수 있다.
본 실시예에서는 메인 스레드는 사용자 입력이 감지 되더라도 바로 사용자 입력의 처리를 수행하지 않고, SFE 기간 동안 대기할 수 있다. 메인 스레드는 이 후 SFE가 도과한 후 사용자 입력의 처리 및 게임 로직을 수행할 수 있으며, 이에 따라 렌더 스레드가 이전 프레임을 처리할 시간이 추가로 확보되고, ACQUIRE의 수행 시간이 짧아질 수 있다.
제3실시예는 도 10 내지 도 11을 통해 보다 상세히 설명하기로 한다.
도 3은 다양한 실시예에 따른 이미지 렌더링에 사용되는 구성의 블록도이다.
다양한 실시예에 따르면, 게임 엔진(310)(또는 프레임워크)는 그래픽 API(320)(예: Vulkan API)를 이용하여, 타겟 프레임 레이트에 맞게 이미지 프레임을 드로잉하는 동작을 수행할 수 있다.
다양한 실시예에 따르면, 프레임 페이서(340)(frame pacer)는 게임 엔진(310)과 그래픽 API(320) 사이에서 동작을 수행하며, 게임 어플리케이션의 프레임이 타겟 프레임 레이트에 맞게 출력될 수 있도록 다양한 동작을 수행할 수 있다.
일 실시예(예: 도 4 내지 도 6)에 따르면, 프레임 페이서(340)는 게임 엔진(310) 또는 프레임워크로부터 특정 프레임에 대한 present 정보를 수신하는 경우, 상기 특정 프레임의 이전 프레임에 대한 렌더링 동작이 종료된 이후에 수신되는 present 정보에 대응하는 present 명령을 GPU(330)로 전달할 수 있다.
일 실시예(예: 도 7 내지 도 9)에 따르면, 프레임 페이서(340)는 프레임의 present와 관련된 동작을 스왑 체인(swap chain) 스레드를 통해 수행할 수 있다. 예를 들어, 게임 엔진(310)은 이미지를 그리는 함수(예: vkQueuepresentKHR) 호출을 직접하는 대신 프레임 페이서(340)에 present 명령을 전달 할 수 있다. 프레임 페이서(340)는 present를 바로 수행하지 않고, 스왑 체인 스레드(342)에 전달하고, 스왑 체인 스레드(342)는 이전 프레임의 GPU(330) 렌더링 완료 시점까지 기다렸다가 present (예: vkQueuepresentKHR)를 수행할 수 있다.
일 실시예(예: 도 10 내지 도 11)에 따르면, 프레임 페이서(340)는 디스플레이를 통해 출력된 적어도 하나의 이전 프레임의 처리 시간을 기반으로 현재 프레임의 예상 처리 시간을 계산하고, 타겟 프레임 레이트 및 계산된 예상 처리 시간에 기초하여, 타임 마진(time margin)(또는 SFE(SyncFrameEnd))을 결정하고, 메인 스레드(또는 게임 스레드)(312)가 타임 마진 동안 슬립 상태로 대기한 후 사용자 입력 및 데이터의 처리를 수행하도록 할 수 있다. 예를 들어, 프레임 페이서(340)는 타겟 fps에 맞는 게임 엔진(310)의 프레임 시작 시점 및 종료 시점을 메인 스레드(312) 및/또는 렌더 스레드(314)에 알려주고, 이에 따라 원활한 애니메이션 및 프레임 타임을 제공하도록 할 수 있다.
도 4는 그래픽 API의 타이밍 확장 기능을 사용하지 않은 실시예에서 각 프레임의 처리 과정을 도시한 것이다.
도 4 내지 도 9에서 각 주기(tn - tn-1)는 디스플레이의 리프레시 인터벌(refresh interval)이고, 디스플레이가 60fps(frame per second)로 동작하는 경우, 리프레시 인터벌은 약 16.6ms일 수 있다. 디스플레이는 tn 타이밍에 수직 동기 신호(V-sync)에 따라 이미지 프레임을 출력할 수 있으며, 하나의 프레임이 n 주기 동안 표시될 수 있다. 이하에서는 타겟 fps가 30이 경우의 처리 과정에 대해 설명하기로 한다.
도 4를 참조 하면, CPU(410)는 정해진 클래스(예: choreographer)를 이용하여, 어플리케이션(또는 게임 엔진)으로부터 V-sync 주기에 맞추어 렌더링을 시작할 수 있다. 예를 들어, CPU(410) 동작 중 어플리케이션은 2번의 V-sync 주기(t1, t3, t5) 마다 각 프레임의 렌더링을 수행할 수 있다.
다양한 실시예에 따르면, GPU(420)는 CPU(410)에서 present 명령을 전달하는 경우, 해당 프레임의 렌더링을 시작하고, CPU(410)는 GPU(420)에서 해당 프레임의 렌더링 동작이 완료할 때까지 대기할 수 있다.
다양한 실시예에 따르면, 서피스 플린저(430)는 CPU(410)의 present 명령 시, 바로 다음 V-sync 신호에 맞추어 백 버퍼(back buffer)에 저장된 데이터를 컴포지션한 후 디스플레이(440)에 출력할 수 있다. 서피스 플린저(430)는 GPU(420)의 렌더링 동작이 완료될 때까지 대기한 후 렌더링 동작이 완료된 이후의 V-sync 타이밍에 디스플레이(440)로 프레임 데이터를 출력할 수 있다. 예를 들어, 서피스 플린저(430)는 GPU(420)의 1번 프레임의 렌더링 동작이 t4-t5 사이에 완료되므로, GPU(420) 렌더링이 수행되는 시간 동안 대기한 후 완료 시점부터 컴포지션 동작을 수행하고, t5에 디스플레이(440)로 프레임 데이터를 출력할 수 있다. 또한, 서피스 플린저(430)는 GPU(420)의 2번 프레임의 렌더링 동작이 완료된 후 컴포지션 동작을 수행하고, t6에 디스플레이(440)로 프레임 데이터를 출력할 수 있다.
이와 같은 처리 과정에 따라, 1번 프레임은 한 주기 동안 표시되고, 2번 및 3번 프레임은 두 주기 동안 표시될 수 있다. 이에, 본 실시예에서는 의도한 30fps와 일부 오차가 생길 수 있다.
도 5는 그래픽 API의 타이밍 확장 기능을 사용한 실시예에서 각 프레임의 처리 과정을 도시한 것이다.
다양한 실시예에 따르면, 서피스 플린저(530)는 그래픽 API(예: Vulkan API)의 타이밍 확장 기능(예: Vulkan Google Display Timing Extension)을 적용하여, 렌더링 된 프레임의 표시 타이밍을 조절할 수 있다. 타이밍 확장 기능은 present 된 프레임이 실제 디스플레이(540)에 출력될 시간에 출력되도록 서피스 플린저(530)의 처리 타이밍을 딜레이 시키는 기능일 수 있다.
도 5를 참조 하면, CPU(510)의 1번 프레임에 대한 present 명령에 따라 GPU(520)는 렌더링을 수행하고, 서피스 플린저(530)는 GPU(520) 렌더링이 종료되더라도 바로 컴포지션 동작을 수행하지 않고, 다음 V-sync 인 t5 직전에 수행할 수 있다.
이와 같이, 타이밍 확장 기능을 이용하여, 각 프레임의 출력 주기를 동일하게 조절할 수도 있으나, 도 5와 같은 케이스에서는 서피스 플린저(530)의 딜레이 타임 예측이 정확하지 않을 수 있다. 타이밍 확장 기능은 과거 프레임들의 타이밍 정보를 제공하지만, 현재 GPU(520)가 렌더링 중인 직전 프레임의 경우 아직 디스플레이(540)에 출력되지 않았기 때문에, 해당 프레임에 대한 정보가 없으므로 정확한 프레임 시작 시점을 예측하기가 어렵다.
이에 따라, 타이밍 확장 기능을 이용하더라도 도 4와 마찬가지로 1번 프레임은 한 주기 동안 표시되고, 2번 및 3번 프레임은 두 주기 동안 표시될 수 있다. 따라서, 본 실시예에서도 의도한 30fps와 일부 오차가 생길 수 있다.
도 6은 그래픽 API의 타이밍 확장 기능을 사용하고 present 타이밍을 조절한 실시예에서 각 프레임의 처리 과정을 도시한 것이다.
다양한 실시예에 따르면, 프레임 페이서는 게임 엔진 또는 프레임워크에서 present 명령을 전달 받더라도, 바로 present를 수행하지 않고, 이전 프레임의 GPU(620) 렌더링 동작이 끝날 때까지 대기한 후 present를 수행할 수 있다.
도 6을 참조 하면, CPU(610)는 1번 프레임의 GPU(620) 렌더링 완료 시점까지 2번 프레임의 present를 수행하지 않고 대기할 수 있다. CPU(610)는 1번 프레임의 GPU(620) 렌더링이 완료되는 경우, 2번 프레임의 present를 수행하고, 이에 따라 2번 프레임의 GPU(620) 렌더링 시점이 딜레이 될 수 있다. 서피스 플린저(630)는 타이밍 확장 기능을 사용하여 각 프레임의 GPU(620) 렌더링 이후에 바로 컴포지션 동작을 수행하지 않고 소정의 딜레이 시간 이후에 컴포지션 동작을 수행할 수 있다.
도 6을 참조 하면, 이와 같이 CPU(610)의 present 딜레이 및 타이밍 확장 기능에 의해 서피스 플린저(630)의 동작 타이밍이 딜레이 됨에 따라 1번 프레임은 t6 - t8 2 주기 동안 디스플레이(640) 상에 표시될 수 있다. 이후 2번 프레임 및 3번 프레임도 2주기 동안 표시되어, 타겟 fps인 30fps에 맞게 디스플레이(640) 상에 각 프레임이 표시될 수 있다.
본 실시예의 경우, 직전 프레임의 GPU(620) 완료 시점까지 present 동작을 대기하기 때문에, 언제든지 직전 프레임이 디스플레이(640)에 출력되는 타이밍에 대해 계산이 가능하다. 이와 같이, 직전 프레임에 대한 타이밍 정보까지 고려하여 CPU(610)에서 present를 수행하면 보다 정확하고 안정적인 fps 지원이 가능할 수 있다.
일 실시예에 따르면, CPU(610)의 present 대기 동작은 그래픽 API의 vkFence를 이용해서 수행할 수 있다.
도 7은 present 동작을 CPU의 렌더 스레드에서 처리하는 실시예에서 각 프레임의 처리 과정을 도시한 것이다.
일 실시예에 따르면, CPU(710)의 렌더 스레드에서 각 프레임의 present 동작을 수행할 수 있다. 도 7을 참조 하면, CPU(710)는 1번 프레임의 present 이후 1번 프레임의 GPU(720) 렌더링을 대기함에 따라, 2번 프레임의 present는 실행 시간이 지연될 수 있다. 본 케이스에서 3번 프레임의 CPU(710) 렌더링 처리가 늦게 완료되는 경우 전체적인 GPU(720) 렌더링 타이밍이 지연될 수 있으며, 이에 따라 1번 프레임은 2주기 동안 디스플레이(740)에 표시되는 반면, 2번 프레임은 3주기 동안 디스플레이(740)에 표시될 수 있다.
이에 따라, 의도한 30fps와 일부 오차가 생길 수 있다.
도 8은 present 동작을 스왑체인 스레드에서 처리하는 실시예에서 각 프레임의 처리 과정을 도시한 것이다.
다양한 실시예에 따르면, 전자 장치는 프레임의 present 동작을 CPU(810) 렌더 스레드에서 수행하지 않고, 이와 분리된 스왑체인 스레드에서 수행할 수 있다. 예를 들어, 스왑 체인 스레드(swap chain thread)(815)에서는 그래픽 API의 현재 프레임을 GPU(820) 및 서피스 플린저(830)에 전달할 함수(예: vkQueuepresentKHR)와 다음 프레임의 이미지를 가져올 함수(예: vkacquireNextImageKHR)를 실행할 수 있다.
도 7의 실시예에서는 게임 엔진 또는 프레임워크의 스레드에서 present 명령을 수행함에 따라 이전 프레임의 GPU(820) 렌더링 완료 시까지 다음 프레임의 present를 대기할 수 있다. 이러한 present 대기는 타겟 fps에 맞지 않게 특정 프레임이 긴 주기 동안 표시될 수 있으며, 특히 CPU(810) 바운드 상황에서는 이미지의 표시 타이밍에 좋지 않은 영향을 미칠 수 있다.
다양한 실시예에 따르면, 전자 장치는 스왑체인 스레드를 통해 present를 수행함에 따라, present 수행 시에 게임 엔진 또는 프레임워크의 스레드와 GPU(820)의 간섭 동기화를 최소화 하여, 타겟 fps에 따라 디스플레이(840)가 각 프레임을 출력하도록 할 수 있다.
도 8을 참조 하면, 1번 프레임의 CPU(810) 렌더링이 완료되면, 스왑체인 스레드에서 1번 프레임의 present를 수행할 수 있다. GPU(820)는 present 명령에 따라 1번 프레임의 GPU(820) 렌더링을 수행하고, 서피스 플린저(830)는 GPU(820) 렌더링이 완료되는 경우 composition 처리 하여 다음 V-sync 타이밍인 t4에 디스플레이(840) 상에 1번 프레임이 표시될 수 있다.
다양한 실시예에 따르면, 프레임워크의 렌더 스레드는 스왑체인 스레드에서 present 동작을 수행하는 동안 다음 프레임의 드로잉 동작을 수행할 수 있어, 다음 프레임의 처리 지연이 발생하지 않을 수 있다. 도 8을 참조 하면, 2번 프레임 및 3번 프레임에서 present 명령 후 CPU(810) 렌더링 시 지연 시간이 줄어들 수 있으며, 3번 프레임이 t8에 표시되게 되어, 1-3번 프레임 모두 2주기 동안 표시될 수 있다. 이와 같이, 스왑체인 스레드에서 present를 수행함에 따라 CPU(810) bound 상황에서도 보다 안정적인 fps를 제공할 수 있다.
도 9는 GPU vertex 처리와 fragment 처리를 병렬로 처리하는 실시예에서 각 프레임의 처리 과정을 도시한 것이다.
일 실시예에 따르면, 전자 장치는 GPU 파이프 라인 중 vertex(922) 처리와 fragment(924) 처리를 병행하여 실행할 수 있다.
도 9를 참조 하면, CPU(910)가 각 프레임의 드로잉을 완료 하면, GPU vertex(922) 처리가 수행되고, 이어서 GPU fragment(924) 처리가 수행될 수 있다. 본 실시예에서는 GPU vertex(922) 와 GPU fragment(924)가 병렬로 처리되기 때문에, 1번 프레임의 GPU fragment(924)가 완료되기 이전에도 2번 프레임의 GPU vertex(922)가 수행될 수 있다.
다양한 실시예에 따르면, 전자 장치는 스왑체인 스레드를 통해 프레임의 present를 수행할 수 있다. 이에 따라, CPU(910)에서 드로잉 한 프레임의 present 시간이 긴 경우에도 각 프레임은 동일한 2주기 동안 디스플레이(940) 상에 표시될 수 있다.
도 10은 SFE를 사용하기 이전에 게임 엔진에서 수행되는 스레드의 일 예를 도시한 것이다.
다양한 실시예에 따르면, 게임 스레드(1010)(game thread)는 사용자 입력의 처리 및 사용자 입력에 기초한 게임 로직을 수행할 수 있다. 게임 스레드(1010)는 게임 로직의 수행에 따른 이미지 업데이트와 관련된 데이터를 렌더 스레드(1020)로 출력할 수 있다. 렌더 스레드(1020)(render thread)는 게임 스레드(1010)로부터 수신되는 데이터에 따라, 이미지 데이터를 프레임 단위로 렌더링 할 수 있다. 렌더 스레드(1020)의 렌더링 동작은 acquire, submit 및 present 동작을 포함할 수 있다. 게임 스레드(1010)는 렌더 스레드(1020)의 하나의 프레임의 렌더링 처리가 종료되는 경우, 다음 프레임에 대한 데이터를 렌더 스레드(1020)로 제공할 수 있다.
도 10을 참조 하면, 렌더 스레드(1020)에서 이미지 프레임이 처리되는 동안 게임 스레드(1010)에서 사용자 입력 처리(1081) 및 게임 로직(1082)의 실행이 완료될 수 있다. 이 경우, 게임 스레드(1010)는 렌더 스레드(1020)가 해당 프레임의 처리를 완료할 때까지 대기(1083)할 수 있다. 이 경우, 렌더 스레드(1020)의 acquire(1092) 수행 시점에 GPU의 이전 프레임(1091)에 대한 작업이 완료되지 않을 수 있기 때문에, acquire(1092) 실행이 지연될 수 있다. 이와 같이 acquire(1092) 동작의 지연에 따라, submit(1093), present(1094) 동작도 지연되게 되어, 전체적으로 이미지 데이터의 처리 시간이 증가할 수 있다.
도 11은 SFE를 사용한 이후 게임 엔진에서 수행되는 스레드의 일 예를 도시한 것이다.
다양한 실시예에 따르면, 게임 엔진 또는 프레임워크는 타겟 fps를 고려하여, 실제 실행되는 프레임 처리 시간 동안에 원활한 GPU의 동작을 보정하도록 하기 위한 타임 마진(time margin)을 설정할 수 있다. 여기서, 타임 마진은 SyncFrameEnd(SFE)로 지칭될 수도 있다.
다양한 실시예에 따르면, 게임 스레드(1110)는 게임 어플리케이션 상에서 사용자 입력이 감지되더라도, SFE(1170) 동안 슬립을 수행하고, SFE(1170)가 도과한 이후 사용자 입력의 처리 및 게임 로직을 수행할 수 있다.
다양한 실시예에 따르면, SFE(1170)(또는 타임 마진)는 타겟 fps의 허용 시간과 현재 프레임의 실행 예측 시간의 차로써 계산될 수 있다. 여기서, 타겟 fps의 허용 시간은 타겟 fps에서 각 프레임의 present 부터 디스플레이에 출력하기 까지의 시간의 평균 값으로 결정될 수 있다. 현재 프레임의 실행 예측 시간은 이전의 프레임들에서 게임 스레드(1110)가 프레임을 present하는 시간의 차이의 평균으로 계산될 수 있다.
도 11을 참조 하면, 게임 스레드(1110)는 사용자 입력이 감지 되더라도 바로 사용자 입력의 처리를 수행하지 않고, SFE(1170) 기간 동안 대기할 수 있다. 게임 스레드(1110)는 이 후 SFE(1170)가 도과한 후 사용자 입력(1181)의 처리 및 게임 로직(1182)을 수행할 수 있으며, 이에 따라 렌더 스레드(1120)가 이전 프레임(1191)을 처리할 시간이 추가로 확보되고, acquire(1192)의 수행 시간이 짧아질 수 있다.
본 실시예와 같이 SFE를 사용할 경우, 게임 스레드가 슬립 하는 시간의 계산 시, 현재 프레임 처리 시간에 대한 예측 시간을 기반으로 계산되기 때문에 오차가 발생할 수 있다. 일 실시예에 따르면, 실제 프레임의 처리 시 SFE 시간에 오차가 발생한 경우, 해당 오차만큼 서피스 플린저의 딜레이 시간을 증가 또는 감소 시켜, 오차를 보정할 수 있다. 일 실시예에 따르면, 전자 장치는 상기 SFE 시간에 오차를 보정한 시간을 누적 저장하고, 누적된 값을 이용해 다음 프레임에 적용될 SFE 시간을 결정할 수 있다. 또한, 보정된 SFE 시간을 게임 엔진 및 프레임워크에 제공하여, 프레임 별 균일한 렌더링 타이밍 정보를 제공할 수 있으며, 게임 엔진 또는 어플리케이션에서 각 프레임 별로 정확한 애니메이션 포지션을 렌더링 하는데 활용할 수 있다.
일 실시예에 따르면, 렌드 스레드에서 acquire 실행 시간을 더 줄이기 위해, 스왑체인 이미지의 개수를 증가 시킬 수 있다. 일반적으로 모바일 플랫폼(예: 안드로이드 플랫폼)에서는 렌더 스레드에서 3개의 스왑체인 이미지를 사용하고 있으며, 스왑체인 이미지를 4개로 늘리는 경우, 특정 상황에서 acquire 실행 시간이 감소될 수 있다. 예를 들어, 이미지 렌더링 시에 GPU의 부하로 인해 GPU 프로세스가 오래 걸릴 수 있으며, 이 경우 3개의 스왑체인 이미지 중 1개는 디스플레이에 출력 중이고, 1개는 서피스 플린저에서 GPU 프로세스가 완료되지 않아 합성(composition) 작업을 대기 중이고, 나머지 1개는 GPU 프로세스에서 작업 수행 중일 수 있다. 이러한 경우, 렌더 스레드에서 acquire를 수행 하더라도, 남은 이미지가 없기 때문에 acquire 수행 시간이 길어질 수 있다. 일 실시예에 따라 스왑체인 이미지를 4개 사용하는 경우, 상기 대기 시간이 줄어들 수 있다. 즉, 게임 스레드의 input 부터 렌더 스레드의 present까지의 프레임 처리 시간이 단축될 수 있으며, 특정 프레임의 처리가 오래 걸리더라도 이를 보정할 수 있는 시간이 확보되므로, 원활환 프레임 페이싱이 수행될 수 있다.
도 12는 다양한 실시예에 따른 전자 장치의 이미지 렌더링 방법의 흐름도이다.
다양한 실시예에 따르면, 동작 1210에서, 게임 엔진(또는 프레임워크)은 게임 어플리케이션의 실행 화면을 구성하는 프레임을 생성하기 위한 동작을 개시하고, 동작 1220에서, 프레임을 드로잉 및 present 할 수 있다. 일 실시예에 따르면, 게임 엔진은 그래픽 API로 present 하지 않고, 프레임 페이서로 present 할 수 있다.
다양한 실시예에 따르면, 동작 1230에서, 프레임 페이서는 프레임의 present를 확인할 수 있다.
다양한 실시예에 따르면, 동작 1240에서, 메인 스레드는 SFE(SyncFrameEnd)(또는 타임 마진) 동안 슬립 상태로 대기한 후, SFE 시간이 도과하면 사용자 입력 및 데이터의 처리를 수행할 수 있다. 여기서, SFE(또는 타임 마진)는 타겟 fps의 허용 시간과 현재 프레임의 실행 예측 시간의 차로써 계산될 수 있다.
다양한 실시예에 따르면, 동작 1250에서 프레임 페이서는 스왑 체인 스레드를 통해 present를 수행할 수 있다. 동작 1270에서, 스왑 체인 스레드는 이전 프레임의 GPU 렌더링이 완료 되었는지 확인하고, GPU 렌더링이 완료된 경우, 동작 1260에서 그래픽 API의 present(예: vkQueuepresentKHR)를 수행할 수 있다. 이와 같이, 스왑 체인 스레드에서 acquire 및 present를 수행하여, 게임 엔진의 CPU 처리 시간을 보장할 수 있다. 또한, GPU의 렌더링이 끝나는 시점을 확인하여 present를 수행하기 때문에 GPU 바운드 상황에서 보다 안정적인 프레임 시간을 제공할 수 있다.
다양한 실시예에 따른 전자 장치는, 디스플레이, 메모리, 및 상기 디스플레이 및 상기 메모리와 작동적으로 연결되는 프로세서를 포함하고, 상기 프로세서는, 어플리케이션의 실행에 대응하여, 상기 어플리케이션 상에서 사용자의 입력 및 데이터 처리와 관련된 메인 스레드(main thread) 및 상기 메인 스레드에서 처리된 데이터를 기반으로 프레임 단위로 이미지 데이터를 렌더링 하는 렌더 스레드(render thread)를 생성하고, 상기 어플리케이션의 실행 화면을 상기 디스플레이 상에 표시하기 위한 타겟 프레임 레이트를 설정하고, 상기 디스플레이를 통해 출력된 적어도 하나의 이전 프레임의 처리 시간을 기반으로, 현재 프레임의 예상 처리 시간을 계산하고, 상기 타겟 프레임 레이트 및 상기 계산된 예상 처리 시간에 기초하여, 타임 마진(time margin)을 결정하고, 및 상기 메인 스레드가 상기 타임 마진 동안 슬립 상태로 대기한 후, 상기 사용자 입력 및 데이터 처리를 수행하도록 설정될 수 있다.
다양한 실시예에 따르면, 상기 프로세서는, 상기 적어도 하나의 이전 프레임의 present 시간을 기반으로 상기 예상 처리 시간을 계산하도록 설정될 수 있다.
다양한 실시예에 따르면, 상기 프로세서는, 상기 메인 스레드가 상기 현재 프레임에 대응하는 시간 구간 이전에 입력된 사용자 입력의 처리를 상기 슬립 상태가 종료된 이후에 처리하도록 설정될 수 있다.
다양한 실시예에 따르면, 상기 프로세서는, 상기 메인 스레드 및 상기 렌더 스레드를 실행하는 CPU(central processing unit) 및 상기 CPU의 present 명령에 따라 프레임을 렌더링 하는 GPU(graphic processing unit)를 포함할 수 있다.
다양한 실시예에 따르면, 상기 CPU는, 게임 엔진 또는 프레임워크로부터 특정 프레임에 대한 present 정보를 수신하는 경우, 상기 특정 프레임의 이전 프레임에 대한 상기 GPU의 렌더링 동작이 종료된 이후에 상기 수신되는 present 정보에 대응하는 present 명령을 상기 GPU로 전달하도록 설정될 수 있다.
다양한 실시예에 따르면, 상기 present 명령에 따라 렌더링 한 프레임은 서피스 플린저(surface flinger)로 전달되고, 상기 서피스 플린저는 수직 동기 신호에 따라 상기 프레임을 상기 디스플레이 상에 표시하도록 할 수 있다.
다양한 실시예에 따르면, 상기 서피스 플린저는, 상기 GPU의 렌더링 동작이 완료된 후 소정의 딜레이 시간 이후에 상기 렌더링 된 프레임을 처리하도록 설정될 수 있다.
다양한 실시예에 따르면, 상기 프로세서는, 스왑 체인(swapchain) 스레드를 더 실행하고, 생성된 프레임의 present 명령을 상기 스왑 체인 스레드를 통해 수행하도록 할 수 있다.
다양한 실시예에 따르면, 상기 스왑 체인 스레드는, 현재 프레임을 GPU 및 서피스 플린저에 전달할 함수 및 다음 프레임을 획득하기 위한 함수를 수행하도록 설정될 수 있다.
다양한 실시예에 따르면, 상기 어플리케이션은 게임 어플리케이션일 수 있다.
다양한 실시예에 따른 전자 장치의 이미지 렌더링 방법은, 어플리케이션의 실행에 대응하여, 상기 어플리케이션 상에서 사용자의 입력 및 데이터 처리와 관련된 메인 스레드(main thread) 및 상기 메인 스레드에서 처리된 데이터를 기반으로 프레임 단위로 이미지 데이터를 렌더링 하는 렌더 스레드(render thread)를 생성하는 동작, 상기 어플리케이션의 실행 화면을 상기 디스플레이 상에 표시하기 위한 타겟 프레임 레이트를 설정하는 동작, 디스플레이를 통해 출력된 적어도 하나의 이전 프레임의 처리 시간을 기반으로, 현재 프레임의 예상 처리 시간을 계산하는 동작, 상기 타겟 프레임 레이트 및 상기 계산된 예상 처리 시간에 기초하여, 타임 마진(time margin)을 결정하는 동작, 및 상기 메인 스레드가 상기 타임 마진 동안 슬립 상태로 대기한 후, 상기 사용자 입력 및 데이터 처리를 수행하는 동작을 포함할 수 있다.
다양한 실시예에 따르면, 상기 예상 처리 시간을 계산하는 동작은, 상기 적어도 하나의 이전 프레임의 present 시간을 기반으로 상기 예상 처리 시간을 계산하는 동작을 포함할 수 있다.
다양한 실시예에 따르면, 상기 프로세서는, 상기 메인 스레드가 상기 현재 프레임에 대응하는 시간 구간 이전에 입력된 사용자 입력의 처리를 상기 슬립 상태가 종료된 이후에 처리하는 동작을 포함할 수 있다.
다양한 실시예에 따르면, 상기 전자 장치는, 상기 메인 스레드 및 상기 렌더 스레드를 실행하는 CPU(central processing unit) 및 상기 CPU의 present 명령에 따라 프레임을 렌더링 하는 GPU(graphic processing unit)를 포함할 수 있다.
다양한 실시예에 따르면, 상기 CPU는, 게임 엔진 또는 프레임워크로부터 특정 프레임에 대한 present 정보를 수신하는 경우, 상기 특정 프레임의 이전 프레임에 대한 상기 GPU의 렌더링 동작이 종료된 이후에 상기 수신되는 present 정보에 대응하는 present 명령을 상기 GPU로 전달하도록 설정될 수 있다.
다양한 실시예에 따르면, 상기 present 명령에 따라 렌더링 한 프레임은 서피스 플린저(surface flinger)로 전달되고, 상기 서피스 플린저는 수직 동기 신호에 따라 상기 프레임을 상기 디스플레이 상에 표시할 수 있다.
다양한 실시예에 따르면, 상기 서피스 플린저가 상기 GPU의 렌더링 동작이 완료된 후 소정의 딜레이 시간 이후에 상기 렌더링 된 프레임을 처리하는 동작을 포함할 수 있다.
다양한 실시예에 따르면, 스왑 체인(swapchain) 스레드를 더 실행하는 동작, 및 생성된 프레임의 present 명령을 상기 스왑 체인 스레드를 통해 수행하는 동작을 포함할 수 있다.
다양한 실시예에 따르면, 상기 스왑 체인 스레드는, 현재 프레임을 GPU 및 서피스 플린저에 전달할 함수 및 다음 프레임을 획득하기 위한 함수를 수행할 수 있다.
다양한 실시예에 따르면, 상기 어플리케이션은 게임 어플리케이션일 수 있다.

Claims (15)

  1. 전자 장치에 있어서,
    디스플레이;
    메모리; 및
    상기 디스플레이 및 상기 메모리와 작동적으로 연결되는 프로세서를 포함하고,
    상기 프로세서는,
    어플리케이션의 실행에 대응하여, 상기 어플리케이션 상에서 사용자의 입력 및 데이터 처리와 관련된 메인 스레드(main thread) 및 상기 메인 스레드에서 처리된 데이터를 기반으로 프레임 단위로 이미지 데이터를 렌더링 하는 렌더 스레드(render thread)를 생성하고,
    상기 어플리케이션의 실행 화면을 상기 디스플레이 상에 표시하기 위한 타겟 프레임 레이트를 설정하고,
    상기 디스플레이를 통해 출력된 적어도 하나의 이전 프레임의 처리 시간을 기반으로, 현재 프레임의 예상 처리 시간을 계산하고,
    상기 타겟 프레임 레이트 및 상기 계산된 예상 처리 시간에 기초하여, 타임 마진(time margin)을 결정하고, 및
    상기 메인 스레드가 상기 타임 마진 동안 슬립 상태로 대기한 후, 상기 사용자 입력 및 데이터 처리를 수행하도록 설정된 전자 장치.
  2. 제 1항에 있어서,
    상기 프로세서는,
    상기 적어도 하나의 이전 프레임의 present 시간을 기반으로 상기 예상 처리 시간을 계산하도록 설정된 전자 장치.
  3. 제 1항에 있어서,
    상기 프로세서는,
    상기 메인 스레드가 상기 현재 프레임에 대응하는 시간 구간 이전에 입력된 사용자 입력의 처리를 상기 슬립 상태가 종료된 이후에 처리하도록 설정된 전자 장치.
  4. 제 1항에 있어서,
    상기 프로세서는,
    상기 메인 스레드 및 상기 렌더 스레드를 실행하는 CPU(central processing unit) 및 상기 CPU의 present 명령에 따라 프레임을 렌더링 하는 GPU(graphic processing unit)를 포함하는 전자 장치.
  5. 제 4항에 있어서,
    상기 CPU는,
    게임 엔진 또는 프레임워크로부터 특정 프레임에 대한 present 정보를 수신하는 경우,
    상기 특정 프레임의 이전 프레임에 대한 상기 GPU의 렌더링 동작이 종료된 이후에 상기 수신되는 present 정보에 대응하는 present 명령을 상기 GPU로 전달하도록 설정된 전자 장치.
  6. 제 5항에 있어서,
    상기 present 명령에 따라 렌더링 한 프레임은 서피스 플린저(surface flinger)로 전달되고,
    상기 서피스 플린저는 수직 동기 신호에 따라 상기 프레임을 상기 디스플레이 상에 표시하도록 하는 전자 장치.
  7. 제 6항에 있어서,
    상기 서피스 플린저는,
    상기 GPU의 렌더링 동작이 완료된 후 소정의 딜레이 시간 이후에 상기 렌더링 된 프레임을 처리하도록 설정된 전자 장치.
  8. 제 1항에 있어서,
    상기 프로세서는,
    스왑 체인(swapchain) 스레드를 더 실행하고,
    생성된 프레임의 present 명령을 상기 스왑 체인 스레드를 통해 수행하도록 하는 전자 장치.
  9. 제 8항에 있어서,
    상기 스왑 체인 스레드는,
    현재 프레임을 GPU 및 서피스 플린저에 전달할 함수 및 다음 프레임을 획득하기 위한 함수를 수행하도록 설정된 전자 장치.
  10. 제 1항에 있어서,
    상기 어플리케이션은 게임 어플리케이션인 전자 장치.
  11. 전자 장치의 이미지 렌더링 방법에 있어서,
    어플리케이션의 실행에 대응하여, 상기 어플리케이션 상에서 사용자의 입력 및 데이터 처리와 관련된 메인 스레드(main thread) 및 상기 메인 스레드에서 처리된 데이터를 기반으로 프레임 단위로 이미지 데이터를 렌더링 하는 렌더 스레드(render thread)를 생성하는 동작;
    상기 어플리케이션의 실행 화면을 상기 디스플레이 상에 표시하기 위한 타겟 프레임 레이트를 설정하는 동작;
    디스플레이를 통해 출력된 적어도 하나의 이전 프레임의 처리 시간을 기반으로, 현재 프레임의 예상 처리 시간을 계산하는 동작;
    상기 타겟 프레임 레이트 및 상기 계산된 예상 처리 시간에 기초하여, 타임 마진(time margin)을 결정하는 동작; 및
    상기 메인 스레드가 상기 타임 마진 동안 슬립 상태로 대기한 후, 상기 사용자 입력 및 데이터 처리를 수행하는 동작을 포함하는 방법.
  12. 제 11항에 있어서,
    상기 예상 처리 시간을 계산하는 동작은,
    상기 적어도 하나의 이전 프레임의 present 시간을 기반으로 상기 예상 처리 시간을 계산하는 동작을 포함하는 방법.
  13. 제 11항에 있어서,
    상기 메인 스레드가 상기 현재 프레임에 대응하는 시간 구간 이전에 입력된 사용자 입력의 처리를 상기 슬립 상태가 종료된 이후에 처리하는 동작을 더 포함하는 방법.
  14. 제 11항에 있어서,
    스왑 체인(swapchain) 스레드를 더 실행하는 동작; 및
    생성된 프레임의 present 명령을 상기 스왑 체인 스레드를 통해 수행하는 동작을 더 포함하는 방법.
  15. 제 14항에 있어서,
    상기 스왑 체인 스레드는,
    현재 프레임을 GPU 및 서피스 플린저에 전달할 함수 및 다음 프레임을 획득하기 위한 함수를 수행하는 방법.
PCT/KR2021/016648 2020-11-13 2021-11-15 전자 장치 및 전자 장치의 이미지 렌더링 방법 WO2022103225A1 (ko)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US17/544,411 US11935149B2 (en) 2020-11-13 2021-12-07 Electronic device and image rendering method thereof for adjusting frame rate

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
KR20200152270 2020-11-13
KR10-2020-0152270 2020-11-13
KR10-2021-0052642 2021-04-22
KR1020210052642A KR20220065650A (ko) 2020-11-13 2021-04-22 전자 장치 및 전자 장치의 이미지 렌더링 방법

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/544,411 Continuation US11935149B2 (en) 2020-11-13 2021-12-07 Electronic device and image rendering method thereof for adjusting frame rate

Publications (1)

Publication Number Publication Date
WO2022103225A1 true WO2022103225A1 (ko) 2022-05-19

Family

ID=81602513

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2021/016648 WO2022103225A1 (ko) 2020-11-13 2021-11-15 전자 장치 및 전자 장치의 이미지 렌더링 방법

Country Status (1)

Country Link
WO (1) WO2022103225A1 (ko)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117130766A (zh) * 2023-01-17 2023-11-28 荣耀终端有限公司 一种线程处理方法及电子设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20120123722A (ko) * 2010-03-02 2012-11-09 엠파이어 테크놀로지 디벨롭먼트 엘엘씨 분산형 마르코프 체인 몬테 카를로
KR20160066228A (ko) * 2014-12-02 2016-06-10 (주)두리반테크 분산 렌더링 시스템
KR101680545B1 (ko) * 2015-06-30 2016-11-30 인천대학교 산학협력단 파노라마 동영상 생성 서비스 제공 방법 및 장치
CN109887065A (zh) * 2019-02-11 2019-06-14 京东方科技集团股份有限公司 图像渲染方法及其装置
KR20190134694A (ko) * 2017-03-30 2019-12-04 매직 립, 인코포레이티드 중앙화된 렌더링

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20120123722A (ko) * 2010-03-02 2012-11-09 엠파이어 테크놀로지 디벨롭먼트 엘엘씨 분산형 마르코프 체인 몬테 카를로
KR20160066228A (ko) * 2014-12-02 2016-06-10 (주)두리반테크 분산 렌더링 시스템
KR101680545B1 (ko) * 2015-06-30 2016-11-30 인천대학교 산학협력단 파노라마 동영상 생성 서비스 제공 방법 및 장치
KR20190134694A (ko) * 2017-03-30 2019-12-04 매직 립, 인코포레이티드 중앙화된 렌더링
CN109887065A (zh) * 2019-02-11 2019-06-14 京东方科技集团股份有限公司 图像渲染方法及其装置

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117130766A (zh) * 2023-01-17 2023-11-28 荣耀终端有限公司 一种线程处理方法及电子设备

Similar Documents

Publication Publication Date Title
WO2021145727A1 (en) Electronic device and screen refresh method thereof
WO2020166894A1 (en) Electronic device and method for recommending word in same
WO2022108192A1 (ko) 전자 장치 및 전자 장치의 멀티윈도우 제어방법
WO2022103225A1 (ko) 전자 장치 및 전자 장치의 이미지 렌더링 방법
WO2021158055A1 (en) Electronic device including touch sensor ic and operation method thereof
WO2022169092A1 (ko) 전자 장치 및 그 제어 방법
WO2022030998A1 (ko) 디스플레이를 포함하는 전자 장치 및 그의 동작 방법
WO2022092580A1 (ko) 전자 장치 표면의 온도를 예측하는 방법 및 그 전자 장치
WO2022005003A1 (ko) 가변 리프레시 레이트를 갖는 표시 장치를 포함하는 전자 장치 및 그 동작 방법
WO2023022356A1 (ko) 디스플레이 패널을 제어하는 커맨드들을 처리하는 타이밍을 동기화하기 위한 전자 장치 및 방법
WO2024101879A1 (ko) 전자 장치 및 전자 장치에서 이미지 프레임 동기화 제어 방법
WO2022103156A1 (ko) 플렉서블 디스플레이를 포함하는 전자 장치 및 이를 이용하는 방법
WO2023287057A1 (ko) 주변 장치로부터 입력을 수신하였을 때 화면을 빠르게 업데이트하는 전자 장치
WO2022191409A1 (ko) 전자 장치 및 그 제어 방법
WO2024072057A1 (ko) 터치 회로로부터의 신호에 기반하여 이미지의 표시를 스케줄링하는 전자 장치 및 방법
WO2022114648A1 (ko) 배경 화면을 설정하기 위한 전자 장치 및 그의 동작 방법
WO2023214675A1 (ko) 터치 입력을 처리하기 위한 전자 장치 및 방법
WO2024096317A1 (ko) 디스플레이에게 전력을 제공하기 위한 전자 장치
WO2022030866A1 (ko) 데이터 처리 장치 및 방법
WO2024072056A1 (ko) 프로세서로부터 디스플레이로의 펄스 신호를 제어하는 전자 장치
WO2024058415A1 (ko) 화면 제공 시간을 저감하는 전자 장치 및 이의 제어 방법
WO2023106606A1 (ko) 전자 장치들 간의 공동 편집을 지원하는 클라우드 서버 및 그 동작 방법
WO2021251655A1 (ko) 전자 장치 및 전자 장치에서 디스플레이 구동 신호 기반의 동기화 방법
WO2024076031A1 (ko) 클럭 레이트를 제어하는 디스플레이 구동 회로를 포함하는 전자 장치
WO2022181949A1 (ko) Ar/vr 환경을 제공하는 전자 장치 및 그 운용 방법

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: 21892392

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: 21892392

Country of ref document: EP

Kind code of ref document: A1