summaryrefslogtreecommitdiff
path: root/src/gpu/texture_manager.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/texture_manager.h')
-rw-r--r--src/gpu/texture_manager.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/gpu/texture_manager.h b/src/gpu/texture_manager.h
index 86d1f63..5a2b9f8 100644
--- a/src/gpu/texture_manager.h
+++ b/src/gpu/texture_manager.h
@@ -52,6 +52,13 @@ class TextureManager {
const GpuProceduralParams& params);
#if !defined(STRIP_GPU_COMPOSITE)
+ enum class SamplerType {
+ LinearClamp,
+ LinearRepeat,
+ NearestClamp,
+ NearestRepeat
+ };
+
// GPU composite generation (multi-input textures)
void create_gpu_composite_texture(const std::string& name,
const std::string& shader_func,
@@ -59,7 +66,8 @@ class TextureManager {
const void* uniform_data,
size_t uniform_size,
int width, int height,
- const std::vector<std::string>& input_names);
+ const std::vector<std::string>& input_names,
+ SamplerType sampler = SamplerType::LinearClamp);
#endif
#if !defined(STRIP_ALL)
@@ -91,7 +99,8 @@ class TextureManager {
void dispatch_composite(const std::string& func_name, WGPUTexture target,
const GpuProceduralParams& params,
const void* uniform_data, size_t uniform_size,
- const std::vector<WGPUTextureView>& input_views);
+ const std::vector<WGPUTextureView>& input_views,
+ SamplerType sampler_type);
#endif
WGPUDevice device_;
@@ -99,6 +108,7 @@ class TextureManager {
std::map<std::string, GpuTexture> textures_;
std::map<std::string, ComputePipelineInfo> compute_pipelines_;
#if !defined(STRIP_GPU_COMPOSITE)
- WGPUSampler linear_sampler_;
+ WGPUSampler get_or_create_sampler(SamplerType type);
+ std::map<SamplerType, WGPUSampler> samplers_;
#endif
};