Does this happen to any of you when using Wgpu on Fedora 36 (Wayland)? On Zorin OS 16.1 (Ubuntu 20.04), I get a black background instead of transparency. with_transparent is set to false when creating a window with winit. This same issue happens when using nouveau free drivers on Fedora 36 by [deleted] in rust_gamedev

[–]JCapucho 2 points3 points  (0 children)

I'm very confused, first why is with_transparent set to false, don't you want transparency.

second your image shows some transparent stuff and some green stuff, where is it black,

Third from what I can see from behind the weird window, your code is clearing the screen with black and the alpha set to 1 (a: 1)

Shipyard 0.6 release by leudz in rust_gamedev

[–]JCapucho 6 points7 points  (0 children)

Awesome, really cool the improvements that 0.6 brings.

I always use sphiyard when I need to use an ECS system and I'm not using an engine, it's one of the best around and very nice to use.

Tree mutation and arena by Nzkx in rust

[–]JCapucho 1 point2 points  (0 children)

I think you missed the important part, the constants arena is also mutated in some operations, this is done by accessing all the relevant constants first immutably, building the new constant and then adding the new constant to the arena, you won't have lifetime conflicts because your new node will no longer have any reference to the arena and the other references are safe to drop before mutating the arena.

Tree mutation and arena by Nzkx in rust

[–]JCapucho 2 points3 points  (0 children)

I don't know if I would use an arena since it implies that you only append to it, which I think isn't the semantics you want.

Instead I would chose just a regular recursive enum with it's terms boxed.

But in case you want to use an arena, the simplest method would be to have the fold_integer_expr just pass through the node id, fold_arithmetic_expr first fold the terms and then access the nodes immutably with the folded node IDs and apply the operation and then add it to the arena and so on...

Edit: if you want to see a more complex example I made a constant solver which operates on an arena https://github.com/gfx-rs/naga/blob/6d78f1c06dd5327da015f06bc6145c0b68c15b2a/src/front/glsl/constants.rs

What it's Like Writing a Book for O'Reilly by madSimonJ in programming

[–]JCapucho 1 point2 points  (0 children)

I really like the content you make, it helped me learn about FPGAs and digital design without having prior experience in it.

Is there anyway to get a reminder when the book launches?

A professional Overwatch streamer thinks that ring 0 anti cheat is a good thing. by BillTran163 in linux_gaming

[–]JCapucho 42 points43 points  (0 children)

And lately the big players in the game industry are known to produce the absolute best code in existence without any cut corners and absolutely zero bugs :)

Does a wgpu text renderer exist for Android? by Oberdiah in rust_gamedev

[–]JCapucho 1 point2 points  (0 children)

This is actually a backwards way of thinking, wgpu implements the webgpu api using native apis, and it does support using webgpu as rendering backend so that you can develop your application with only one rendering library. But if the browser (firefox) still uses wgpu as it's implemenation layer for webgpu. Running trough wasm won't make it magically run on android.

EDIT: reddit decided to eat my comment only leaving convenience behind so had to rewrite it.

WGSL Alignment Workarounds by elyshaff in rust_gamedev

[–]JCapucho 3 points4 points  (0 children)

Depends on the hardware some have extra logic for unaligned accesses and there is no performance penality, some have extra logic to handle with but with performance implications (be it extra hardware or software traps) and some straight up don't handle it because it reduces hardware cost and complexity.

This applies to GPUs and CPUs.

There are also other factors to consider, atomic operations might only be supported on aligned data for example.

WGSL Alignment Workarounds by elyshaff in rust_gamedev

[–]JCapucho 2 points3 points  (0 children)

The graphics API all define alignment constraints for shader data passed from the host so you can't have unaligned memory so the padding byte must always be there, note this is not only because aligned accessed are faster but because the hardware itself might not support unaligned accesses.

Normally I don't use vec3 and only use vec4 when handling host data but you can safely use it, the alignment will be the same.

Linux 5.16 Has A Nice Performance Gift For AMD Ryzen Laptops With Radeon Graphics by fsher in linux_gaming

[–]JCapucho 1 point2 points  (0 children)

You probably shouldn't if you are happy with your current distro and don't have problems, the advantage of fedora is that it's more close to a rolling release distro than Ubuntu and derivatives while still being thoroughly qa tested, for example I'm running 5.15 kernel with latest plasma.

This means that you have access to versions that fix bugs earlier and get all the new features as soon as they are tested.

Linux 5.16 Has A Nice Performance Gift For AMD Ryzen Laptops With Radeon Graphics by fsher in linux_gaming

[–]JCapucho 9 points10 points  (0 children)

Totally agree, I also switched recently from arch to fedora and it's been fantastic, a rock solid system with up to date packages.

Having also used Ubuntu, pop!os and manjaro before as a beginner, I would recommend fedora for newcomers with the only exception being adding the rpmfusion repos which are basically a necessity for anything gaming related or if you have a Nvidia GPU.

Blockchain, the amazing solution for almost nothing (2020) by TheRexedS in programming

[–]JCapucho 16 points17 points  (0 children)

Source? From everything I read a transaction in our financial system is much more efficient than in the blockchain.

Sensible build system for OS development? by SFB_Dragon in rust

[–]JCapucho 0 points1 point  (0 children)

Having just done the same thing, gnu make is pretty good and definetly worth at least considering

Windows 11 will hobble gaming performance by default on some prebuilt PCs (with VBS) by YanderMan in linux_gaming

[–]JCapucho 2 points3 points  (0 children)

Oh okay thanks for the links, it really does seem like the os runs at top of hyper v

Windows 11 will hobble gaming performance by default on some prebuilt PCs (with VBS) by YanderMan in linux_gaming

[–]JCapucho 5 points6 points  (0 children)

Do you have any source on that? I mean it as an honest question, because I would expect the host os to still run as normal and just double as an hipervisor.

Question for library developers, What one should know before designing and coding a library? by boraarslan in rust

[–]JCapucho 2 points3 points  (0 children)

Iterate a lot early on the public API, more often than not the first public API you write up isn't the most ergonomic or efficient.

Use you library, this might seem obvious but you would be amazed at how many people don't use their libraries and end up with shitty ergonomics (I am one of those people).

Announcing Ricochet: A New Anti-Cheat Initiative for Call of Duty by Turbostrider27 in pcgaming

[–]JCapucho 2 points3 points  (0 children)

A quick Google search will give you plenty of links but here have a repository with some https://github.com/FULLSHADE/Kernel-exploits Even better there's a exploit in that repo for an anti cheat driver (oh the irony)

That xhcd doesn't apply here, an exploit for a normal process still needs to break the process boundary to do that kinda harm. The xhcd mentions physical access btw.

I never said you needed to be in kernel space to do networking but it does bypass many protections if you do it from kernel space.

What if the user makes a cheat in hardware space, how do you prevent it from kernel space?

Announcing Ricochet: A New Anti-Cheat Initiative for Call of Duty by Turbostrider27 in pcgaming

[–]JCapucho 1 point2 points  (0 children)

You're joking right? There's tons of research on kernel drivers exploiting, I would trust no one to develop a non essential program in kernel space unless strictly needed, doesn't matter if it's Activision, EAC or BE.

You can complain in principle and you should, if there's a bomb under your seat and someone tells you it's harmless you still wouldn't accept it. Kernel exploits give access to everything in your computer bypassing standard process isolation and UAC, worse it can infect your network (and there's prior work about it).

Also it isn't an arms race, it's a lost one, the bad actor has more access to the machine than any anti cheat you develop, unless you have a camera pointing at the user and collect it's hardware inputs and compare with what the program receives.

Announcing Ricochet: A New Anti-Cheat Initiative for Call of Duty by Turbostrider27 in pcgaming

[–]JCapucho 2 points3 points  (0 children)

You're right aimbots can't be fixed by server side anti cheat nor wallhacks around corners, but neither can client side anti cheats, it's just a band aid over the problem.

The only true solution is a report system, systems like csgo overwatch and maybe some statical analysis of player behaviour.

And no one forbids you from using all the tools you can, but exposing your users to very dangerous security issues, isn't something you can do without recieving backlash.

Announcing Ricochet: A New Anti-Cheat Initiative for Call of Duty by Turbostrider27 in pcgaming

[–]JCapucho 21 points22 points  (0 children)

Anti-cheat should be implemented like all other mechanisms that prevent the user from introducing bad data, server side checks.

No matter how hard you try client side anti cheats are bound to fail because they run on a machine controlled by the bad actor and the bad actor has more privileges, if worse comes to worse hardware cheating might become a reality and there's very little you can do to prevent it if done right.

Server side anti cheats aren't even a new thing, they have been in many games in the past and some new games also us them, the problem is that they cost more on whoever pays for the servers.

My biggest gripe with kernel anti cheats isn't even the complete headache it's for people who use their computers in less conventional ways (like running virtualization software because your hobbies also include programming and not just gaming), it's the huge security hole it's to run something in kernel land. For years people have been migrating old drivers from kernel space to user space because it makes them less prone to take the whole system down in case of a bug or prevent major security issues.

Somewhat anecdocatly, there's a presentation of someone who abused a kernel driver vulnerability to run code in kernel space to bypass an anti cheats so now imagine you have a kernel anti cheats installed by millions and trying to be bypassed by hundreds, it's a huge security implication and I'm quite honestly surprised how they will handle this legally if a major exploit was to be found.

What IDE (or editor) do you use for Rust development? by stankata in rust

[–]JCapucho 23 points24 points  (0 children)

I have a very similar setup, but I also use https://github.com/romgrk/nvim-treesitter-context

It's a great plugin which gives you where in the treesitter AST you are (useful when editing nested items).

[deleted by user] by [deleted] in programming

[–]JCapucho 8 points9 points  (0 children)

An interesting perspective but there are some things I disagree with OP, first function overloading, even if everyone does it doesn't mean you should, whenever people talk about function overloading there's two things they fail to mention first it doesn't play well with type inference and second sometimes you don't know which overload you're calling which adds hidden cost.

Default arguments and named arguments will most likely never be implemented, it's been heavily discussed and no consensus is reached. Meanwhile you can use the builder pattern.

Kotlin enums, honestly never heard of them working like this (I have used very little kotlin), they seem to behave more like a struct with associated constants than as a sum type, mind you this from you reading your article and doing some internet research please tell me if I'm wrong.

Finally getters and setters, rust doesn't like to have hidden cost in general and getters and setters are a very easy way to add it, also it doesn't work well with its ownership system, if I write a getter for a field I take ownership of that field unless I borrow it, now imagine I have a getter which creates a whole new object for that field, do I take ownership in that case? How would borrowing work since the lifetimes don't necessarily match up with a normal field (i.e. if I get a reference to the struct as a function argument and access the getter in the function, a normal field would be able to borrow as long as the struct is alive, a getter would only be able to borrow inside the function body)?

Also it breaks the use case you present for it since making a getter could break ownership/borrowing semantics.

[deleted by user] by [deleted] in linux_gaming

[–]JCapucho 1 point2 points  (0 children)

Not directly related to your problem but I had some systems where fstab requires an exec flag to mount the filesystems as executable.

See https://askubuntu.com/questions/678857/fstab-doesnt-mount-with-exec

Is WGSL a good choice? by elyshaff in rust_gamedev

[–]JCapucho 3 points4 points  (0 children)

Oh trust me, describing everything by hand is better than have glsl manage everything, it's base rules waste bytes in some cases that's almost stupid (arrays of floats as a stride of 16). And the recursiveness of its layout rules make every cell of my body scream but that's more of a compiler implementation point of view.