dMZX Forums: DirectX 11 renderer - dMZX Forums

Jump to content

If you are new to DMZX, please take the time to look over the FAQ pinned in General before asking a question.

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

DirectX 11 renderer

#1 User is offline   LogiCow 

  • Holiday cow
  • PipPipPipPipPip
  • Group: Members
  • Posts: 2,671
  • Joined: 18-July 02
  • Gender:Male
  • Location:Quebec

Posted 21 May 2018 - 03:59 AM

I've been working on a DirectX 11 renderer for mzx.
It skips the scaler and doesn't filter anything.
It supports layers (and therefore unbound sprites).
It runs in its own thread.
A single shader handles both non-smzx and smzx modes.

I could add a step to render in 640x350 and scale it up, or split up regular and smzx modes to skip a condition in the shader but I think it runs well enough the way it is at the moment.

Let me know if you've got a windows PC supporting DirectX 11 that can't reach 60 frames per second at your desktop's native resolution, has rendering errors or has significantly worse performance compared to other renderers.

https://github.com/l...ee/d3d11_branch

As a side note, the shoddy threading code has an SDL_Delay(0) loop checking for updates, which should probably be changed before merging to the master repository as it wastes ~15% CPU not doing much.

This post has been edited by LogiCow: 21 May 2018 - 04:25 AM

0

#2 User is offline   LogiCow 

  • Holiday cow
  • PipPipPipPipPip
  • Group: Members
  • Posts: 2,671
  • Joined: 18-July 02
  • Gender:Male
  • Location:Quebec

Posted 21 May 2018 - 04:23 AM

Here's an executable compiled and set up to use d3d11 with the framerate counter enabled.

Update: fixed row pitch issue on textures, tweaked scaling, threads use conditions and signals, fixed transparency on colors above 255, fixed SMZX indices

Attached File(s)


This post has been edited by LogiCow: 24 May 2018 - 09:41 AM

0

#3 User is offline   Graham 

  • . "@Master Procrastinator"
  • PipPipPipPip
  • Group: Members
  • Posts: 625
  • Joined: 28-December 12
  • Gender:Male
  • Location:Oregon

Posted 23 May 2018 - 04:26 AM

Hmm. Well it appears to not currently support indicies files in MZX mode 3. at least that's what it looks like to me.

this is how the screen should look
Attached File  screen0.png (27.1K)
Number of downloads: 17


But this is how it appeared when I tested it
Attached File  Untitled.png (182.87K)
Number of downloads: 24


I wasn't able to use F12 to grab a picture. The picture it grabbed looked correct. That is the photo I included of the correct image. I had to print screen and copy to paint and save it.
Currently working on Servo for MegaZeux, I hope to complete it by the middle of 2015? Who knows...

"Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you’re a mile away and you have their shoes."
-Jack Handey
0

#4 User is offline   Graham 

  • . "@Master Procrastinator"
  • PipPipPipPip
  • Group: Members
  • Posts: 625
  • Joined: 28-December 12
  • Gender:Male
  • Location:Oregon

Posted 23 May 2018 - 04:28 AM

also my player sprite did not appear on screen when I tried walking around. I think he was below other layers of sprites.
Currently working on Servo for MegaZeux, I hope to complete it by the middle of 2015? Who knows...

"Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you’re a mile away and you have their shoes."
-Jack Handey
0

#5 User is offline   KKairos 

  • not an actual chipmunk
  • PipPipPipPipPip
  • Group: Members
  • Posts: 2,245
  • Joined: 05-August 00
  • Gender:Male

Posted 24 May 2018 - 05:09 AM

View PostGraham, on 22 May 2018 - 09:26 PM, said:

But this is how it appeared when I tested it
Attachment Untitled.png

I don't see the problem
darganflayer.net kaikairos.dev itch.io
0

#6 User is offline   LogiCow 

  • Holiday cow
  • PipPipPipPipPip
  • Group: Members
  • Posts: 2,671
  • Joined: 18-July 02
  • Gender:Male
  • Location:Quebec

Posted 24 May 2018 - 09:43 AM

I made the renderer force update the palette and indices texture every frame and it solved the issue for now, since at the moment there's no good way to know if/when indices changed.
0

#7 User is offline   Graham 

  • . "@Master Procrastinator"
  • PipPipPipPip
  • Group: Members
  • Posts: 625
  • Joined: 28-December 12
  • Gender:Male
  • Location:Oregon

Posted 25 May 2018 - 03:11 AM

That fixed it. Performance seemed comparable to GLSL that i'm currently using. I wasn't sure how to bring up the framerate counter, could you elaborate? There was a lot of screen tearing with DirectX; I don't experience any with GLSL.
Currently working on Servo for MegaZeux, I hope to complete it by the middle of 2015? Who knows...

"Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you’re a mile away and you have their shoes."
-Jack Handey
0

#8 User is offline   LogiCow 

  • Holiday cow
  • PipPipPipPipPip
  • Group: Members
  • Posts: 2,671
  • Joined: 18-July 02
  • Gender:Male
  • Location:Quebec

Posted 27 May 2018 - 07:54 PM

for tearing It's using the "gl_sync" config var, which defaults to false. (Doesn't apply on windows 10 in a window, where everything is triple-buffered)

Framerate counter shows up in the window title at the top, but it's not visible when full-screen.
0

#9 User is offline   Graham 

  • . "@Master Procrastinator"
  • PipPipPipPip
  • Group: Members
  • Posts: 625
  • Joined: 28-December 12
  • Gender:Male
  • Location:Oregon

Posted 30 May 2018 - 08:21 PM

View PostLogiCow, on 27 May 2018 - 11:54 AM, said:

for tearing It's using the "gl_sync" config var, which defaults to false. (Doesn't apply on windows 10 in a window, where everything is triple-buffered)

Framerate counter shows up in the window title at the top, but it's not visible when full-screen.


Oh ok gotcha. I always use full screen. Just a habit. I’ll try windowed mode.
Currently working on Servo for MegaZeux, I hope to complete it by the middle of 2015? Who knows...

"Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you’re a mile away and you have their shoes."
-Jack Handey
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users