Skip to content

Commit d93c1fc

Browse files
committed
revert unintentionally checked in gput generation
1 parent 7a0f1ca commit d93c1fc

2 files changed

Lines changed: 3 additions & 16 deletions

File tree

ngsolve_webgpu/cf.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from webgpu.colormap import Colormap
1010
from webgpu.renderer import Renderer, RenderOptions, check_timestamp
1111
from webgpu.shapes import ShapeRenderer, generate_cylinder
12-
from webgpu.utils import BufferBinding, UniformBinding, buffer_from_array, write_array_to_buffer, read_shader_file, device_generation
12+
from webgpu.utils import BufferBinding, UniformBinding, buffer_from_array, write_array_to_buffer, read_shader_file
1313
from webgpu.renderer import BaseRenderer, RenderOptions, check_timestamp
1414
from webgpu.uniforms import UniformBase, ct
1515
from webgpu.utils import (
@@ -212,7 +212,6 @@ class FunctionData:
212212
order_3d: int
213213
_timestamp: float = -1
214214
_gpu_dirty: bool = True
215-
_gpu_generation: int = -1
216215
minval: list[float]
217216
maxval: list[float]
218217

@@ -337,24 +336,21 @@ def get_buffers(self, include_mesh_data=True):
337336
buffers = self.mesh_data.get_buffers().copy()
338337
else:
339338
buffers = {}
340-
gen = device_generation()
341-
stale = self._gpu_generation != gen
342339
if self.data_2d is not None:
343-
if self._gpu_dirty or stale or self.gpu_2d is None:
340+
if self._gpu_dirty or self.gpu_2d is None:
344341
self.gpu_2d = buffer_from_array(
345342
self.data_2d, label="function_data_2d", reuse=self.gpu_2d
346343
)
347344
buffers["data_2d"] = self.gpu_2d
348345

349346
if self.data_3d is not None:
350-
if self._gpu_dirty or stale or self.gpu_3d is None:
347+
if self._gpu_dirty or self.gpu_3d is None:
351348
self.gpu_3d = buffer_from_array(
352349
self.data_3d, label="function_data_3d", reuse=self.gpu_3d
353350
)
354351
buffers["data_3d"] = self.gpu_3d
355352

356353
self._gpu_dirty = False
357-
self._gpu_generation = gen
358354

359355
return buffers
360356

ngsolve_webgpu/mesh.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
BufferBinding,
2222
UniformBinding,
2323
buffer_from_array,
24-
device_generation,
2524
get_device,
2625
read_shader_file,
2726
uniform_from_array,
@@ -131,7 +130,6 @@ class MeshData:
131130
_need_3d: bool = False
132131
_update_lock: Lock
133132
_gpu_dirty: bool = True
134-
_gpu_generation: int = -1
135133

136134
def __init__(self, mesh, el2d_bitarray=None, el3d_bitarray=None):
137135
import netgen.meshing
@@ -594,13 +592,6 @@ def get_bounding_box(self):
594592
return ([pmin[0], pmin[1], pmin[2]], [pmax[0], pmax[1], pmax[2]])
595593

596594
def get_buffers(self):
597-
gen = device_generation()
598-
if self._gpu_generation != gen:
599-
self._gpu_dirty = True
600-
self.gpu_elements = {}
601-
self._dummy_buffer = None
602-
self._gpu_generation = gen
603-
604595
if self._gpu_dirty:
605596
self.gpu_data = buffer_from_array(
606597
self.cpu_data,

0 commit comments

Comments
 (0)