Mark appropriate methods of wgpu wrappers as const
This commit is contained in:
parent
b3cb60371e
commit
074cbb18ba
18 changed files with 52 additions and 52 deletions
|
|
@ -84,10 +84,10 @@ namespace psemek::wgpu
|
|||
uint32_t device_id;
|
||||
};
|
||||
|
||||
std::vector<feature> enumerate_features();
|
||||
limits get_limits();
|
||||
info get_info();
|
||||
bool has_feature(feature feature);
|
||||
std::vector<feature> enumerate_features() const;
|
||||
limits get_limits() const;
|
||||
info get_info() const;
|
||||
bool has_feature(feature feature) const;
|
||||
void request_device(callback_mode mode, device::descriptor const & descriptor, device::request_callback const & callback);
|
||||
|
||||
static void reference(void * ptr);
|
||||
|
|
|
|||
|
|
@ -65,10 +65,10 @@ namespace psemek::wgpu
|
|||
using map_callback = std::function<void(map_async_status, std::string_view)>;
|
||||
|
||||
void destroy();
|
||||
std::uint64_t get_size();
|
||||
usage get_usage();
|
||||
map_state get_map_state();
|
||||
void const * get_const_mapped_range(std::size_t offset, std::size_t size);
|
||||
std::uint64_t get_size() const;
|
||||
usage get_usage() const;
|
||||
map_state get_map_state() const;
|
||||
void const * get_const_mapped_range(std::size_t offset, std::size_t size) const;
|
||||
void * get_mapped_range(std::size_t offset, std::size_t size);
|
||||
void map_async(callback_mode mode, map_mode flags, std::size_t offset, std::size_t size, map_callback const & callback);
|
||||
void unmap();
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ namespace psemek::wgpu
|
|||
programmable_stage_descriptor compute;
|
||||
};
|
||||
|
||||
bind_group_layout get_bind_group_layout(std::uint32_t index);
|
||||
bind_group_layout get_bind_group_layout(std::uint32_t index) const;
|
||||
void set_label(std::string const & label);
|
||||
|
||||
static void reference(void * ptr);
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@ namespace psemek::wgpu
|
|||
using pop_error_callback = std::function<void(pop_error_scope_status, error_type, std::string_view)>;
|
||||
using error_callback = std::function<void(error_type, std::string const &)>;
|
||||
|
||||
queue get_queue();
|
||||
queue get_queue() const;
|
||||
bind_group create_bind_group(bind_group::descriptor const & desc);
|
||||
bind_group_layout create_bind_group_layout(bind_group_layout::descriptor const & desc);
|
||||
buffer create_buffer(buffer::descriptor const & desc);
|
||||
|
|
@ -214,9 +214,9 @@ namespace psemek::wgpu
|
|||
shader_module create_shader_module(shader_module::descriptor const & desc);
|
||||
texture create_texture(texture::descriptor const & desc);
|
||||
void destroy();
|
||||
std::vector<feature> enumerate_features();
|
||||
limits get_limits();
|
||||
bool has_feature(feature feature);
|
||||
std::vector<feature> enumerate_features() const;
|
||||
limits get_limits() const;
|
||||
bool has_feature(feature feature) const;
|
||||
void push_error_scope(error_filter filter);
|
||||
void pop_error_scope(callback_mode mode, pop_error_callback const & callback);
|
||||
void set_label(std::string const & label);
|
||||
|
|
|
|||
|
|
@ -29,8 +29,8 @@ namespace psemek::wgpu
|
|||
};
|
||||
|
||||
void destroy();
|
||||
std::uint32_t get_count();
|
||||
type get_type();
|
||||
std::uint32_t get_count() const;
|
||||
type get_type() const;
|
||||
void set_label(std::string const & label);
|
||||
|
||||
static void reference(void * ptr);
|
||||
|
|
|
|||
|
|
@ -280,7 +280,7 @@ namespace psemek::wgpu
|
|||
std::optional<fragment_state> fragment = {};
|
||||
};
|
||||
|
||||
bind_group_layout get_bind_group_layout(std::uint32_t index);
|
||||
bind_group_layout get_bind_group_layout(std::uint32_t index) const;
|
||||
void set_label(std::string const & label);
|
||||
|
||||
static void reference(void * ptr);
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ namespace psemek::wgpu
|
|||
|
||||
using compilation_info_callback = std::function<void(compilation_info_request_status, compilation_info const &)>;
|
||||
|
||||
void get_compilation_info(callback_mode mode, compilation_info_callback const & callback);
|
||||
void get_compilation_info(callback_mode mode, compilation_info_callback const & callback) const;
|
||||
void set_label(std::string const & label);
|
||||
|
||||
static void reference(void * ptr);
|
||||
|
|
|
|||
|
|
@ -89,8 +89,8 @@ namespace psemek::wgpu
|
|||
};
|
||||
|
||||
void configure(configuration const & conf);
|
||||
capabilities get_capabilities(adapter const & adapter);
|
||||
current_texture get_current_texture();
|
||||
capabilities get_capabilities(adapter const & adapter) const;
|
||||
current_texture get_current_texture() const;
|
||||
void present();
|
||||
void unconfigure();
|
||||
|
||||
|
|
|
|||
|
|
@ -181,13 +181,13 @@ namespace psemek::wgpu
|
|||
|
||||
texture_view create_view(texture_view::descriptor const & desc);
|
||||
void destroy();
|
||||
std::uint32_t get_width();
|
||||
std::uint32_t get_height();
|
||||
std::uint32_t get_depth();
|
||||
dimension get_dimension();
|
||||
format get_format();
|
||||
std::uint32_t get_mip_level_count();
|
||||
usage get_usage();
|
||||
std::uint32_t get_width() const;
|
||||
std::uint32_t get_height() const;
|
||||
std::uint32_t get_depth() const;
|
||||
dimension get_dimension() const;
|
||||
format get_format() const;
|
||||
std::uint32_t get_mip_level_count() const;
|
||||
usage get_usage() const;
|
||||
void set_label(std::string const & label);
|
||||
|
||||
static void reference(void * ptr);
|
||||
|
|
|
|||
|
|
@ -8,14 +8,14 @@
|
|||
namespace psemek::wgpu
|
||||
{
|
||||
|
||||
std::vector<feature> adapter::enumerate_features()
|
||||
std::vector<feature> adapter::enumerate_features() const
|
||||
{
|
||||
WGPUSupportedFeatures supported_features;
|
||||
wgpuAdapterGetFeatures((WGPUAdapter)get(), &supported_features);
|
||||
return std::vector<feature>((feature const *)supported_features.features, (feature const *)(supported_features.features) + supported_features.featureCount);
|
||||
}
|
||||
|
||||
limits adapter::get_limits()
|
||||
limits adapter::get_limits() const
|
||||
{
|
||||
WGPULimits limits = {};
|
||||
detail::check_status("wgpuAdapterGetLimits", wgpuAdapterGetLimits((WGPUAdapter)get(), &limits));
|
||||
|
|
@ -57,7 +57,7 @@ namespace psemek::wgpu
|
|||
return result;
|
||||
}
|
||||
|
||||
adapter::info adapter::get_info()
|
||||
adapter::info adapter::get_info() const
|
||||
{
|
||||
WGPUAdapterInfo info;
|
||||
detail::check_status("wgpuAdapterGetInfo", wgpuAdapterGetInfo((WGPUAdapter)get(), &info));
|
||||
|
|
@ -74,7 +74,7 @@ namespace psemek::wgpu
|
|||
};
|
||||
}
|
||||
|
||||
bool adapter::has_feature(feature feature)
|
||||
bool adapter::has_feature(feature feature) const
|
||||
{
|
||||
return wgpuAdapterHasFeature((WGPUAdapter)get(), (WGPUFeatureName)feature);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,22 +12,22 @@ namespace psemek::wgpu
|
|||
wgpuBufferDestroy((WGPUBuffer)get());
|
||||
}
|
||||
|
||||
std::uint64_t buffer::get_size()
|
||||
std::uint64_t buffer::get_size() const
|
||||
{
|
||||
return wgpuBufferGetSize((WGPUBuffer)get());
|
||||
}
|
||||
|
||||
buffer::usage buffer::get_usage()
|
||||
buffer::usage buffer::get_usage() const
|
||||
{
|
||||
return (usage)wgpuBufferGetUsage((WGPUBuffer)get());
|
||||
}
|
||||
|
||||
buffer::map_state buffer::get_map_state()
|
||||
buffer::map_state buffer::get_map_state() const
|
||||
{
|
||||
return (map_state)wgpuBufferGetMapState((WGPUBuffer)get());
|
||||
}
|
||||
|
||||
void const * buffer::get_const_mapped_range(std::size_t offset, std::size_t size)
|
||||
void const * buffer::get_const_mapped_range(std::size_t offset, std::size_t size) const
|
||||
{
|
||||
return wgpuBufferGetConstMappedRange((WGPUBuffer)get(), offset, size);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
namespace psemek::wgpu
|
||||
{
|
||||
|
||||
bind_group_layout compute_pipeline::get_bind_group_layout(std::uint32_t index)
|
||||
bind_group_layout compute_pipeline::get_bind_group_layout(std::uint32_t index) const
|
||||
{
|
||||
return bind_group_layout(wgpuComputePipelineGetBindGroupLayout((WGPUComputePipeline)get(), index));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
namespace psemek::wgpu
|
||||
{
|
||||
|
||||
queue device::get_queue()
|
||||
queue device::get_queue() const
|
||||
{
|
||||
return queue(wgpuDeviceGetQueue((WGPUDevice)get()));
|
||||
}
|
||||
|
|
@ -381,7 +381,7 @@ namespace psemek::wgpu
|
|||
wgpuDeviceDestroy((WGPUDevice)get());
|
||||
}
|
||||
|
||||
std::vector<feature> device::enumerate_features()
|
||||
std::vector<feature> device::enumerate_features() const
|
||||
{
|
||||
WGPUSupportedFeatures supported_features;
|
||||
wgpuDeviceGetFeatures((WGPUDevice)get(), &supported_features);
|
||||
|
|
@ -391,7 +391,7 @@ namespace psemek::wgpu
|
|||
return result;
|
||||
}
|
||||
|
||||
limits device::get_limits()
|
||||
limits device::get_limits() const
|
||||
{
|
||||
WGPULimits limits = {};
|
||||
detail::check_status("wgpuDeviceGetLimits", wgpuDeviceGetLimits((WGPUDevice)get(), &limits));
|
||||
|
|
@ -433,7 +433,7 @@ namespace psemek::wgpu
|
|||
return result;
|
||||
}
|
||||
|
||||
bool device::has_feature(feature feature)
|
||||
bool device::has_feature(feature feature) const
|
||||
{
|
||||
return wgpuDeviceHasFeature((WGPUDevice)get(), (WGPUFeatureName)feature);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,12 +10,12 @@ namespace psemek::wgpu
|
|||
wgpuQuerySetDestroy((WGPUQuerySet)get());
|
||||
}
|
||||
|
||||
std::uint32_t query_set::get_count()
|
||||
std::uint32_t query_set::get_count() const
|
||||
{
|
||||
return wgpuQuerySetGetCount((WGPUQuerySet)get());
|
||||
}
|
||||
|
||||
query_set::type query_set::get_type()
|
||||
query_set::type query_set::get_type() const
|
||||
{
|
||||
return (type)wgpuQuerySetGetType((WGPUQuerySet)get());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
namespace psemek::wgpu
|
||||
{
|
||||
|
||||
bind_group_layout render_pipeline::get_bind_group_layout(std::uint32_t index)
|
||||
bind_group_layout render_pipeline::get_bind_group_layout(std::uint32_t index) const
|
||||
{
|
||||
return bind_group_layout(wgpuRenderPipelineGetBindGroupLayout((WGPURenderPipeline)get(), index));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
namespace psemek::wgpu
|
||||
{
|
||||
|
||||
void shader_module::get_compilation_info(callback_mode mode, compilation_info_callback const & callback)
|
||||
void shader_module::get_compilation_info(callback_mode mode, compilation_info_callback const & callback) const
|
||||
{
|
||||
WGPUCompilationInfoCallbackInfo callback_info = {};
|
||||
callback_info.mode = (WGPUCallbackMode)mode;
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ namespace psemek::wgpu
|
|||
wgpuSurfaceConfigure((WGPUSurface)get(), &config);
|
||||
}
|
||||
|
||||
surface::capabilities surface::get_capabilities(adapter const & adapter)
|
||||
surface::capabilities surface::get_capabilities(adapter const & adapter) const
|
||||
{
|
||||
WGPUSurfaceCapabilities caps = {};
|
||||
detail::check_status("wgpuSurfaceGetCapabilities", wgpuSurfaceGetCapabilities((WGPUSurface)get(), (WGPUAdapter)adapter.get(), &caps));
|
||||
|
|
@ -42,7 +42,7 @@ namespace psemek::wgpu
|
|||
return result;
|
||||
}
|
||||
|
||||
surface::current_texture surface::get_current_texture()
|
||||
surface::current_texture surface::get_current_texture() const
|
||||
{
|
||||
WGPUSurfaceTexture tex;
|
||||
wgpuSurfaceGetCurrentTexture((WGPUSurface)get(), &tex);
|
||||
|
|
|
|||
|
|
@ -26,37 +26,37 @@ namespace psemek::wgpu
|
|||
wgpuTextureDestroy((WGPUTexture)get());
|
||||
}
|
||||
|
||||
std::uint32_t texture::get_width()
|
||||
std::uint32_t texture::get_width() const
|
||||
{
|
||||
return wgpuTextureGetWidth((WGPUTexture)get());
|
||||
}
|
||||
|
||||
std::uint32_t texture::get_height()
|
||||
std::uint32_t texture::get_height() const
|
||||
{
|
||||
return wgpuTextureGetHeight((WGPUTexture)get());
|
||||
}
|
||||
|
||||
std::uint32_t texture::get_depth()
|
||||
std::uint32_t texture::get_depth() const
|
||||
{
|
||||
return wgpuTextureGetDepthOrArrayLayers((WGPUTexture)get());
|
||||
}
|
||||
|
||||
texture::dimension texture::get_dimension()
|
||||
texture::dimension texture::get_dimension() const
|
||||
{
|
||||
return (dimension)wgpuTextureGetDimension((WGPUTexture)get());
|
||||
}
|
||||
|
||||
texture::format texture::get_format()
|
||||
texture::format texture::get_format() const
|
||||
{
|
||||
return (format)wgpuTextureGetFormat((WGPUTexture)get());
|
||||
}
|
||||
|
||||
std::uint32_t texture::get_mip_level_count()
|
||||
std::uint32_t texture::get_mip_level_count() const
|
||||
{
|
||||
return wgpuTextureGetMipLevelCount((WGPUTexture)get());
|
||||
}
|
||||
|
||||
texture::usage texture::get_usage()
|
||||
texture::usage texture::get_usage() const
|
||||
{
|
||||
return (usage)wgpuTextureGetUsage((WGPUTexture)get());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue