Merge pull request #2251 from jpark37/lut-volume-texture

Use volume textures for LUT filter
This commit is contained in:
Jim
2019-12-29 11:04:20 -08:00
committed by GitHub
19 changed files with 699 additions and 84 deletions

View File

@@ -52,7 +52,8 @@ device_cubetexture_create(gs_device_t *device, uint32_t size,
EXPORT gs_texture_t *
device_voltexture_create(gs_device_t *device, uint32_t width, uint32_t height,
uint32_t depth, enum gs_color_format color_format,
uint32_t levels, const uint8_t **data, uint32_t flags);
uint32_t levels, const uint8_t *const *data,
uint32_t flags);
EXPORT gs_zstencil_t *device_zstencil_create(gs_device_t *device,
uint32_t width, uint32_t height,
enum gs_zstencil_format format);

View File

@@ -53,7 +53,7 @@ struct gs_exports {
gs_texture_t *(*device_voltexture_create)(
gs_device_t *device, uint32_t width, uint32_t height,
uint32_t depth, enum gs_color_format color_format,
uint32_t levels, const uint8_t **data, uint32_t flags);
uint32_t levels, const uint8_t *const *data, uint32_t flags);
gs_zstencil_t *(*device_zstencil_create)(
gs_device_t *device, uint32_t width, uint32_t height,
enum gs_zstencil_format format);

View File

@@ -938,10 +938,12 @@ static inline bool gs_is_compressed_format(enum gs_color_format format)
return (format == GS_DXT1 || format == GS_DXT3 || format == GS_DXT5);
}
static inline uint32_t gs_get_total_levels(uint32_t width, uint32_t height)
static inline uint32_t gs_get_total_levels(uint32_t width, uint32_t height,
uint32_t depth)
{
uint32_t size = width > height ? width : height;
uint32_t num_levels = 0;
size = size > depth ? size : depth;
uint32_t num_levels = 1;
while (size > 1) {
size /= 2;