aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-10-25 09:59:33 +0200
committermarha <marha@users.sourceforge.net>2012-10-25 09:59:33 +0200
commit281f26a1dfda732687680a36857960f74608df5b (patch)
tree2dada31e73b6e8a6d4e1202999a88377d0eebbf3 /mesalib/src/mesa
parent34d741a3fc96c9424ffec29b114a1bdfde40f8b0 (diff)
downloadvcxsrv-281f26a1dfda732687680a36857960f74608df5b.tar.gz
vcxsrv-281f26a1dfda732687680a36857960f74608df5b.tar.bz2
vcxsrv-281f26a1dfda732687680a36857960f74608df5b.zip
fontconfig mesa pixman git update
fonconfig: 73ab254336100c5971e3a1e14b73222efd0e9822 mesa: 86cd77d0a9ac940c2c06eebc5e9ef840d176712a pixman: 9df645dfb04b5a790faabe1e9a84fc37287d91b0
Diffstat (limited to 'mesalib/src/mesa')
-rw-r--r--mesalib/src/mesa/main/api_exec.c45
-rw-r--r--mesalib/src/mesa/main/api_loopback.h1
-rw-r--r--mesalib/src/mesa/main/bufferobj.c3
-rw-r--r--mesalib/src/mesa/main/dlist.c5
-rw-r--r--mesalib/src/mesa/main/pack.c216
-rw-r--r--mesalib/src/mesa/main/queryobj.c45
-rw-r--r--mesalib/src/mesa/main/queryobj.h3
-rw-r--r--mesalib/src/mesa/main/samplerobj.c14
-rw-r--r--mesalib/src/mesa/main/samplerobj.h3
-rw-r--r--mesalib/src/mesa/main/transformfeedback.c7
-rw-r--r--mesalib/src/mesa/main/transformfeedback.h3
-rw-r--r--mesalib/src/mesa/main/uniforms.c18
-rw-r--r--mesalib/src/mesa/state_tracker/st_cb_texture.c5
-rw-r--r--mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp21
-rw-r--r--mesalib/src/mesa/state_tracker/st_mesa_to_tgsi.c12
15 files changed, 233 insertions, 168 deletions
diff --git a/mesalib/src/mesa/main/api_exec.c b/mesalib/src/mesa/main/api_exec.c
index d2f14ce1a..a670fba43 100644
--- a/mesalib/src/mesa/main/api_exec.c
+++ b/mesalib/src/mesa/main/api_exec.c
@@ -322,10 +322,12 @@ _mesa_create_exec_table(struct gl_context *ctx)
SET_DisableClientState(exec, _mesa_DisableClientState);
SET_EdgeFlagPointer(exec, _mesa_EdgeFlagPointer);
SET_EnableClientState(exec, _mesa_EnableClientState);
- SET_GetPointerv(exec, _mesa_GetPointerv);
SET_IndexPointer(exec, _mesa_IndexPointer);
SET_InterleavedArrays(exec, _mesa_InterleavedArrays);
}
+ if (ctx->API != API_OPENGLES2) {
+ SET_GetPointerv(exec, _mesa_GetPointerv);
+ }
SET_IsTexture(exec, _mesa_IsTexture);
if (ctx->API != API_OPENGL_CORE && ctx->API != API_OPENGLES2) {
SET_NormalPointer(exec, _mesa_NormalPointer);
@@ -490,8 +492,8 @@ _mesa_create_exec_table(struct gl_context *ctx)
/* 352. GL_EXT_transform_feedback */
/* ARB 93. GL_ARB_transform_feedback2 */
- if (ctx->API != API_OPENGLES2) {
- _mesa_init_transform_feedback_dispatch(exec);
+ if (ctx->API != API_OPENGLES2 || _mesa_is_gles3(ctx)) {
+ _mesa_init_transform_feedback_dispatch(ctx, exec);
}
/* 364. GL_EXT_provoking_vertex */
@@ -578,13 +580,15 @@ _mesa_create_exec_table(struct gl_context *ctx)
SET_EnableVertexAttribArrayARB(exec, _mesa_EnableVertexAttribArrayARB);
SET_DisableVertexAttribArrayARB(exec, _mesa_DisableVertexAttribArrayARB);
if (ctx->API != API_OPENGLES2) {
- SET_ProgramStringARB(exec, _mesa_ProgramStringARB);
/* glBindProgramARB aliases glBindProgramNV */
/* glDeleteProgramsARB aliases glDeleteProgramsNV */
/* glGenProgramsARB aliases glGenProgramsNV */
/* glIsProgramARB aliases glIsProgramNV */
SET_GetVertexAttribdvARB(exec, _mesa_GetVertexAttribdvARB);
}
+ if (ctx->API == API_OPENGL) {
+ SET_ProgramStringARB(exec, _mesa_ProgramStringARB);
+ }
SET_GetVertexAttribfvARB(exec, _mesa_GetVertexAttribfvARB);
SET_GetVertexAttribivARB(exec, _mesa_GetVertexAttribivARB);
@@ -610,15 +614,15 @@ _mesa_create_exec_table(struct gl_context *ctx)
_mesa_init_bufferobj_dispatch(ctx, exec);
/* ARB 29. GL_ARB_occlusion_query */
- if (ctx->API != API_OPENGLES2) {
- _mesa_init_queryobj_dispatch(exec);
+ if (ctx->API != API_OPENGLES2 || _mesa_is_gles3(ctx)) {
+ _mesa_init_queryobj_dispatch(ctx, exec);
}
/* ARB 37. GL_ARB_draw_buffers */
SET_DrawBuffersARB(exec, _mesa_DrawBuffersARB);
/* ARB 66. GL_ARB_sync */
- if (ctx->API != API_OPENGLES2) {
+ if (ctx->API != API_OPENGLES2 || _mesa_is_gles3(ctx)) {
_mesa_init_sync_dispatch(exec);
}
@@ -668,7 +672,7 @@ _mesa_create_exec_table(struct gl_context *ctx)
SET_GetFramebufferAttachmentParameterivEXT(exec, _mesa_GetFramebufferAttachmentParameterivEXT);
SET_GenerateMipmapEXT(exec, _mesa_GenerateMipmapEXT);
- if (ctx->API != API_OPENGLES2) {
+ if (ctx->API != API_OPENGLES2 || _mesa_is_gles3(ctx)) {
SET_BlitFramebufferEXT(exec, _mesa_BlitFramebufferEXT);
}
@@ -679,7 +683,7 @@ _mesa_create_exec_table(struct gl_context *ctx)
}
/* GL_MESA_texture_array / GL_EXT_texture_array */
- if (ctx->API != API_OPENGLES2) {
+ if (ctx->API != API_OPENGLES2 || _mesa_is_gles3(ctx)) {
SET_FramebufferTextureLayerEXT(exec, _mesa_FramebufferTextureLayerEXT);
}
@@ -691,7 +695,7 @@ _mesa_create_exec_table(struct gl_context *ctx)
/* The ARB_fbo functions are the union of
* GL_EXT_fbo, GL_EXT_framebuffer_blit, GL_EXT_texture_array
*/
- if (ctx->API != API_OPENGLES2) {
+ if (ctx->API != API_OPENGLES2 || _mesa_is_gles3(ctx)) {
SET_RenderbufferStorageMultisample(exec, _mesa_RenderbufferStorageMultisample);
}
@@ -700,7 +704,7 @@ _mesa_create_exec_table(struct gl_context *ctx)
SET_FlushMappedBufferRange(exec, _mesa_FlushMappedBufferRange);
/* GL_ARB_copy_buffer */
- if (ctx->API != API_OPENGLES2) {
+ if (ctx->API != API_OPENGLES2 || _mesa_is_gles3(ctx)) {
SET_CopyBufferSubData(exec, _mesa_CopyBufferSubData);
}
@@ -710,9 +714,11 @@ _mesa_create_exec_table(struct gl_context *ctx)
/* GL_EXT_draw_buffers2 */
if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
+ SET_GetIntegerIndexedvEXT(exec, _mesa_GetIntegerIndexedv);
+ }
+ if (_mesa_is_desktop_gl(ctx)) {
SET_ColorMaskIndexedEXT(exec, _mesa_ColorMaskIndexed);
SET_GetBooleanIndexedvEXT(exec, _mesa_GetBooleanIndexedv);
- SET_GetIntegerIndexedvEXT(exec, _mesa_GetIntegerIndexedv);
SET_EnableIndexedEXT(exec, _mesa_EnableIndexed);
SET_DisableIndexedEXT(exec, _mesa_DisableIndexed);
SET_IsEnabledIndexedEXT(exec, _mesa_IsEnabledIndexed);
@@ -743,7 +749,7 @@ _mesa_create_exec_table(struct gl_context *ctx)
}
/* GL_EXT_texture_integer */
- if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
+ if (_mesa_is_desktop_gl(ctx)) {
SET_ClearColorIiEXT(exec, _mesa_ClearColorIiEXT);
SET_ClearColorIuiEXT(exec, _mesa_ClearColorIuiEXT);
}
@@ -755,24 +761,23 @@ _mesa_create_exec_table(struct gl_context *ctx)
}
/* GL_EXT_gpu_shader4 / OpenGL 3.0 */
- if (ctx->API != API_OPENGLES2) {
+ if (ctx->API != API_OPENGLES2 || _mesa_is_gles3(ctx)) {
SET_GetVertexAttribIivEXT(exec, _mesa_GetVertexAttribIiv);
SET_GetVertexAttribIuivEXT(exec, _mesa_GetVertexAttribIuiv);
SET_VertexAttribIPointerEXT(exec, _mesa_VertexAttribIPointer);
}
/* GL 3.0 (functions not covered by other extensions) */
- if (ctx->API != API_OPENGLES2) {
+ if (ctx->API != API_OPENGLES2 || _mesa_is_gles3(ctx)) {
SET_ClearBufferiv(exec, _mesa_ClearBufferiv);
SET_ClearBufferuiv(exec, _mesa_ClearBufferuiv);
SET_ClearBufferfv(exec, _mesa_ClearBufferfv);
SET_ClearBufferfi(exec, _mesa_ClearBufferfi);
SET_GetStringi(exec, _mesa_GetStringi);
- SET_ClampColor(exec, _mesa_ClampColorARB);
}
/* GL_ARB_instanced_arrays */
- if (ctx->API != API_OPENGLES2) {
+ if (ctx->API != API_OPENGLES2 || _mesa_is_gles3(ctx)) {
SET_VertexAttribDivisorARB(exec, _mesa_VertexAttribDivisor);
}
@@ -802,12 +807,14 @@ _mesa_create_exec_table(struct gl_context *ctx)
if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
SET_TexStorage2D(exec, _mesa_TexStorage2D);
SET_TexStorage3D(exec, _mesa_TexStorage3D);
+ }
+ if (_mesa_is_desktop_gl(ctx)) {
SET_TextureStorage2DEXT(exec, _mesa_TextureStorage2DEXT);
SET_TextureStorage3DEXT(exec, _mesa_TextureStorage3DEXT);
}
- if (ctx->API != API_OPENGLES2) {
- _mesa_init_sampler_object_dispatch(exec);
+ if (ctx->API != API_OPENGLES2 || _mesa_is_gles3(ctx)) {
+ _mesa_init_sampler_object_dispatch(ctx, exec);
}
if (_mesa_is_desktop_gl(ctx)) {
diff --git a/mesalib/src/mesa/main/api_loopback.h b/mesalib/src/mesa/main/api_loopback.h
index 3e43286d2..628d4f89e 100644
--- a/mesalib/src/mesa/main/api_loopback.h
+++ b/mesalib/src/mesa/main/api_loopback.h
@@ -31,6 +31,7 @@
#include "main/mfeatures.h"
struct _glapi_table;
+struct gl_context;
extern void
_mesa_loopback_init_api_table(const struct gl_context *ctx,
diff --git a/mesalib/src/mesa/main/bufferobj.c b/mesalib/src/mesa/main/bufferobj.c
index ac6bbc56b..ac58c99d9 100644
--- a/mesalib/src/mesa/main/bufferobj.c
+++ b/mesalib/src/mesa/main/bufferobj.c
@@ -2341,6 +2341,9 @@ _mesa_init_bufferobj_dispatch(struct gl_context *ctx, struct _glapi_table *disp)
SET_DeleteBuffersARB(disp, _mesa_DeleteBuffersARB);
SET_GenBuffersARB(disp, _mesa_GenBuffersARB);
SET_GetBufferParameterivARB(disp, _mesa_GetBufferParameterivARB);
+ /* TODO: add GetBufferParameteri64v for desktop GL and GLES3 once tests
+ * exist for it.
+ */
SET_GetBufferPointervARB(disp, _mesa_GetBufferPointervARB);
if (ctx->API != API_OPENGLES2) {
SET_GetBufferSubDataARB(disp, _mesa_GetBufferSubDataARB);
diff --git a/mesalib/src/mesa/main/dlist.c b/mesalib/src/mesa/main/dlist.c
index 28cd52a40..d53879efd 100644
--- a/mesalib/src/mesa/main/dlist.c
+++ b/mesalib/src/mesa/main/dlist.c
@@ -10060,7 +10060,7 @@ _mesa_create_save_table(const struct gl_context *ctx)
SET_MapBufferARB(table, _mesa_MapBufferARB);
SET_UnmapBufferARB(table, _mesa_UnmapBufferARB);
- _mesa_init_queryobj_dispatch(table); /* glGetQuery, etc */
+ _mesa_init_queryobj_dispatch(ctx, table); /* glGetQuery, etc */
SET_BeginQueryARB(table, save_BeginQueryARB);
SET_EndQueryARB(table, save_EndQueryARB);
SET_QueryCounter(table, save_QueryCounter);
@@ -10143,7 +10143,6 @@ _mesa_create_save_table(const struct gl_context *ctx)
/* GL_ARB_color_buffer_float */
SET_ClampColorARB(table, save_ClampColorARB);
- SET_ClampColor(table, save_ClampColorARB);
/* GL 3.0 */
SET_ClearBufferiv(table, save_ClearBufferiv);
@@ -10197,7 +10196,7 @@ _mesa_create_save_table(const struct gl_context *ctx)
SET_TextureBarrierNV(table, save_TextureBarrierNV);
/* GL_ARB_sampler_objects */
- _mesa_init_sampler_object_dispatch(table); /* plug in Gen/Get/etc functions */
+ _mesa_init_sampler_object_dispatch(ctx, table); /* plug in Gen/Get/etc functions */
SET_BindSampler(table, save_BindSampler);
SET_SamplerParameteri(table, save_SamplerParameteri);
SET_SamplerParameterf(table, save_SamplerParameterf);
diff --git a/mesalib/src/mesa/main/pack.c b/mesalib/src/mesa/main/pack.c
index a23bc998d..4f0caa763 100644
--- a/mesalib/src/mesa/main/pack.c
+++ b/mesalib/src/mesa/main/pack.c
@@ -557,9 +557,9 @@ _mesa_pack_rgba_span_from_uints(struct gl_context *ctx, GLuint n, GLuint rgba[][
if ((dstFormat == GL_RGB) || (dstFormat == GL_RGB_INTEGER)) {
GLubyte *dst = (GLubyte *) dstAddr;
for (i=0;i<n;i++) {
- dst[i] = (CLAMP(rgba[i][RCOMP], 0, 7) << 5)
- | (CLAMP(rgba[i][GCOMP], 0, 7) << 2)
- | (CLAMP(rgba[i][BCOMP], 0, 3) );
+ dst[i] = (MIN2(rgba[i][RCOMP], 7) << 5)
+ | (MIN2(rgba[i][GCOMP], 7) << 2)
+ | (MIN2(rgba[i][BCOMP], 3) );
}
} else {
_pack_rgba_span_from_uints_problem(ctx, dstFormat, dstType);
@@ -569,9 +569,9 @@ _mesa_pack_rgba_span_from_uints(struct gl_context *ctx, GLuint n, GLuint rgba[][
if ((dstFormat == GL_RGB) || (dstFormat == GL_RGB_INTEGER)) {
GLubyte *dst = (GLubyte *) dstAddr;
for (i=0;i<n;i++) {
- dst[i] = (CLAMP(rgba[i][RCOMP], 0, 7) )
- | (CLAMP(rgba[i][GCOMP], 0, 7) << 3)
- | (CLAMP(rgba[i][BCOMP], 0, 3) << 6);
+ dst[i] = (MIN2(rgba[i][RCOMP], 7) )
+ | (MIN2(rgba[i][GCOMP], 7) << 3)
+ | (MIN2(rgba[i][BCOMP], 3) << 6);
}
} else {
_pack_rgba_span_from_uints_problem(ctx, dstFormat, dstType);
@@ -581,9 +581,9 @@ _mesa_pack_rgba_span_from_uints(struct gl_context *ctx, GLuint n, GLuint rgba[][
if ((dstFormat == GL_RGB) || (dstFormat == GL_RGB_INTEGER)) {
GLushort *dst = (GLushort *) dstAddr;
for (i=0;i<n;i++) {
- dst[i] = (CLAMP(rgba[i][RCOMP], 0, 31) << 11)
- | (CLAMP(rgba[i][GCOMP], 0, 63) << 5)
- | (CLAMP(rgba[i][BCOMP], 0, 31) );
+ dst[i] = (MIN2(rgba[i][RCOMP], 31) << 11)
+ | (MIN2(rgba[i][GCOMP], 63) << 5)
+ | (MIN2(rgba[i][BCOMP], 31) );
}
} else {
_pack_rgba_span_from_uints_problem(ctx, dstFormat, dstType);
@@ -593,9 +593,9 @@ _mesa_pack_rgba_span_from_uints(struct gl_context *ctx, GLuint n, GLuint rgba[][
if ((dstFormat == GL_RGB) || (dstFormat == GL_RGB_INTEGER)) {
GLushort *dst = (GLushort *) dstAddr;
for (i=0;i<n;i++) {
- dst[i] = (CLAMP(rgba[i][RCOMP], 0, 31) )
- | (CLAMP(rgba[i][GCOMP], 0, 63) << 5)
- | (CLAMP(rgba[i][BCOMP], 0, 31) << 11);
+ dst[i] = (MIN2(rgba[i][RCOMP], 31) )
+ | (MIN2(rgba[i][GCOMP], 63) << 5)
+ | (MIN2(rgba[i][BCOMP], 31) << 11);
}
} else {
_pack_rgba_span_from_uints_problem(ctx, dstFormat, dstType);
@@ -605,28 +605,28 @@ _mesa_pack_rgba_span_from_uints(struct gl_context *ctx, GLuint n, GLuint rgba[][
if ((dstFormat == GL_RGBA) || (dstFormat == GL_RGBA_INTEGER_EXT)) {
GLushort *dst = (GLushort *) dstAddr;
for (i=0;i<n;i++) {
- dst[i] = (CLAMP(rgba[i][RCOMP], 0, 15) << 12)
- | (CLAMP(rgba[i][GCOMP], 0, 15) << 8)
- | (CLAMP(rgba[i][BCOMP], 0, 15) << 4)
- | (CLAMP(rgba[i][ACOMP], 0, 15) );
+ dst[i] = (MIN2(rgba[i][RCOMP], 15) << 12)
+ | (MIN2(rgba[i][GCOMP], 15) << 8)
+ | (MIN2(rgba[i][BCOMP], 15) << 4)
+ | (MIN2(rgba[i][ACOMP], 15) );
}
}
else if ((dstFormat == GL_BGRA) || (dstFormat == GL_BGRA_INTEGER)) {
GLushort *dst = (GLushort *) dstAddr;
for (i=0;i<n;i++) {
- dst[i] = (CLAMP(rgba[i][BCOMP], 0, 15) << 12)
- | (CLAMP(rgba[i][GCOMP], 0, 15) << 8)
- | (CLAMP(rgba[i][RCOMP], 0, 15) << 4)
- | (CLAMP(rgba[i][ACOMP], 0, 15) );
+ dst[i] = (MIN2(rgba[i][BCOMP], 15) << 12)
+ | (MIN2(rgba[i][GCOMP], 15) << 8)
+ | (MIN2(rgba[i][RCOMP], 15) << 4)
+ | (MIN2(rgba[i][ACOMP], 15) );
}
}
else if (dstFormat == GL_ABGR_EXT) {
GLushort *dst = (GLushort *) dstAddr;
for (i=0;i<n;i++) {
- dst[i] = (CLAMP(rgba[i][ACOMP], 0, 15) << 12)
- | (CLAMP(rgba[i][BCOMP], 0, 15) << 8)
- | (CLAMP(rgba[i][GCOMP], 0, 15) << 4)
- | (CLAMP(rgba[i][RCOMP], 0, 15) );
+ dst[i] = (MIN2(rgba[i][ACOMP], 15) << 12)
+ | (MIN2(rgba[i][BCOMP], 15) << 8)
+ | (MIN2(rgba[i][GCOMP], 15) << 4)
+ | (MIN2(rgba[i][RCOMP], 15) );
}
} else {
_pack_rgba_span_from_uints_problem(ctx, dstFormat, dstType);
@@ -636,28 +636,28 @@ _mesa_pack_rgba_span_from_uints(struct gl_context *ctx, GLuint n, GLuint rgba[][
if ((dstFormat == GL_RGBA) || (dstFormat == GL_RGBA_INTEGER_EXT)) {
GLushort *dst = (GLushort *) dstAddr;
for (i=0;i<n;i++) {
- dst[i] = (CLAMP(rgba[i][RCOMP], 0, 15) )
- | (CLAMP(rgba[i][GCOMP], 0, 15) << 4)
- | (CLAMP(rgba[i][BCOMP], 0, 15) << 8)
- | (CLAMP(rgba[i][ACOMP], 0, 15) << 12);
+ dst[i] = (MIN2(rgba[i][RCOMP], 15) )
+ | (MIN2(rgba[i][GCOMP], 15) << 4)
+ | (MIN2(rgba[i][BCOMP], 15) << 8)
+ | (MIN2(rgba[i][ACOMP], 15) << 12);
}
}
else if ((dstFormat == GL_BGRA) || (dstFormat == GL_BGRA_INTEGER)) {
GLushort *dst = (GLushort *) dstAddr;
for (i=0;i<n;i++) {
- dst[i] = (CLAMP(rgba[i][BCOMP], 0, 15) )
- | (CLAMP(rgba[i][GCOMP], 0, 15) << 4)
- | (CLAMP(rgba[i][RCOMP], 0, 15) << 8)
- | (CLAMP(rgba[i][ACOMP], 0, 15) << 12);
+ dst[i] = (MIN2(rgba[i][BCOMP], 15) )
+ | (MIN2(rgba[i][GCOMP], 15) << 4)
+ | (MIN2(rgba[i][RCOMP], 15) << 8)
+ | (MIN2(rgba[i][ACOMP], 15) << 12);
}
}
else if (dstFormat == GL_ABGR_EXT) {
GLushort *dst = (GLushort *) dstAddr;
for (i=0;i<n;i++) {
- dst[i] = (CLAMP(rgba[i][ACOMP], 0, 15) )
- | (CLAMP(rgba[i][BCOMP], 0, 15) << 4)
- | (CLAMP(rgba[i][GCOMP], 0, 15) << 8)
- | (CLAMP(rgba[i][RCOMP], 0, 15) << 12);
+ dst[i] = (MIN2(rgba[i][ACOMP], 15) )
+ | (MIN2(rgba[i][BCOMP], 15) << 4)
+ | (MIN2(rgba[i][GCOMP], 15) << 8)
+ | (MIN2(rgba[i][RCOMP], 15) << 12);
}
} else {
_pack_rgba_span_from_uints_problem(ctx, dstFormat, dstType);
@@ -667,28 +667,28 @@ _mesa_pack_rgba_span_from_uints(struct gl_context *ctx, GLuint n, GLuint rgba[][
if ((dstFormat == GL_RGBA) || (dstFormat == GL_RGBA_INTEGER_EXT)) {
GLushort *dst = (GLushort *) dstAddr;
for (i=0;i<n;i++) {
- dst[i] = (CLAMP(rgba[i][RCOMP], 0, 31) << 11)
- | (CLAMP(rgba[i][GCOMP], 0, 31) << 6)
- | (CLAMP(rgba[i][BCOMP], 0, 31) << 1)
- | (CLAMP(rgba[i][ACOMP], 0, 1) );
+ dst[i] = (MIN2(rgba[i][RCOMP], 31) << 11)
+ | (MIN2(rgba[i][GCOMP], 31) << 6)
+ | (MIN2(rgba[i][BCOMP], 31) << 1)
+ | (MIN2(rgba[i][ACOMP], 1) );
}
}
else if ((dstFormat == GL_BGRA) || (dstFormat == GL_BGRA_INTEGER)) {
GLushort *dst = (GLushort *) dstAddr;
for (i=0;i<n;i++) {
- dst[i] = (CLAMP(rgba[i][BCOMP], 0, 31) << 11)
- | (CLAMP(rgba[i][GCOMP], 0, 31) << 6)
- | (CLAMP(rgba[i][RCOMP], 0, 31) << 1)
- | (CLAMP(rgba[i][ACOMP], 0, 1) );
+ dst[i] = (MIN2(rgba[i][BCOMP], 31) << 11)
+ | (MIN2(rgba[i][GCOMP], 31) << 6)
+ | (MIN2(rgba[i][RCOMP], 31) << 1)
+ | (MIN2(rgba[i][ACOMP], 1) );
}
}
else if (dstFormat == GL_ABGR_EXT) {
GLushort *dst = (GLushort *) dstAddr;
for (i=0;i<n;i++) {
- dst[i] = (CLAMP(rgba[i][ACOMP], 0, 31) << 11)
- | (CLAMP(rgba[i][BCOMP], 0, 31) << 6)
- | (CLAMP(rgba[i][GCOMP], 0, 31) << 1)
- | (CLAMP(rgba[i][RCOMP], 0, 1) );
+ dst[i] = (MIN2(rgba[i][ACOMP], 31) << 11)
+ | (MIN2(rgba[i][BCOMP], 31) << 6)
+ | (MIN2(rgba[i][GCOMP], 31) << 1)
+ | (MIN2(rgba[i][RCOMP], 1) );
}
} else {
_pack_rgba_span_from_uints_problem(ctx, dstFormat, dstType);
@@ -698,28 +698,28 @@ _mesa_pack_rgba_span_from_uints(struct gl_context *ctx, GLuint n, GLuint rgba[][
if ((dstFormat == GL_RGBA) || (dstFormat == GL_RGBA_INTEGER_EXT)) {
GLushort *dst = (GLushort *) dstAddr;
for (i=0;i<n;i++) {
- dst[i] = (CLAMP(rgba[i][RCOMP], 0, 31) )
- | (CLAMP(rgba[i][GCOMP], 0, 31) << 5)
- | (CLAMP(rgba[i][BCOMP], 0, 31) << 10)
- | (CLAMP(rgba[i][ACOMP], 0, 1) << 15);
+ dst[i] = (MIN2(rgba[i][RCOMP], 31) )
+ | (MIN2(rgba[i][GCOMP], 31) << 5)
+ | (MIN2(rgba[i][BCOMP], 31) << 10)
+ | (MIN2(rgba[i][ACOMP], 1) << 15);
}
}
else if ((dstFormat == GL_BGRA) || (dstFormat == GL_BGRA_INTEGER)) {
GLushort *dst = (GLushort *) dstAddr;
for (i=0;i<n;i++) {
- dst[i] = (CLAMP(rgba[i][BCOMP], 0, 31) )
- | (CLAMP(rgba[i][GCOMP], 0, 31) << 5)
- | (CLAMP(rgba[i][RCOMP], 0, 31) << 10)
- | (CLAMP(rgba[i][ACOMP], 0, 1) << 15);
+ dst[i] = (MIN2(rgba[i][BCOMP], 31) )
+ | (MIN2(rgba[i][GCOMP], 31) << 5)
+ | (MIN2(rgba[i][RCOMP], 31) << 10)
+ | (MIN2(rgba[i][ACOMP], 1) << 15);
}
}
else if (dstFormat == GL_ABGR_EXT) {
GLushort *dst = (GLushort *) dstAddr;
for (i=0;i<n;i++) {
- dst[i] = (CLAMP(rgba[i][ACOMP], 0, 31) )
- | (CLAMP(rgba[i][BCOMP], 0, 31) << 5)
- | (CLAMP(rgba[i][GCOMP], 0, 31) << 10)
- | (CLAMP(rgba[i][RCOMP], 0, 1) << 15);
+ dst[i] = (MIN2(rgba[i][ACOMP], 31) )
+ | (MIN2(rgba[i][BCOMP], 31) << 5)
+ | (MIN2(rgba[i][GCOMP], 31) << 10)
+ | (MIN2(rgba[i][RCOMP], 1) << 15);
}
} else {
_pack_rgba_span_from_uints_problem(ctx, dstFormat, dstType);
@@ -729,28 +729,28 @@ _mesa_pack_rgba_span_from_uints(struct gl_context *ctx, GLuint n, GLuint rgba[][
if ((dstFormat == GL_RGBA) || (dstFormat == GL_RGBA_INTEGER_EXT)) {
GLuint *dst = (GLuint *) dstAddr;
for (i=0;i<n;i++) {
- dst[i] = (CLAMP(rgba[i][RCOMP], 0, 255) << 24)
- | (CLAMP(rgba[i][GCOMP], 0, 255) << 16)
- | (CLAMP(rgba[i][BCOMP], 0, 255) << 8)
- | (CLAMP(rgba[i][ACOMP], 0, 255) );
+ dst[i] = (MIN2(rgba[i][RCOMP], 255) << 24)
+ | (MIN2(rgba[i][GCOMP], 255) << 16)
+ | (MIN2(rgba[i][BCOMP], 255) << 8)
+ | (MIN2(rgba[i][ACOMP], 255) );
}
}
else if ((dstFormat == GL_BGRA) || (dstFormat == GL_BGRA_INTEGER)) {
GLuint *dst = (GLuint *) dstAddr;
for (i=0;i<n;i++) {
- dst[i] = (CLAMP(rgba[i][BCOMP], 0, 255) << 24)
- | (CLAMP(rgba[i][GCOMP], 0, 255) << 16)
- | (CLAMP(rgba[i][RCOMP], 0, 255) << 8)
- | (CLAMP(rgba[i][ACOMP], 0, 255) );
+ dst[i] = (MIN2(rgba[i][BCOMP], 255) << 24)
+ | (MIN2(rgba[i][GCOMP], 255) << 16)
+ | (MIN2(rgba[i][RCOMP], 255) << 8)
+ | (MIN2(rgba[i][ACOMP], 255) );
}
}
else if (dstFormat == GL_ABGR_EXT) {
GLuint *dst = (GLuint *) dstAddr;
for (i=0;i<n;i++) {
- dst[i] = (CLAMP(rgba[i][ACOMP], 0, 255) << 24)
- | (CLAMP(rgba[i][BCOMP], 0, 255) << 16)
- | (CLAMP(rgba[i][GCOMP], 0, 255) << 8)
- | (CLAMP(rgba[i][RCOMP], 0, 255) );
+ dst[i] = (MIN2(rgba[i][ACOMP], 255) << 24)
+ | (MIN2(rgba[i][BCOMP], 255) << 16)
+ | (MIN2(rgba[i][GCOMP], 255) << 8)
+ | (MIN2(rgba[i][RCOMP], 255) );
}
} else {
_pack_rgba_span_from_uints_problem(ctx, dstFormat, dstType);
@@ -760,28 +760,28 @@ _mesa_pack_rgba_span_from_uints(struct gl_context *ctx, GLuint n, GLuint rgba[][
if ((dstFormat == GL_RGBA) || (dstFormat == GL_RGBA_INTEGER_EXT)) {
GLuint *dst = (GLuint *) dstAddr;
for (i=0;i<n;i++) {
- dst[i] = (CLAMP(rgba[i][RCOMP], 0, 255) )
- | (CLAMP(rgba[i][GCOMP], 0, 255) << 8)
- | (CLAMP(rgba[i][BCOMP], 0, 255) << 16)
- | (CLAMP(rgba[i][ACOMP], 0, 255) << 24);
+ dst[i] = (MIN2(rgba[i][RCOMP], 255) )
+ | (MIN2(rgba[i][GCOMP], 255) << 8)
+ | (MIN2(rgba[i][BCOMP], 255) << 16)
+ | (MIN2(rgba[i][ACOMP], 255) << 24);
}
}
else if ((dstFormat == GL_BGRA) || (dstFormat == GL_BGRA_INTEGER)) {
GLuint *dst = (GLuint *) dstAddr;
for (i=0;i<n;i++) {
- dst[i] = (CLAMP(rgba[i][BCOMP], 0, 255) )
- | (CLAMP(rgba[i][GCOMP], 0, 255) << 8)
- | (CLAMP(rgba[i][RCOMP], 0, 255) << 16)
- | (CLAMP(rgba[i][ACOMP], 0, 255) << 24);
+ dst[i] = (MIN2(rgba[i][BCOMP], 255) )
+ | (MIN2(rgba[i][GCOMP], 255) << 8)
+ | (MIN2(rgba[i][RCOMP], 255) << 16)
+ | (MIN2(rgba[i][ACOMP], 255) << 24);
}
}
else if (dstFormat == GL_ABGR_EXT) {
GLuint *dst = (GLuint *) dstAddr;
for (i=0;i<n;i++) {
- dst[i] = (CLAMP(rgba[i][ACOMP], 0, 255) )
- | (CLAMP(rgba[i][BCOMP], 0, 255) << 8)
- | (CLAMP(rgba[i][GCOMP], 0, 255) << 16)
- | (CLAMP(rgba[i][RCOMP], 0, 255) << 24);
+ dst[i] = (MIN2(rgba[i][ACOMP], 255) )
+ | (MIN2(rgba[i][BCOMP], 255) << 8)
+ | (MIN2(rgba[i][GCOMP], 255) << 16)
+ | (MIN2(rgba[i][RCOMP], 255) << 24);
}
} else {
_pack_rgba_span_from_uints_problem(ctx, dstFormat, dstType);
@@ -791,28 +791,28 @@ _mesa_pack_rgba_span_from_uints(struct gl_context *ctx, GLuint n, GLuint rgba[][
if ((dstFormat == GL_RGBA) || (dstFormat == GL_RGBA_INTEGER_EXT)) {
GLuint *dst = (GLuint *) dstAddr;
for (i=0;i<n;i++) {
- dst[i] = (CLAMP(rgba[i][RCOMP], 0, 1023) << 22)
- | (CLAMP(rgba[i][GCOMP], 0, 1023) << 12)
- | (CLAMP(rgba[i][BCOMP], 0, 1023) << 2)
- | (CLAMP(rgba[i][ACOMP], 0, 3) );
+ dst[i] = (MIN2(rgba[i][RCOMP], 1023) << 22)
+ | (MIN2(rgba[i][GCOMP], 1023) << 12)
+ | (MIN2(rgba[i][BCOMP], 1023) << 2)
+ | (MIN2(rgba[i][ACOMP], 3) );
}
}
else if ((dstFormat == GL_BGRA) || (dstFormat == GL_BGRA_INTEGER)) {
GLuint *dst = (GLuint *) dstAddr;
for (i=0;i<n;i++) {
- dst[i] = (CLAMP(rgba[i][BCOMP], 0, 1023) << 22)
- | (CLAMP(rgba[i][GCOMP], 0, 1023) << 12)
- | (CLAMP(rgba[i][RCOMP], 0, 1023) << 2)
- | (CLAMP(rgba[i][ACOMP], 0, 3) );
+ dst[i] = (MIN2(rgba[i][BCOMP], 1023) << 22)
+ | (MIN2(rgba[i][GCOMP], 1023) << 12)
+ | (MIN2(rgba[i][RCOMP], 1023) << 2)
+ | (MIN2(rgba[i][ACOMP], 3) );
}
}
else if (dstFormat == GL_ABGR_EXT) {
GLuint *dst = (GLuint *) dstAddr;
for (i=0;i<n;i++) {
- dst[i] = (CLAMP(rgba[i][ACOMP], 0, 1023) << 22)
- | (CLAMP(rgba[i][BCOMP], 0, 1023) << 12)
- | (CLAMP(rgba[i][GCOMP], 0, 1023) << 2)
- | (CLAMP(rgba[i][RCOMP], 0, 3) );
+ dst[i] = (MIN2(rgba[i][ACOMP], 1023) << 22)
+ | (MIN2(rgba[i][BCOMP], 1023) << 12)
+ | (MIN2(rgba[i][GCOMP], 1023) << 2)
+ | (MIN2(rgba[i][RCOMP], 3) );
}
} else {
_pack_rgba_span_from_uints_problem(ctx, dstFormat, dstType);
@@ -822,28 +822,28 @@ _mesa_pack_rgba_span_from_uints(struct gl_context *ctx, GLuint n, GLuint rgba[][
if ((dstFormat == GL_RGBA) || (dstFormat == GL_RGBA_INTEGER_EXT)) {
GLuint *dst = (GLuint *) dstAddr;
for (i=0;i<n;i++) {
- dst[i] = (CLAMP(rgba[i][RCOMP], 0, 1023) )
- | (CLAMP(rgba[i][GCOMP], 0, 1023) << 10)
- | (CLAMP(rgba[i][BCOMP], 0, 1023) << 20)
- | (CLAMP(rgba[i][ACOMP], 0, 3) << 30);
+ dst[i] = (MIN2(rgba[i][RCOMP], 1023) )
+ | (MIN2(rgba[i][GCOMP], 1023) << 10)
+ | (MIN2(rgba[i][BCOMP], 1023) << 20)
+ | (MIN2(rgba[i][ACOMP], 3) << 30);
}
}
else if ((dstFormat == GL_BGRA) || (dstFormat == GL_BGRA_INTEGER)) {
GLuint *dst = (GLuint *) dstAddr;
for (i=0;i<n;i++) {
- dst[i] = (CLAMP(rgba[i][BCOMP], 0, 1023) )
- | (CLAMP(rgba[i][GCOMP], 0, 1023) << 10)
- | (CLAMP(rgba[i][RCOMP], 0, 1023) << 20)
- | (CLAMP(rgba[i][ACOMP], 0, 3) << 30);
+ dst[i] = (MIN2(rgba[i][BCOMP], 1023) )
+ | (MIN2(rgba[i][GCOMP], 1023) << 10)
+ | (MIN2(rgba[i][RCOMP], 1023) << 20)
+ | (MIN2(rgba[i][ACOMP], 3) << 30);
}
}
else if (dstFormat == GL_ABGR_EXT) {
GLuint *dst = (GLuint *) dstAddr;
for (i=0;i<n;i++) {
- dst[i] = (CLAMP(rgba[i][ACOMP], 0, 1023) )
- | (CLAMP(rgba[i][BCOMP], 0, 1023) << 10)
- | (CLAMP(rgba[i][GCOMP], 0, 1023) << 20)
- | (CLAMP(rgba[i][RCOMP], 0, 3) << 30);
+ dst[i] = (MIN2(rgba[i][ACOMP], 1023) )
+ | (MIN2(rgba[i][BCOMP], 1023) << 10)
+ | (MIN2(rgba[i][GCOMP], 1023) << 20)
+ | (MIN2(rgba[i][RCOMP], 3) << 30);
}
} else {
_pack_rgba_span_from_uints_problem(ctx, dstFormat, dstType);
diff --git a/mesalib/src/mesa/main/queryobj.c b/mesalib/src/mesa/main/queryobj.c
index 18792cf6c..d21691328 100644
--- a/mesalib/src/mesa/main/queryobj.c
+++ b/mesalib/src/mesa/main/queryobj.c
@@ -301,6 +301,19 @@ _mesa_BeginQueryIndexed(GLenum target, GLuint index, GLuint id)
return;
}
+ /* From the GL_ARB_occlusion_query spec:
+ *
+ * "If BeginQueryARB is called while another query is already in
+ * progress with the same target, an INVALID_OPERATION error is
+ * generated."
+ */
+ if (*bindpt) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glBeginQuery{Indexed}(target=%s is active)",
+ _mesa_lookup_enum_by_nr(target));
+ return;
+ }
+
if (id == 0) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glBeginQuery{Indexed}(id==0)");
return;
@@ -361,6 +374,16 @@ _mesa_EndQueryIndexed(GLenum target, GLuint index)
/* XXX should probably refcount query objects */
q = *bindpt;
+
+ /* Check for GL_ANY_SAMPLES_PASSED vs GL_SAMPLES_PASSED. */
+ if (q && q->Target != target) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glEndQuery(target=%s with active query of target %s)",
+ _mesa_lookup_enum_by_nr(target),
+ _mesa_lookup_enum_by_nr(q->Target));
+ return;
+ }
+
*bindpt = NULL;
if (!q || !q->Active) {
@@ -509,7 +532,7 @@ _mesa_GetQueryIndexediv(GLenum target, GLuint index, GLenum pname,
}
break;
case GL_CURRENT_QUERY_ARB:
- *params = q ? q->Id : 0;
+ *params = (q && q->Target == target) ? q->Id : 0;
break;
default:
_mesa_error(ctx, GL_INVALID_ENUM, "glGetQuery{Indexed}iv(pname)");
@@ -708,7 +731,8 @@ _mesa_GetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64EXT *params)
void
-_mesa_init_queryobj_dispatch(struct _glapi_table *disp)
+_mesa_init_queryobj_dispatch(const struct gl_context *ctx,
+ struct _glapi_table *disp)
{
SET_GenQueriesARB(disp, _mesa_GenQueriesARB);
SET_DeleteQueriesARB(disp, _mesa_DeleteQueriesARB);
@@ -716,16 +740,19 @@ _mesa_init_queryobj_dispatch(struct _glapi_table *disp)
SET_BeginQueryARB(disp, _mesa_BeginQueryARB);
SET_EndQueryARB(disp, _mesa_EndQueryARB);
SET_GetQueryivARB(disp, _mesa_GetQueryivARB);
- SET_GetQueryObjectivARB(disp, _mesa_GetQueryObjectivARB);
SET_GetQueryObjectuivARB(disp, _mesa_GetQueryObjectuivARB);
- SET_QueryCounter(disp, _mesa_QueryCounter);
- SET_GetQueryObjecti64vEXT(disp, _mesa_GetQueryObjecti64vEXT);
- SET_GetQueryObjectui64vEXT(disp, _mesa_GetQueryObjectui64vEXT);
+ if (_mesa_is_desktop_gl(ctx)) {
+ SET_GetQueryObjectivARB(disp, _mesa_GetQueryObjectivARB);
+ SET_QueryCounter(disp, _mesa_QueryCounter);
+
+ SET_GetQueryObjecti64vEXT(disp, _mesa_GetQueryObjecti64vEXT);
+ SET_GetQueryObjectui64vEXT(disp, _mesa_GetQueryObjectui64vEXT);
- SET_BeginQueryIndexed(disp, _mesa_BeginQueryIndexed);
- SET_EndQueryIndexed(disp, _mesa_EndQueryIndexed);
- SET_GetQueryIndexediv(disp, _mesa_GetQueryIndexediv);
+ SET_BeginQueryIndexed(disp, _mesa_BeginQueryIndexed);
+ SET_EndQueryIndexed(disp, _mesa_EndQueryIndexed);
+ SET_GetQueryIndexediv(disp, _mesa_GetQueryIndexediv);
+ }
}
diff --git a/mesalib/src/mesa/main/queryobj.h b/mesalib/src/mesa/main/queryobj.h
index 0f662fb57..1e35185c7 100644
--- a/mesalib/src/mesa/main/queryobj.h
+++ b/mesalib/src/mesa/main/queryobj.h
@@ -44,7 +44,8 @@ extern void
_mesa_init_query_object_functions(struct dd_function_table *driver);
extern void
-_mesa_init_queryobj_dispatch(struct _glapi_table *disp);
+_mesa_init_queryobj_dispatch(const struct gl_context *ctx,
+ struct _glapi_table *disp);
extern void
_mesa_init_queryobj(struct gl_context *ctx);
diff --git a/mesalib/src/mesa/main/samplerobj.c b/mesalib/src/mesa/main/samplerobj.c
index 4514b1224..09cbd2939 100644
--- a/mesalib/src/mesa/main/samplerobj.c
+++ b/mesalib/src/mesa/main/samplerobj.c
@@ -1444,7 +1444,8 @@ _mesa_init_sampler_object_functions(struct dd_function_table *driver)
void
-_mesa_init_sampler_object_dispatch(struct _glapi_table *disp)
+_mesa_init_sampler_object_dispatch(const struct gl_context *ctx,
+ struct _glapi_table *disp)
{
SET_GenSamplers(disp, _mesa_GenSamplers);
SET_DeleteSamplers(disp, _mesa_DeleteSamplers);
@@ -1454,10 +1455,13 @@ _mesa_init_sampler_object_dispatch(struct _glapi_table *disp)
SET_SamplerParameterf(disp, _mesa_SamplerParameterf);
SET_SamplerParameteriv(disp, _mesa_SamplerParameteriv);
SET_SamplerParameterfv(disp, _mesa_SamplerParameterfv);
- SET_SamplerParameterIiv(disp, _mesa_SamplerParameterIiv);
- SET_SamplerParameterIuiv(disp, _mesa_SamplerParameterIuiv);
SET_GetSamplerParameteriv(disp, _mesa_GetSamplerParameteriv);
SET_GetSamplerParameterfv(disp, _mesa_GetSamplerParameterfv);
- SET_GetSamplerParameterIiv(disp, _mesa_GetSamplerParameterIiv);
- SET_GetSamplerParameterIuiv(disp, _mesa_GetSamplerParameterIuiv);
+
+ if (_mesa_is_desktop_gl(ctx)) {
+ SET_SamplerParameterIiv(disp, _mesa_SamplerParameterIiv);
+ SET_SamplerParameterIuiv(disp, _mesa_SamplerParameterIuiv);
+ SET_GetSamplerParameterIiv(disp, _mesa_GetSamplerParameterIiv);
+ SET_GetSamplerParameterIuiv(disp, _mesa_GetSamplerParameterIuiv);
+ }
}
diff --git a/mesalib/src/mesa/main/samplerobj.h b/mesalib/src/mesa/main/samplerobj.h
index e70ee4881..bea4c2232 100644
--- a/mesalib/src/mesa/main/samplerobj.h
+++ b/mesalib/src/mesa/main/samplerobj.h
@@ -77,7 +77,8 @@ extern void
_mesa_init_sampler_object_functions(struct dd_function_table *driver);
extern void
-_mesa_init_sampler_object_dispatch(struct _glapi_table *disp);
+_mesa_init_sampler_object_dispatch(const struct gl_context *ctx,
+ struct _glapi_table *disp);
extern void GLAPIENTRY
_mesa_BindSampler(GLuint unit, GLuint sampler);
diff --git a/mesalib/src/mesa/main/transformfeedback.c b/mesalib/src/mesa/main/transformfeedback.c
index ea6cfdf8c..0669b3a25 100644
--- a/mesalib/src/mesa/main/transformfeedback.c
+++ b/mesalib/src/mesa/main/transformfeedback.c
@@ -246,12 +246,15 @@ _mesa_init_transform_feedback_functions(struct dd_function_table *driver)
void
-_mesa_init_transform_feedback_dispatch(struct _glapi_table *disp)
+_mesa_init_transform_feedback_dispatch(const struct gl_context *ctx,
+ struct _glapi_table *disp)
{
/* EXT_transform_feedback */
SET_BeginTransformFeedbackEXT(disp, _mesa_BeginTransformFeedback);
SET_EndTransformFeedbackEXT(disp, _mesa_EndTransformFeedback);
- SET_BindBufferOffsetEXT(disp, _mesa_BindBufferOffsetEXT);
+ if (_mesa_is_desktop_gl(ctx)) {
+ SET_BindBufferOffsetEXT(disp, _mesa_BindBufferOffsetEXT);
+ }
SET_TransformFeedbackVaryingsEXT(disp, _mesa_TransformFeedbackVaryings);
SET_GetTransformFeedbackVaryingEXT(disp, _mesa_GetTransformFeedbackVarying);
/* ARB_transform_feedback2 */
diff --git a/mesalib/src/mesa/main/transformfeedback.h b/mesalib/src/mesa/main/transformfeedback.h
index 7d4a945c5..6ff9c50b4 100644
--- a/mesalib/src/mesa/main/transformfeedback.h
+++ b/mesalib/src/mesa/main/transformfeedback.h
@@ -47,7 +47,8 @@ extern void
_mesa_init_transform_feedback_functions(struct dd_function_table *driver);
extern void
-_mesa_init_transform_feedback_dispatch(struct _glapi_table *disp);
+_mesa_init_transform_feedback_dispatch(const struct gl_context *ctx,
+ struct _glapi_table *disp);
/*** GL_EXT_transform_feedback ***/
diff --git a/mesalib/src/mesa/main/uniforms.c b/mesalib/src/mesa/main/uniforms.c
index 39fac1534..d89255aaa 100644
--- a/mesalib/src/mesa/main/uniforms.c
+++ b/mesalib/src/mesa/main/uniforms.c
@@ -853,20 +853,24 @@ _mesa_init_shader_uniform_dispatch(const struct gl_context *ctx,
SET_Uniform4uivEXT(exec, _mesa_Uniform4uiv);
SET_GetUniformuivEXT(exec, _mesa_GetUniformuiv);
- /* GL_ARB_robustness */
- SET_GetnUniformfvARB(exec, _mesa_GetnUniformfvARB);
- SET_GetnUniformivARB(exec, _mesa_GetnUniformivARB);
- SET_GetnUniformuivARB(exec, _mesa_GetnUniformuivARB);
- SET_GetnUniformdvARB(exec, _mesa_GetnUniformdvARB); /* GL 4.0 */
-
/* GL_ARB_uniform_buffer_object / GL 3.1 */
SET_GetUniformBlockIndex(exec, _mesa_GetUniformBlockIndex);
SET_GetUniformIndices(exec, _mesa_GetUniformIndices);
SET_GetActiveUniformsiv(exec, _mesa_GetActiveUniformsiv);
SET_GetActiveUniformBlockiv(exec, _mesa_GetActiveUniformBlockiv);
SET_GetActiveUniformBlockName(exec, _mesa_GetActiveUniformBlockName);
- SET_GetActiveUniformName(exec, _mesa_GetActiveUniformName);
SET_UniformBlockBinding(exec, _mesa_UniformBlockBinding);
}
+
+ if (_mesa_is_desktop_gl(ctx)) {
+ /* GL_ARB_robustness */
+ SET_GetnUniformfvARB(exec, _mesa_GetnUniformfvARB);
+ SET_GetnUniformivARB(exec, _mesa_GetnUniformivARB);
+ SET_GetnUniformuivARB(exec, _mesa_GetnUniformuivARB);
+ SET_GetnUniformdvARB(exec, _mesa_GetnUniformdvARB);
+
+ /* GL_ARB_uniform_buffer_object / GL 3.1 */
+ SET_GetActiveUniformName(exec, _mesa_GetActiveUniformName);
+ }
#endif /* FEATURE_GL */
}
diff --git a/mesalib/src/mesa/state_tracker/st_cb_texture.c b/mesalib/src/mesa/state_tracker/st_cb_texture.c
index b19dc67bf..6c287b3d4 100644
--- a/mesalib/src/mesa/state_tracker/st_cb_texture.c
+++ b/mesalib/src/mesa/state_tracker/st_cb_texture.c
@@ -1120,7 +1120,10 @@ copy_image_data_to_texture(struct st_context *st,
assert(src_level <= stImage->pt->last_level);
assert(u_minify(stImage->pt->width0, src_level) == stImage->base.Width);
- assert(u_minify(stImage->pt->height0, src_level) == stImage->base.Height);
+ assert(stImage->pt->target == PIPE_TEXTURE_1D_ARRAY ||
+ u_minify(stImage->pt->height0, src_level) == stImage->base.Height);
+ assert(stImage->pt->target == PIPE_TEXTURE_2D_ARRAY ||
+ u_minify(stImage->pt->depth0, src_level) == stImage->base.Depth);
st_texture_image_copy(st->pipe,
stObj->pt, dstLevel, /* dest texture, level */
diff --git a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 705f2b055..14b72dc80 100644
--- a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -630,6 +630,11 @@ glsl_to_tgsi_visitor::get_opcode(ir_instruction *ir, unsigned op,
{
int type = GLSL_TYPE_FLOAT;
+ assert(src0.type != GLSL_TYPE_ARRAY);
+ assert(src0.type != GLSL_TYPE_STRUCT);
+ assert(src1.type != GLSL_TYPE_ARRAY);
+ assert(src1.type != GLSL_TYPE_STRUCT);
+
if (src0.type == GLSL_TYPE_FLOAT || src1.type == GLSL_TYPE_FLOAT)
type = GLSL_TYPE_FLOAT;
else if (native_integers)
@@ -1071,8 +1076,12 @@ glsl_to_tgsi_visitor::visit(ir_variable *ir)
assert(index == storage->index + (int)i);
}
} else {
- st_src_reg src(PROGRAM_STATE_VAR, index,
- native_integers ? ir->type->base_type : GLSL_TYPE_FLOAT);
+ /* We use GLSL_TYPE_FLOAT here regardless of the actual type of
+ * the data being moved since MOV does not care about the type of
+ * data it is moving, and we don't want to declare registers with
+ * array or struct types.
+ */
+ st_src_reg src(PROGRAM_STATE_VAR, index, GLSL_TYPE_FLOAT);
src.swizzle = slots[i].swizzle;
emit(ir, TGSI_OPCODE_MOV, dst, src);
/* even a float takes up a whole vec4 reg in a struct/array. */
@@ -2039,6 +2048,9 @@ glsl_to_tgsi_visitor::visit(ir_dereference_array *ir)
else
src.swizzle = SWIZZLE_NOOP;
+ /* Change the register type to the element type of the array. */
+ src.type = ir->type->base_type;
+
this->result = src;
}
@@ -2064,6 +2076,7 @@ glsl_to_tgsi_visitor::visit(ir_dereference_record *ir)
this->result.swizzle = SWIZZLE_NOOP;
this->result.index += offset;
+ this->result.type = ir->type->base_type;
}
/**
@@ -2283,6 +2296,10 @@ glsl_to_tgsi_visitor::visit(ir_assignment *ir)
inst->dead_mask = inst->dst.writemask;
} else {
for (i = 0; i < type_size(ir->lhs->type); i++) {
+ if (ir->rhs->type->is_array())
+ r.type = ir->rhs->type->element_type()->base_type;
+ else if (ir->rhs->type->is_record())
+ r.type = ir->rhs->type->fields.structure[i].type->base_type;
emit(ir, TGSI_OPCODE_MOV, l, r);
l.index++;
r.index++;
diff --git a/mesalib/src/mesa/state_tracker/st_mesa_to_tgsi.c b/mesalib/src/mesa/state_tracker/st_mesa_to_tgsi.c
index a023058d0..0acab4340 100644
--- a/mesalib/src/mesa/state_tracker/st_mesa_to_tgsi.c
+++ b/mesalib/src/mesa/state_tracker/st_mesa_to_tgsi.c
@@ -118,11 +118,8 @@ static unsigned *get_label( struct st_translate *t,
unsigned i;
if (t->labels_count + 1 >= t->labels_size) {
- unsigned old_size = t->labels_size;
t->labels_size = 1 << (util_logbase2(t->labels_size) + 1);
- t->labels = REALLOC( t->labels,
- old_size * sizeof t->labels[0],
- t->labels_size * sizeof t->labels[0] );
+ t->labels = realloc(t->labels, t->labels_size * sizeof t->labels[0]);
if (t->labels == NULL) {
static unsigned dummy;
t->error = TRUE;
@@ -146,11 +143,8 @@ static void set_insn_start( struct st_translate *t,
unsigned start )
{
if (t->insn_count + 1 >= t->insn_size) {
- unsigned old_size = t->insn_size;
t->insn_size = 1 << (util_logbase2(t->insn_size) + 1);
- t->insn = REALLOC( t->insn,
- old_size * sizeof t->insn[0],
- t->insn_size * sizeof t->insn[0] );
+ t->insn = realloc(t->insn, t->insn_size * sizeof t->insn[0]);
if (t->insn == NULL) {
t->error = TRUE;
return;
@@ -1265,5 +1259,5 @@ out:
void
st_free_tokens(const struct tgsi_token *tokens)
{
- free((void *)tokens);
+ ureg_free_tokens(tokens);
}