r/linux_programming • • Dec 21 '23

Writing graphics programs

is there any way to access the intel/amd graphics devices directly or are their APIs only available to kernel modules?

6 Upvotes

11 comments sorted by

2

u/quaderrordemonstand Dec 21 '23

You almost certainly don't want to access the hardware directly. That would be very difficult, error prone, time consuming and it would gain you almost nothing.

If you want to get close to the metal then use something like Vulkan. However, the learning curve on Vulkan is very steep. You might find it easier to start with OpenGL, SDL or just good old Cairo.

1

u/Spocino Dec 22 '23

I want to make my own graphics API. I know how to use vulkan.

→ More replies (1)

1

u/[deleted] Dec 21 '23

What are you trying to do?

1

u/Spocino Dec 22 '23

Make my own graphics API (a la vulkan)

8

u/[deleted] Dec 21 '23

[removed] — view removed comment

1

u/Spocino Dec 22 '23

I want to make a graphics API

3

u/afiefh Dec 22 '23

If you need to ask this question then you certainly don't know enough to make a graphics API.

But to answer the question: Look at the Vulcan implementation in Mesa, it communicates with the interface the Kernel exposes. If you need to go even lower level then you pretty much need to go into the Kernel and talk to the hardware directly and expose that to your API.

1

u/Spocino Dec 22 '23

great! i was looking in mesa's src/amd and not src/vulkan, this helps!