aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/main')
-rw-r--r--mesalib/src/mesa/main/bitset.h61
-rw-r--r--mesalib/src/mesa/main/multisample.c17
2 files changed, 11 insertions, 67 deletions
diff --git a/mesalib/src/mesa/main/bitset.h b/mesalib/src/mesa/main/bitset.h
index c3b060b01..601fd0ebf 100644
--- a/mesalib/src/mesa/main/bitset.h
+++ b/mesalib/src/mesa/main/bitset.h
@@ -96,65 +96,4 @@ __bitset_ffs(const BITSET_WORD *x, int n)
#define BITSET_FFS(x) __bitset_ffs(x, Elements(x))
-/****************************************************************************
- * 64-bit bitset implementation
- */
-
-#define BITSET64_WORD GLuint
-#define BITSET64_WORDBITS (sizeof (BITSET64_WORD) * 8)
-
-/* bitset declarations
- */
-#define BITSET64_DECLARE(name, size) \
- GLuint name[2]
-
-/* bitset operations
- */
-#define BITSET64_COPY(x, y) do { (x)[0] = (y)[0]; (x)[1] = (y)[1]; } while (0)
-#define BITSET64_EQUAL(x, y) ( (x)[0] == (y)[0] && (x)[1] == (y)[1] )
-#define BITSET64_ZERO(x) do { (x)[0] = 0; (x)[1] = 0; } while (0)
-#define BITSET64_ONES(x) do { (x)[0] = 0xFF; (x)[1] = 0xFF; } while (0)
-
-#define BITSET64_BITWORD(b) ((b) / BITSET64_WORDBITS)
-#define BITSET64_BIT(b) (1 << ((b) % BITSET64_WORDBITS))
-
-/* single bit operations
- */
-#define BITSET64_TEST(x, b) ((x)[BITSET64_BITWORD(b)] & BITSET64_BIT(b))
-#define BITSET64_SET(x, b) ((x)[BITSET64_BITWORD(b)] |= BITSET64_BIT(b))
-#define BITSET64_CLEAR(x, b) ((x)[BITSET64_BITWORD(b)] &= ~BITSET64_BIT(b))
-
-#define BITSET64_MASK(b) ((b) == BITSET64_WORDBITS ? ~0 : BITSET64_BIT(b) - 1)
-#define BITSET64_RANGE(b, e) (BITSET64_MASK((e) + 1) & ~BITSET64_MASK(b))
-
-/* bit range operations
- */
-#define BITSET64_TEST_SUBRANGE(x, b, e) \
- (BITSET64_BITWORD(b) == BITSET64_BITWORD(e) ? \
- ((x)[BITSET64_BITWORD(b)] & BITSET64_RANGE(b, e)) : \
- (assert (!"BITSET64_TEST_RANGE: bit range crosses word boundary"), 0))
-#define BITSET64_TEST_RANGE(x, b, e) \
- (BITSET64_BITWORD(b) == BITSET64_BITWORD(e) ? \
- (BITSET64_TEST_SUBRANGE(x, b, e)) : \
- (BITSET64_TEST_SUBRANGE(x, b, BITSET64_WORDBITS - 1) | \
- BITSET64_TEST_SUBRANGE(x, BITSET64_WORDBITS, e)))
-#define BITSET64_SET_SUBRANGE(x, b, e) \
- (BITSET64_BITWORD(b) == BITSET64_BITWORD(e) ? \
- ((x)[BITSET64_BITWORD(b)] |= BITSET64_RANGE(b, e)) : \
- (assert (!"BITSET64_SET_RANGE: bit range crosses word boundary"), 0))
-#define BITSET64_SET_RANGE(x, b, e) \
- (BITSET64_BITWORD(b) == BITSET64_BITWORD(e) ? \
- (BITSET64_SET_SUBRANGE(x, b, e)) : \
- (BITSET64_SET_SUBRANGE(x, b, BITSET64_WORDBITS - 1) | \
- BITSET64_SET_SUBRANGE(x, BITSET64_WORDBITS, e)))
-#define BITSET64_CLEAR_SUBRANGE(x, b, e) \
- (BITSET64_BITWORD(b) == BITSET64_BITWORD(e) ? \
- ((x)[BITSET64_BITWORD(b)] &= ~BITSET64_RANGE(b, e)) : \
- (assert (!"BITSET64_CLEAR_RANGE: bit range crosses word boundary"), 0))
-#define BITSET64_CLEAR_RANGE(x, b, e) \
- (BITSET64_BITWORD(b) == BITSET64_BITWORD(e) ? \
- (BITSET64_CLEAR_SUBRANGE(x, b, e)) : \
- (BITSET64_CLEAR_SUBRANGE(x, b, BITSET64_WORDBITS - 1) | \
- BITSET64_CLEAR_SUBRANGE(x, BITSET64_WORDBITS, e)))
-
#endif
diff --git a/mesalib/src/mesa/main/multisample.c b/mesalib/src/mesa/main/multisample.c
index f4116ca00..8b974c1b7 100644
--- a/mesalib/src/mesa/main/multisample.c
+++ b/mesalib/src/mesa/main/multisample.c
@@ -120,7 +120,8 @@ _mesa_SampleMaski(GLuint index, GLbitfield mask)
}
-/* Helper for checking a requested sample count against the limit
+/**
+ * Helper for checking a requested sample count against the limit
* for a particular (target, internalFormat) pair. The limit imposed,
* and the error generated, both depend on which extensions are supported.
*
@@ -131,8 +132,9 @@ GLenum
_mesa_check_sample_count(struct gl_context *ctx, GLenum target,
GLenum internalFormat, GLsizei samples)
{
- /* If ARB_internalformat_query is supported, then treat its highest returned sample
- * count as the absolute maximum for this format; it is allowed to exceed MAX_SAMPLES.
+ /* If ARB_internalformat_query is supported, then treat its highest
+ * returned sample count as the absolute maximum for this format; it is
+ * allowed to exceed MAX_SAMPLES.
*
* From the ARB_internalformat_query spec:
*
@@ -141,7 +143,8 @@ _mesa_check_sample_count(struct gl_context *ctx, GLenum target,
*/
if (ctx->Extensions.ARB_internalformat_query) {
GLint buffer[16];
- int count = ctx->Driver.QuerySamplesForFormat(ctx, target, internalFormat, buffer);
+ int count = ctx->Driver.QuerySamplesForFormat(ctx, target,
+ internalFormat, buffer);
int limit = count ? buffer[0] : -1;
return samples > limit ? GL_INVALID_OPERATION : GL_NO_ERROR;
@@ -159,7 +162,8 @@ _mesa_check_sample_count(struct gl_context *ctx, GLenum target,
*
* And when describing the operation of TexImage*Multisample:
*
- * "The error INVALID_OPERATION may be generated if any of the following are true:
+ * "The error INVALID_OPERATION may be generated if any of the following
+ * are true:
*
* * <internalformat> is a depth/stencil-renderable format and <samples>
* is greater than the value of MAX_DEPTH_TEXTURE_SAMPLES
@@ -171,7 +175,8 @@ _mesa_check_sample_count(struct gl_context *ctx, GLenum target,
if (ctx->Extensions.ARB_texture_multisample) {
if (_mesa_is_enum_format_integer(internalFormat))
- return samples > ctx->Const.MaxIntegerSamples ? GL_INVALID_OPERATION : GL_NO_ERROR;
+ return samples > ctx->Const.MaxIntegerSamples
+ ? GL_INVALID_OPERATION : GL_NO_ERROR;
if (target == GL_TEXTURE_2D_MULTISAMPLE ||
target == GL_TEXTURE_2D_MULTISAMPLE_ARRAY) {