Preview

Writing High Performance Shaders with a High-Level Shading Language

Good Essays
Open Document
Open Document
3162 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Writing High Performance Shaders with a High-Level Shading Language
1

This topic has grown on me over the years as I have seen shader code on slides at conferences, by brilliant people, where the code could have been written in a much better way. Occasionally I hear an “this is unoptimized” or “educational example” attached to it, but most of the time this excuse doesn't hold. I sometimes sense that the author may use “unoptimized” or “educational” as an excuse because they are unsure how to make it right. And then again, code that's shipping in SDK samples from IHVs aren't always doing it right either.
When the best of the best aren't doing it right, then we have a problem as an industry.

2

3

(x – 0.3) * 2.5 = x * 2.5 + (-0.75)

4

Assembly languages are dead. The last time I used one was 2003. Since then it has been HLSL and GLSL for everything. I haven't looked back.
So shading has of course evolved, and it is a natural development that we are seeing higher level abstractions as we're moving along. Nothing wrong with that. But as the gap between the hardware and the abstractions we are working with widens, there is an increasing risk of losing touch with the hardware. If we only ever see the HLSL code, but never see what the GPU runs, this will become a problem. The message in this presentation is that maintaining a low-level mindset while working in a high-level shading language is crucial for writing high performance shaders.

5

This is a clear illustration of why we should bother with low-level thinking. With no other change than moving things around a little and adding some parentheses we achieved a substantially faster shader. This is enabled by having an understanding of the underlying HW and mapping of HLSL constructs to it.
The HW used in this presentation is a Radeon HD 4870 (selected because it features the most readable disassembly), but most of everything in this slide deck is really general and applies to any GPU unless stated otherwise.

6

Hardware comes in many configurations

You May Also Find These Documents Helpful

  • Better Essays

    Tanglewood Case-3

    • 2541 Words
    • 11 Pages

    "Executives: Your Company Isn 't Attracting the Best Talent." Executives: Your Company Isn 't Attracting the Best Talent. N.p., n.d. Web. 27 Nov. 2012. .…

    • 2541 Words
    • 11 Pages
    Better Essays
  • Satisfactory Essays

    “I prefer to think of this factory as a giant atelier, where a team of artists creates not specialized tools, but hand-machined works of art,” said Roger, the owner of Calumette Industries. “And as long as our goal remains pellucid to every employee, this company will soar.” Roger, who took over the failing operation just months ago, sparked life back into the floundering plant by replacing archaic industry practices with new methods guaranteed to increase production; however, despite Roger’s many changes to the plant, he was quick to note that he is a firm believer in the axiom, “Don’t fix things that…

    • 371 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    Microsoft, (2006), Knowledge base article 99588, Hardware abstraction layer (HAL), Retrieved July 21, 2007 from: http://support.microsoft.com/kb/99588…

    • 2709 Words
    • 11 Pages
    Powerful Essays
  • Powerful Essays

    Introduction: In this assignment, I will explain the role of hardware and software components within a computer system. Furthermore, I will explain how they relate to digital graphics.I will also recommend suitable components for Cambridge Industrial Design. (P1)…

    • 3549 Words
    • 15 Pages
    Powerful Essays
  • Satisfactory Essays

    This article focuses a lot on the output of the rewriting activity, inspecting the rewritten HPC programs and causes of source-code bloat. “A key metric was the number of SLOC (source lines of code).” The use of source code, uncovers various indications that the rewritten programs had fewer lines of code, and also that they were easier to read, verify, and modify. The new code is clear, concise, and easy to read. Readability and maintainability of the source code benefited greatly from condensing these transformations into a few functions, but the performance suffered from the extra procedure calls and loss of many specializations and optimizations of the transformations. The battle to deliver good performance on expressive HPC source code must still…

    • 630 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    In Rodriguez, darker sink is not specific shading. Darker is verification of the mix. Brown skin is a shade made by yearning…

    • 1042 Words
    • 5 Pages
    Good Essays
  • Good Essays

    The Crisis At Chipotle

    • 350 Words
    • 2 Pages

    In big name businesses the fame and cash rolling in non-stop can’t always be good. Everybody makes mistakes just some are broadcasted bigger than others. The way that you take care of your mistakes reflects how you are asa company or person. This shows other people if they can trust you of this ever happens again and hopefully it won't.…

    • 350 Words
    • 2 Pages
    Good Essays
  • Better Essays

    Assembly language enables programmers to relate op codes using symbolic names in place of numbers to perform an instruction or input a piece of data. Programmers can inscribe op codes using purposeful words like JUMP, CLEAR, and ADD as an alternative to cryptic binary codes consisting of series of 0s and 1s. An example of assembly language, machine language and its meaning are listed in the book called, “Invitation to Computer Science” (Schneider & Gersting, 2013, pp. 285, fig. 6.5). In figure 6.5, assembly language is clearly easier to comprehend than machine language, which makes assembly language user friendly.…

    • 2002 Words
    • 9 Pages
    Better Essays
  • Good Essays

    Red lobster

    • 1270 Words
    • 6 Pages

    The major problem is that B&D has enjoyed leading brand name and good quality, but they did not perform as good in tradesmen segment as in consumer segment and industrial segment.…

    • 1270 Words
    • 6 Pages
    Good Essays
  • Good Essays

    The company is criticized for lack of concern in promoting sound management to ensure productivity and efficiency in the process.…

    • 1714 Words
    • 7 Pages
    Good Essays
  • Powerful Essays

    THE VIEWS EXPRESSED ARE THOSE OF THE AUTHORS. NO RESPONSIBILITY FOR THEM SHOULD BE ATTRIBUTED TO INDUSTRY CANADA.…

    • 12116 Words
    • 49 Pages
    Powerful Essays
  • Good Essays

    Operations Management

    • 536 Words
    • 3 Pages

    A. Why does the "proper" operation strategy keep changing for A. companies that are world-class competitors? The world is evolving every day and is at a constant change or upgrade. So it only makes sense that the “proper ” operation strategy will also evolve and change over time, otherwise your corporation could easily get run over by the competition and transforming market. As a company it ’s important to position yourself with your product or service in the market, whether it would be high price and high quality or low price and fast shipping.…

    • 536 Words
    • 3 Pages
    Good Essays
  • Best Essays

    big problems from day to day. In order to be competitive in the global workspace, they have to…

    • 1685 Words
    • 7 Pages
    Best Essays
  • Powerful Essays

    There is no doubt that problems exists in any dynamic business. The most important is that what are usually lacking are clear definitions of the problems and the priority…

    • 4247 Words
    • 17 Pages
    Powerful Essays
  • Satisfactory Essays

    2. Failure to broadly define their industry restricts companies from taking advantage of growth opportunities. Inability of being proactive and staying one step ahead of competition destroys company’s own high profitable assets.…

    • 273 Words
    • 2 Pages
    Satisfactory Essays

Related Topics