These are chat archives for bjz/gfx-rs

3rd
Jul 2014
Dzmitry Malyshau
@kvark
Jul 03 2014 00:47
@bjz any preferences on the device crate name? My default is /src/device/
Corey Richardson
@cmr
Jul 03 2014 00:49
@kvark it's nice to see gfx-rs really taking off with you involved :)
Dzmitry Malyshau
@kvark
Jul 03 2014 00:51
@cmr thanks! I feel fresh blood flooding my veins again when working on it, especially in such a great team. Have you considered joining?
Corey Richardson
@cmr
Jul 03 2014 00:52
I have no time, but I've been following the conversations.
Dzmitry Malyshau
@kvark
Jul 03 2014 00:52
@cmr you are Mozilla intern now, right? When does you term end, and do you see @bjz often?
Corey Richardson
@cmr
Jul 03 2014 00:53
@kvark I am yes. August 3. I'm at a different office than @bjz, but I see him ... almost weekly I guess
@kvark I need to focus a lot on academics this next semester :worried:
Dzmitry Malyshau
@kvark
Jul 03 2014 00:54
what do you study?
Corey Richardson
@cmr
Jul 03 2014 00:54
computer science
Dzmitry Malyshau
@kvark
Jul 03 2014 00:54
that's pretty generic :)
Corey Richardson
@cmr
Jul 03 2014 00:54
:P
I'm an undergrad.
Dzmitry Malyshau
@kvark
Jul 03 2014 00:56
@cmr you and @bjz make me reconsider my whole student life and after up until now. Sadly we haven't got the time machine yet :date:
I mean... I've been pretty successful at anything I touched, but you set up an example of how the success can be multiplied if you are an active part of the community, and you work in a team. :clap:
Corey Richardson
@cmr
Jul 03 2014 01:00
Yes, certainly. I got involved in open source right from the start, which was a huge influence. Especially having smart mentors to guide me along a good path.
more role models than mentors I guess
Anyway, what's the latest thinking for gfx-rs's model?
Dzmitry Malyshau
@kvark
Jul 03 2014 01:02
@cmr splitting the device into its own crate, simplify layers, then keeping it bind-less while implementing missing feature for the "Ready To Roll" milestone. Meanwhile, @photex is working on the resource management, which is also essential.
Corey Richardson
@cmr
Jul 03 2014 01:04
Once there is more of it in place I would like to work on a 2.1 renderer
Coraline Sherratt
@removed~csherratt
Jul 03 2014 01:05
@cmr that would be really helpful
Corey Richardson
@cmr
Jul 03 2014 01:11
Is it targeting 4.x with a 3.x fallback?
If so I could probably just extend the fallback to do querying of extensions instead of assuming a particulra version, and only falling back to true 2.1 for egregious cases
because that's going to be really awfully inefficient
Coraline Sherratt
@removed~csherratt
Jul 03 2014 01:13
I think gfx currently assumes opengl 3.2 core.
Dzmitry Malyshau
@kvark
Jul 03 2014 01:15
@cmr Sorry, what I said was more of a progress update than gfx-rs model description. BTW, the task of GL-2.1 support is #55.
Corey Richardson
@cmr
Jul 03 2014 01:23
I'd also like to work on a D3D renderer, but that'd be pretty far off.
I see that it wants --cfg gl etc. Is using one library for multiple render backends out of the question?
Dzmitry Malyshau
@kvark
Jul 03 2014 01:28
@cmr hmm... I dunno. If you know how to do it, PRs are welcome ;)
Corey Richardson
@cmr
Jul 03 2014 01:28
Ok! I'll look into that, because I think it's pretty important.
Dzmitry Malyshau
@kvark
Jul 03 2014 01:41
@cmr Would be perfect if you create an issue for that, describing what needs to be done
Corey Richardson
@cmr
Jul 03 2014 01:43
#56
Should be tagged enhancement I think
Dzmitry Malyshau
@kvark
Jul 03 2014 01:49
@cmr awesome, thank you!
Corey Richardson
@cmr
Jul 03 2014 01:51
I find graphics in particular much more interesting than gamedev in general, so gfx-rs is a pretty exciting for me :D
Dzmitry Malyshau
@kvark
Jul 03 2014 02:01
@cmr haha, interesting. I always try to force myself into more gamedev, less graphics, because a bad gameplay could still be a game, while even some good graphics may be completely useless.
Corey Richardson
@cmr
Jul 03 2014 02:01
I'm not very interested in making games though, I just like dicking around with the tech.
:P
Dzmitry Malyshau
@kvark
Jul 03 2014 02:31
crap, I cant auto-derive Show for the device::Request, because one of the variants uses Color, which is a fixed-size array, because I can't implement Show for it....
kvark @kvark wishes fixed-size arrays become the first-class citizens in Rust...
Brendan Zabarauskas
@brendanzab
Jul 03 2014 02:40
ahhhg
they will be :(
we could just make a newtype for now :(
or implement it directly
Dzmitry Malyshau
@kvark
Jul 03 2014 02:41
@bjz that's what I ended up doing, of course. It's just a bit creepy to define ClearData now on user side: color: Some(gfx::Color([0.3, 0.3, 0.3, 1.0])),
Brendan Zabarauskas
@brendanzab
Jul 03 2014 02:42
:(
Dzmitry Malyshau
@kvark
Jul 03 2014 02:42
not that it can't be helped, we will make it simpler at some point
Brendan Zabarauskas
@brendanzab
Jul 03 2014 02:42
you could also just implement on device::Request
Dzmitry Malyshau
@kvark
Jul 03 2014 02:42
that would be tons of code...
Brendan Zabarauskas
@brendanzab
Jul 03 2014 02:43
yeah... :{
Dzmitry Malyshau
@kvark
Jul 03 2014 02:43
@bjz you didn't respond on the device crate name
Brendan Zabarauskas
@brendanzab
Jul 03 2014 02:44
could you relink - sorry
I will look in the issues
Dzmitry Malyshau
@kvark
Jul 03 2014 02:44
any preferences on the device crate name? My default is /src/device/
Brendan Zabarauskas
@brendanzab
Jul 03 2014 02:44
hmm
Corey Richardson
@cmr
Jul 03 2014 02:45
device seems like a bad name in general, but I can't come up with anything better...
brendanzab @bjz looks at the Metal docs
The MTLDevice protocol defines the interface to a single graphics processor (GPU). You use this object to query the capabilities of the processor and to allocate objects used to access those capabilities.
So there is precedent... I guess?
Dzmitry Malyshau
@kvark
Jul 03 2014 02:47
haha, device it is then?
Brendan Zabarauskas
@brendanzab
Jul 03 2014 02:48
yep, I think so. but it is weird when it is a standalone crate :{
it makes more sense when phrased, gfx::device
we could have a facade crate that re-exports the underlying crates right?
Dzmitry Malyshau
@kvark
Jul 03 2014 02:49
@bjz I thought gfx itself will re-export the device
Corey Richardson
@cmr
Jul 03 2014 02:49
gfx::device is just so right
Brendan Zabarauskas
@brendanzab
Jul 03 2014 02:49
yep
:)
Coraline Sherratt
@removed~csherratt
Jul 03 2014 02:51
yay the render-mux is done in snowmew. Now all the demos can use gfx or the AZDO based render.
Dzmitry Malyshau
@kvark
Jul 03 2014 02:52
@csherratt what is render-mux?
Coraline Sherratt
@removed~csherratt
Jul 03 2014 02:55
Just a small module that implements a RenderFactory but returns the render based on environment variables instead of something hard coded.
The renderfactory is just used since you don't have a window to give to the render when the engine is configured, once the engine creates a window and spawns a render it consumes the renderfactory.
Corey Richardson
@cmr
Jul 03 2014 02:57
I really should probably just read the code but does gfx-rs intend to be able to use AZDO? From what @kvark said it sounds like it's using a bindless model..
Dzmitry Malyshau
@kvark
Jul 03 2014 02:58
@cmr We definitely want to provide that ability
Coraline Sherratt
@removed~csherratt
Jul 03 2014 02:58
there is no reason gfx could not implement a AZDO path. I just already have one in snowmew.
Corey Richardson
@cmr
Jul 03 2014 02:58
ok.
just making sure :)
Dzmitry Malyshau
@kvark
Jul 03 2014 02:59
@cmr we try to be as generic as possible, it's just that no-one tried/asked to do AZDO with gfx-rs yet. I suppose @csherratt has it as its own back-end (alternative to gfx-rs?)
Brendan Zabarauskas
@brendanzab
Jul 03 2014 03:03
YOU REFER TO IT USING AN ACRONYM NOW?!
brendanzab @bjz had to google
Corey Richardson
@cmr
Jul 03 2014 03:03
lol
AZDO always had its acronym!
it's too long
Coraline Sherratt
@removed~csherratt
Jul 03 2014 03:04
it sounds cool tool, azdo.
Dzmitry Malyshau
@kvark
Jul 03 2014 03:04
@bjz hmm... I guess I need to move platform folder inside the device crate, unless we want that to be a separate crate as well (it's going to be rather small)
@bjz it also leaves render folder kinda lonely inside src/gfx. I wonder if we'll have any other folders there to make it some company
actually, forget it. I'll just move the GraphicsContext trait there, and leave the implementation to the gfx-rs
Coraline Sherratt
@removed~csherratt
Jul 03 2014 03:14
Anyone have any ideas for #29 ? Right now it will buffer until your system runs out of swap, which is not fun.
Corey Richardson
@cmr
Jul 03 2014 03:15
hm
Dzmitry Malyshau
@kvark
Jul 03 2014 03:15
@csherratt sorry, I thought about it briefly and hasn't found a solution. We need to go deeper...
Corey Richardson
@cmr
Jul 03 2014 03:15
how does that manifest?
One solution, that is perhaps too heavy-handed, is to just use a bounded channel, and block when it's full.
I'm not sure if you can have more useful behavior if you know that the server isn't keeping up
Coraline Sherratt
@removed~csherratt
Jul 03 2014 03:19
that will probably work for now. I mean that is how opengl works.
Corey Richardson
@cmr
Jul 03 2014 03:20
I honestly can't think of anything sane to do in that case, so blocking seems fine.
Dzmitry Malyshau
@kvark
Jul 03 2014 03:21
@cmr we could skip whole frames, since we know when the SwapBuffers is requested
Corey Richardson
@cmr
Jul 03 2014 03:22
Ah, the server would do that, not the client?
Yeah, the server can be smarter than the client here
Dzmitry Malyshau
@kvark
Jul 03 2014 03:23
I thought about the client, actually. If it receives a message from the server saying "I'm overflowed", it can skip the next frame
Corey Richardson
@cmr
Jul 03 2014 03:23
It can do the same with a blocking queue
it can use try_send and if it blocks, it can say "skip the next frame"
... otoh it needs to know if there's enough space for the whole frame
How does the server decide when it can't keep up?
Dzmitry Malyshau
@kvark
Jul 03 2014 03:24
hmm... so block for the rest of the current frame, and skip the next one?
Coraline Sherratt
@removed~csherratt
Jul 03 2014 03:24
What if we sent the whole frame as a single packet?
cmr @cmr looks for existing implementations
Corey Richardson
@cmr
Jul 03 2014 03:27
That might make more sens.e
You give it a fixed time interval in which it has to render a frame.
As it's processing the frame if it misses the deadline, it sends back a message indicating such.
If it sees too many missed frames, the client can slow down and give it more time.
Not sure how much overhead that logic would impose.
So most of the Cast stuff would happen within a single frame, and have a soft-realtime requirement, whereas most of the calls would be considered initialization and not have the timelimit?
Brendan Zabarauskas
@brendanzab
Jul 03 2014 03:34
@cmr didn't that Metal presentation use a semaphore for this problem?
@cmr not saying that is the solution we should use
Coraline Sherratt
@removed~csherratt
Jul 03 2014 03:35
@bjz that seems like a simple solution
Brendan Zabarauskas
@brendanzab
Jul 03 2014 03:35
they had a cool diagram
Corey Richardson
@cmr
Jul 03 2014 03:35
@bjz 1. what presentation, 2. what does the semaphore do?
Brendan Zabarauskas
@brendanzab
Jul 03 2014 03:36
it was about the gpu getting too far ahead of the cpu I think and running out of uniform ids I think
Coraline Sherratt
@removed~csherratt
Jul 03 2014 03:36
initialize it to N (2-3?), decrement it on every frame_swap command, increment it when the frame_swap actually is executed?
Corey Richardson
@cmr
Jul 03 2014 03:37
isn't that the same as a bounded queue of frame commands?
Dzmitry Malyshau
@kvark
Jul 03 2014 03:37
@csherratt sounds good
Brendan Zabarauskas
@brendanzab
Jul 03 2014 03:37
@cmr: I think it was the 'Metal Fundamentals' one: https://developer.apple.com/videos/wwdc/2014/
Corey Richardson
@cmr
Jul 03 2014 03:38
"To watch the streaming version of this video, use the latest version of Safari on a Mac running OS X Lion or later. Alternatively, you can watch this video in the WWDC app or download the video when available."
cmr @cmr sighs
Brendan Zabarauskas
@brendanzab
Jul 03 2014 03:38
around 18:30
Dzmitry Malyshau
@kvark
Jul 03 2014 03:38
@bjz my #52 is ready for review/merge, and that is the end of my effort for today
Corey Richardson
@cmr
Jul 03 2014 03:40
@bjz thanks
Coraline Sherratt
@removed~csherratt
Jul 03 2014 03:41
I wonder if the back pressure should be exposed? Do a try start frame, and if it fails the client should discard the frame.
Brendan Zabarauskas
@brendanzab
Jul 03 2014 03:42
@kvark :heart: multiple compilation units
Dzmitry Malyshau
@kvark
Jul 03 2014 03:44
cheers!
kvark @kvark shuts down
Corey Richardson
@cmr
Jul 03 2014 03:46
@csherratt I believe that is the easiest and most flexible thing to do.
It puts a lot of the decision making into the user.
Coraline Sherratt
@removed~csherratt
Jul 03 2014 03:47
And we can swap the semaphore out later for something more sophisticated if we need it.
Corey Richardson
@cmr
Jul 03 2014 03:48
Well it doesn't explicitly need to use a semaphore: a bounded queue is the same thing! (and, rust's semaphores are currently implemented with channels)
Brendan Zabarauskas
@brendanzab
Jul 03 2014 03:50
@cmr @csherratt can I merge #52?
looks good to me
Corey Richardson
@cmr
Jul 03 2014 03:50
same
Coraline Sherratt
@removed~csherratt
Jul 03 2014 03:54
go for it.
Corey Richardson
@cmr
Jul 03 2014 04:00
Ok, I see what it's doing.
it being metal's semaphores
it's solving race conditions modifying memory shared with the GPU, but it seems gfx-rs wouldn't have that particular problem, given that updates to a buffer happen as part of the command strea
m
Coraline Sherratt
@removed~csherratt
Jul 03 2014 04:02
So while GFX is entirely unoptimized I decided to try and compare it to the default render in snowmew. So making it render 125K objects a frame it drops to about 1.5 FPS. the default render is around 125 FPS for the same scene.
Brendan Zabarauskas
@brendanzab
Jul 03 2014 04:02
@csherratt yeek!
@csherratt that is horriffic! haha!
Coraline Sherratt
@removed~csherratt
Jul 03 2014 04:03
bjz, that's actually not that bad considering gfx binds everything every render command
so there is quite a bit of low hanging fruit.
Brendan Zabarauskas
@brendanzab
Jul 03 2014 04:04
oh nice!
brendanzab @bjz is not as experienced with the numbers
Brendan Zabarauskas
@brendanzab
Jul 03 2014 04:05
We can close #48?
Corey Richardson
@cmr
Jul 03 2014 04:05
@csherratt am I reading snowmew-render-gfx/lib.rs correctly and you're sending a new buffer for every object on every frame?
no, you aren't, I am reading it wrong.
nvm
Coraline Sherratt
@removed~csherratt
Jul 03 2014 04:08
I am modifying two uniforms and sending a draw command for every object, all the meshes should be already loaded by gfx.
Corey Richardson
@cmr
Jul 03 2014 04:08
yup
Coraline Sherratt
@removed~csherratt
Jul 03 2014 04:09
that being said, every time you change a uniform it sends a command to gfx. so the gfx server is handling around 600 000 commands a second.
Corey Richardson
@cmr
Jul 03 2014 04:13
are you building with cargo? it still doesn't use -O
Coraline Sherratt
@removed~csherratt
Jul 03 2014 04:13
I build with --opt-level=3 and link time optimizations.
Corey Richardson
@cmr
Jul 03 2014 04:13
ok
Coraline Sherratt
@removed~csherratt
Jul 03 2014 04:14
also cargo does not build with -O? what does it do?
Corey Richardson
@cmr
Jul 03 2014 04:14
it just... doesn't :shipit: rust-lang/cargo#60
Coraline Sherratt
@removed~csherratt
Jul 03 2014 04:19
@cmr, @bjz have either of you seen a benchmark of just channels?
Corey Richardson
@cmr
Jul 03 2014 04:19
not in a while.
Coraline Sherratt
@removed~csherratt
Jul 03 2014 04:41
this is a strange question... but can anyone push or pull to gfx-rs?
sorry, even just clone?
Corey Richardson
@cmr
Jul 03 2014 04:42
I can clone
Coraline Sherratt
@removed~csherratt
Jul 03 2014 04:42
can you try right now?
Corey Richardson
@cmr
Jul 03 2014 04:42
I just did
Coraline Sherratt
@removed~csherratt
Jul 03 2014 04:42
ok
strange
I can clone cgmath, but gfx-rs is giving me issues
Corey Richardson
@cmr
Jul 03 2014 04:42
weird
Coraline Sherratt
@removed~csherratt
Jul 03 2014 04:43
it worked now :D
Brendan Zabarauskas
@brendanzab
Jul 03 2014 04:43
I was trying too
didn't work before - it is working now?
yayy!
weird
Coraline Sherratt
@removed~csherratt
Jul 03 2014 04:44
it is working now for me. just for like 10 minutes it would not clone.
Brendan Zabarauskas
@brendanzab
Jul 03 2014 04:44
yeah, so strange - maybe a github issue
Brendan Zabarauskas
@brendanzab
Jul 03 2014 06:10
@photex boop
Dzmitry Malyshau
@kvark
Jul 03 2014 12:52
@csherratt You compared our regular calls with your AZDO? 125K objects with 125fps is very impressive. I don't think it makes much sense to benchmark gfx-rs before it reaches "Ready to Roll" milestone. It's going to be even slower, probably, due to the need to handle rasterizer states and framebuffers. On the other hand, caching on different levels (esp. shader Environment and Mesh attributes in #53) is, as you said, a low-hanging fruit.
Sven Nilsen
@bvssvni
Jul 03 2014 13:48
@kvark you made me think of git submodules! AARRGGHH!
@kvark still got painful memories...
Dzmitry Malyshau
@kvark
Jul 03 2014 13:52
@bvssvni :satisfied:
Sven Nilsen
@bvssvni
Jul 03 2014 14:02
@kvark I wish I could point out exactly where git submodules are horrible, but for some reason the drawbacks are so subtle. I think it's because I had to keep the dependency structure in my head and the other memories I made during that period did not get enough room to grow.
Brendan Zabarauskas
@brendanzab
Jul 03 2014 15:14
@kvark thanks! Fixed #59 for you - good suggestion.
Dzmitry Malyshau
@kvark
Jul 03 2014 15:15
@bjz thanks! DRY FTW
Brendan Zabarauskas
@brendanzab
Jul 03 2014 15:15
^_^
Dzmitry Malyshau
@kvark
Jul 03 2014 15:16
@bjz I don't know what to do with the 'enhancement' label. Now that I added 'feature' and 'optimization', there is rarely a case where an issue should be marked as 'enhancement'. What do you think about renaming it to 'refactor'? Or, perhaps, you can think of a better name?
kvark @kvark also wishes he could refer to milestones from here as he does to bugs
Brendan Zabarauskas
@brendanzab
Jul 03 2014 15:17
yeah :(
refactor or redesign would be nicer
yay naming
Dzmitry Malyshau
@kvark
Jul 03 2014 15:21
I wonder if it's possible to view issues only without PRs
ok, our issue list is more or less properly marked now. I hope we'll keep it the same (or better) way
Brendan Zabarauskas
@brendanzab
Jul 03 2014 15:25
CRAP
oops
just a sec...
Dzmitry Malyshau
@kvark
Jul 03 2014 15:27
errr what's going on?...
Brendan Zabarauskas
@brendanzab
Jul 03 2014 15:27
my fault - just a sec
lol
thank goodness we only have a few issues :P
Dzmitry Malyshau
@kvark
Jul 03 2014 15:30
how did you do it?
Coraline Sherratt
@removed~csherratt
Jul 03 2014 15:30
my phone went crazy.
Brendan Zabarauskas
@brendanzab
Jul 03 2014 15:30
sorry!
Dzmitry Malyshau
@kvark
Jul 03 2014 15:31
@bjz please don't do that to Rust repo ;)
Brendan Zabarauskas
@brendanzab
Jul 03 2014 15:31
ticked the checkmark and mis-clicked 'close'
haha, I was just thinking that
Dzmitry Malyshau
@kvark
Jul 03 2014 15:31
poor Travis... has to rebuild everything now
Brendan Zabarauskas
@brendanzab
Jul 03 2014 15:32
they seriously should have a confirmation popup and an undo
Coraline Sherratt
@removed~csherratt
Jul 03 2014 15:32
was there no safeguard? that surprises me.
Brendan Zabarauskas
@brendanzab
Jul 03 2014 15:32
yikes
nope, they don't
plus the button is not even red
Dzmitry Malyshau
@kvark
Jul 03 2014 15:32
@bjz perhaps we could leave #3 closed?
Coraline Sherratt
@removed~csherratt
Jul 03 2014 15:33
I would almost say that is a bug, where do you file github bugs?
Brendan Zabarauskas
@brendanzab
Jul 03 2014 15:33
closed
Coraline Sherratt
@removed~csherratt
Jul 03 2014 15:44
@kvark Yeah I think the benchmark is premature. But it is good to get an early idea if we are going to have an unexpected bottleneck. And the message passing per call is looking like a potential bottleneck.
Dzmitry Malyshau
@kvark
Jul 03 2014 15:46
@csherratt so it's the message passing? Between which tasks exactly? I thought the majority of time is spent on the render server, which is doing all the uniform and attribute matching.
Coraline Sherratt
@removed~csherratt
Jul 03 2014 15:50
About 31% of the total time is spent in message passing. It is just split among a dozen smaller function calls.
the render server is 42% when you sum up the decoding and opengl driver.
but still, that is a huge chunk.
I will probably have to re-profile it per-thread to give a more accurate breakdown.
Dzmitry Malyshau
@kvark
Jul 03 2014 15:52
I'm not as much worried about the draw call capacity (anything beyond 4K should use AZDO anyways), as much about the latency that our message passing introduces....
Brendan Zabarauskas
@brendanzab
Jul 03 2014 15:58
can we just remove the render task - like only have one channel?
Dzmitry Malyshau
@kvark
Jul 03 2014 16:00

@bjz I thought about that (mentioned in #9):

we could have an alternative client that doesn't spawn the render task but has the same interface

@bjz I wonder if we could share some code between these two client implementations
Brendan Zabarauskas
@brendanzab
Jul 03 2014 16:29
Yeah you did
brendanzab @bjz gets to work
Dzmitry Malyshau
@kvark
Jul 03 2014 16:54
Created #60 for that
Dzmitry Malyshau
@kvark
Jul 03 2014 18:19
I kinda dislike the Option<Frame> argument of draw calls. While it's certainly a safe choice, it would be less verbose to just treat an empty Frame as a default framebuffer.
Dzmitry Malyshau
@kvark
Jul 03 2014 19:38
@Kimundi \o/
Marvin Löbel
@Kimundi
Jul 03 2014 19:38
Hi ;)
Dzmitry Malyshau
@kvark
Jul 03 2014 19:39
perhaps, we should describe the start-up instructions in Readme
Marvin Löbel
@Kimundi
Jul 03 2014 19:41
I could write a short Getting started section containing just the instructions to do make deps all and make
Dzmitry Malyshau
@kvark
Jul 03 2014 19:42
that'd be great! I believe you don't need make after make deps all
Marvin Löbel
@Kimundi
Jul 03 2014 19:42
Well, its still doing something, so I assumed you'D have too
But yeah, looking at the output, you don't...
Dzmitry Malyshau
@kvark
Jul 03 2014 19:43
@Kimundi our makefile is pretty basic, it recompiles on every call....
Marvin Löbel
@Kimundi
Jul 03 2014 19:43
heh, alright
Brendan Zabarauskas
@brendanzab
Jul 03 2014 19:43
We sHould also link to here pretty prominantly in the README
Marvin Löbel
@Kimundi
Jul 03 2014 19:43
Okay, two things to add
Dzmitry Malyshau
@kvark
Jul 03 2014 19:44
@bjz do you think we could improve the makefile? or just drop it completely in favor or cargo?
I believe rust-compress uses some trickery to not recompile stuff
Brendan Zabarauskas
@brendanzab
Jul 03 2014 19:44
We could use cargo definitely
Dzmitry Malyshau
@kvark
Jul 03 2014 19:51
yeah, looks like rust-compress ended up dropping Makefile
Coraline Sherratt
@removed~csherratt
Jul 03 2014 19:56
I think everyone is just moving to Cargo. That is my plan for snowmew this weekend.
Marvin Löbel
@Kimundi
Jul 03 2014 19:58
So, made a PR about the README. Now lets see if I can get the example to run...
Dzmitry Malyshau
@kvark
Jul 03 2014 20:02
@Kimundi oh, no, you broke the build! :hammer:
Coraline Sherratt
@removed~csherratt
Jul 03 2014 20:04
:P @bjz is anyone working on gl-rs build break?
Marvin Löbel
@Kimundi
Jul 03 2014 20:04
oh nooo D:
;)
Okay, I get runtime failure about GLSL 1.50 not being supported.NOw to actually find where those shaders get defined...
Dzmitry Malyshau
@kvark
Jul 03 2014 20:09
in the triangle example itself
Marvin Löbel
@Kimundi
Jul 03 2014 20:10
Oh wait, its triangles main.rs of course :P
yeah...
Dzmitry Malyshau
@kvark
Jul 03 2014 20:10
we'd need to rewrite the shaders for GLSL 1.3 support (I assume that version is supported on your HW)
I'll post a Gist for you shortly
Marvin Löbel
@Kimundi
Jul 03 2014 20:11
Eh... Supported are 1.10, 1.20 and 1.00 ES
Dzmitry Malyshau
@kvark
Jul 03 2014 20:11
oops
Marvin Löbel
@Kimundi
Jul 03 2014 20:14
Well, that made the shaders errors go away, but now it has a assertion faliure because 1280 is not equal to 0 xD
Lets see what the backtrace says...
Dzmitry Malyshau
@kvark
Jul 03 2014 20:14
oh, that must be the VAO thing
current code only checks for GL errors at the end of draw calls
so backtrace will tell nothing
Coraline Sherratt
@removed~csherratt
Jul 03 2014 20:15
apitrace
Marvin Löbel
@Kimundi
Jul 03 2014 20:15
That explains why I don't find anything! :)
Coraline Sherratt
@removed~csherratt
Jul 03 2014 20:16
https://github.com/apitrace/apitrace your best friend for why did that not work on X
Dzmitry Malyshau
@kvark
Jul 03 2014 20:18

@Kimundi my blind guess would be to remove the following line from render/mod.rs:

self.device.send(device::CastBindArrayBuffer(self.common_array_buffer));

And replace the following block:

        device.send(device::CallNewArrayBuffer);
        let abuf = match device.recv() {
            device::ReplyNewArrayBuffer(name) => name,
            _ => fail!("invalid device reply for CallNewArrayBuffer")
        };

With just let abuf = 0;

Can't think of anything else (outside of GLSL 1.5 and VAO) that is currently not compatible with GL-2.1
Interesting why you didn't crashed with an attempt to create a VAO. Apparently, your hardware supports it via extensions, but then it's not clear why you got GL_INVALID_PARAM (which 1280 is)
Marvin Löbel
@Kimundi
Jul 03 2014 20:27
Yeah, that doesn't work either
apitrace: loaded
apitrace: loaded
apitrace: tracing to /home/marvin/dev/rust/gfx-rs/main.2.trace
apitrace: redirecting dlopen("libGL.so.1", 0x102)
task '<main>' failed at 'assertion failed: (left == right) && (right == left) (left: 1280, right: 0)', src/device/gl/mod.rs:42
task '<unnamed>' failed at 'sending on a closed channel', /build/rust-git/src/rust/src/libsync/comm/mod.rs:552
task '<unnamed>' failed at 'sending on a closed channel', /build/rust-git/src/rust/src/libsync/comm/mod.rs:552
Coraline Sherratt
@removed~csherratt
Jul 03 2014 20:29
it should have produced a trace file that you can replay with qapitrace now
Marvin Löbel
@Kimundi
Jul 03 2014 20:30
yeah, I'm looking for truth in it right now ;)
At 806 calls its a bit hard finding the one you want if its not the last one :P
Corey Richardson
@cmr
Jul 03 2014 20:31
heheh
Dzmitry Malyshau
@kvark
Jul 03 2014 20:31
it should be close to the last one...
Marvin Löbel
@Kimundi
Jul 03 2014 20:33
Well, I'm not sure what I'm supposed to be looking for to be honest :( - would it help if I upload the trace for you?
I don't get any obvious "This is an error" indication at least
Dzmitry Malyshau
@kvark
Jul 03 2014 20:34
definitely
Coraline Sherratt
@removed~csherratt
Jul 03 2014 20:39
@Kimundi what gpu are you using?
Marvin Löbel
@Kimundi
Jul 03 2014 20:42
older internal intel one.
Intel® Graphics Media Accelerator HD
Whatever thats supposed to mean :P
Coraline Sherratt
@removed~csherratt
Jul 03 2014 20:42
Like a 950?
Marvin Löbel
@Kimundi
Jul 03 2014 20:43
Dunno, how do I find out?
VGA compatible controller: Intel Corporation Core Processor Integrated Graphics Controller (rev 02) (prog-if 00 [VGA controller])
Dzmitry Malyshau
@kvark
Jul 03 2014 20:45
ugh, I'm unable to replay the trace on my windows workstation
I guess I can still dump it
Marvin Löbel
@Kimundi
Jul 03 2014 20:46
Kernel driver in use: i915
Ah, was I supposed to replay the trace?
Dzmitry Malyshau
@kvark
Jul 03 2014 20:48
@Kimundi no, it's fine, I can read it here. Funny how it reports us calling glBindAttribLocation, while we don't do that ever
Marvin Löbel
@Kimundi
Jul 03 2014 20:49
heh
Dzmitry Malyshau
@kvark
Jul 03 2014 20:52
@csherratt It doesn't seem like apitrace is doing any GL error checks for us, so it doesn't help. We need to know exactly what command triggered the error
oh, I got an idea
it probably complains about the GL_UNIFORM_BLOCK_INDEX query, which we can safely ignore for the sake of experiment

@Kimundi could you please try replacing the following line (from src/device/shade.rs):

let num = get_program_iv(prog, gl::ACTIVE_UNIFORM_BLOCKS);

With just:

let num = 0u;
Marvin Löbel
@Kimundi
Jul 03 2014 20:57
DOne, lets see what happens...
Dzmitry Malyshau
@kvark
Jul 03 2014 20:57
actually, that would not be enough. This block needs temporary removal:
    unsafe {
        gl::GetActiveUniformsiv(prog, total_num as gl::types::GLsizei,
            indices.as_slice().as_ptr(), gl::UNIFORM_BLOCK_INDEX,
            block_indices.as_mut_slice().as_mut_ptr());
        //TODO: UNIFORM_IS_ROW_MAJOR
    }
Marvin Löbel
@Kimundi
Jul 03 2014 20:58
Wohe, a ugly triangle!
Dzmitry Malyshau
@kvark
Jul 03 2014 20:58
hah! nice!
Corey Richardson
@cmr
Jul 03 2014 20:58
Triangles may be surprising, but they are never ugly!
Marvin Löbel
@Kimundi
Jul 03 2014 20:58
... and shitty perfomance due to apitrace actually getting frames to dump
Dzmitry Malyshau
@kvark
Jul 03 2014 20:58
you're half-through implementing the GL-compat feature
Marvin Löbel
@Kimundi
Jul 03 2014 20:59
yay ;)
So, should I still remove that unsafe block?
Dzmitry Malyshau
@kvark
Jul 03 2014 20:59
weird that it worked... I think it should have been reported as an error
Marvin Löbel
@Kimundi
Jul 03 2014 21:00
lets try it again without apitrace
nope, no output except a black red green traingle in a window
Dzmitry Malyshau
@kvark
Jul 03 2014 21:02
@Kimundi triangle is all you need!
Marvin Löbel
@Kimundi
Jul 03 2014 21:03
Ugh, my system doesn't like that triangle at all, firefox becomes unresponsive
Though why it fills the RAM instead of taxing my CPU, I have no idea :P
Dzmitry Malyshau
@kvark
Jul 03 2014 21:05
@Kimundi do you think it fills the RAM? I haven't checked what's going on, but I can confirm it loads the system rather too hard.
Marvin Löbel
@Kimundi
Jul 03 2014 21:07
Okay, I get a triangle, but running the example now rapidly fils my RAM, which is... weird. Either there is some major chaching going on, or a memory leak...
fills caching*, etc
Dzmitry Malyshau
@kvark
Jul 03 2014 21:10
@Kimundi we need to investigate... I'll create an issue - #62
Coraline Sherratt
@removed~csherratt
Jul 03 2014 21:16
Could it be what swap_buffers ack is trying to fix?
the triangles render thread does not actually have a throttle.
Dzmitry Malyshau
@kvark
Jul 03 2014 21:18
I'll be able to check when your PR is ready ;)
@csherratt I agree that it totally makes sense.
Corey Richardson
@cmr
Jul 03 2014 21:19
swap_buffers should be merged.
Coraline Sherratt
@removed~csherratt
Jul 03 2014 21:20
@cmr I am going do a bit of redesign that should make it obvious how it should be used.
as in, I don't want people using it optionally.
Brendan Zabarauskas
@brendanzab
Jul 03 2014 21:23
@csherratt btw, did you update that PR #57?
Coraline Sherratt
@removed~csherratt
Jul 03 2014 21:23
not yet, I have not had time.
Brendan Zabarauskas
@brendanzab
Jul 03 2014 21:24
np!
Marvin Löbel
@Kimundi
Jul 03 2014 21:51
So, did a reboot and update of my system. Trying again, it seems gl-rs no longer builds. I guess that's what you mentioned earlier?
Dzmitry Malyshau
@kvark
Jul 03 2014 21:54
@Kimundi I believe there is already a PR #97 to fix it (in gl-rs)
Marvin Löbel
@Kimundi
Jul 03 2014 21:56
Ah, nice
Brendan Zabarauskas
@brendanzab
Jul 03 2014 22:22
@kvark: bjz/gl-rs#97
Aww - does not work yay! Got the right markdown.
Dzmitry Malyshau
@kvark
Jul 03 2014 22:23
why?
Brendan Zabarauskas
@brendanzab
Jul 03 2014 22:23
you need to specify the username as well as the repo it seems :)
Corey Richardson
@cmr
Jul 03 2014 22:24
You can paste in a link and it does the Right Thing
Brendan Zabarauskas
@brendanzab
Jul 03 2014 22:24
ooh
Corey Richardson
@cmr
Jul 03 2014 22:24
which is pretty cool
I was pleasently surprised by that last night
Marvin Löbel
@Kimundi
Jul 03 2014 22:46
Just curious, now that the gl-rs build failure is fixed, what is neccessary for something like gfx-rs to receive that fix?
Corey Richardson
@cmr
Jul 03 2014 22:46
nothing, since they don't specify a specific version
cargo will pull the latest
you might need cargo build -u
for it to sync with the repo
Marvin Löbel
@Kimundi
Jul 03 2014 22:52
well, gfx-rs does not have cargo support yet, so I'm not sure what you mean.
Corey Richardson
@cmr
Jul 03 2014 22:53
well, gfx-rs is the one exception :P it needs to update the submodule
Marvin Löbel
@Kimundi
Jul 03 2014 22:54
Okay, so checked-in submodules need to be updated to point at the new head revision?
Corey Richardson
@cmr
Jul 03 2014 22:54
yeah
Dzmitry Malyshau
@kvark
Jul 03 2014 23:17
@bjz I wonder if we should kick Andy from this room. He has probably just forgot to leave...
Brendan Zabarauskas
@brendanzab
Jul 03 2014 23:17
@kvark eh, it's fine - he is our support :D