The present invention is generally directed to 2D rendering on 3D graphics hardware, and in particular, to 2D rendering on 3D graphics hardware by forming the 3D object using the 2D object.
Users continue to demand more and more graphics for all aspects of computing. Often, computer application need to render 2D graphic objects, but often modern computer systems only have 3D graphics hardware available to render the 2D graphic objects.
Therefore, there is a need in the art for an apparatus, computer readable medium, and method of rendering a 2D object using a 3D graphics processing unit (GPU).
The method includes one or more shaders running on the 3D GPU forming a 3D object by accessing the 2D object.
The method may include one or more shaders running on the 3D GPU forming a 3D object by forming a plurality of 3D vertex positions of the 2D object by accessing the 2D object.
The method may include one or more shaders running on the 3D GPU forming a 3D object by forming a plurality of 3D vertex attributes of the 2D object by accessing the 2D object.
The 3D vertex attributes may include texture coordinates, colors, or positions.
The method may include copying the 2D object from a central processing memory (CPU) to a GPU memory, and the one or more shaders running on the 3D GPU forming a 3D object by forming a plurality of 3D vertex positions of the 2D object by accessing the 2D object from the GPU memory.
The method may include copying a plurality of the 2D objects from a central processing memory (CPU) to a GPU memory; and, one or more shaders running on the 3D GPU forming the 3D object by forming a plurality of 3D vertex positions of the 2D object of the plurality of 2D objects by accessing the 2D object from the GPU memory.
The method may include the one or more shaders running on the 3D GPU forming a 3D object by converting the 2D object into a 3D object by accessing the 2D object.
Each of the one or more shaders may be executed by a single instruction multiple data (SIMD) processor of the GPU. The method may include displaying the 2D object using the 3D GPU.
The 2D object may be a rectangle. The 2D object may be a polygon.
The method may include the one or more shaders performing rendering effects on the formed 3D object.
A 2D rendering device is disclosed. The 2D rendering device may include a 3D graphic processing unit (GPU) and one or more shaders configured to execute on the 3D GPU and configured to form a 3D object by accessing the 2D object.
The 2D rendering device may include a central processing unit (CPU), a first memory, and a second memory. The CPU may be configured to copy one or more 2D objects from the first memory to the second memory, and the one or more shaders may be configured to access the 2D object from the second memory.
The one or more shaders may be further configured to form a plurality of 3D vertex attributes of the 2D object.
The 3D GPU may include a plurality of single instruction multiple data (SIMD) processors, and each of the one or more shaders may be further configured to execute on a different SIMDs of the plurality of SIMD processors.
A computer readable non-transitory medium including instructions which when executed in a processing system cause the processing system to execute a method for 2D rendering, the method comprising one or more shaders running on the 3D GPU forming a 3D object by forming a plurality of 3D positions of the 2D object by accessing the 2D object.
A more detailed understanding may be had from the following description, given by way of example in conjunction with the accompanying drawings wherein:
The processor 102 may include a central processing unit (CPU) 116, a graphics processing unit (GPU) 118, which may be located on the same die or different dies. The CPU 112 may include a memory 120 and one or more processor cores (not illustrated). Each of the processor cores may itself be a CPU or a GPU. The memory 120 may be a memory that is only accessible to the CPU 116 or it may be a shared memory accessible by other components of the system 100 such as the GPU 118. The GPU 118 may include a memory 122 which may be accessible only to the GPU 118 or it may be a shared memory accessible by other components of the system 100 such as the CPU 116.
The memory 104 may be located on the same die as the processor 102, or may be located separately from the processor 102. The memory 104 may include a volatile or non-volatile memory, for example, random access memory (RAM), dynamic RAM, or a cache. The memory 104 may include a cache (not illustrated) which may be a type of storage that may have faster access times than other portions of the memory 104.
The storage 106 may include a fixed or removable storage, for example, a hard disk drive, a solid state drive, an optical disk, or a flash drive. The input devices 108 may include a keyboard, a keypad, a touch screen, a touch pad, a detector, a microphone, an accelerometer, a gyroscope, a biometric scanner, or a network connection (e.g., a wireless local area network card for transmission and/or reception of wireless IEEE 802 signals). The output devices 110 may include a display, a speaker, a printer, a haptic feedback device, one or more lights, an antenna, or a network connection (e.g., a wireless local area network card for transmission and/or reception of wireless IEEE 802 signals).
The input driver 112 communicates with the processor 102 and the input devices 108, and permits the processor 102 to receive input from the input devices 108. The output driver 114 communicates with the processor 102 and the output devices 110, and permits the processor 102 to send output to the output devices 110. It is noted that the input driver 112 and the output driver 114 are optional components, and that the device 100 will operate in the same manner if the input driver 112 and the output driver 114 are not present.
The GPU 118 may include a bus 206, processing units 220, memory 122, and a shader 230. The bus 206 may be a communication bus for the processing units 220, shader 230, and memory 122 to communicate with one another. The processing units 220 may include processors 212, processing unit control 216. The processors 212 may be single instruction multiple data (SIMD) units. The processing unit control 216 may control the operation of the processors 212. Each of the processors 212 may execute the same instruction 218 at the same time with different data. As illustrated, each of the processors 212 is forming a portion of a 3D object 210 from the 2D object 202. The processors 212 may access memory 122 using the bus 206 with memory requests 208. The memory 122 may be a memory associated with the GPU 118 as discussed above. The shader 230 may be configured to perform shader operations on the 2D object 202 by forming the 3D object of the 2D object 202 by accessing the 2D object 202. The shader 230 and 3D object 210 are discussed further in conjunction with
The method 300 may continue with switch(vertex_index) 344 at 342. If the value of vertex_index is zero, the method 300 may continue with case 0 at 346. The method 300 may continue with pos_out.x=rect.y at 348. For example, referring to
In some embodiments, each portion of the switch 344 may be performed by a different processor 212.1. In some embodiments, conditional operators are used rather than a switch statement in the example of
The method may continue with one or more shaders running on the 3D GPU forming a 3D object of the 2D object by accessing the 2D object at 506. For example, again referring to
Some disclosed embodiments have the advantage that the representation of the 2D object is not converted into a 3D object representation in memory for the shaders to access the 3D object representation. By not converting the 2D object to a 3D object memory space is saved, and processing time is reduced.
It should be understood that many variations are possible based on the disclosure herein. Although features and elements are described above in particular combinations, each feature or element may be used alone without the other features and elements or in various combinations with or without other features and elements.
The methods provided may be implemented in a general purpose computer, a processor, or a processor core. Suitable processors include, by way of example, a general purpose processor, a special purpose processor, a conventional processor, a digital signal processor (DSP), a plurality of microprocessors, one or more microprocessors in association with a DSP core, a controller, a microcontroller, Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) circuits, any other type of integrated circuit (IC), and/or a state machine. Such processors may be manufactured by configuring a manufacturing process using the results of processed hardware description language (HDL) instructions and other intermediary data including netlists (such instructions capable of being stored on a computer readable media). The results of such processing may be maskworks that are then used in a semiconductor manufacturing process to manufacture a processor which implements aspects of the present invention.
The methods or flow charts provided herein may be implemented in a computer program, software, or firmware incorporated in a computer-readable storage medium for execution by a general purpose computer or a processor. Examples of computer-readable storage mediums include a read only memory (ROM), a random access memory (RAM), a register, cache memory, semiconductor memory devices, magnetic media such as internal hard disks and removable disks, magneto-optical media, and optical media such as CD-ROM disks, and digital versatile disks (DVDs). The computer-readable storage may be non-transitory.
This application claims the benefit of U.S. provisional application No. 61/750,628 filed Jan. 9, 2013, the contents of which are hereby incorporated by reference as if fully set forth herein.
Number | Date | Country | |
---|---|---|---|
61750628 | Jan 2013 | US |