mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-27 22:20:24 +00:00
40e25218e2
Apparently AMD's GLSL compiler doesn't like our #if statements. Turn them into simple #ifdefs and compute them in the preamble instead.
38 lines
1.1 KiB
C
38 lines
1.1 KiB
C
#pragma once
|
|
|
|
#include "gskgputypesprivate.h"
|
|
|
|
static inline GskGpuShaderFlags
|
|
gsk_gpu_shader_flags_create (GskGpuShaderClip clip,
|
|
gboolean texture0_is_external,
|
|
gboolean texture1_is_external)
|
|
{
|
|
return (clip & GSK_GPU_SHADER_CLIP_MASK) |
|
|
(texture0_is_external ? 1 << GSK_GPU_SHADER_CLIP_SHIFT : 0) |
|
|
(texture1_is_external ? 1 << (GSK_GPU_SHADER_CLIP_SHIFT + 1) : 0);
|
|
}
|
|
|
|
static inline gboolean
|
|
gsk_gpu_shader_flags_has_external_textures (GskGpuShaderFlags flags)
|
|
{
|
|
return flags & (3 << GSK_GPU_SHADER_CLIP_SHIFT) ? TRUE : FALSE;
|
|
}
|
|
|
|
static inline gboolean
|
|
gsk_gpu_shader_flags_has_external_texture0 (GskGpuShaderFlags flags)
|
|
{
|
|
return flags & (1 << GSK_GPU_SHADER_CLIP_SHIFT) ? TRUE : FALSE;
|
|
}
|
|
|
|
static inline gboolean
|
|
gsk_gpu_shader_flags_has_external_texture1 (GskGpuShaderFlags flags)
|
|
{
|
|
return flags & (2 << GSK_GPU_SHADER_CLIP_SHIFT) ? TRUE : FALSE;
|
|
}
|
|
|
|
static inline GskGpuShaderClip
|
|
gsk_gpu_shader_flags_get_clip (GskGpuShaderFlags flags)
|
|
{
|
|
return flags & GSK_GPU_SHADER_CLIP_MASK;
|
|
}
|