summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2016-08-31 17:44:01 -0400
committerRob Clark <robdclark@gmail.com>2016-09-26 15:29:17 -0400
commitecd6fce2611e88ff8468a354cff8eda39f260a31 (patch)
treef4c281475a9dfb836cf9c9ff1853de0edc850bc6 /src/mesa/main
parente0ec1c31345aa8f47b5dea16d26be4420bd908ad (diff)
downloadexternal_mesa3d-ecd6fce2611e88ff8468a354cff8eda39f260a31.zip
external_mesa3d-ecd6fce2611e88ff8468a354cff8eda39f260a31.tar.gz
external_mesa3d-ecd6fce2611e88ff8468a354cff8eda39f260a31.tar.bz2
mesa/st: support lowering multi-planar YUV
Support multi-planar YUV for external EGLImage's (currently just in the dma-buf import path) by lowering to multiple texture fetch's for each plane and CSC in shader. There was some discussion of alternative approaches for tracking the additional UV or U/V planes: https://lists.freedesktop.org/archives/mesa-dev/2016-September/127832.html They all seemed worse than pipe_resource::next Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/mtypes.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 85aeb1e..ee811ff 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -45,6 +45,7 @@
#include "compiler/shader_enums.h"
#include "main/formats.h" /* MESA_FORMAT_COUNT */
#include "compiler/glsl/list.h"
+#include "util/bitscan.h"
#ifdef __cplusplus
@@ -1929,6 +1930,7 @@ struct gl_program
GLbitfield TexturesUsed[MAX_COMBINED_TEXTURE_IMAGE_UNITS]; /**< TEXTURE_x_BIT bitmask */
GLbitfield SamplersUsed; /**< Bitfield of which samplers are used */
GLbitfield ShadowSamplers; /**< Texture units used for shadow sampling. */
+ GLbitfield ExternalSamplersUsed; /**< Texture units used for samplerExternalOES */
GLboolean UsesGather; /**< Does this program use gather4 at all? */
@@ -2460,6 +2462,20 @@ struct gl_linked_shader
struct gl_shader_info info;
};
+static inline GLbitfield gl_external_samplers(struct gl_linked_shader *shader)
+{
+ GLbitfield external_samplers = 0;
+ GLbitfield mask = shader->active_samplers;
+
+ while (mask) {
+ int idx = u_bit_scan(&mask);
+ if (shader->SamplerTargets[idx] == TEXTURE_EXTERNAL_INDEX)
+ external_samplers |= (1 << idx);
+ }
+
+ return external_samplers;
+}
+
/**
* A GLSL shader object.
*/