diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-06-03 14:35:15 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-06-03 17:18:50 +0300 |
commit | 91cc1f38aefdac70c2de2e19cec0d349329aa925 (patch) | |
tree | 4b5bc27e524128113b204717434b1a1f180948ef /source/blender/gpu/GPU_material.h | |
parent | 866e067d65c1691941865ee426bc0dac5c9e3f95 (diff) |
GPUMaterial: Add support for different sampler state per image sampler
This bridge between the new sampler state support from GPUTexture and
draw material handling.
The Sampler State is just the one from the texture for now. No change in
logic.
Diffstat (limited to 'source/blender/gpu/GPU_material.h')
-rw-r--r-- | source/blender/gpu/GPU_material.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/source/blender/gpu/GPU_material.h b/source/blender/gpu/GPU_material.h index c23960da1ed..eeb2d2caef2 100644 --- a/source/blender/gpu/GPU_material.h +++ b/source/blender/gpu/GPU_material.h @@ -29,6 +29,8 @@ #include "BLI_sys_types.h" /* for bool */ +#include "GPU_texture.h" /* for eGPUSamplerState */ + #ifdef __cplusplus extern "C" { #endif @@ -138,8 +140,14 @@ typedef enum eGPUMaterialStatus { GPUNodeLink *GPU_constant(const float *num); GPUNodeLink *GPU_uniform(const float *num); GPUNodeLink *GPU_attribute(GPUMaterial *mat, CustomDataType type, const char *name); -GPUNodeLink *GPU_image(GPUMaterial *mat, struct Image *ima, struct ImageUser *iuser); -GPUNodeLink *GPU_image_tiled(GPUMaterial *mat, struct Image *ima, struct ImageUser *iuser); +GPUNodeLink *GPU_image(GPUMaterial *mat, + struct Image *ima, + struct ImageUser *iuser, + eGPUSamplerState sampler_state); +GPUNodeLink *GPU_image_tiled(GPUMaterial *mat, + struct Image *ima, + struct ImageUser *iuser, + eGPUSamplerState sampler_state); GPUNodeLink *GPU_image_tiled_mapping(GPUMaterial *mat, struct Image *ima, struct ImageUser *iuser); GPUNodeLink *GPU_color_band(GPUMaterial *mat, int size, float *pixels, float *layer); GPUNodeLink *GPU_volume_grid(GPUMaterial *mat, const char *name); @@ -229,6 +237,7 @@ typedef struct GPUMaterialTexture { char sampler_name[32]; /* Name of sampler in GLSL. */ char tiled_mapping_name[32]; /* Name of tile mapping sampler in GLSL. */ int users; + int sampler_state; /* eGPUSamplerState */ } GPUMaterialTexture; typedef struct GPUMaterialVolumeGrid { |