Giter VIP home page Giter VIP logo

Comments (21)

itfrombit avatar itfrombit commented on June 27, 2024

The osx_asset_builder got left behind when I reorganized the repository a while back. Sorry about that!

I just checked in the code along with some additional instructions in the README file. Let me know if you are still having problems.

Thanks!
Jeff

from osx_handmade.

josephsweeney avatar josephsweeney commented on June 27, 2024

Thanks! Got it compiling, but getting a plain white screen now. Probably a separate issue though, will investigate. Let me know if you have any ideas of what may be causing it!

from osx_handmade.

itfrombit avatar itfrombit commented on June 27, 2024

Hmm. Are you using the latest version in the repository, or are you on a different commit day? Also, what type of Mac are you running on?

from osx_handmade.

josephsweeney avatar josephsweeney commented on June 27, 2024

I'm using the handmade hero repo from day 430 like it says in the Readme. Patch is applied.

Specs: MacBook Pro (13-inch, Late 2016, Four Thunderbolt 3 Ports)
Core i7, 16gb ram, macOS 10.13.6.

from osx_handmade.

itfrombit avatar itfrombit commented on June 27, 2024

I'm testing on a 2012 Mac Pro and a 2012 MacBook Pro, so you have way better hardware than I do - shouldn't be any problem there. I assume you are also using Casey's Day 430 code? It wouldn't work (or probably wouldn't even compile) with his latest code. Any messages in the terminal when you run the application?

from osx_handmade.

josephsweeney avatar josephsweeney commented on June 27, 2024

Yeah, I'm on Casey's day 430 code. Get these messages then it hangs:

2018-08-08 23:46:19.041 handmade[70207:14276032] working directory: /Users/joe/Developer/Handmade Hero/repos/osx_handmade
TargetSecondsPerFrame: 0.016667
Target frames per second = 60
process pid: 70207   path: /Users/joe/Developer/Handmade Hero/repos/osx_handmade/code/handmade
------------------------------ Game setup complete
OpenGL extension functions loaded
Loading asset intro_art.hha
Loading asset test1.hha
Loading asset test2.hha
Loading asset test3.hha
Loading asset testfonts.hha

from osx_handmade.

itfrombit avatar itfrombit commented on June 27, 2024

Just for reference, these are the messages I have in my terminal when I start:

dragon:code jsb$ ./handmade
2018-08-08 23:46:35.096 handmade[3766:228270] working directory: /Users/jsb/Dropbox/dev/handmade/handmadeGL/code
TargetSecondsPerFrame: 0.016667
Target frames per second = 60
process pid: 3766 path: /Users/jsb/Dropbox/dev/handmade/handmadeGL/code/handmade
------------------------------ Game setup complete
OpenGL extension functions loaded
Loading asset intro_art.hha
Loading asset test1.hha
Loading asset test2.hha
Loading asset test3.hha
Loading asset testfonts.hha

from osx_handmade.

josephsweeney avatar josephsweeney commented on June 27, 2024

For reference what I'm seeing when running:
screen shot 2018-08-08 at 11 50 45 pm

from osx_handmade.

josephsweeney avatar josephsweeney commented on June 27, 2024

I did a quick check in lldb and set a breakpoint at OSXProcessFrameAndRunGameLogic line 491, and it looks like I only hit it once and it hangs. I'm inexperienced with lldb though so I might be using it incorrectly.

Suspecting some bug in the rendering causing it to loop forever but not sure.

from osx_handmade.

itfrombit avatar itfrombit commented on June 27, 2024

That all looks good, except for the white window! Do you have a discrete graphics chip in your Mac, or is it Intel integrated graphics? I don't think that should make a difference, but both of my machines have discrete graphics (one Nvidia, one ATI). I'm digging out my MacBook Air with Intel graphics to test just in case.

from osx_handmade.

itfrombit avatar itfrombit commented on June 27, 2024

If you are in lldb when it hangs, go to the lldb terminal window and hit Ctrl-C. That should break back to the lldb command prompt. Then type 'bt' (without the quotes) and hit return. That will give you a stack backtrace and show you where you are in the code.

from osx_handmade.

josephsweeney avatar josephsweeney commented on June 27, 2024

Intel integrate graphics, and here's the backtrace, thanks for the tip!

* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
  * frame #0: 0x00007fff5e01e20a libsystem_kernel.dylib`mach_msg_trap + 10
    frame #1: 0x00007fff5e01d724 libsystem_kernel.dylib`mach_msg + 60
    frame #2: 0x00007fff388528a7 IOKit`io_connect_method + 369
    frame #3: 0x00007fff3885270e IOKit`IOConnectCallMethod + 244
    frame #4: 0x00007fff38853807 IOKit`IOConnectCallStructMethod + 38
    frame #5: 0x00007fff502af721 IOAccelerator`IOAccelContextSubmitDataBuffersExt2 + 248
    frame #6: 0x00007fff4eb124ba libGPUSupportMercury.dylib`gpusSubmitDataBuffers + 156
    frame #7: 0x000000010d01b59a AppleIntelSKLGraphicsGLDriver`IntelCommandBuffer::getNew(GLDContextRec*) + 178
    frame #8: 0x000000010d01b19b AppleIntelSKLGraphicsGLDriver`intelSubmitCommands + 171
    frame #9: 0x000000010d16aab4 AppleIntelSKLGraphicsGLDriver`intelFlushCommands + 187
    frame #10: 0x000000010d021ccc AppleIntelSKLGraphicsGLDriver`glrWriteTextureData + 5296
    frame #11: 0x00007fff40636b2d GLEngine`glTexSubImage1D_Exec + 1434
    frame #12: 0x00007fff3fa2f70e libGL.dylib`glTexSubImage1D + 42
    frame #13: 0x000000010000991a handmade`OSXDisplayBufferInWindow(platform_work_queue*, game_offscreen_buffer*, game_render_commands*, rectangle2i, unsigned int, unsigned int, memory_arena*) at handmade_opengl.cpp:2367
    frame #14: 0x000000010000828f handmade`OSXDisplayBufferInWindow(RenderQueue=<unavailable>, RenderBuffer=<unavailable>, Commands=0x00007ffeefbff910, DrawRegion=<unavailable>, WindowWidth=960, WindowHeight=540, TempArena=0x0000000107018be0) at osx_handmade_game.cpp:608
    frame #15: 0x000000010000b758 handmade`OSXProcessFrameAndRunGameLogic(GameData=<unavailable>, WindowFrame=(origin = (x = 0, y = 0), size = (width = 960, height = 540)), MouseInWindowFlag=<unavailable>, MouseLocation=<unavailable>, MouseButtonMask=<unavailable>) at osx_handmade_game.cpp:987
    frame #16: 0x0000000100002ca5 handmade`main(argc=<unavailable>, argv=<unavailable>) at osx_main.mm:491
    frame #17: 0x00007fff5ded7015 libdyld.dylib`start + 1

from osx_handmade.

itfrombit avatar itfrombit commented on June 27, 2024

That's definitely in an OpenGL call. Line 2368 of handmade_opengl.cpp calling glTexSubImage1D (frame #12). Now you might have just randomly landed on that call. You could try breaking again in lldb and seeing if you always get stuck there. Once you Ctrl-C to break in lldb, you can type 'c' and hit return to continue running again.

You could also try a different code day, just to see if it's a peculiarity with one of the more recent commits. Day 387 is right before Casey started messing with lighting, so it might be a good place to try.

from osx_handmade.

josephsweeney avatar josephsweeney commented on June 27, 2024

I tried a few more times after that because I thought the same thing but I tried again and it always stops on the call to glTexSubImage1D. I will experiment with other days and see if that solves the issue, thank you for your help and all your work!

from osx_handmade.

itfrombit avatar itfrombit commented on June 27, 2024

Thanks for investigating. Let me know what you find out. I have a 2017 iMac 5K and a MacBook Air to try here. If I can't reproduce it on any of my machines here, I'll track down a MacBook Pro with your specs and figure it out. Handmade Hero isn't pushing the limit of modern graphics cards, so it should be something pretty easy to solve.

from osx_handmade.

josephsweeney avatar josephsweeney commented on June 27, 2024

I tried a few previous days around 387 but I'm not able to compile. Just undeclared identifiers which makes sense if the code is out of sync. I was only able to get days in the 420's to compile, but those all had a plain white screen. Let me know if you reproduce. Thanks again!

from osx_handmade.

itfrombit avatar itfrombit commented on June 27, 2024

If you want to try compiling older days, you need to sync up the OS X platform layer with Casey's code from that day. I just tried it with Day 387 and it worked okay.

If you haven't messed around much with git branches and tags, here's one way to do it:

  1. If you want to do this in a new directory, clone the git repository as usual. Alternatively, you can skip this step and just go into your existing git clone repository directories.
    git clone https://github.com/itfrombit/osx_handmade

  2. Go to that directory:
    cd osx_handmade

  3. Change to the day 387 commit:
    git checkout tags/v387

  4. Clone Casey's cpp repository (or go to the existing one).

  5. Go to Casey's cpp repository and change to the day 387 commit. He uses 'day' as the prefix for his tags:
    git checkout tags/day387

  6. Run the fix_handmade_hero_source.sh shell script

  7. If in a new set of directories, copy the asset files that you recently generated over to the data subdirectory.

  8. Change to the code directory, run make. You should be able to run the executable now.

  9. To switch back to the latest commits in the git repositories, go to the root of the repositories and checkout the master:
    git checkout master

You can use the same .hha asset files that you recently generated. They haven't changed in a long time.

from osx_handmade.

josephsweeney avatar josephsweeney commented on June 27, 2024

Yup, I was checking out the correct day in the cpp repo, but not v387 of osx_handmade, now its running perfectly! Any ideas what's going wrong with later dates?

from osx_handmade.

itfrombit avatar itfrombit commented on June 27, 2024

Okay, we have some progress!

I haven't been able to reproduce your problem on any of my 4 Macs. I will try to find a MacBook Pro like you have from one of my friends, but in the meantime, here are a few things to try if you feel like investigating a little more.

First, it would be nice to track down the day it stops working. Here are a few milestones between your working day 387 and your non-working day 430. I'd recommend trying these in this order:

  • Day 388, which introduced a patch to Casey's OpenGL code.
  • Day 393, which added lighting textures. This might begin to stress the graphics card more.
  • Day 404, which was the last day before Casey upgraded to GLSL 3.3 shaders everywhere.
  • Day 405, which was the first day of GLSL 3.3 shaders.

It's pretty easy to bounce from day to day. You can just use the
git checkout tags/vXXX (for the osx_handmade repository)
and
git checkout tags/dayXXX (for Casey's repository)
to switch to the desired day, run the fix_handmade_hero_source.sh patch and compile. None of the asset files changed during that time.

If Day 405 works okay, then I'd probably just kind of binary search between it and Day 430 until you find out when it stops working. Note that I don't have a tag for every single day of Handmade Hero. I usually only update the repository when a change is required to run. So that means if you want to try, say, Day 418, you can git checkout that day from Casey's repository, but you should get Day 416 from osx_handmade as that is the most recent repository. I do test with every day of Casey's code, so all days should work. You can see a list of the day tags when I updated the osx_handmade repository by clicking on the "releases" link on github's main page of the repository.

Also, can you send me a little information on the integrated graphics chip in your computer? If you go to "About This Mac" on the main Apple menu, and then click the "System Report..." button, it will bring up a new window with a bunch of information. If you select "Graphics/Displays" on the left list of options, you should see some details on your graphics card. I'm most interested in the VRAM (or RAM), the Resolution, and the Framebuffer Depth. I'm guessing your hardware is plenty capable enough, but it would be good to know.

Thanks!

from osx_handmade.

josephsweeney avatar josephsweeney commented on June 27, 2024

I haven't had a chance to try out other days but I wanted to send over the graphics information:

Intel Iris Graphics 550:

Chipset Model: Intel Iris Graphics 550
Type: GPU
Bus: Built-In
VRAM (Dynamic, Max): 1536 MB
Vendor: Intel
Device ID: 0x1927
Revision ID: 0x000a
Metal: Supported, feature set macOS GPUFamily1 v3

from osx_handmade.

itfrombit avatar itfrombit commented on June 27, 2024

Thanks for the additional graphics information. According to Apple's documentation, your graphics card can support up to OpenGL 4.1, which is plenty good enough. Since your integrated graphics shares memory with your CPU, there is some chance that you are starved for texture memory, but that's probably not likely.

Let me know the results if you get a chance to try out a few of the other days mentioned above.

Thanks,
Jeff

from osx_handmade.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.