Repository navigation
[26488] Implement Droppable struct for gpubuffer - #36897
willypuzzle wants to merge 1 commit into
Conversation
|
Just heads up that default wpt run does not cover webgpu tests. We have special webgpu label/preset for it. |
82e90d3 to
9ab53bf
Compare
|
I haven't looked at this carefully yet, but the use of the Promise in the code that runs in the drop implementation is a problem, since that uses the JS engine. We need to figure out what to do about that. |
9fa13a0 to
c31ef97
Compare
Signed-off-by: Domenico Rizzo <[email protected]> Corrected member access Signed-off-by: Domenico Rizzo <[email protected]> removing unwanted macro Signed-off-by: Domenico Rizzo <[email protected]> Corrected methods' name Signed-off-by: Domenico Rizzo <[email protected]> applied mach fmt Signed-off-by: Domenico Rizzo <[email protected]>
c31ef97 to
627834f
Compare
@jdm the tests passed, tough. |
|
@willypuzzle The problem these changes are trying to solve only appears intermittently. The risk is that when the GPUBuffer is garbage collected and runs it's Drop code, the Promise object has already been garbage collected and will trigger a crash. This can happen when shutting down the JS engine while closing a tab. |
@jdm could any solution exist? |
|
@jdm maybe we can check if the promise has been just garbage collected and, in case, doing nothing. |
Unfortunately I don't yet know how to do this. Unlike other DOM objects that Servo implements, Promises are implemented in the JS engine and I don't know of a way to learn when a particular promise has been GCed. |
@jdm so should we give up the task? 😔 |
I suggest leaving this PR for now and working on other structs that implement Drop while we figure out what to do here. |
|
@jdm any ideas for this? |
|
I have a plan. I'm creating a new PromiseFinalizerRegistry that stores I'll make a PR once I've finished the implementation. |
|
This was addressed by #46415. |
Implemented Droppable struct for GPUBuffer in order to accomplish incremental satisfatcion of #26488
Testing: The code is just covered by tests
Fixes (partially): #26488