#include "prog_cache.h"
#include "prog_parameter.h"
#include "prog_instruction.h"
+#include "util/bitscan.h"
#include "util/ralloc.h"
#include "util/u_atomic.h"
ctx->Shared->DefaultFragmentProgram);
assert(ctx->FragmentProgram.Current);
ctx->FragmentProgram.Cache = _mesa_new_program_cache();
+ ctx->VertexProgram._VPMode = VP_MODE_FF;
/* XXX probably move this stuff */
ctx->ATIFragmentShader.Enabled = GL_FALSE;
*/
GLint
_mesa_get_min_invocations_per_fragment(struct gl_context *ctx,
- const struct gl_program *prog,
- bool ignore_sample_qualifier)
+ const struct gl_program *prog)
{
/* From ARB_sample_shading specification:
* "Using gl_SampleID in a fragment shader causes the entire shader
* "Use of the "sample" qualifier on a fragment shader input
* forces per-sample shading"
*/
- if (prog->info.fs.uses_sample_qualifier && !ignore_sample_qualifier)
- return MAX2(_mesa_geometric_samples(ctx->DrawBuffer), 1);
-
- if (prog->info.system_values_read & (SYSTEM_BIT_SAMPLE_ID |
- SYSTEM_BIT_SAMPLE_POS))
+ if (prog->info.fs.uses_sample_qualifier ||
+ (prog->info.system_values_read & (SYSTEM_BIT_SAMPLE_ID |
+ SYSTEM_BIT_SAMPLE_POS)))
return MAX2(_mesa_geometric_samples(ctx->DrawBuffer), 1);
else if (ctx->Multisample.SampleShading)
return MAX2(ceil(ctx->Multisample.MinSampleShadingValue *
}
return 1;
}
+
+
+GLbitfield
+gl_external_samplers(const struct gl_program *prog)
+{
+ GLbitfield external_samplers = 0;
+ GLbitfield mask = prog->SamplersUsed;
+
+ while (mask) {
+ int idx = u_bit_scan(&mask);
+ if (prog->sh.SamplerTargets[idx] == TEXTURE_EXTERNAL_INDEX)
+ external_samplers |= (1 << idx);
+ }
+
+ return external_samplers;
+}