Graphics driver “hello world” example? [closed]

  • Step 1: Understand the particular GPU you are targetting (Architecture, register and stream details). I am afraid for many of
    the GPUs these details may be proprietary and you may not get it. (But as you mentioned, in your case specs are available)
  • Step 2: Add some calls in your driver that are able to query registers / details from the driver.
  • Step 3: Add some calls in your driver to modify registers. (Change mode etc)
  • Step 4: You can check how to draw a triangle / quad on your GPU with a constant color. Try to implement screen clear (functionality
    similar to glClear) by drawing a big quad or 2 triangles or 1
    triangle of dimension double of the screen or sending some clear
    command. (whichever method is supported by the GPU) If you are
    drawing a triangle or quad, use NDC (normalized device coordinate)
    system and prefer to work in Raw windowing system or NWS (Null
    windowing system). Windowing system is responsible for displaying
    your output framebuffer after compositing or some post processing. By
    Raw or NWS, I mean display the framebuffer directly to screen.
  • Step 5 (most of the things are optional): Implement some complex drawing. This may involve support of other drawing modes like pixel,
    line, triangular strip, triangular fan etc and support of texture,
    lighting, transformation, interaction with other windowing system.
    For this step you will need to learn assembly. But do notice, this is
    not x86 or arm (CPU) assembly, rather it is GPU assembly which is
    specialized in handling SIMD.
  • Step 6: Implement stencil functionality. Prepare a stencil of hello world in your program. Clear the screen with color 1. Apply the
    stencil and clear the screen again with color 2. Now you have hello
    world written in color 2 with color 1 as background.

Mottivation to do this all is: You want to do this. And this will be cool.

Demotivation to do this is: Possible unavailability of GPU specifications, learning curve for GPU assembly, complexity of graphics.

My Recommendation: If GPU specs (along with assembly) is available to you, I would suggest implement subset of any available API set (open vg and open GLES 1.1) for example. To read more about these API set, please visit khronos website.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)