mirror of
https://github.com/reactos/reactos.git
synced 2025-02-25 01:39:30 +00:00
[MESA]
- leaner build part 3 of X - Get rid of ARB_depth_texture, ARB_sampler_objects, ARB_shadow, ARB_shadow_ambient, ARB_texture_rgb10a2ui, ARB_timer_query and EXT_texture_sRGB_decode extensions svn path=/trunk/; revision=60496
This commit is contained in:
parent
38aa52bcbd
commit
c837a2ca6c
32 changed files with 16 additions and 2737 deletions
|
@ -42,7 +42,6 @@
|
||||||
#include "main/texstore.h"
|
#include "main/texstore.h"
|
||||||
#include "main/bufferobj.h"
|
#include "main/bufferobj.h"
|
||||||
#include "main/fbobject.h"
|
#include "main/fbobject.h"
|
||||||
#include "main/samplerobj.h"
|
|
||||||
#include "main/syncobj.h"
|
#include "main/syncobj.h"
|
||||||
#include "main/texturebarrier.h"
|
#include "main/texturebarrier.h"
|
||||||
#include "main/transformfeedback.h"
|
#include "main/transformfeedback.h"
|
||||||
|
@ -199,8 +198,6 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
|
||||||
|
|
||||||
_mesa_init_transform_feedback_functions(driver);
|
_mesa_init_transform_feedback_functions(driver);
|
||||||
|
|
||||||
_mesa_init_sampler_object_functions(driver);
|
|
||||||
|
|
||||||
/* T&L stuff */
|
/* T&L stuff */
|
||||||
driver->CurrentExecPrimitive = 0;
|
driver->CurrentExecPrimitive = 0;
|
||||||
driver->CurrentSavePrimitive = 0;
|
driver->CurrentSavePrimitive = 0;
|
||||||
|
|
|
@ -1329,7 +1329,6 @@ blitframebuffer_texture(struct gl_context *ctx,
|
||||||
const GLint maxLevelSave = texObj->MaxLevel;
|
const GLint maxLevelSave = texObj->MaxLevel;
|
||||||
const GLenum wrapSSave = texObj->Sampler.WrapS;
|
const GLenum wrapSSave = texObj->Sampler.WrapS;
|
||||||
const GLenum wrapTSave = texObj->Sampler.WrapT;
|
const GLenum wrapTSave = texObj->Sampler.WrapT;
|
||||||
const GLenum srgbSave = texObj->Sampler.sRGBDecode;
|
|
||||||
const GLenum fbo_srgb_save = ctx->Color.sRGBEnabled;
|
const GLenum fbo_srgb_save = ctx->Color.sRGBEnabled;
|
||||||
const GLenum target = texObj->Target;
|
const GLenum target = texObj->Target;
|
||||||
|
|
||||||
|
@ -1364,10 +1363,6 @@ blitframebuffer_texture(struct gl_context *ctx,
|
||||||
_mesa_TexParameteri(target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
_mesa_TexParameteri(target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||||
|
|
||||||
/* Always do our blits with no sRGB decode or encode.*/
|
/* Always do our blits with no sRGB decode or encode.*/
|
||||||
if (ctx->Extensions.EXT_texture_sRGB_decode) {
|
|
||||||
_mesa_TexParameteri(target, GL_TEXTURE_SRGB_DECODE_EXT,
|
|
||||||
GL_SKIP_DECODE_EXT);
|
|
||||||
}
|
|
||||||
if (ctx->Extensions.EXT_framebuffer_sRGB) {
|
if (ctx->Extensions.EXT_framebuffer_sRGB) {
|
||||||
_mesa_set_enable(ctx, GL_FRAMEBUFFER_SRGB_EXT, GL_FALSE);
|
_mesa_set_enable(ctx, GL_FRAMEBUFFER_SRGB_EXT, GL_FALSE);
|
||||||
}
|
}
|
||||||
|
@ -1433,9 +1428,6 @@ blitframebuffer_texture(struct gl_context *ctx,
|
||||||
}
|
}
|
||||||
_mesa_TexParameteri(target, GL_TEXTURE_WRAP_S, wrapSSave);
|
_mesa_TexParameteri(target, GL_TEXTURE_WRAP_S, wrapSSave);
|
||||||
_mesa_TexParameteri(target, GL_TEXTURE_WRAP_T, wrapTSave);
|
_mesa_TexParameteri(target, GL_TEXTURE_WRAP_T, wrapTSave);
|
||||||
if (ctx->Extensions.EXT_texture_sRGB_decode) {
|
|
||||||
_mesa_TexParameteri(target, GL_TEXTURE_SRGB_DECODE_EXT, srgbSave);
|
|
||||||
}
|
|
||||||
if (ctx->Extensions.EXT_framebuffer_sRGB && fbo_srgb_save) {
|
if (ctx->Extensions.EXT_framebuffer_sRGB && fbo_srgb_save) {
|
||||||
_mesa_set_enable(ctx, GL_FRAMEBUFFER_SRGB_EXT, GL_TRUE);
|
_mesa_set_enable(ctx, GL_FRAMEBUFFER_SRGB_EXT, GL_TRUE);
|
||||||
}
|
}
|
||||||
|
@ -2297,14 +2289,7 @@ _mesa_meta_DrawPixels(struct gl_context *ctx,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (_mesa_is_depth_format(format)) {
|
else if (_mesa_is_depth_format(format)) {
|
||||||
if (ctx->Extensions.ARB_depth_texture &&
|
fallback = GL_TRUE;
|
||||||
ctx->Extensions.ARB_fragment_program) {
|
|
||||||
texIntFormat = GL_DEPTH_COMPONENT;
|
|
||||||
metaExtraSave = (MESA_META_SHADER);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
fallback = GL_TRUE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
fallback = GL_TRUE;
|
fallback = GL_TRUE;
|
||||||
|
@ -2682,8 +2667,7 @@ _mesa_meta_check_generate_mipmap_fallback(struct gl_context *ctx, GLenum target,
|
||||||
return GL_TRUE;
|
return GL_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_mesa_get_format_color_encoding(baseImage->TexFormat) == GL_SRGB &&
|
if (_mesa_get_format_color_encoding(baseImage->TexFormat) == GL_SRGB) {
|
||||||
!ctx->Extensions.EXT_texture_sRGB_decode) {
|
|
||||||
/* The texture format is sRGB but we can't turn off sRGB->linear
|
/* The texture format is sRGB but we can't turn off sRGB->linear
|
||||||
* texture sample conversion. So we won't be able to generate the
|
* texture sample conversion. So we won't be able to generate the
|
||||||
* right colors when rendering. Need to use a fallback.
|
* right colors when rendering. Need to use a fallback.
|
||||||
|
@ -2908,7 +2892,6 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target,
|
||||||
const GLenum wrapSSave = texObj->Sampler.WrapS;
|
const GLenum wrapSSave = texObj->Sampler.WrapS;
|
||||||
const GLenum wrapTSave = texObj->Sampler.WrapT;
|
const GLenum wrapTSave = texObj->Sampler.WrapT;
|
||||||
const GLenum wrapRSave = texObj->Sampler.WrapR;
|
const GLenum wrapRSave = texObj->Sampler.WrapR;
|
||||||
const GLenum srgbDecodeSave = texObj->Sampler.sRGBDecode;
|
|
||||||
const GLenum srgbBufferSave = ctx->Color.sRGBEnabled;
|
const GLenum srgbBufferSave = ctx->Color.sRGBEnabled;
|
||||||
const GLuint fboSave = ctx->DrawBuffer->Name;
|
const GLuint fboSave = ctx->DrawBuffer->Name;
|
||||||
const GLuint original_active_unit = ctx->Texture.CurrentUnit;
|
const GLuint original_active_unit = ctx->Texture.CurrentUnit;
|
||||||
|
@ -2973,10 +2956,6 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target,
|
||||||
_mesa_TexParameteri(target, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE);
|
_mesa_TexParameteri(target, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE);
|
||||||
|
|
||||||
/* We don't want to encode or decode sRGB values; treat them as linear */
|
/* We don't want to encode or decode sRGB values; treat them as linear */
|
||||||
if (ctx->Extensions.EXT_texture_sRGB_decode) {
|
|
||||||
_mesa_TexParameteri(target, GL_TEXTURE_SRGB_DECODE_EXT,
|
|
||||||
GL_SKIP_DECODE_EXT);
|
|
||||||
}
|
|
||||||
if (ctx->Extensions.EXT_framebuffer_sRGB) {
|
if (ctx->Extensions.EXT_framebuffer_sRGB) {
|
||||||
_mesa_set_enable(ctx, GL_FRAMEBUFFER_SRGB_EXT, GL_FALSE);
|
_mesa_set_enable(ctx, GL_FRAMEBUFFER_SRGB_EXT, GL_FALSE);
|
||||||
}
|
}
|
||||||
|
@ -3102,10 +3081,6 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target,
|
||||||
_mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4);
|
_mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctx->Extensions.EXT_texture_sRGB_decode) {
|
|
||||||
_mesa_TexParameteri(target, GL_TEXTURE_SRGB_DECODE_EXT,
|
|
||||||
srgbDecodeSave);
|
|
||||||
}
|
|
||||||
if (ctx->Extensions.EXT_framebuffer_sRGB && srgbBufferSave) {
|
if (ctx->Extensions.EXT_framebuffer_sRGB && srgbBufferSave) {
|
||||||
_mesa_set_enable(ctx, GL_FRAMEBUFFER_SRGB_EXT, GL_TRUE);
|
_mesa_set_enable(ctx, GL_FRAMEBUFFER_SRGB_EXT, GL_TRUE);
|
||||||
}
|
}
|
||||||
|
@ -3415,7 +3390,6 @@ decompress_texture_image(struct gl_context *ctx,
|
||||||
const GLint maxLevelSave = texObj->MaxLevel;
|
const GLint maxLevelSave = texObj->MaxLevel;
|
||||||
const GLenum wrapSSave = texObj->Sampler.WrapS;
|
const GLenum wrapSSave = texObj->Sampler.WrapS;
|
||||||
const GLenum wrapTSave = texObj->Sampler.WrapT;
|
const GLenum wrapTSave = texObj->Sampler.WrapT;
|
||||||
const GLenum srgbSave = texObj->Sampler.sRGBDecode;
|
|
||||||
|
|
||||||
/* restrict sampling to the texture level of interest */
|
/* restrict sampling to the texture level of interest */
|
||||||
_mesa_TexParameteri(target, GL_TEXTURE_BASE_LEVEL, texImage->Level);
|
_mesa_TexParameteri(target, GL_TEXTURE_BASE_LEVEL, texImage->Level);
|
||||||
|
@ -3424,11 +3398,6 @@ decompress_texture_image(struct gl_context *ctx,
|
||||||
_mesa_TexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
_mesa_TexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
_mesa_TexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
_mesa_TexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
|
|
||||||
/* No sRGB decode or encode.*/
|
|
||||||
if (ctx->Extensions.EXT_texture_sRGB_decode) {
|
|
||||||
_mesa_TexParameteri(target, GL_TEXTURE_SRGB_DECODE_EXT,
|
|
||||||
GL_SKIP_DECODE_EXT);
|
|
||||||
}
|
|
||||||
if (ctx->Extensions.EXT_framebuffer_sRGB) {
|
if (ctx->Extensions.EXT_framebuffer_sRGB) {
|
||||||
_mesa_set_enable(ctx, GL_FRAMEBUFFER_SRGB_EXT, GL_FALSE);
|
_mesa_set_enable(ctx, GL_FRAMEBUFFER_SRGB_EXT, GL_FALSE);
|
||||||
}
|
}
|
||||||
|
@ -3447,9 +3416,6 @@ decompress_texture_image(struct gl_context *ctx,
|
||||||
}
|
}
|
||||||
_mesa_TexParameteri(target, GL_TEXTURE_WRAP_S, wrapSSave);
|
_mesa_TexParameteri(target, GL_TEXTURE_WRAP_S, wrapSSave);
|
||||||
_mesa_TexParameteri(target, GL_TEXTURE_WRAP_T, wrapTSave);
|
_mesa_TexParameteri(target, GL_TEXTURE_WRAP_T, wrapTSave);
|
||||||
if (ctx->Extensions.EXT_texture_sRGB_decode) {
|
|
||||||
_mesa_TexParameteri(target, GL_TEXTURE_SRGB_DECODE_EXT, srgbSave);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* read pixels from renderbuffer */
|
/* read pixels from renderbuffer */
|
||||||
|
|
|
@ -2,13 +2,10 @@
|
||||||
list(APPEND SOURCE
|
list(APPEND SOURCE
|
||||||
api_arrayelt.c
|
api_arrayelt.c
|
||||||
api_exec.c
|
api_exec.c
|
||||||
# api_exec_es1.c
|
|
||||||
# api_exec_es2.c
|
|
||||||
api_loopback.c
|
api_loopback.c
|
||||||
api_validate.c
|
api_validate.c
|
||||||
accum.c
|
accum.c
|
||||||
arbprogram.c
|
arbprogram.c
|
||||||
# atifragshader.c
|
|
||||||
attrib.c
|
attrib.c
|
||||||
arrayobj.c
|
arrayobj.c
|
||||||
blend.c
|
blend.c
|
||||||
|
@ -54,7 +51,6 @@ list(APPEND SOURCE
|
||||||
mipmap.c
|
mipmap.c
|
||||||
mm.c
|
mm.c
|
||||||
multisample.c
|
multisample.c
|
||||||
# nvprogram.c
|
|
||||||
pack.c
|
pack.c
|
||||||
pbo.c
|
pbo.c
|
||||||
pixel.c
|
pixel.c
|
||||||
|
@ -68,7 +64,6 @@ list(APPEND SOURCE
|
||||||
readpix.c
|
readpix.c
|
||||||
remap.c
|
remap.c
|
||||||
renderbuffer.c
|
renderbuffer.c
|
||||||
samplerobj.c
|
|
||||||
scissor.c
|
scissor.c
|
||||||
shaderapi.c
|
shaderapi.c
|
||||||
shaderobj.c
|
shaderobj.c
|
||||||
|
|
|
@ -76,9 +76,6 @@
|
||||||
#include "polygon.h"
|
#include "polygon.h"
|
||||||
#include "queryobj.h"
|
#include "queryobj.h"
|
||||||
#include "readpix.h"
|
#include "readpix.h"
|
||||||
#if FEATURE_ARB_sampler_objects
|
|
||||||
#include "samplerobj.h"
|
|
||||||
#endif
|
|
||||||
#include "scissor.h"
|
#include "scissor.h"
|
||||||
#include "stencil.h"
|
#include "stencil.h"
|
||||||
#include "texenv.h"
|
#include "texenv.h"
|
||||||
|
@ -747,10 +744,6 @@ _mesa_create_exec_table(void)
|
||||||
SET_TextureStorage2DEXT(exec, _mesa_TextureStorage2DEXT);
|
SET_TextureStorage2DEXT(exec, _mesa_TextureStorage2DEXT);
|
||||||
SET_TextureStorage3DEXT(exec, _mesa_TextureStorage3DEXT);
|
SET_TextureStorage3DEXT(exec, _mesa_TextureStorage3DEXT);
|
||||||
|
|
||||||
#if FEATURE_ARB_sampler_objects
|
|
||||||
_mesa_init_sampler_object_dispatch(exec);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return exec;
|
return exec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -795,18 +795,6 @@ pop_texture_group(struct gl_context *ctx, struct texture_state *texstate)
|
||||||
_mesa_TexParameterf(target, GL_TEXTURE_MAX_ANISOTROPY_EXT,
|
_mesa_TexParameterf(target, GL_TEXTURE_MAX_ANISOTROPY_EXT,
|
||||||
samp->MaxAnisotropy);
|
samp->MaxAnisotropy);
|
||||||
}
|
}
|
||||||
if (ctx->Extensions.ARB_shadow_ambient) {
|
|
||||||
_mesa_TexParameterf(target, GL_TEXTURE_COMPARE_FAIL_VALUE_ARB,
|
|
||||||
samp->CompareFailValue);
|
|
||||||
}
|
|
||||||
if (ctx->Extensions.ARB_shadow) {
|
|
||||||
_mesa_TexParameteri(target, GL_TEXTURE_COMPARE_MODE,
|
|
||||||
samp->CompareMode);
|
|
||||||
_mesa_TexParameteri(target, GL_TEXTURE_COMPARE_FUNC,
|
|
||||||
samp->CompareFunc);
|
|
||||||
}
|
|
||||||
if (ctx->Extensions.ARB_depth_texture)
|
|
||||||
_mesa_TexParameteri(target, GL_DEPTH_TEXTURE_MODE, samp->DepthMode);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* remove saved references to the texture objects */
|
/* remove saved references to the texture objects */
|
||||||
|
|
|
@ -929,14 +929,6 @@ struct dd_function_table {
|
||||||
* \name GL_NV_texture_barrier interface
|
* \name GL_NV_texture_barrier interface
|
||||||
*/
|
*/
|
||||||
void (*TextureBarrier)(struct gl_context *ctx);
|
void (*TextureBarrier)(struct gl_context *ctx);
|
||||||
|
|
||||||
/**
|
|
||||||
* \name GL_ARB_sampler_objects
|
|
||||||
*/
|
|
||||||
struct gl_sampler_object * (*NewSamplerObject)(struct gl_context *ctx,
|
|
||||||
GLuint name);
|
|
||||||
void (*DeleteSamplerObject)(struct gl_context *ctx,
|
|
||||||
struct gl_sampler_object *samp);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -669,20 +669,6 @@
|
||||||
#define _gloffset_BlendEquationiARB 598
|
#define _gloffset_BlendEquationiARB 598
|
||||||
#define _gloffset_BlendFuncSeparateiARB 599
|
#define _gloffset_BlendFuncSeparateiARB 599
|
||||||
#define _gloffset_BlendFunciARB 600
|
#define _gloffset_BlendFunciARB 600
|
||||||
#define _gloffset_BindSampler 601
|
|
||||||
#define _gloffset_DeleteSamplers 602
|
|
||||||
#define _gloffset_GenSamplers 603
|
|
||||||
#define _gloffset_GetSamplerParameterIiv 604
|
|
||||||
#define _gloffset_GetSamplerParameterIuiv 605
|
|
||||||
#define _gloffset_GetSamplerParameterfv 606
|
|
||||||
#define _gloffset_GetSamplerParameteriv 607
|
|
||||||
#define _gloffset_IsSampler 608
|
|
||||||
#define _gloffset_SamplerParameterIiv 609
|
|
||||||
#define _gloffset_SamplerParameterIuiv 610
|
|
||||||
#define _gloffset_SamplerParameterf 611
|
|
||||||
#define _gloffset_SamplerParameterfv 612
|
|
||||||
#define _gloffset_SamplerParameteri 613
|
|
||||||
#define _gloffset_SamplerParameteriv 614
|
|
||||||
#define _gloffset_BindTransformFeedback 653
|
#define _gloffset_BindTransformFeedback 653
|
||||||
#define _gloffset_DeleteTransformFeedbacks 654
|
#define _gloffset_DeleteTransformFeedbacks 654
|
||||||
#define _gloffset_DrawTransformFeedback 655
|
#define _gloffset_DrawTransformFeedback 655
|
||||||
|
@ -999,8 +985,6 @@
|
||||||
#define _gloffset_StencilFuncSeparateATI 966
|
#define _gloffset_StencilFuncSeparateATI 966
|
||||||
#define _gloffset_ProgramEnvParameters4fvEXT 967
|
#define _gloffset_ProgramEnvParameters4fvEXT 967
|
||||||
#define _gloffset_ProgramLocalParameters4fvEXT 968
|
#define _gloffset_ProgramLocalParameters4fvEXT 968
|
||||||
#define _gloffset_GetQueryObjecti64vEXT 969
|
|
||||||
#define _gloffset_GetQueryObjectui64vEXT 970
|
|
||||||
#define _gloffset_EGLImageTargetRenderbufferStorageOES 971
|
#define _gloffset_EGLImageTargetRenderbufferStorageOES 971
|
||||||
#define _gloffset_EGLImageTargetTexture2DOES 972
|
#define _gloffset_EGLImageTargetTexture2DOES 972
|
||||||
|
|
||||||
|
@ -1202,20 +1186,6 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ];
|
||||||
#define BlendEquationiARB_remap_index 190
|
#define BlendEquationiARB_remap_index 190
|
||||||
#define BlendFuncSeparateiARB_remap_index 191
|
#define BlendFuncSeparateiARB_remap_index 191
|
||||||
#define BlendFunciARB_remap_index 192
|
#define BlendFunciARB_remap_index 192
|
||||||
#define BindSampler_remap_index 193
|
|
||||||
#define DeleteSamplers_remap_index 194
|
|
||||||
#define GenSamplers_remap_index 195
|
|
||||||
#define GetSamplerParameterIiv_remap_index 196
|
|
||||||
#define GetSamplerParameterIuiv_remap_index 197
|
|
||||||
#define GetSamplerParameterfv_remap_index 198
|
|
||||||
#define GetSamplerParameteriv_remap_index 199
|
|
||||||
#define IsSampler_remap_index 200
|
|
||||||
#define SamplerParameterIiv_remap_index 201
|
|
||||||
#define SamplerParameterIuiv_remap_index 202
|
|
||||||
#define SamplerParameterf_remap_index 203
|
|
||||||
#define SamplerParameterfv_remap_index 204
|
|
||||||
#define SamplerParameteri_remap_index 205
|
|
||||||
#define SamplerParameteriv_remap_index 206
|
|
||||||
#define BindTransformFeedback_remap_index 245
|
#define BindTransformFeedback_remap_index 245
|
||||||
#define DeleteTransformFeedbacks_remap_index 246
|
#define DeleteTransformFeedbacks_remap_index 246
|
||||||
#define DrawTransformFeedback_remap_index 247
|
#define DrawTransformFeedback_remap_index 247
|
||||||
|
@ -1532,8 +1502,6 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ];
|
||||||
#define StencilFuncSeparateATI_remap_index 558
|
#define StencilFuncSeparateATI_remap_index 558
|
||||||
#define ProgramEnvParameters4fvEXT_remap_index 559
|
#define ProgramEnvParameters4fvEXT_remap_index 559
|
||||||
#define ProgramLocalParameters4fvEXT_remap_index 560
|
#define ProgramLocalParameters4fvEXT_remap_index 560
|
||||||
#define GetQueryObjecti64vEXT_remap_index 561
|
|
||||||
#define GetQueryObjectui64vEXT_remap_index 562
|
|
||||||
#define EGLImageTargetRenderbufferStorageOES_remap_index 563
|
#define EGLImageTargetRenderbufferStorageOES_remap_index 563
|
||||||
#define EGLImageTargetTexture2DOES_remap_index 564
|
#define EGLImageTargetTexture2DOES_remap_index 564
|
||||||
|
|
||||||
|
@ -1730,20 +1698,6 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ];
|
||||||
#define _gloffset_BlendEquationiARB driDispatchRemapTable[BlendEquationiARB_remap_index]
|
#define _gloffset_BlendEquationiARB driDispatchRemapTable[BlendEquationiARB_remap_index]
|
||||||
#define _gloffset_BlendFuncSeparateiARB driDispatchRemapTable[BlendFuncSeparateiARB_remap_index]
|
#define _gloffset_BlendFuncSeparateiARB driDispatchRemapTable[BlendFuncSeparateiARB_remap_index]
|
||||||
#define _gloffset_BlendFunciARB driDispatchRemapTable[BlendFunciARB_remap_index]
|
#define _gloffset_BlendFunciARB driDispatchRemapTable[BlendFunciARB_remap_index]
|
||||||
#define _gloffset_BindSampler driDispatchRemapTable[BindSampler_remap_index]
|
|
||||||
#define _gloffset_DeleteSamplers driDispatchRemapTable[DeleteSamplers_remap_index]
|
|
||||||
#define _gloffset_GenSamplers driDispatchRemapTable[GenSamplers_remap_index]
|
|
||||||
#define _gloffset_GetSamplerParameterIiv driDispatchRemapTable[GetSamplerParameterIiv_remap_index]
|
|
||||||
#define _gloffset_GetSamplerParameterIuiv driDispatchRemapTable[GetSamplerParameterIuiv_remap_index]
|
|
||||||
#define _gloffset_GetSamplerParameterfv driDispatchRemapTable[GetSamplerParameterfv_remap_index]
|
|
||||||
#define _gloffset_GetSamplerParameteriv driDispatchRemapTable[GetSamplerParameteriv_remap_index]
|
|
||||||
#define _gloffset_IsSampler driDispatchRemapTable[IsSampler_remap_index]
|
|
||||||
#define _gloffset_SamplerParameterIiv driDispatchRemapTable[SamplerParameterIiv_remap_index]
|
|
||||||
#define _gloffset_SamplerParameterIuiv driDispatchRemapTable[SamplerParameterIuiv_remap_index]
|
|
||||||
#define _gloffset_SamplerParameterf driDispatchRemapTable[SamplerParameterf_remap_index]
|
|
||||||
#define _gloffset_SamplerParameterfv driDispatchRemapTable[SamplerParameterfv_remap_index]
|
|
||||||
#define _gloffset_SamplerParameteri driDispatchRemapTable[SamplerParameteri_remap_index]
|
|
||||||
#define _gloffset_SamplerParameteriv driDispatchRemapTable[SamplerParameteriv_remap_index]
|
|
||||||
#define _gloffset_BindTransformFeedback driDispatchRemapTable[BindTransformFeedback_remap_index]
|
#define _gloffset_BindTransformFeedback driDispatchRemapTable[BindTransformFeedback_remap_index]
|
||||||
#define _gloffset_DeleteTransformFeedbacks driDispatchRemapTable[DeleteTransformFeedbacks_remap_index]
|
#define _gloffset_DeleteTransformFeedbacks driDispatchRemapTable[DeleteTransformFeedbacks_remap_index]
|
||||||
#define _gloffset_DrawTransformFeedback driDispatchRemapTable[DrawTransformFeedback_remap_index]
|
#define _gloffset_DrawTransformFeedback driDispatchRemapTable[DrawTransformFeedback_remap_index]
|
||||||
|
@ -2060,8 +2014,6 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ];
|
||||||
#define _gloffset_StencilFuncSeparateATI driDispatchRemapTable[StencilFuncSeparateATI_remap_index]
|
#define _gloffset_StencilFuncSeparateATI driDispatchRemapTable[StencilFuncSeparateATI_remap_index]
|
||||||
#define _gloffset_ProgramEnvParameters4fvEXT driDispatchRemapTable[ProgramEnvParameters4fvEXT_remap_index]
|
#define _gloffset_ProgramEnvParameters4fvEXT driDispatchRemapTable[ProgramEnvParameters4fvEXT_remap_index]
|
||||||
#define _gloffset_ProgramLocalParameters4fvEXT driDispatchRemapTable[ProgramLocalParameters4fvEXT_remap_index]
|
#define _gloffset_ProgramLocalParameters4fvEXT driDispatchRemapTable[ProgramLocalParameters4fvEXT_remap_index]
|
||||||
#define _gloffset_GetQueryObjecti64vEXT driDispatchRemapTable[GetQueryObjecti64vEXT_remap_index]
|
|
||||||
#define _gloffset_GetQueryObjectui64vEXT driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index]
|
|
||||||
#define _gloffset_EGLImageTargetRenderbufferStorageOES driDispatchRemapTable[EGLImageTargetRenderbufferStorageOES_remap_index]
|
#define _gloffset_EGLImageTargetRenderbufferStorageOES driDispatchRemapTable[EGLImageTargetRenderbufferStorageOES_remap_index]
|
||||||
#define _gloffset_EGLImageTargetTexture2DOES driDispatchRemapTable[EGLImageTargetTexture2DOES_remap_index]
|
#define _gloffset_EGLImageTargetTexture2DOES driDispatchRemapTable[EGLImageTargetTexture2DOES_remap_index]
|
||||||
|
|
||||||
|
@ -8678,160 +8630,6 @@ static inline void SET_BlendFunciARB(struct _glapi_table *disp, void (GLAPIENTRY
|
||||||
SET_by_offset(disp, _gloffset_BlendFunciARB, fn);
|
SET_by_offset(disp, _gloffset_BlendFunciARB, fn);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef void (GLAPIENTRYP _glptr_BindSampler)(GLuint, GLuint);
|
|
||||||
#define CALL_BindSampler(disp, parameters) \
|
|
||||||
(* GET_BindSampler(disp)) parameters
|
|
||||||
static inline _glptr_BindSampler GET_BindSampler(struct _glapi_table *disp) {
|
|
||||||
return (_glptr_BindSampler) (GET_by_offset(disp, _gloffset_BindSampler));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void SET_BindSampler(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLuint)) {
|
|
||||||
SET_by_offset(disp, _gloffset_BindSampler, fn);
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef void (GLAPIENTRYP _glptr_DeleteSamplers)(GLsizei, const GLuint *);
|
|
||||||
#define CALL_DeleteSamplers(disp, parameters) \
|
|
||||||
(* GET_DeleteSamplers(disp)) parameters
|
|
||||||
static inline _glptr_DeleteSamplers GET_DeleteSamplers(struct _glapi_table *disp) {
|
|
||||||
return (_glptr_DeleteSamplers) (GET_by_offset(disp, _gloffset_DeleteSamplers));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void SET_DeleteSamplers(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLsizei, const GLuint *)) {
|
|
||||||
SET_by_offset(disp, _gloffset_DeleteSamplers, fn);
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef void (GLAPIENTRYP _glptr_GenSamplers)(GLsizei, GLuint *);
|
|
||||||
#define CALL_GenSamplers(disp, parameters) \
|
|
||||||
(* GET_GenSamplers(disp)) parameters
|
|
||||||
static inline _glptr_GenSamplers GET_GenSamplers(struct _glapi_table *disp) {
|
|
||||||
return (_glptr_GenSamplers) (GET_by_offset(disp, _gloffset_GenSamplers));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void SET_GenSamplers(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLsizei, GLuint *)) {
|
|
||||||
SET_by_offset(disp, _gloffset_GenSamplers, fn);
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef void (GLAPIENTRYP _glptr_GetSamplerParameterIiv)(GLuint, GLenum, GLint *);
|
|
||||||
#define CALL_GetSamplerParameterIiv(disp, parameters) \
|
|
||||||
(* GET_GetSamplerParameterIiv(disp)) parameters
|
|
||||||
static inline _glptr_GetSamplerParameterIiv GET_GetSamplerParameterIiv(struct _glapi_table *disp) {
|
|
||||||
return (_glptr_GetSamplerParameterIiv) (GET_by_offset(disp, _gloffset_GetSamplerParameterIiv));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void SET_GetSamplerParameterIiv(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLenum, GLint *)) {
|
|
||||||
SET_by_offset(disp, _gloffset_GetSamplerParameterIiv, fn);
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef void (GLAPIENTRYP _glptr_GetSamplerParameterIuiv)(GLuint, GLenum, GLuint *);
|
|
||||||
#define CALL_GetSamplerParameterIuiv(disp, parameters) \
|
|
||||||
(* GET_GetSamplerParameterIuiv(disp)) parameters
|
|
||||||
static inline _glptr_GetSamplerParameterIuiv GET_GetSamplerParameterIuiv(struct _glapi_table *disp) {
|
|
||||||
return (_glptr_GetSamplerParameterIuiv) (GET_by_offset(disp, _gloffset_GetSamplerParameterIuiv));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void SET_GetSamplerParameterIuiv(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLenum, GLuint *)) {
|
|
||||||
SET_by_offset(disp, _gloffset_GetSamplerParameterIuiv, fn);
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef void (GLAPIENTRYP _glptr_GetSamplerParameterfv)(GLuint, GLenum, GLfloat *);
|
|
||||||
#define CALL_GetSamplerParameterfv(disp, parameters) \
|
|
||||||
(* GET_GetSamplerParameterfv(disp)) parameters
|
|
||||||
static inline _glptr_GetSamplerParameterfv GET_GetSamplerParameterfv(struct _glapi_table *disp) {
|
|
||||||
return (_glptr_GetSamplerParameterfv) (GET_by_offset(disp, _gloffset_GetSamplerParameterfv));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void SET_GetSamplerParameterfv(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLenum, GLfloat *)) {
|
|
||||||
SET_by_offset(disp, _gloffset_GetSamplerParameterfv, fn);
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef void (GLAPIENTRYP _glptr_GetSamplerParameteriv)(GLuint, GLenum, GLint *);
|
|
||||||
#define CALL_GetSamplerParameteriv(disp, parameters) \
|
|
||||||
(* GET_GetSamplerParameteriv(disp)) parameters
|
|
||||||
static inline _glptr_GetSamplerParameteriv GET_GetSamplerParameteriv(struct _glapi_table *disp) {
|
|
||||||
return (_glptr_GetSamplerParameteriv) (GET_by_offset(disp, _gloffset_GetSamplerParameteriv));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void SET_GetSamplerParameteriv(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLenum, GLint *)) {
|
|
||||||
SET_by_offset(disp, _gloffset_GetSamplerParameteriv, fn);
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef GLboolean (GLAPIENTRYP _glptr_IsSampler)(GLuint);
|
|
||||||
#define CALL_IsSampler(disp, parameters) \
|
|
||||||
(* GET_IsSampler(disp)) parameters
|
|
||||||
static inline _glptr_IsSampler GET_IsSampler(struct _glapi_table *disp) {
|
|
||||||
return (_glptr_IsSampler) (GET_by_offset(disp, _gloffset_IsSampler));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void SET_IsSampler(struct _glapi_table *disp, GLboolean (GLAPIENTRYP fn)(GLuint)) {
|
|
||||||
SET_by_offset(disp, _gloffset_IsSampler, fn);
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef void (GLAPIENTRYP _glptr_SamplerParameterIiv)(GLuint, GLenum, const GLint *);
|
|
||||||
#define CALL_SamplerParameterIiv(disp, parameters) \
|
|
||||||
(* GET_SamplerParameterIiv(disp)) parameters
|
|
||||||
static inline _glptr_SamplerParameterIiv GET_SamplerParameterIiv(struct _glapi_table *disp) {
|
|
||||||
return (_glptr_SamplerParameterIiv) (GET_by_offset(disp, _gloffset_SamplerParameterIiv));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void SET_SamplerParameterIiv(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLenum, const GLint *)) {
|
|
||||||
SET_by_offset(disp, _gloffset_SamplerParameterIiv, fn);
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef void (GLAPIENTRYP _glptr_SamplerParameterIuiv)(GLuint, GLenum, const GLuint *);
|
|
||||||
#define CALL_SamplerParameterIuiv(disp, parameters) \
|
|
||||||
(* GET_SamplerParameterIuiv(disp)) parameters
|
|
||||||
static inline _glptr_SamplerParameterIuiv GET_SamplerParameterIuiv(struct _glapi_table *disp) {
|
|
||||||
return (_glptr_SamplerParameterIuiv) (GET_by_offset(disp, _gloffset_SamplerParameterIuiv));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void SET_SamplerParameterIuiv(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLenum, const GLuint *)) {
|
|
||||||
SET_by_offset(disp, _gloffset_SamplerParameterIuiv, fn);
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef void (GLAPIENTRYP _glptr_SamplerParameterf)(GLuint, GLenum, GLfloat);
|
|
||||||
#define CALL_SamplerParameterf(disp, parameters) \
|
|
||||||
(* GET_SamplerParameterf(disp)) parameters
|
|
||||||
static inline _glptr_SamplerParameterf GET_SamplerParameterf(struct _glapi_table *disp) {
|
|
||||||
return (_glptr_SamplerParameterf) (GET_by_offset(disp, _gloffset_SamplerParameterf));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void SET_SamplerParameterf(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLenum, GLfloat)) {
|
|
||||||
SET_by_offset(disp, _gloffset_SamplerParameterf, fn);
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef void (GLAPIENTRYP _glptr_SamplerParameterfv)(GLuint, GLenum, const GLfloat *);
|
|
||||||
#define CALL_SamplerParameterfv(disp, parameters) \
|
|
||||||
(* GET_SamplerParameterfv(disp)) parameters
|
|
||||||
static inline _glptr_SamplerParameterfv GET_SamplerParameterfv(struct _glapi_table *disp) {
|
|
||||||
return (_glptr_SamplerParameterfv) (GET_by_offset(disp, _gloffset_SamplerParameterfv));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void SET_SamplerParameterfv(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLenum, const GLfloat *)) {
|
|
||||||
SET_by_offset(disp, _gloffset_SamplerParameterfv, fn);
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef void (GLAPIENTRYP _glptr_SamplerParameteri)(GLuint, GLenum, GLint);
|
|
||||||
#define CALL_SamplerParameteri(disp, parameters) \
|
|
||||||
(* GET_SamplerParameteri(disp)) parameters
|
|
||||||
static inline _glptr_SamplerParameteri GET_SamplerParameteri(struct _glapi_table *disp) {
|
|
||||||
return (_glptr_SamplerParameteri) (GET_by_offset(disp, _gloffset_SamplerParameteri));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void SET_SamplerParameteri(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLenum, GLint)) {
|
|
||||||
SET_by_offset(disp, _gloffset_SamplerParameteri, fn);
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef void (GLAPIENTRYP _glptr_SamplerParameteriv)(GLuint, GLenum, const GLint *);
|
|
||||||
#define CALL_SamplerParameteriv(disp, parameters) \
|
|
||||||
(* GET_SamplerParameteriv(disp)) parameters
|
|
||||||
static inline _glptr_SamplerParameteriv GET_SamplerParameteriv(struct _glapi_table *disp) {
|
|
||||||
return (_glptr_SamplerParameteriv) (GET_by_offset(disp, _gloffset_SamplerParameteriv));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void SET_SamplerParameteriv(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLenum, const GLint *)) {
|
|
||||||
SET_by_offset(disp, _gloffset_SamplerParameteriv, fn);
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef void (GLAPIENTRYP _glptr_BindTransformFeedback)(GLenum, GLuint);
|
typedef void (GLAPIENTRYP _glptr_BindTransformFeedback)(GLenum, GLuint);
|
||||||
#define CALL_BindTransformFeedback(disp, parameters) \
|
#define CALL_BindTransformFeedback(disp, parameters) \
|
||||||
(* GET_BindTransformFeedback(disp)) parameters
|
(* GET_BindTransformFeedback(disp)) parameters
|
||||||
|
@ -12308,28 +12106,6 @@ static inline void SET_ProgramLocalParameters4fvEXT(struct _glapi_table *disp, v
|
||||||
SET_by_offset(disp, _gloffset_ProgramLocalParameters4fvEXT, fn);
|
SET_by_offset(disp, _gloffset_ProgramLocalParameters4fvEXT, fn);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef void (GLAPIENTRYP _glptr_GetQueryObjecti64vEXT)(GLuint, GLenum, GLint64EXT *);
|
|
||||||
#define CALL_GetQueryObjecti64vEXT(disp, parameters) \
|
|
||||||
(* GET_GetQueryObjecti64vEXT(disp)) parameters
|
|
||||||
static inline _glptr_GetQueryObjecti64vEXT GET_GetQueryObjecti64vEXT(struct _glapi_table *disp) {
|
|
||||||
return (_glptr_GetQueryObjecti64vEXT) (GET_by_offset(disp, _gloffset_GetQueryObjecti64vEXT));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void SET_GetQueryObjecti64vEXT(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLenum, GLint64EXT *)) {
|
|
||||||
SET_by_offset(disp, _gloffset_GetQueryObjecti64vEXT, fn);
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef void (GLAPIENTRYP _glptr_GetQueryObjectui64vEXT)(GLuint, GLenum, GLuint64EXT *);
|
|
||||||
#define CALL_GetQueryObjectui64vEXT(disp, parameters) \
|
|
||||||
(* GET_GetQueryObjectui64vEXT(disp)) parameters
|
|
||||||
static inline _glptr_GetQueryObjectui64vEXT GET_GetQueryObjectui64vEXT(struct _glapi_table *disp) {
|
|
||||||
return (_glptr_GetQueryObjectui64vEXT) (GET_by_offset(disp, _gloffset_GetQueryObjectui64vEXT));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void SET_GetQueryObjectui64vEXT(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLenum, GLuint64EXT *)) {
|
|
||||||
SET_by_offset(disp, _gloffset_GetQueryObjectui64vEXT, fn);
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef void (GLAPIENTRYP _glptr_EGLImageTargetRenderbufferStorageOES)(GLenum, GLvoid *);
|
typedef void (GLAPIENTRYP _glptr_EGLImageTargetRenderbufferStorageOES)(GLenum, GLvoid *);
|
||||||
#define CALL_EGLImageTargetRenderbufferStorageOES(disp, parameters) \
|
#define CALL_EGLImageTargetRenderbufferStorageOES(disp, parameters) \
|
||||||
(* GET_EGLImageTargetRenderbufferStorageOES(disp)) parameters
|
(* GET_EGLImageTargetRenderbufferStorageOES(disp)) parameters
|
||||||
|
|
|
@ -58,7 +58,6 @@
|
||||||
#include "pack.h"
|
#include "pack.h"
|
||||||
#include "pbo.h"
|
#include "pbo.h"
|
||||||
#include "queryobj.h"
|
#include "queryobj.h"
|
||||||
#include "samplerobj.h"
|
|
||||||
#include "shaderapi.h"
|
#include "shaderapi.h"
|
||||||
#include "syncobj.h"
|
#include "syncobj.h"
|
||||||
#include "teximage.h"
|
#include "teximage.h"
|
||||||
|
@ -450,13 +449,6 @@ typedef enum
|
||||||
/* GL_NV_texture_barrier */
|
/* GL_NV_texture_barrier */
|
||||||
OPCODE_TEXTURE_BARRIER_NV,
|
OPCODE_TEXTURE_BARRIER_NV,
|
||||||
|
|
||||||
/* GL_ARB_sampler_object */
|
|
||||||
OPCODE_BIND_SAMPLER,
|
|
||||||
OPCODE_SAMPLER_PARAMETERIV,
|
|
||||||
OPCODE_SAMPLER_PARAMETERFV,
|
|
||||||
OPCODE_SAMPLER_PARAMETERIIV,
|
|
||||||
OPCODE_SAMPLER_PARAMETERUIV,
|
|
||||||
|
|
||||||
/* GL_ARB_geometry_shader4 */
|
/* GL_ARB_geometry_shader4 */
|
||||||
OPCODE_PROGRAM_PARAMETERI,
|
OPCODE_PROGRAM_PARAMETERI,
|
||||||
OPCODE_FRAMEBUFFER_TEXTURE,
|
OPCODE_FRAMEBUFFER_TEXTURE,
|
||||||
|
@ -7173,136 +7165,6 @@ save_TextureBarrierNV(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* GL_ARB_sampler_objects */
|
|
||||||
static void GLAPIENTRY
|
|
||||||
save_BindSampler(GLuint unit, GLuint sampler)
|
|
||||||
{
|
|
||||||
Node *n;
|
|
||||||
GET_CURRENT_CONTEXT(ctx);
|
|
||||||
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
|
|
||||||
n = alloc_instruction(ctx, OPCODE_BIND_SAMPLER, 2);
|
|
||||||
if (n) {
|
|
||||||
n[1].ui = unit;
|
|
||||||
n[2].ui = sampler;
|
|
||||||
}
|
|
||||||
if (ctx->ExecuteFlag) {
|
|
||||||
CALL_BindSampler(ctx->Exec, (unit, sampler));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void GLAPIENTRY
|
|
||||||
save_SamplerParameteriv(GLuint sampler, GLenum pname, const GLint *params)
|
|
||||||
{
|
|
||||||
Node *n;
|
|
||||||
GET_CURRENT_CONTEXT(ctx);
|
|
||||||
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
|
|
||||||
n = alloc_instruction(ctx, OPCODE_SAMPLER_PARAMETERIV, 6);
|
|
||||||
if (n) {
|
|
||||||
n[1].ui = sampler;
|
|
||||||
n[2].e = pname;
|
|
||||||
n[3].i = params[0];
|
|
||||||
if (pname == GL_TEXTURE_BORDER_COLOR) {
|
|
||||||
n[4].i = params[1];
|
|
||||||
n[5].i = params[2];
|
|
||||||
n[6].i = params[3];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
n[4].i = n[5].i = n[6].i = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (ctx->ExecuteFlag) {
|
|
||||||
CALL_SamplerParameteriv(ctx->Exec, (sampler, pname, params));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void GLAPIENTRY
|
|
||||||
save_SamplerParameteri(GLuint sampler, GLenum pname, GLint param)
|
|
||||||
{
|
|
||||||
save_SamplerParameteriv(sampler, pname, ¶m);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void GLAPIENTRY
|
|
||||||
save_SamplerParameterfv(GLuint sampler, GLenum pname, const GLfloat *params)
|
|
||||||
{
|
|
||||||
Node *n;
|
|
||||||
GET_CURRENT_CONTEXT(ctx);
|
|
||||||
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
|
|
||||||
n = alloc_instruction(ctx, OPCODE_SAMPLER_PARAMETERFV, 6);
|
|
||||||
if (n) {
|
|
||||||
n[1].ui = sampler;
|
|
||||||
n[2].e = pname;
|
|
||||||
n[3].f = params[0];
|
|
||||||
if (pname == GL_TEXTURE_BORDER_COLOR) {
|
|
||||||
n[4].f = params[1];
|
|
||||||
n[5].f = params[2];
|
|
||||||
n[6].f = params[3];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
n[4].f = n[5].f = n[6].f = 0.0F;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (ctx->ExecuteFlag) {
|
|
||||||
CALL_SamplerParameterfv(ctx->Exec, (sampler, pname, params));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void GLAPIENTRY
|
|
||||||
save_SamplerParameterf(GLuint sampler, GLenum pname, GLfloat param)
|
|
||||||
{
|
|
||||||
save_SamplerParameterfv(sampler, pname, ¶m);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void GLAPIENTRY
|
|
||||||
save_SamplerParameterIiv(GLuint sampler, GLenum pname, const GLint *params)
|
|
||||||
{
|
|
||||||
Node *n;
|
|
||||||
GET_CURRENT_CONTEXT(ctx);
|
|
||||||
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
|
|
||||||
n = alloc_instruction(ctx, OPCODE_SAMPLER_PARAMETERIIV, 6);
|
|
||||||
if (n) {
|
|
||||||
n[1].ui = sampler;
|
|
||||||
n[2].e = pname;
|
|
||||||
n[3].i = params[0];
|
|
||||||
if (pname == GL_TEXTURE_BORDER_COLOR) {
|
|
||||||
n[4].i = params[1];
|
|
||||||
n[5].i = params[2];
|
|
||||||
n[6].i = params[3];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
n[4].i = n[5].i = n[6].i = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (ctx->ExecuteFlag) {
|
|
||||||
CALL_SamplerParameterIiv(ctx->Exec, (sampler, pname, params));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void GLAPIENTRY
|
|
||||||
save_SamplerParameterIuiv(GLuint sampler, GLenum pname, const GLuint *params)
|
|
||||||
{
|
|
||||||
Node *n;
|
|
||||||
GET_CURRENT_CONTEXT(ctx);
|
|
||||||
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
|
|
||||||
n = alloc_instruction(ctx, OPCODE_SAMPLER_PARAMETERUIV, 6);
|
|
||||||
if (n) {
|
|
||||||
n[1].ui = sampler;
|
|
||||||
n[2].e = pname;
|
|
||||||
n[3].ui = params[0];
|
|
||||||
if (pname == GL_TEXTURE_BORDER_COLOR) {
|
|
||||||
n[4].ui = params[1];
|
|
||||||
n[5].ui = params[2];
|
|
||||||
n[6].ui = params[3];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
n[4].ui = n[5].ui = n[6].ui = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (ctx->ExecuteFlag) {
|
|
||||||
CALL_SamplerParameterIuiv(ctx->Exec, (sampler, pname, params));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* GL_ARB_geometry_shader4 */
|
/* GL_ARB_geometry_shader4 */
|
||||||
static void GLAPIENTRY
|
static void GLAPIENTRY
|
||||||
save_ProgramParameteri(GLuint program, GLenum pname, GLint value)
|
save_ProgramParameteri(GLuint program, GLenum pname, GLint value)
|
||||||
|
@ -8610,51 +8472,6 @@ execute_list(struct gl_context *ctx, GLuint list)
|
||||||
CALL_DrawTransformFeedback(ctx->Exec, (n[1].e, n[2].ui));
|
CALL_DrawTransformFeedback(ctx->Exec, (n[1].e, n[2].ui));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
case OPCODE_BIND_SAMPLER:
|
|
||||||
CALL_BindSampler(ctx->Exec, (n[1].ui, n[2].ui));
|
|
||||||
break;
|
|
||||||
case OPCODE_SAMPLER_PARAMETERIV:
|
|
||||||
{
|
|
||||||
GLint params[4];
|
|
||||||
params[0] = n[3].i;
|
|
||||||
params[1] = n[4].i;
|
|
||||||
params[2] = n[5].i;
|
|
||||||
params[3] = n[6].i;
|
|
||||||
CALL_SamplerParameteriv(ctx->Exec, (n[1].ui, n[2].e, params));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case OPCODE_SAMPLER_PARAMETERFV:
|
|
||||||
{
|
|
||||||
GLfloat params[4];
|
|
||||||
params[0] = n[3].f;
|
|
||||||
params[1] = n[4].f;
|
|
||||||
params[2] = n[5].f;
|
|
||||||
params[3] = n[6].f;
|
|
||||||
CALL_SamplerParameterfv(ctx->Exec, (n[1].ui, n[2].e, params));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case OPCODE_SAMPLER_PARAMETERIIV:
|
|
||||||
{
|
|
||||||
GLint params[4];
|
|
||||||
params[0] = n[3].i;
|
|
||||||
params[1] = n[4].i;
|
|
||||||
params[2] = n[5].i;
|
|
||||||
params[3] = n[6].i;
|
|
||||||
CALL_SamplerParameterIiv(ctx->Exec, (n[1].ui, n[2].e, params));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case OPCODE_SAMPLER_PARAMETERUIV:
|
|
||||||
{
|
|
||||||
GLuint params[4];
|
|
||||||
params[0] = n[3].ui;
|
|
||||||
params[1] = n[4].ui;
|
|
||||||
params[2] = n[5].ui;
|
|
||||||
params[3] = n[6].ui;
|
|
||||||
CALL_SamplerParameterIuiv(ctx->Exec, (n[1].ui, n[2].e, params));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
/* GL_ARB_geometry_shader4 */
|
/* GL_ARB_geometry_shader4 */
|
||||||
case OPCODE_PROGRAM_PARAMETERI:
|
case OPCODE_PROGRAM_PARAMETERI:
|
||||||
CALL_ProgramParameteriARB(ctx->Exec, (n[1].ui, n[2].e, n[3].i));
|
CALL_ProgramParameteriARB(ctx->Exec, (n[1].ui, n[2].e, n[3].i));
|
||||||
|
@ -10390,16 +10207,6 @@ _mesa_create_save_table(void)
|
||||||
/* GL_NV_texture_barrier */
|
/* GL_NV_texture_barrier */
|
||||||
SET_TextureBarrierNV(table, save_TextureBarrierNV);
|
SET_TextureBarrierNV(table, save_TextureBarrierNV);
|
||||||
|
|
||||||
/* GL_ARB_sampler_objects */
|
|
||||||
_mesa_init_sampler_object_dispatch(table); /* plug in Gen/Get/etc functions */
|
|
||||||
SET_BindSampler(table, save_BindSampler);
|
|
||||||
SET_SamplerParameteri(table, save_SamplerParameteri);
|
|
||||||
SET_SamplerParameterf(table, save_SamplerParameterf);
|
|
||||||
SET_SamplerParameteriv(table, save_SamplerParameteriv);
|
|
||||||
SET_SamplerParameterfv(table, save_SamplerParameterfv);
|
|
||||||
SET_SamplerParameterIiv(table, save_SamplerParameterIiv);
|
|
||||||
SET_SamplerParameterIuiv(table, save_SamplerParameterIuiv);
|
|
||||||
|
|
||||||
/* GL_ARB_draw_buffer_blend */
|
/* GL_ARB_draw_buffer_blend */
|
||||||
SET_BlendFunciARB(table, save_BlendFunci);
|
SET_BlendFunciARB(table, save_BlendFunci);
|
||||||
SET_BlendFuncSeparateiARB(table, save_BlendFuncSeparatei);
|
SET_BlendFuncSeparateiARB(table, save_BlendFuncSeparatei);
|
||||||
|
|
|
@ -84,7 +84,6 @@ static const struct extension extension_table[] = {
|
||||||
{ "GL_ARB_conservative_depth", o(ARB_conservative_depth), GL, 2011 },
|
{ "GL_ARB_conservative_depth", o(ARB_conservative_depth), GL, 2011 },
|
||||||
{ "GL_ARB_depth_buffer_float", o(ARB_depth_buffer_float), GL, 2008 },
|
{ "GL_ARB_depth_buffer_float", o(ARB_depth_buffer_float), GL, 2008 },
|
||||||
{ "GL_ARB_depth_clamp", o(ARB_depth_clamp), GL, 2003 },
|
{ "GL_ARB_depth_clamp", o(ARB_depth_clamp), GL, 2003 },
|
||||||
{ "GL_ARB_depth_texture", o(ARB_depth_texture), GL, 2001 },
|
|
||||||
{ "GL_ARB_draw_buffers", o(dummy_true), GL, 2002 },
|
{ "GL_ARB_draw_buffers", o(dummy_true), GL, 2002 },
|
||||||
{ "GL_ARB_draw_buffers_blend", o(ARB_draw_buffers_blend), GL, 2009 },
|
{ "GL_ARB_draw_buffers_blend", o(ARB_draw_buffers_blend), GL, 2009 },
|
||||||
{ "GL_ARB_draw_elements_base_vertex", o(ARB_draw_elements_base_vertex), GL, 2009 },
|
{ "GL_ARB_draw_elements_base_vertex", o(ARB_draw_elements_base_vertex), GL, 2009 },
|
||||||
|
@ -109,14 +108,11 @@ static const struct extension extension_table[] = {
|
||||||
{ "GL_ARB_point_sprite", o(ARB_point_sprite), GL, 2003 },
|
{ "GL_ARB_point_sprite", o(ARB_point_sprite), GL, 2003 },
|
||||||
{ "GL_ARB_provoking_vertex", o(EXT_provoking_vertex), GL, 2009 },
|
{ "GL_ARB_provoking_vertex", o(EXT_provoking_vertex), GL, 2009 },
|
||||||
{ "GL_ARB_robustness", o(dummy_true), GL, 2010 },
|
{ "GL_ARB_robustness", o(dummy_true), GL, 2010 },
|
||||||
{ "GL_ARB_sampler_objects", o(ARB_sampler_objects), GL, 2009 },
|
|
||||||
{ "GL_ARB_seamless_cube_map", o(ARB_seamless_cube_map), GL, 2009 },
|
{ "GL_ARB_seamless_cube_map", o(ARB_seamless_cube_map), GL, 2009 },
|
||||||
{ "GL_ARB_shader_objects", o(ARB_shader_objects), GL, 2002 },
|
{ "GL_ARB_shader_objects", o(ARB_shader_objects), GL, 2002 },
|
||||||
{ "GL_ARB_shader_stencil_export", o(ARB_shader_stencil_export), GL, 2009 },
|
{ "GL_ARB_shader_stencil_export", o(ARB_shader_stencil_export), GL, 2009 },
|
||||||
{ "GL_ARB_shader_texture_lod", o(ARB_shader_texture_lod), GL, 2009 },
|
{ "GL_ARB_shader_texture_lod", o(ARB_shader_texture_lod), GL, 2009 },
|
||||||
{ "GL_ARB_shading_language_100", o(ARB_shading_language_100), GL, 2003 },
|
{ "GL_ARB_shading_language_100", o(ARB_shading_language_100), GL, 2003 },
|
||||||
{ "GL_ARB_shadow_ambient", o(ARB_shadow_ambient), GL, 2001 },
|
|
||||||
{ "GL_ARB_shadow", o(ARB_shadow), GL, 2001 },
|
|
||||||
{ "GL_ARB_sync", o(ARB_sync), GL, 2003 },
|
{ "GL_ARB_sync", o(ARB_sync), GL, 2003 },
|
||||||
{ "GL_ARB_texture_border_clamp", o(ARB_texture_border_clamp), GL, 2000 },
|
{ "GL_ARB_texture_border_clamp", o(ARB_texture_border_clamp), GL, 2000 },
|
||||||
{ "GL_ARB_texture_buffer_object", o(ARB_texture_buffer_object), GL, 2008 },
|
{ "GL_ARB_texture_buffer_object", o(ARB_texture_buffer_object), GL, 2008 },
|
||||||
|
@ -132,7 +128,6 @@ static const struct extension extension_table[] = {
|
||||||
{ "GL_ARB_texture_multisample", o(ARB_texture_multisample), GL, 2009 },
|
{ "GL_ARB_texture_multisample", o(ARB_texture_multisample), GL, 2009 },
|
||||||
{ "GL_ARB_texture_non_power_of_two", o(ARB_texture_non_power_of_two), GL, 2003 },
|
{ "GL_ARB_texture_non_power_of_two", o(ARB_texture_non_power_of_two), GL, 2003 },
|
||||||
{ "GL_ARB_texture_rectangle", o(NV_texture_rectangle), GL, 2004 },
|
{ "GL_ARB_texture_rectangle", o(NV_texture_rectangle), GL, 2004 },
|
||||||
{ "GL_ARB_texture_rgb10_a2ui", o(ARB_texture_rgb10_a2ui), GL, 2009 },
|
|
||||||
{ "GL_ARB_texture_rg", o(ARB_texture_rg), GL, 2008 },
|
{ "GL_ARB_texture_rg", o(ARB_texture_rg), GL, 2008 },
|
||||||
{ "GL_ARB_texture_storage", o(ARB_texture_storage), GL, 2011 },
|
{ "GL_ARB_texture_storage", o(ARB_texture_storage), GL, 2011 },
|
||||||
{ "GL_ARB_transform_feedback2", o(ARB_transform_feedback2), GL, 2010 },
|
{ "GL_ARB_transform_feedback2", o(ARB_transform_feedback2), GL, 2010 },
|
||||||
|
@ -202,9 +197,7 @@ static const struct extension extension_table[] = {
|
||||||
{ "GL_EXT_texture_rectangle", o(NV_texture_rectangle), GL, 2004 },
|
{ "GL_EXT_texture_rectangle", o(NV_texture_rectangle), GL, 2004 },
|
||||||
{ "GL_EXT_texture_snorm", o(EXT_texture_snorm), GL, 2009 },
|
{ "GL_EXT_texture_snorm", o(EXT_texture_snorm), GL, 2009 },
|
||||||
{ "GL_EXT_texture_sRGB", o(EXT_texture_sRGB), GL, 2004 },
|
{ "GL_EXT_texture_sRGB", o(EXT_texture_sRGB), GL, 2004 },
|
||||||
{ "GL_EXT_texture_sRGB_decode", o(EXT_texture_sRGB_decode), GL, 2006 },
|
|
||||||
{ "GL_EXT_texture_type_2_10_10_10_REV", o(dummy_true), ES2, 2008 },
|
{ "GL_EXT_texture_type_2_10_10_10_REV", o(dummy_true), ES2, 2008 },
|
||||||
{ "GL_EXT_timer_query", o(EXT_timer_query), GL, 2006 },
|
|
||||||
{ "GL_EXT_transform_feedback", o(EXT_transform_feedback), GL, 2011 },
|
{ "GL_EXT_transform_feedback", o(EXT_transform_feedback), GL, 2011 },
|
||||||
{ "GL_EXT_vertex_array_bgra", o(EXT_vertex_array_bgra), GL, 2008 },
|
{ "GL_EXT_vertex_array_bgra", o(EXT_vertex_array_bgra), GL, 2008 },
|
||||||
{ "GL_EXT_vertex_array", o(dummy_true), GL, 1995 },
|
{ "GL_EXT_vertex_array", o(dummy_true), GL, 1995 },
|
||||||
|
@ -217,7 +210,6 @@ static const struct extension extension_table[] = {
|
||||||
{ "GL_OES_compressed_paletted_texture", o(dummy_true), ES1, 2003 },
|
{ "GL_OES_compressed_paletted_texture", o(dummy_true), ES1, 2003 },
|
||||||
{ "GL_OES_depth24", o(EXT_framebuffer_object), ES1 | ES2, 2005 },
|
{ "GL_OES_depth24", o(EXT_framebuffer_object), ES1 | ES2, 2005 },
|
||||||
{ "GL_OES_depth32", o(dummy_false), DISABLE, 2005 },
|
{ "GL_OES_depth32", o(dummy_false), DISABLE, 2005 },
|
||||||
{ "GL_OES_depth_texture", o(ARB_depth_texture), ES2, 2006 },
|
|
||||||
#if FEATURE_OES_draw_texture
|
#if FEATURE_OES_draw_texture
|
||||||
{ "GL_OES_draw_texture", o(OES_draw_texture), ES1 | ES2, 2004 },
|
{ "GL_OES_draw_texture", o(OES_draw_texture), ES1 | ES2, 2004 },
|
||||||
#endif
|
#endif
|
||||||
|
@ -374,7 +366,6 @@ _mesa_enable_sw_extensions(struct gl_context *ctx)
|
||||||
{
|
{
|
||||||
/*ctx->Extensions.ARB_copy_buffer = GL_TRUE;*/
|
/*ctx->Extensions.ARB_copy_buffer = GL_TRUE;*/
|
||||||
ctx->Extensions.ARB_depth_clamp = GL_TRUE;
|
ctx->Extensions.ARB_depth_clamp = GL_TRUE;
|
||||||
ctx->Extensions.ARB_depth_texture = GL_TRUE;
|
|
||||||
ctx->Extensions.ARB_draw_elements_base_vertex = GL_TRUE;
|
ctx->Extensions.ARB_draw_elements_base_vertex = GL_TRUE;
|
||||||
ctx->Extensions.ARB_draw_instanced = GL_TRUE;
|
ctx->Extensions.ARB_draw_instanced = GL_TRUE;
|
||||||
ctx->Extensions.ARB_explicit_attrib_location = GL_TRUE;
|
ctx->Extensions.ARB_explicit_attrib_location = GL_TRUE;
|
||||||
|
@ -408,8 +399,6 @@ _mesa_enable_sw_extensions(struct gl_context *ctx)
|
||||||
#if FEATURE_ARB_shading_language_100
|
#if FEATURE_ARB_shading_language_100
|
||||||
ctx->Extensions.ARB_shading_language_100 = GL_TRUE;
|
ctx->Extensions.ARB_shading_language_100 = GL_TRUE;
|
||||||
#endif
|
#endif
|
||||||
ctx->Extensions.ARB_shadow = GL_TRUE;
|
|
||||||
ctx->Extensions.ARB_shadow_ambient = GL_TRUE;
|
|
||||||
ctx->Extensions.ARB_texture_border_clamp = GL_TRUE;
|
ctx->Extensions.ARB_texture_border_clamp = GL_TRUE;
|
||||||
ctx->Extensions.ARB_texture_cube_map = GL_TRUE;
|
ctx->Extensions.ARB_texture_cube_map = GL_TRUE;
|
||||||
ctx->Extensions.ARB_texture_env_combine = GL_TRUE;
|
ctx->Extensions.ARB_texture_env_combine = GL_TRUE;
|
||||||
|
@ -474,7 +463,6 @@ _mesa_enable_sw_extensions(struct gl_context *ctx)
|
||||||
ctx->Extensions.EXT_texture_mirror_clamp = GL_TRUE;
|
ctx->Extensions.EXT_texture_mirror_clamp = GL_TRUE;
|
||||||
#if FEATURE_EXT_texture_sRGB
|
#if FEATURE_EXT_texture_sRGB
|
||||||
ctx->Extensions.EXT_texture_sRGB = GL_TRUE;
|
ctx->Extensions.EXT_texture_sRGB = GL_TRUE;
|
||||||
ctx->Extensions.EXT_texture_sRGB_decode = GL_TRUE;
|
|
||||||
#endif
|
#endif
|
||||||
#if FEATURE_EXT_transform_feedback
|
#if FEATURE_EXT_transform_feedback
|
||||||
/*ctx->Extensions.EXT_transform_feedback = GL_TRUE;*/
|
/*ctx->Extensions.EXT_transform_feedback = GL_TRUE;*/
|
||||||
|
@ -540,8 +528,6 @@ _mesa_enable_1_3_extensions(struct gl_context *ctx)
|
||||||
void
|
void
|
||||||
_mesa_enable_1_4_extensions(struct gl_context *ctx)
|
_mesa_enable_1_4_extensions(struct gl_context *ctx)
|
||||||
{
|
{
|
||||||
ctx->Extensions.ARB_depth_texture = GL_TRUE;
|
|
||||||
ctx->Extensions.ARB_shadow = GL_TRUE;
|
|
||||||
ctx->Extensions.ARB_texture_env_crossbar = GL_TRUE;
|
ctx->Extensions.ARB_texture_env_crossbar = GL_TRUE;
|
||||||
ctx->Extensions.ARB_window_pos = GL_TRUE;
|
ctx->Extensions.ARB_window_pos = GL_TRUE;
|
||||||
ctx->Extensions.EXT_blend_color = GL_TRUE;
|
ctx->Extensions.EXT_blend_color = GL_TRUE;
|
||||||
|
|
|
@ -602,11 +602,6 @@ test_attachment_completeness(const struct gl_context *ctx, GLenum format,
|
||||||
if (baseFormat == GL_DEPTH_COMPONENT) {
|
if (baseFormat == GL_DEPTH_COMPONENT) {
|
||||||
/* OK */
|
/* OK */
|
||||||
}
|
}
|
||||||
else if (ctx->Extensions.EXT_packed_depth_stencil &&
|
|
||||||
ctx->Extensions.ARB_depth_texture &&
|
|
||||||
baseFormat == GL_DEPTH_STENCIL_EXT) {
|
|
||||||
/* OK */
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
att->Complete = GL_FALSE;
|
att->Complete = GL_FALSE;
|
||||||
att_incomplete("bad depth format");
|
att_incomplete("bad depth format");
|
||||||
|
@ -614,13 +609,7 @@ test_attachment_completeness(const struct gl_context *ctx, GLenum format,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ASSERT(format == GL_STENCIL);
|
{
|
||||||
if (ctx->Extensions.EXT_packed_depth_stencil &&
|
|
||||||
ctx->Extensions.ARB_depth_texture &&
|
|
||||||
baseFormat == GL_DEPTH_STENCIL_EXT) {
|
|
||||||
/* OK */
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
/* no such thing as stencil-only textures */
|
/* no such thing as stencil-only textures */
|
||||||
att_incomplete("illegal stencil texture");
|
att_incomplete("illegal stencil texture");
|
||||||
att->Complete = GL_FALSE;
|
att->Complete = GL_FALSE;
|
||||||
|
@ -1293,8 +1282,6 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat)
|
||||||
return ctx->Extensions.EXT_texture_integer &&
|
return ctx->Extensions.EXT_texture_integer &&
|
||||||
ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE_ALPHA : 0;
|
ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE_ALPHA : 0;
|
||||||
|
|
||||||
case GL_RGB10_A2UI:
|
|
||||||
return ctx->Extensions.ARB_texture_rgb10_a2ui ? GL_RGBA : 0;
|
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,7 +110,6 @@ struct state_key {
|
||||||
struct {
|
struct {
|
||||||
GLuint enabled:1;
|
GLuint enabled:1;
|
||||||
GLuint source_index:4; /**< TEXTURE_x_INDEX */
|
GLuint source_index:4; /**< TEXTURE_x_INDEX */
|
||||||
GLuint shadow:1;
|
|
||||||
GLuint ScaleShiftRGB:2;
|
GLuint ScaleShiftRGB:2;
|
||||||
GLuint ScaleShiftA:2;
|
GLuint ScaleShiftA:2;
|
||||||
|
|
||||||
|
@ -440,11 +439,6 @@ static GLuint make_state_key( struct gl_context *ctx, struct state_key *key )
|
||||||
key->unit[i].source_index =
|
key->unit[i].source_index =
|
||||||
translate_tex_src_bit(texUnit->_ReallyEnabled);
|
translate_tex_src_bit(texUnit->_ReallyEnabled);
|
||||||
|
|
||||||
key->unit[i].shadow =
|
|
||||||
((texObj->Sampler.CompareMode == GL_COMPARE_R_TO_TEXTURE) &&
|
|
||||||
((format == GL_DEPTH_COMPONENT) ||
|
|
||||||
(format == GL_DEPTH_STENCIL_EXT)));
|
|
||||||
|
|
||||||
key->unit[i].NumArgsRGB = comb->_NumArgsRGB;
|
key->unit[i].NumArgsRGB = comb->_NumArgsRGB;
|
||||||
key->unit[i].NumArgsA = comb->_NumArgsA;
|
key->unit[i].NumArgsA = comb->_NumArgsA;
|
||||||
|
|
||||||
|
@ -1006,54 +1000,34 @@ static void load_texture( struct texenv_fragment_program *p, GLuint unit )
|
||||||
|
|
||||||
switch (texTarget) {
|
switch (texTarget) {
|
||||||
case TEXTURE_1D_INDEX:
|
case TEXTURE_1D_INDEX:
|
||||||
if (p->state->unit[unit].shadow)
|
|
||||||
sampler_type = p->shader->symbols->get_type("sampler1DShadow");
|
|
||||||
else
|
|
||||||
sampler_type = p->shader->symbols->get_type("sampler1D");
|
sampler_type = p->shader->symbols->get_type("sampler1D");
|
||||||
coords = 1;
|
coords = 1;
|
||||||
break;
|
break;
|
||||||
case TEXTURE_1D_ARRAY_INDEX:
|
case TEXTURE_1D_ARRAY_INDEX:
|
||||||
if (p->state->unit[unit].shadow)
|
|
||||||
sampler_type = p->shader->symbols->get_type("sampler1DArrayShadow");
|
|
||||||
else
|
|
||||||
sampler_type = p->shader->symbols->get_type("sampler1DArray");
|
sampler_type = p->shader->symbols->get_type("sampler1DArray");
|
||||||
coords = 2;
|
coords = 2;
|
||||||
break;
|
break;
|
||||||
case TEXTURE_2D_INDEX:
|
case TEXTURE_2D_INDEX:
|
||||||
if (p->state->unit[unit].shadow)
|
|
||||||
sampler_type = p->shader->symbols->get_type("sampler2DShadow");
|
|
||||||
else
|
|
||||||
sampler_type = p->shader->symbols->get_type("sampler2D");
|
sampler_type = p->shader->symbols->get_type("sampler2D");
|
||||||
coords = 2;
|
coords = 2;
|
||||||
break;
|
break;
|
||||||
case TEXTURE_2D_ARRAY_INDEX:
|
case TEXTURE_2D_ARRAY_INDEX:
|
||||||
if (p->state->unit[unit].shadow)
|
|
||||||
sampler_type = p->shader->symbols->get_type("sampler2DArrayShadow");
|
|
||||||
else
|
|
||||||
sampler_type = p->shader->symbols->get_type("sampler2DArray");
|
sampler_type = p->shader->symbols->get_type("sampler2DArray");
|
||||||
coords = 3;
|
coords = 3;
|
||||||
break;
|
break;
|
||||||
case TEXTURE_RECT_INDEX:
|
case TEXTURE_RECT_INDEX:
|
||||||
if (p->state->unit[unit].shadow)
|
|
||||||
sampler_type = p->shader->symbols->get_type("sampler2DRectShadow");
|
|
||||||
else
|
|
||||||
sampler_type = p->shader->symbols->get_type("sampler2DRect");
|
sampler_type = p->shader->symbols->get_type("sampler2DRect");
|
||||||
coords = 2;
|
coords = 2;
|
||||||
break;
|
break;
|
||||||
case TEXTURE_3D_INDEX:
|
case TEXTURE_3D_INDEX:
|
||||||
assert(!p->state->unit[unit].shadow);
|
|
||||||
sampler_type = p->shader->symbols->get_type("sampler3D");
|
sampler_type = p->shader->symbols->get_type("sampler3D");
|
||||||
coords = 3;
|
coords = 3;
|
||||||
break;
|
break;
|
||||||
case TEXTURE_CUBE_INDEX:
|
case TEXTURE_CUBE_INDEX:
|
||||||
if (p->state->unit[unit].shadow)
|
|
||||||
sampler_type = p->shader->symbols->get_type("samplerCubeShadow");
|
|
||||||
else
|
|
||||||
sampler_type = p->shader->symbols->get_type("samplerCube");
|
sampler_type = p->shader->symbols->get_type("samplerCube");
|
||||||
coords = 3;
|
coords = 3;
|
||||||
break;
|
break;
|
||||||
case TEXTURE_EXTERNAL_INDEX:
|
case TEXTURE_EXTERNAL_INDEX:
|
||||||
assert(!p->state->unit[unit].shadow);
|
|
||||||
sampler_type = p->shader->symbols->get_type("samplerExternalOES");
|
sampler_type = p->shader->symbols->get_type("samplerExternalOES");
|
||||||
coords = 2;
|
coords = 2;
|
||||||
break;
|
break;
|
||||||
|
@ -1077,14 +1051,6 @@ static void load_texture( struct texenv_fragment_program *p, GLuint unit )
|
||||||
|
|
||||||
tex->coordinate = new(p->mem_ctx) ir_swizzle(texcoord, 0, 1, 2, 3, coords);
|
tex->coordinate = new(p->mem_ctx) ir_swizzle(texcoord, 0, 1, 2, 3, coords);
|
||||||
|
|
||||||
if (p->state->unit[unit].shadow) {
|
|
||||||
texcoord = texcoord->clone(p->mem_ctx, NULL);
|
|
||||||
tex->shadow_comparitor = new(p->mem_ctx) ir_swizzle(texcoord,
|
|
||||||
coords, 0, 0, 0,
|
|
||||||
1);
|
|
||||||
coords++;
|
|
||||||
}
|
|
||||||
|
|
||||||
texcoord = texcoord->clone(p->mem_ctx, NULL);
|
texcoord = texcoord->clone(p->mem_ctx, NULL);
|
||||||
tex->projector = new(p->mem_ctx) ir_swizzle(texcoord, 3, 0, 0, 0, 1);
|
tex->projector = new(p->mem_ctx) ir_swizzle(texcoord, 3, 0, 0, 0, 1);
|
||||||
|
|
||||||
|
|
|
@ -2507,20 +2507,6 @@ unpack_int_rgba_INTENSITY_INT8(const GLbyte *src, GLuint dst[][4], GLuint n)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
unpack_int_rgba_ARGB2101010_UINT(const GLuint *src, GLuint dst[][4], GLuint n)
|
|
||||||
{
|
|
||||||
unsigned int i;
|
|
||||||
|
|
||||||
for (i = 0; i < n; i++) {
|
|
||||||
GLuint tmp = src[i];
|
|
||||||
dst[i][0] = (tmp >> 20) & 0x3ff;
|
|
||||||
dst[i][1] = (tmp >> 10) & 0x3ff;
|
|
||||||
dst[i][2] = (tmp >> 0) & 0x3ff;
|
|
||||||
dst[i][3] = (tmp >> 30) & 0x3;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_mesa_unpack_uint_rgba_row(gl_format format, GLuint n,
|
_mesa_unpack_uint_rgba_row(gl_format format, GLuint n,
|
||||||
const void *src, GLuint dst[][4])
|
const void *src, GLuint dst[][4])
|
||||||
|
@ -2680,9 +2666,6 @@ _mesa_unpack_uint_rgba_row(gl_format format, GLuint n,
|
||||||
unpack_int_rgba_INTENSITY_INT8(src, dst, n);
|
unpack_int_rgba_INTENSITY_INT8(src, dst, n);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MESA_FORMAT_ARGB2101010_UINT:
|
|
||||||
unpack_int_rgba_ARGB2101010_UINT(src, dst, n);
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
_mesa_problem(NULL, "%s: bad format %s", __FUNCTION__,
|
_mesa_problem(NULL, "%s: bad format %s", __FUNCTION__,
|
||||||
_mesa_get_format_name(format));
|
_mesa_get_format_name(format));
|
||||||
|
|
|
@ -1481,16 +1481,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
|
||||||
0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */
|
0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */
|
||||||
0, 0, 0, 32, 8, /* Lum/Int/Index/Depth/StencilBits */
|
0, 0, 0, 32, 8, /* Lum/Int/Index/Depth/StencilBits */
|
||||||
1, 1, 8 /* BlockWidth/Height,Bytes */
|
1, 1, 8 /* BlockWidth/Height,Bytes */
|
||||||
},
|
}
|
||||||
{
|
|
||||||
MESA_FORMAT_ARGB2101010_UINT,
|
|
||||||
"MESA_FORMAT_ARGB2101010_UINT",
|
|
||||||
GL_RGBA,
|
|
||||||
GL_UNSIGNED_INT,
|
|
||||||
10, 10, 10, 2,
|
|
||||||
0, 0, 0, 0, 0,
|
|
||||||
1, 1, 4
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -2451,11 +2442,6 @@ _mesa_format_to_type_and_comps(gl_format format,
|
||||||
*comps = 4;
|
*comps = 4;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case MESA_FORMAT_ARGB2101010_UINT:
|
|
||||||
*datatype = GL_UNSIGNED_INT_2_10_10_10_REV;
|
|
||||||
*comps = 4;
|
|
||||||
return;
|
|
||||||
|
|
||||||
case MESA_FORMAT_COUNT:
|
case MESA_FORMAT_COUNT:
|
||||||
assert(0);
|
assert(0);
|
||||||
return;
|
return;
|
||||||
|
@ -2778,9 +2764,6 @@ _mesa_format_matches_format_and_type(gl_format gl_format,
|
||||||
/* FINISHME: SNORM */
|
/* FINISHME: SNORM */
|
||||||
return GL_FALSE;
|
return GL_FALSE;
|
||||||
|
|
||||||
case MESA_FORMAT_ARGB2101010_UINT:
|
|
||||||
return GL_FALSE;
|
|
||||||
|
|
||||||
case MESA_FORMAT_Z32_FLOAT:
|
case MESA_FORMAT_Z32_FLOAT:
|
||||||
return format == GL_DEPTH_COMPONENT && type == GL_FLOAT;
|
return format == GL_DEPTH_COMPONENT && type == GL_FLOAT;
|
||||||
|
|
||||||
|
|
|
@ -270,8 +270,6 @@ typedef enum
|
||||||
MESA_FORMAT_Z32_FLOAT,
|
MESA_FORMAT_Z32_FLOAT,
|
||||||
MESA_FORMAT_Z32_FLOAT_X24S8,
|
MESA_FORMAT_Z32_FLOAT_X24S8,
|
||||||
|
|
||||||
MESA_FORMAT_ARGB2101010_UINT,
|
|
||||||
|
|
||||||
MESA_FORMAT_COUNT
|
MESA_FORMAT_COUNT
|
||||||
} gl_format;
|
} gl_format;
|
||||||
|
|
||||||
|
|
|
@ -283,11 +283,6 @@ static const int extra_GLSL_130[] = {
|
||||||
EXTRA_END
|
EXTRA_END
|
||||||
};
|
};
|
||||||
|
|
||||||
static const int extra_ARB_sampler_objects[] = {
|
|
||||||
EXT(ARB_sampler_objects),
|
|
||||||
EXTRA_END
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
EXTRA_EXT(ARB_ES2_compatibility);
|
EXTRA_EXT(ARB_ES2_compatibility);
|
||||||
EXTRA_EXT(ARB_texture_cube_map);
|
EXTRA_EXT(ARB_texture_cube_map);
|
||||||
|
@ -1267,10 +1262,6 @@ static const struct value_desc values[] = {
|
||||||
{ GL_TEXTURE_BUFFER_ARB, LOC_CUSTOM, TYPE_INT, 0,
|
{ GL_TEXTURE_BUFFER_ARB, LOC_CUSTOM, TYPE_INT, 0,
|
||||||
extra_ARB_texture_buffer_object },
|
extra_ARB_texture_buffer_object },
|
||||||
|
|
||||||
/* GL_ARB_sampler_objects / GL 3.3 */
|
|
||||||
{ GL_SAMPLER_BINDING,
|
|
||||||
LOC_CUSTOM, TYPE_INT, GL_SAMPLER_BINDING, extra_ARB_sampler_objects },
|
|
||||||
|
|
||||||
/* GL 3.0 */
|
/* GL 3.0 */
|
||||||
{ GL_NUM_EXTENSIONS, LOC_CUSTOM, TYPE_INT, 0, extra_version_30 },
|
{ GL_NUM_EXTENSIONS, LOC_CUSTOM, TYPE_INT, 0, extra_version_30 },
|
||||||
{ GL_MAJOR_VERSION, CONTEXT_INT(VersionMajor), extra_version_30 },
|
{ GL_MAJOR_VERSION, CONTEXT_INT(VersionMajor), extra_version_30 },
|
||||||
|
@ -1738,15 +1729,6 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu
|
||||||
v->value_int = ctx->Texture.Unit[ctx->Texture.CurrentUnit]
|
v->value_int = ctx->Texture.Unit[ctx->Texture.CurrentUnit]
|
||||||
.CurrentTex[TEXTURE_BUFFER_INDEX]->BufferObjectFormat;
|
.CurrentTex[TEXTURE_BUFFER_INDEX]->BufferObjectFormat;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* GL_ARB_sampler_objects */
|
|
||||||
case GL_SAMPLER_BINDING:
|
|
||||||
{
|
|
||||||
struct gl_sampler_object *samp =
|
|
||||||
ctx->Texture.Unit[ctx->Texture.CurrentUnit].Sampler;
|
|
||||||
v->value_int = samp ? samp->Name : 0;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -385,10 +385,6 @@ _mesa_error_check_format_and_type(const struct gl_context *ctx,
|
||||||
if (format == GL_RGB) {
|
if (format == GL_RGB) {
|
||||||
break; /* OK */
|
break; /* OK */
|
||||||
}
|
}
|
||||||
if (format == GL_RGB_INTEGER_EXT &&
|
|
||||||
ctx->Extensions.ARB_texture_rgb10_a2ui) {
|
|
||||||
break; /* OK */
|
|
||||||
}
|
|
||||||
return GL_INVALID_OPERATION;
|
return GL_INVALID_OPERATION;
|
||||||
|
|
||||||
case GL_UNSIGNED_SHORT_4_4_4_4:
|
case GL_UNSIGNED_SHORT_4_4_4_4:
|
||||||
|
@ -404,10 +400,6 @@ _mesa_error_check_format_and_type(const struct gl_context *ctx,
|
||||||
format == GL_ABGR_EXT) {
|
format == GL_ABGR_EXT) {
|
||||||
break; /* OK */
|
break; /* OK */
|
||||||
}
|
}
|
||||||
if ((format == GL_RGBA_INTEGER_EXT || format == GL_BGRA_INTEGER_EXT) &&
|
|
||||||
ctx->Extensions.ARB_texture_rgb10_a2ui) {
|
|
||||||
break; /* OK */
|
|
||||||
}
|
|
||||||
return GL_INVALID_OPERATION;
|
return GL_INVALID_OPERATION;
|
||||||
|
|
||||||
case GL_UNSIGNED_INT_24_8:
|
case GL_UNSIGNED_INT_24_8:
|
||||||
|
@ -633,12 +625,6 @@ _mesa_error_check_format_and_type(const struct gl_context *ctx,
|
||||||
return (ctx->VersionMajor >= 3 ||
|
return (ctx->VersionMajor >= 3 ||
|
||||||
ctx->Extensions.EXT_texture_integer)
|
ctx->Extensions.EXT_texture_integer)
|
||||||
? GL_NO_ERROR : GL_INVALID_ENUM;
|
? GL_NO_ERROR : GL_INVALID_ENUM;
|
||||||
case GL_UNSIGNED_BYTE_3_3_2:
|
|
||||||
case GL_UNSIGNED_BYTE_2_3_3_REV:
|
|
||||||
case GL_UNSIGNED_SHORT_5_6_5:
|
|
||||||
case GL_UNSIGNED_SHORT_5_6_5_REV:
|
|
||||||
return ctx->Extensions.ARB_texture_rgb10_a2ui
|
|
||||||
? GL_NO_ERROR : GL_INVALID_ENUM;
|
|
||||||
default:
|
default:
|
||||||
return GL_INVALID_ENUM;
|
return GL_INVALID_ENUM;
|
||||||
}
|
}
|
||||||
|
@ -671,16 +657,6 @@ _mesa_error_check_format_and_type(const struct gl_context *ctx,
|
||||||
return (ctx->VersionMajor >= 3 ||
|
return (ctx->VersionMajor >= 3 ||
|
||||||
ctx->Extensions.EXT_texture_integer)
|
ctx->Extensions.EXT_texture_integer)
|
||||||
? GL_NO_ERROR : GL_INVALID_ENUM;
|
? GL_NO_ERROR : GL_INVALID_ENUM;
|
||||||
case GL_UNSIGNED_SHORT_4_4_4_4:
|
|
||||||
case GL_UNSIGNED_SHORT_4_4_4_4_REV:
|
|
||||||
case GL_UNSIGNED_SHORT_5_5_5_1:
|
|
||||||
case GL_UNSIGNED_SHORT_1_5_5_5_REV:
|
|
||||||
case GL_UNSIGNED_INT_8_8_8_8:
|
|
||||||
case GL_UNSIGNED_INT_8_8_8_8_REV:
|
|
||||||
case GL_UNSIGNED_INT_10_10_10_2:
|
|
||||||
case GL_UNSIGNED_INT_2_10_10_10_REV:
|
|
||||||
return ctx->Extensions.ARB_texture_rgb10_a2ui
|
|
||||||
? GL_NO_ERROR : GL_INVALID_ENUM;
|
|
||||||
default:
|
default:
|
||||||
return GL_INVALID_ENUM;
|
return GL_INVALID_ENUM;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1306,7 +1306,6 @@ typedef enum
|
||||||
MAX_FACES = 6
|
MAX_FACES = 6
|
||||||
} gl_face_index;
|
} gl_face_index;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sampler object state. These objects are new with GL_ARB_sampler_objects
|
* Sampler object state. These objects are new with GL_ARB_sampler_objects
|
||||||
* and OpenGL 3.3. Legacy texture objects also contain a sampler object.
|
* and OpenGL 3.3. Legacy texture objects also contain a sampler object.
|
||||||
|
@ -1326,14 +1325,8 @@ struct gl_sampler_object
|
||||||
GLfloat MaxLod; /**< max lambda, OpenGL 1.2 */
|
GLfloat MaxLod; /**< max lambda, OpenGL 1.2 */
|
||||||
GLfloat LodBias; /**< OpenGL 1.4 */
|
GLfloat LodBias; /**< OpenGL 1.4 */
|
||||||
GLfloat MaxAnisotropy; /**< GL_EXT_texture_filter_anisotropic */
|
GLfloat MaxAnisotropy; /**< GL_EXT_texture_filter_anisotropic */
|
||||||
GLenum CompareMode; /**< GL_ARB_shadow */
|
|
||||||
GLenum CompareFunc; /**< GL_ARB_shadow */
|
|
||||||
GLfloat CompareFailValue; /**< GL_ARB_shadow_ambient */
|
|
||||||
GLenum sRGBDecode; /**< GL_DECODE_EXT or GL_SKIP_DECODE_EXT */
|
|
||||||
GLboolean CubeMapSeamless; /**< GL_AMD_seamless_cubemap_per_texture */
|
GLboolean CubeMapSeamless; /**< GL_AMD_seamless_cubemap_per_texture */
|
||||||
|
|
||||||
/* deprecated sampler state */
|
|
||||||
GLenum DepthMode; /**< GL_ARB_depth_texture */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -1434,9 +1427,6 @@ struct gl_texture_unit
|
||||||
GLenum BumpTarget;
|
GLenum BumpTarget;
|
||||||
GLfloat RotMatrix[4]; /* 2x2 matrix */
|
GLfloat RotMatrix[4]; /* 2x2 matrix */
|
||||||
|
|
||||||
/** Current sampler object (GL_ARB_sampler_objects) */
|
|
||||||
struct gl_sampler_object *Sampler;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \name GL_EXT_texture_env_combine
|
* \name GL_EXT_texture_env_combine
|
||||||
*/
|
*/
|
||||||
|
@ -2144,7 +2134,6 @@ struct gl_query_state
|
||||||
{
|
{
|
||||||
struct _mesa_HashTable *QueryObjects;
|
struct _mesa_HashTable *QueryObjects;
|
||||||
struct gl_query_object *CurrentOcclusionObject; /* GL_ARB_occlusion_query */
|
struct gl_query_object *CurrentOcclusionObject; /* GL_ARB_occlusion_query */
|
||||||
struct gl_query_object *CurrentTimerObject; /* GL_EXT_timer_query */
|
|
||||||
|
|
||||||
/** GL_NV_conditional_render */
|
/** GL_NV_conditional_render */
|
||||||
struct gl_query_object *CondRenderQuery;
|
struct gl_query_object *CondRenderQuery;
|
||||||
|
@ -2521,9 +2510,6 @@ struct gl_shared_state
|
||||||
/* GL_ARB_sync */
|
/* GL_ARB_sync */
|
||||||
struct simple_node SyncObjects;
|
struct simple_node SyncObjects;
|
||||||
|
|
||||||
/** GL_ARB_sampler_objects */
|
|
||||||
struct _mesa_HashTable *SamplerObjects;
|
|
||||||
|
|
||||||
void *DriverData; /**< Device driver shared state */
|
void *DriverData; /**< Device driver shared state */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2860,7 +2846,6 @@ struct gl_extensions
|
||||||
GLboolean ARB_copy_buffer;
|
GLboolean ARB_copy_buffer;
|
||||||
GLboolean ARB_depth_buffer_float;
|
GLboolean ARB_depth_buffer_float;
|
||||||
GLboolean ARB_depth_clamp;
|
GLboolean ARB_depth_clamp;
|
||||||
GLboolean ARB_depth_texture;
|
|
||||||
GLboolean ARB_draw_buffers_blend;
|
GLboolean ARB_draw_buffers_blend;
|
||||||
GLboolean ARB_draw_elements_base_vertex;
|
GLboolean ARB_draw_elements_base_vertex;
|
||||||
GLboolean ARB_draw_instanced;
|
GLboolean ARB_draw_instanced;
|
||||||
|
@ -2878,14 +2863,11 @@ struct gl_extensions
|
||||||
GLboolean ARB_occlusion_query;
|
GLboolean ARB_occlusion_query;
|
||||||
GLboolean ARB_occlusion_query2;
|
GLboolean ARB_occlusion_query2;
|
||||||
GLboolean ARB_point_sprite;
|
GLboolean ARB_point_sprite;
|
||||||
GLboolean ARB_sampler_objects;
|
|
||||||
GLboolean ARB_seamless_cube_map;
|
GLboolean ARB_seamless_cube_map;
|
||||||
GLboolean ARB_shader_objects;
|
GLboolean ARB_shader_objects;
|
||||||
GLboolean ARB_shader_stencil_export;
|
GLboolean ARB_shader_stencil_export;
|
||||||
GLboolean ARB_shader_texture_lod;
|
GLboolean ARB_shader_texture_lod;
|
||||||
GLboolean ARB_shading_language_100;
|
GLboolean ARB_shading_language_100;
|
||||||
GLboolean ARB_shadow;
|
|
||||||
GLboolean ARB_shadow_ambient;
|
|
||||||
GLboolean ARB_sync;
|
GLboolean ARB_sync;
|
||||||
GLboolean ARB_texture_border_clamp;
|
GLboolean ARB_texture_border_clamp;
|
||||||
GLboolean ARB_texture_buffer_object;
|
GLboolean ARB_texture_buffer_object;
|
||||||
|
@ -2898,9 +2880,7 @@ struct gl_extensions
|
||||||
GLboolean ARB_texture_multisample;
|
GLboolean ARB_texture_multisample;
|
||||||
GLboolean ARB_texture_non_power_of_two;
|
GLboolean ARB_texture_non_power_of_two;
|
||||||
GLboolean ARB_texture_rg;
|
GLboolean ARB_texture_rg;
|
||||||
GLboolean ARB_texture_rgb10_a2ui;
|
GLboolean ARB_texture_storage;;
|
||||||
GLboolean ARB_texture_storage;
|
|
||||||
GLboolean ARB_timer_query;
|
|
||||||
GLboolean ARB_transform_feedback2;
|
GLboolean ARB_transform_feedback2;
|
||||||
GLboolean ARB_transpose_matrix;
|
GLboolean ARB_transpose_matrix;
|
||||||
GLboolean ARB_uniform_buffer_object;
|
GLboolean ARB_uniform_buffer_object;
|
||||||
|
@ -2945,7 +2925,6 @@ struct gl_extensions
|
||||||
GLboolean EXT_texture_mirror_clamp;
|
GLboolean EXT_texture_mirror_clamp;
|
||||||
GLboolean EXT_texture_snorm;
|
GLboolean EXT_texture_snorm;
|
||||||
GLboolean EXT_texture_sRGB;
|
GLboolean EXT_texture_sRGB;
|
||||||
GLboolean EXT_texture_sRGB_decode;
|
|
||||||
GLboolean EXT_transform_feedback;
|
GLboolean EXT_transform_feedback;
|
||||||
GLboolean EXT_timer_query;
|
GLboolean EXT_timer_query;
|
||||||
GLboolean EXT_vertex_array_bgra;
|
GLboolean EXT_vertex_array_bgra;
|
||||||
|
|
|
@ -150,11 +150,6 @@ get_query_binding_point(struct gl_context *ctx, GLenum target)
|
||||||
return &ctx->Query.CurrentOcclusionObject;
|
return &ctx->Query.CurrentOcclusionObject;
|
||||||
else
|
else
|
||||||
return NULL;
|
return NULL;
|
||||||
case GL_TIME_ELAPSED_EXT:
|
|
||||||
if (ctx->Extensions.EXT_timer_query)
|
|
||||||
return &ctx->Query.CurrentTimerObject;
|
|
||||||
else
|
|
||||||
return NULL;
|
|
||||||
#if FEATURE_EXT_transform_feedback
|
#if FEATURE_EXT_transform_feedback
|
||||||
case GL_PRIMITIVES_GENERATED:
|
case GL_PRIMITIVES_GENERATED:
|
||||||
if (ctx->Extensions.EXT_transform_feedback)
|
if (ctx->Extensions.EXT_transform_feedback)
|
||||||
|
@ -189,8 +184,7 @@ _mesa_GenQueriesARB(GLsizei n, GLuint *ids)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* No query objects can be active at this time! */
|
/* No query objects can be active at this time! */
|
||||||
if (ctx->Query.CurrentOcclusionObject ||
|
if (ctx->Query.CurrentOcclusionObject) {
|
||||||
ctx->Query.CurrentTimerObject) {
|
|
||||||
_mesa_error(ctx, GL_INVALID_OPERATION, "glGenQueriesARB");
|
_mesa_error(ctx, GL_INVALID_OPERATION, "glGenQueriesARB");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -229,8 +223,7 @@ _mesa_DeleteQueriesARB(GLsizei n, const GLuint *ids)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* No query objects can be active at this time! */
|
/* No query objects can be active at this time! */
|
||||||
if (ctx->Query.CurrentOcclusionObject ||
|
if (ctx->Query.CurrentOcclusionObject) {
|
||||||
ctx->Query.CurrentTimerObject) {
|
|
||||||
_mesa_error(ctx, GL_INVALID_OPERATION, "glDeleteQueriesARB");
|
_mesa_error(ctx, GL_INVALID_OPERATION, "glDeleteQueriesARB");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -488,88 +481,6 @@ _mesa_GetQueryObjectuivARB(GLuint id, GLenum pname, GLuint *params)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* New with GL_EXT_timer_query
|
|
||||||
*/
|
|
||||||
static void GLAPIENTRY
|
|
||||||
_mesa_GetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64EXT *params)
|
|
||||||
{
|
|
||||||
struct gl_query_object *q = NULL;
|
|
||||||
GET_CURRENT_CONTEXT(ctx);
|
|
||||||
ASSERT_OUTSIDE_BEGIN_END(ctx);
|
|
||||||
|
|
||||||
if (MESA_VERBOSE & VERBOSE_API)
|
|
||||||
_mesa_debug(ctx, "glGetQueryObjecti64v(%u, %s)\n", id,
|
|
||||||
_mesa_lookup_enum_by_nr(pname));
|
|
||||||
|
|
||||||
if (id)
|
|
||||||
q = _mesa_lookup_query_object(ctx, id);
|
|
||||||
|
|
||||||
if (!q || q->Active) {
|
|
||||||
_mesa_error(ctx, GL_INVALID_OPERATION,
|
|
||||||
"glGetQueryObjectui64vARB(id=%d is invalid or active)", id);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (pname) {
|
|
||||||
case GL_QUERY_RESULT_ARB:
|
|
||||||
if (!q->Ready)
|
|
||||||
ctx->Driver.WaitQuery(ctx, q);
|
|
||||||
*params = q->Result;
|
|
||||||
break;
|
|
||||||
case GL_QUERY_RESULT_AVAILABLE_ARB:
|
|
||||||
if (!q->Ready)
|
|
||||||
ctx->Driver.CheckQuery( ctx, q );
|
|
||||||
*params = q->Ready;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
_mesa_error(ctx, GL_INVALID_ENUM, "glGetQueryObjecti64vARB(pname)");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* New with GL_EXT_timer_query
|
|
||||||
*/
|
|
||||||
static void GLAPIENTRY
|
|
||||||
_mesa_GetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64EXT *params)
|
|
||||||
{
|
|
||||||
struct gl_query_object *q = NULL;
|
|
||||||
GET_CURRENT_CONTEXT(ctx);
|
|
||||||
ASSERT_OUTSIDE_BEGIN_END(ctx);
|
|
||||||
|
|
||||||
if (MESA_VERBOSE & VERBOSE_API)
|
|
||||||
_mesa_debug(ctx, "glGetQueryObjectui64v(%u, %s)\n", id,
|
|
||||||
_mesa_lookup_enum_by_nr(pname));
|
|
||||||
|
|
||||||
if (id)
|
|
||||||
q = _mesa_lookup_query_object(ctx, id);
|
|
||||||
|
|
||||||
if (!q || q->Active) {
|
|
||||||
_mesa_error(ctx, GL_INVALID_OPERATION,
|
|
||||||
"glGetQueryObjectuui64vARB(id=%d is invalid or active)", id);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (pname) {
|
|
||||||
case GL_QUERY_RESULT_ARB:
|
|
||||||
if (!q->Ready)
|
|
||||||
ctx->Driver.WaitQuery(ctx, q);
|
|
||||||
*params = q->Result;
|
|
||||||
break;
|
|
||||||
case GL_QUERY_RESULT_AVAILABLE_ARB:
|
|
||||||
if (!q->Ready)
|
|
||||||
ctx->Driver.CheckQuery( ctx, q );
|
|
||||||
*params = q->Ready;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
_mesa_error(ctx, GL_INVALID_ENUM, "glGetQueryObjectui64vARB(pname)");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_mesa_init_queryobj_dispatch(struct _glapi_table *disp)
|
_mesa_init_queryobj_dispatch(struct _glapi_table *disp)
|
||||||
{
|
{
|
||||||
|
@ -581,9 +492,6 @@ _mesa_init_queryobj_dispatch(struct _glapi_table *disp)
|
||||||
SET_GetQueryivARB(disp, _mesa_GetQueryivARB);
|
SET_GetQueryivARB(disp, _mesa_GetQueryivARB);
|
||||||
SET_GetQueryObjectivARB(disp, _mesa_GetQueryObjectivARB);
|
SET_GetQueryObjectivARB(disp, _mesa_GetQueryObjectivARB);
|
||||||
SET_GetQueryObjectuivARB(disp, _mesa_GetQueryObjectuivARB);
|
SET_GetQueryObjectuivARB(disp, _mesa_GetQueryObjectuivARB);
|
||||||
|
|
||||||
SET_GetQueryObjecti64vEXT(disp, _mesa_GetQueryObjecti64vEXT);
|
|
||||||
SET_GetQueryObjectui64vEXT(disp, _mesa_GetQueryObjectui64vEXT);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,62 +0,0 @@
|
||||||
/*
|
|
||||||
* Mesa 3-D graphics library
|
|
||||||
*
|
|
||||||
* Copyright (C) 2011 VMware, Inc. All Rights Reserved.
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
||||||
* copy of this software and associated documentation files (the "Software"),
|
|
||||||
* to deal in the Software without restriction, including without limitation
|
|
||||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
||||||
* and/or sell copies of the Software, and to permit persons to whom the
|
|
||||||
* Software is furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included
|
|
||||||
* in all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
||||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
||||||
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
|
||||||
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef SAMPLEROBJ_H
|
|
||||||
#define SAMPLEROBJ_H
|
|
||||||
|
|
||||||
struct dd_function_table;
|
|
||||||
|
|
||||||
static inline struct gl_sampler_object *
|
|
||||||
_mesa_get_samplerobj(struct gl_context *ctx, GLuint unit)
|
|
||||||
{
|
|
||||||
if (ctx->Texture.Unit[unit].Sampler)
|
|
||||||
return ctx->Texture.Unit[unit].Sampler;
|
|
||||||
else
|
|
||||||
return &ctx->Texture.Unit[unit]._Current->Sampler;
|
|
||||||
}
|
|
||||||
|
|
||||||
extern void
|
|
||||||
_mesa_reference_sampler_object(struct gl_context *ctx,
|
|
||||||
struct gl_sampler_object **ptr,
|
|
||||||
struct gl_sampler_object *samp);
|
|
||||||
|
|
||||||
extern void
|
|
||||||
_mesa_init_sampler_object(struct gl_sampler_object *sampObj, GLuint name);
|
|
||||||
|
|
||||||
extern struct gl_sampler_object *
|
|
||||||
_mesa_new_sampler_object(struct gl_context *ctx, GLuint name);
|
|
||||||
|
|
||||||
extern void
|
|
||||||
_mesa_delete_sampler_object(struct gl_context *ctx,
|
|
||||||
struct gl_sampler_object *sampObj);
|
|
||||||
|
|
||||||
extern void
|
|
||||||
_mesa_init_sampler_object_functions(struct dd_function_table *driver);
|
|
||||||
|
|
||||||
extern void
|
|
||||||
_mesa_init_sampler_object_dispatch(struct _glapi_table *disp);
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* SAMPLEROBJ_H */
|
|
|
@ -38,9 +38,6 @@
|
||||||
#include "shared.h"
|
#include "shared.h"
|
||||||
#include "program/program.h"
|
#include "program/program.h"
|
||||||
#include "dlist.h"
|
#include "dlist.h"
|
||||||
#if FEATURE_ARB_sampler_objects
|
|
||||||
#include "samplerobj.h"
|
|
||||||
#endif
|
|
||||||
#include "shaderobj.h"
|
#include "shaderobj.h"
|
||||||
#include "syncobj.h"
|
#include "syncobj.h"
|
||||||
|
|
||||||
|
@ -91,11 +88,6 @@ _mesa_alloc_shared_state(struct gl_context *ctx)
|
||||||
|
|
||||||
shared->BufferObjects = _mesa_NewHashTable();
|
shared->BufferObjects = _mesa_NewHashTable();
|
||||||
|
|
||||||
#if FEATURE_ARB_sampler_objects
|
|
||||||
/* GL_ARB_sampler_objects */
|
|
||||||
shared->SamplerObjects = _mesa_NewHashTable();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Allocate the default buffer object */
|
/* Allocate the default buffer object */
|
||||||
shared->NullBufferObj = ctx->Driver.NewBufferObject(ctx, 0, 0);
|
shared->NullBufferObj = ctx->Driver.NewBufferObject(ctx, 0, 0);
|
||||||
|
|
||||||
|
@ -276,20 +268,6 @@ delete_renderbuffer_cb(GLuint id, void *data, void *userData)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if FEATURE_ARB_sampler_objects
|
|
||||||
/**
|
|
||||||
* Callback for deleting a sampler object. Called by _mesa_HashDeleteAll()
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
delete_sampler_object_cb(GLuint id, void *data, void *userData)
|
|
||||||
{
|
|
||||||
struct gl_context *ctx = (struct gl_context *) userData;
|
|
||||||
struct gl_sampler_object *sampObj = (struct gl_sampler_object *) data;
|
|
||||||
_mesa_reference_sampler_object(ctx, &sampObj, NULL);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deallocate a shared state object and all children structures.
|
* Deallocate a shared state object and all children structures.
|
||||||
*
|
*
|
||||||
|
@ -361,11 +339,6 @@ free_shared_state(struct gl_context *ctx, struct gl_shared_state *shared)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if FEATURE_ARB_sampler_objects
|
|
||||||
_mesa_HashDeleteAll(shared->SamplerObjects, delete_sampler_object_cb, ctx);
|
|
||||||
_mesa_DeleteHashTable(shared->SamplerObjects);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Free texture objects (after FBOs since some textures might have
|
* Free texture objects (after FBOs since some textures might have
|
||||||
* been bound to FBOs).
|
* been bound to FBOs).
|
||||||
|
|
|
@ -204,24 +204,6 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat,
|
||||||
; /* fallthrough */
|
; /* fallthrough */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctx->Extensions.ARB_depth_texture) {
|
|
||||||
switch (internalFormat) {
|
|
||||||
case GL_DEPTH_COMPONENT:
|
|
||||||
case GL_DEPTH_COMPONENT24:
|
|
||||||
case GL_DEPTH_COMPONENT32:
|
|
||||||
RETURN_IF_SUPPORTED(MESA_FORMAT_Z32);
|
|
||||||
RETURN_IF_SUPPORTED(MESA_FORMAT_X8_Z24);
|
|
||||||
RETURN_IF_SUPPORTED(MESA_FORMAT_S8_Z24);
|
|
||||||
break;
|
|
||||||
case GL_DEPTH_COMPONENT16:
|
|
||||||
RETURN_IF_SUPPORTED(MESA_FORMAT_Z16);
|
|
||||||
RETURN_IF_SUPPORTED(MESA_FORMAT_X8_Z24);
|
|
||||||
RETURN_IF_SUPPORTED(MESA_FORMAT_S8_Z24);
|
|
||||||
default:
|
|
||||||
; /* fallthrough */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (internalFormat) {
|
switch (internalFormat) {
|
||||||
case GL_COMPRESSED_ALPHA_ARB:
|
case GL_COMPRESSED_ALPHA_ARB:
|
||||||
RETURN_IF_SUPPORTED(MESA_FORMAT_A8);
|
RETURN_IF_SUPPORTED(MESA_FORMAT_A8);
|
||||||
|
@ -853,15 +835,6 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctx->Extensions.ARB_texture_rgb10_a2ui) {
|
|
||||||
switch (internalFormat) {
|
|
||||||
case GL_RGB10_A2UI:
|
|
||||||
RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB2101010_UINT);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* GL_BGRA can be an internal format *only* in OpenGL ES (1.x or 2.0).
|
/* GL_BGRA can be an internal format *only* in OpenGL ES (1.x or 2.0).
|
||||||
*/
|
*/
|
||||||
if (ctx->API != API_OPENGL) {
|
if (ctx->API != API_OPENGL) {
|
||||||
|
|
|
@ -715,7 +715,7 @@ getteximage_error_check(struct gl_context *ctx, GLenum target, GLint level,
|
||||||
return GL_TRUE;
|
return GL_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ctx->Extensions.ARB_depth_texture && _mesa_is_depth_format(format)) {
|
if (_mesa_is_depth_format(format)) {
|
||||||
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexImage(format)");
|
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexImage(format)");
|
||||||
return GL_TRUE;
|
return GL_TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -139,18 +139,6 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctx->Extensions.ARB_depth_texture) {
|
|
||||||
switch (internalFormat) {
|
|
||||||
case GL_DEPTH_COMPONENT:
|
|
||||||
case GL_DEPTH_COMPONENT16:
|
|
||||||
case GL_DEPTH_COMPONENT24:
|
|
||||||
case GL_DEPTH_COMPONENT32:
|
|
||||||
return GL_DEPTH_COMPONENT;
|
|
||||||
default:
|
|
||||||
; /* fallthrough */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (internalFormat) {
|
switch (internalFormat) {
|
||||||
case GL_COMPRESSED_ALPHA:
|
case GL_COMPRESSED_ALPHA:
|
||||||
return GL_ALPHA;
|
return GL_ALPHA;
|
||||||
|
|
|
@ -142,12 +142,7 @@ _mesa_initialize_texture_object( struct gl_texture_object *obj,
|
||||||
obj->Sampler.MaxLod = 1000.0;
|
obj->Sampler.MaxLod = 1000.0;
|
||||||
obj->Sampler.LodBias = 0.0;
|
obj->Sampler.LodBias = 0.0;
|
||||||
obj->Sampler.MaxAnisotropy = 1.0;
|
obj->Sampler.MaxAnisotropy = 1.0;
|
||||||
obj->Sampler.CompareMode = GL_NONE; /* ARB_shadow */
|
|
||||||
obj->Sampler.CompareFunc = GL_LEQUAL; /* ARB_shadow */
|
|
||||||
obj->Sampler.CompareFailValue = 0.0F; /* ARB_shadow_ambient */
|
|
||||||
obj->Sampler.DepthMode = GL_LUMINANCE; /* ARB_depth_texture */
|
|
||||||
obj->Sampler.CubeMapSeamless = GL_FALSE;
|
obj->Sampler.CubeMapSeamless = GL_FALSE;
|
||||||
obj->Sampler.sRGBDecode = GL_DECODE_EXT;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -248,12 +243,7 @@ _mesa_copy_texture_object( struct gl_texture_object *dest,
|
||||||
dest->BaseLevel = src->BaseLevel;
|
dest->BaseLevel = src->BaseLevel;
|
||||||
dest->MaxLevel = src->MaxLevel;
|
dest->MaxLevel = src->MaxLevel;
|
||||||
dest->Sampler.MaxAnisotropy = src->Sampler.MaxAnisotropy;
|
dest->Sampler.MaxAnisotropy = src->Sampler.MaxAnisotropy;
|
||||||
dest->Sampler.CompareMode = src->Sampler.CompareMode;
|
|
||||||
dest->Sampler.CompareFunc = src->Sampler.CompareFunc;
|
|
||||||
dest->Sampler.CompareFailValue = src->Sampler.CompareFailValue;
|
|
||||||
dest->Sampler.CubeMapSeamless = src->Sampler.CubeMapSeamless;
|
dest->Sampler.CubeMapSeamless = src->Sampler.CubeMapSeamless;
|
||||||
dest->Sampler.DepthMode = src->Sampler.DepthMode;
|
|
||||||
dest->Sampler.sRGBDecode = src->Sampler.sRGBDecode;
|
|
||||||
dest->_MaxLevel = src->_MaxLevel;
|
dest->_MaxLevel = src->_MaxLevel;
|
||||||
dest->_MaxLambda = src->_MaxLambda;
|
dest->_MaxLambda = src->_MaxLambda;
|
||||||
dest->GenerateMipmap = src->GenerateMipmap;
|
dest->GenerateMipmap = src->GenerateMipmap;
|
||||||
|
|
|
@ -300,64 +300,6 @@ set_tex_parameteri(struct gl_context *ctx,
|
||||||
}
|
}
|
||||||
return GL_FALSE;
|
return GL_FALSE;
|
||||||
|
|
||||||
case GL_TEXTURE_COMPARE_MODE_ARB:
|
|
||||||
if (ctx->Extensions.ARB_shadow) {
|
|
||||||
if (texObj->Sampler.CompareMode == params[0])
|
|
||||||
return GL_FALSE;
|
|
||||||
if (params[0] == GL_NONE ||
|
|
||||||
params[0] == GL_COMPARE_R_TO_TEXTURE_ARB) {
|
|
||||||
flush(ctx);
|
|
||||||
texObj->Sampler.CompareMode = params[0];
|
|
||||||
return GL_TRUE;
|
|
||||||
}
|
|
||||||
goto invalid_param;
|
|
||||||
}
|
|
||||||
goto invalid_pname;
|
|
||||||
|
|
||||||
case GL_TEXTURE_COMPARE_FUNC_ARB:
|
|
||||||
if (ctx->Extensions.ARB_shadow) {
|
|
||||||
if (texObj->Sampler.CompareFunc == params[0])
|
|
||||||
return GL_FALSE;
|
|
||||||
switch (params[0]) {
|
|
||||||
case GL_LEQUAL:
|
|
||||||
case GL_GEQUAL:
|
|
||||||
flush(ctx);
|
|
||||||
texObj->Sampler.CompareFunc = params[0];
|
|
||||||
return GL_TRUE;
|
|
||||||
case GL_EQUAL:
|
|
||||||
case GL_NOTEQUAL:
|
|
||||||
case GL_LESS:
|
|
||||||
case GL_GREATER:
|
|
||||||
case GL_ALWAYS:
|
|
||||||
case GL_NEVER:
|
|
||||||
if (ctx->Extensions.EXT_shadow_funcs) {
|
|
||||||
flush(ctx);
|
|
||||||
texObj->Sampler.CompareFunc = params[0];
|
|
||||||
return GL_TRUE;
|
|
||||||
}
|
|
||||||
/* fall-through */
|
|
||||||
default:
|
|
||||||
goto invalid_param;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
goto invalid_pname;
|
|
||||||
|
|
||||||
case GL_DEPTH_TEXTURE_MODE_ARB:
|
|
||||||
if (ctx->Extensions.ARB_depth_texture) {
|
|
||||||
if (texObj->Sampler.DepthMode == params[0])
|
|
||||||
return GL_FALSE;
|
|
||||||
if (params[0] == GL_LUMINANCE ||
|
|
||||||
params[0] == GL_INTENSITY ||
|
|
||||||
params[0] == GL_ALPHA ||
|
|
||||||
(ctx->Extensions.ARB_texture_rg && params[0] == GL_RED)) {
|
|
||||||
flush(ctx);
|
|
||||||
texObj->Sampler.DepthMode = params[0];
|
|
||||||
return GL_TRUE;
|
|
||||||
}
|
|
||||||
goto invalid_param;
|
|
||||||
}
|
|
||||||
goto invalid_pname;
|
|
||||||
|
|
||||||
#if FEATURE_OES_draw_texture
|
#if FEATURE_OES_draw_texture
|
||||||
case GL_TEXTURE_CROP_RECT_OES:
|
case GL_TEXTURE_CROP_RECT_OES:
|
||||||
texObj->CropRect[0] = params[0];
|
texObj->CropRect[0] = params[0];
|
||||||
|
@ -367,19 +309,6 @@ set_tex_parameteri(struct gl_context *ctx,
|
||||||
return GL_TRUE;
|
return GL_TRUE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
case GL_TEXTURE_SRGB_DECODE_EXT:
|
|
||||||
if (ctx->Extensions.EXT_texture_sRGB_decode) {
|
|
||||||
GLenum decode = params[0];
|
|
||||||
if (decode == GL_DECODE_EXT || decode == GL_SKIP_DECODE_EXT) {
|
|
||||||
if (texObj->Sampler.sRGBDecode != decode) {
|
|
||||||
flush(ctx);
|
|
||||||
texObj->Sampler.sRGBDecode = decode;
|
|
||||||
}
|
|
||||||
return GL_TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
goto invalid_pname;
|
|
||||||
|
|
||||||
case GL_TEXTURE_CUBE_MAP_SEAMLESS:
|
case GL_TEXTURE_CUBE_MAP_SEAMLESS:
|
||||||
if (ctx->Extensions.AMD_seamless_cubemap_per_texture) {
|
if (ctx->Extensions.AMD_seamless_cubemap_per_texture) {
|
||||||
GLenum param = params[0];
|
GLenum param = params[0];
|
||||||
|
@ -461,20 +390,6 @@ set_tex_parameterf(struct gl_context *ctx,
|
||||||
}
|
}
|
||||||
return GL_FALSE;
|
return GL_FALSE;
|
||||||
|
|
||||||
case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB:
|
|
||||||
if (ctx->Extensions.ARB_shadow_ambient) {
|
|
||||||
if (texObj->Sampler.CompareFailValue != params[0]) {
|
|
||||||
flush(ctx);
|
|
||||||
texObj->Sampler.CompareFailValue = CLAMP(params[0], 0.0F, 1.0F);
|
|
||||||
return GL_TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
_mesa_error(ctx, GL_INVALID_ENUM,
|
|
||||||
"glTexParameter(pname=GL_TEXTURE_COMPARE_FAIL_VALUE_ARB)");
|
|
||||||
}
|
|
||||||
return GL_FALSE;
|
|
||||||
|
|
||||||
case GL_TEXTURE_LOD_BIAS:
|
case GL_TEXTURE_LOD_BIAS:
|
||||||
/* NOTE: this is really part of OpenGL 1.4, not EXT_texture_lod_bias */
|
/* NOTE: this is really part of OpenGL 1.4, not EXT_texture_lod_bias */
|
||||||
if (texObj->Sampler.LodBias != params[0]) {
|
if (texObj->Sampler.LodBias != params[0]) {
|
||||||
|
@ -531,7 +446,6 @@ _mesa_TexParameterf(GLenum target, GLenum pname, GLfloat param)
|
||||||
case GL_TEXTURE_COMPARE_MODE_ARB:
|
case GL_TEXTURE_COMPARE_MODE_ARB:
|
||||||
case GL_TEXTURE_COMPARE_FUNC_ARB:
|
case GL_TEXTURE_COMPARE_FUNC_ARB:
|
||||||
case GL_DEPTH_TEXTURE_MODE_ARB:
|
case GL_DEPTH_TEXTURE_MODE_ARB:
|
||||||
case GL_TEXTURE_SRGB_DECODE_EXT:
|
|
||||||
case GL_TEXTURE_CUBE_MAP_SEAMLESS:
|
case GL_TEXTURE_CUBE_MAP_SEAMLESS:
|
||||||
{
|
{
|
||||||
/* convert float param to int */
|
/* convert float param to int */
|
||||||
|
@ -592,7 +506,6 @@ _mesa_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params)
|
||||||
case GL_TEXTURE_COMPARE_MODE_ARB:
|
case GL_TEXTURE_COMPARE_MODE_ARB:
|
||||||
case GL_TEXTURE_COMPARE_FUNC_ARB:
|
case GL_TEXTURE_COMPARE_FUNC_ARB:
|
||||||
case GL_DEPTH_TEXTURE_MODE_ARB:
|
case GL_DEPTH_TEXTURE_MODE_ARB:
|
||||||
case GL_TEXTURE_SRGB_DECODE_EXT:
|
|
||||||
case GL_TEXTURE_CUBE_MAP_SEAMLESS:
|
case GL_TEXTURE_CUBE_MAP_SEAMLESS:
|
||||||
{
|
{
|
||||||
/* convert float param to int */
|
/* convert float param to int */
|
||||||
|
@ -924,11 +837,6 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level,
|
||||||
*params = 0;
|
*params = 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GL_TEXTURE_DEPTH_SIZE_ARB:
|
|
||||||
if (!ctx->Extensions.ARB_depth_texture)
|
|
||||||
goto invalid_pname;
|
|
||||||
*params = _mesa_get_format_bits(texFormat, pname);
|
|
||||||
break;
|
|
||||||
case GL_TEXTURE_STENCIL_SIZE_EXT:
|
case GL_TEXTURE_STENCIL_SIZE_EXT:
|
||||||
if (!ctx->Extensions.EXT_packed_depth_stencil &&
|
if (!ctx->Extensions.EXT_packed_depth_stencil &&
|
||||||
!ctx->Extensions.ARB_framebuffer_object)
|
!ctx->Extensions.ARB_framebuffer_object)
|
||||||
|
@ -1050,29 +958,9 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params )
|
||||||
goto invalid_pname;
|
goto invalid_pname;
|
||||||
*params = obj->Sampler.MaxAnisotropy;
|
*params = obj->Sampler.MaxAnisotropy;
|
||||||
break;
|
break;
|
||||||
case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB:
|
|
||||||
if (!ctx->Extensions.ARB_shadow_ambient)
|
|
||||||
goto invalid_pname;
|
|
||||||
*params = obj->Sampler.CompareFailValue;
|
|
||||||
break;
|
|
||||||
case GL_GENERATE_MIPMAP_SGIS:
|
case GL_GENERATE_MIPMAP_SGIS:
|
||||||
*params = (GLfloat) obj->GenerateMipmap;
|
*params = (GLfloat) obj->GenerateMipmap;
|
||||||
break;
|
break;
|
||||||
case GL_TEXTURE_COMPARE_MODE_ARB:
|
|
||||||
if (!ctx->Extensions.ARB_shadow)
|
|
||||||
goto invalid_pname;
|
|
||||||
*params = (GLfloat) obj->Sampler.CompareMode;
|
|
||||||
break;
|
|
||||||
case GL_TEXTURE_COMPARE_FUNC_ARB:
|
|
||||||
if (!ctx->Extensions.ARB_shadow)
|
|
||||||
goto invalid_pname;
|
|
||||||
*params = (GLfloat) obj->Sampler.CompareFunc;
|
|
||||||
break;
|
|
||||||
case GL_DEPTH_TEXTURE_MODE_ARB:
|
|
||||||
if (!ctx->Extensions.ARB_depth_texture)
|
|
||||||
goto invalid_pname;
|
|
||||||
*params = (GLfloat) obj->Sampler.DepthMode;
|
|
||||||
break;
|
|
||||||
case GL_TEXTURE_LOD_BIAS:
|
case GL_TEXTURE_LOD_BIAS:
|
||||||
*params = obj->Sampler.LodBias;
|
*params = obj->Sampler.LodBias;
|
||||||
break;
|
break;
|
||||||
|
@ -1175,29 +1063,9 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params )
|
||||||
goto invalid_pname;
|
goto invalid_pname;
|
||||||
*params = (GLint) obj->Sampler.MaxAnisotropy;
|
*params = (GLint) obj->Sampler.MaxAnisotropy;
|
||||||
break;
|
break;
|
||||||
case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB:
|
|
||||||
if (!ctx->Extensions.ARB_shadow_ambient)
|
|
||||||
goto invalid_pname;
|
|
||||||
*params = (GLint) FLOAT_TO_INT(obj->Sampler.CompareFailValue);
|
|
||||||
break;
|
|
||||||
case GL_GENERATE_MIPMAP_SGIS:
|
case GL_GENERATE_MIPMAP_SGIS:
|
||||||
*params = (GLint) obj->GenerateMipmap;
|
*params = (GLint) obj->GenerateMipmap;
|
||||||
break;
|
break;
|
||||||
case GL_TEXTURE_COMPARE_MODE_ARB:
|
|
||||||
if (!ctx->Extensions.ARB_shadow)
|
|
||||||
goto invalid_pname;
|
|
||||||
*params = (GLint) obj->Sampler.CompareMode;
|
|
||||||
break;
|
|
||||||
case GL_TEXTURE_COMPARE_FUNC_ARB:
|
|
||||||
if (!ctx->Extensions.ARB_shadow)
|
|
||||||
goto invalid_pname;
|
|
||||||
*params = (GLint) obj->Sampler.CompareFunc;
|
|
||||||
break;
|
|
||||||
case GL_DEPTH_TEXTURE_MODE_ARB:
|
|
||||||
if (!ctx->Extensions.ARB_depth_texture)
|
|
||||||
goto invalid_pname;
|
|
||||||
*params = (GLint) obj->Sampler.DepthMode;
|
|
||||||
break;
|
|
||||||
case GL_TEXTURE_LOD_BIAS:
|
case GL_TEXTURE_LOD_BIAS:
|
||||||
*params = (GLint) obj->Sampler.LodBias;
|
*params = (GLint) obj->Sampler.LodBias;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -402,9 +402,6 @@ update_tex_combine(struct gl_context *ctx, struct gl_texture_unit *texUnit)
|
||||||
const struct gl_texture_object *texObj = texUnit->_Current;
|
const struct gl_texture_object *texObj = texUnit->_Current;
|
||||||
GLenum format = texObj->Image[0][texObj->BaseLevel]->_BaseFormat;
|
GLenum format = texObj->Image[0][texObj->BaseLevel]->_BaseFormat;
|
||||||
|
|
||||||
if (format == GL_DEPTH_COMPONENT || format == GL_DEPTH_STENCIL_EXT) {
|
|
||||||
format = texObj->Sampler.DepthMode;
|
|
||||||
}
|
|
||||||
calculate_derived_texenv(&texUnit->_EnvMode, texUnit->EnvMode, format);
|
calculate_derived_texenv(&texUnit->_EnvMode, texUnit->EnvMode, format);
|
||||||
texUnit->_CurrentCombine = & texUnit->_EnvMode;
|
texUnit->_CurrentCombine = & texUnit->_EnvMode;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4012,61 +4012,6 @@ _mesa_texstore_z32f_x24s8(TEXSTORE_PARAMS)
|
||||||
return GL_TRUE;
|
return GL_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GLboolean
|
|
||||||
_mesa_texstore_argb2101010_uint(TEXSTORE_PARAMS)
|
|
||||||
{
|
|
||||||
const GLenum baseFormat = _mesa_get_format_base_format(dstFormat);
|
|
||||||
|
|
||||||
ASSERT(dstFormat == MESA_FORMAT_ARGB2101010_UINT);
|
|
||||||
ASSERT(_mesa_get_format_bytes(dstFormat) == 4);
|
|
||||||
|
|
||||||
if (!srcPacking->SwapBytes &&
|
|
||||||
dstFormat == MESA_FORMAT_ARGB2101010_UINT &&
|
|
||||||
srcFormat == GL_BGRA_INTEGER_EXT &&
|
|
||||||
srcType == GL_UNSIGNED_INT_2_10_10_10_REV &&
|
|
||||||
baseInternalFormat == GL_RGBA) {
|
|
||||||
/* simple memcpy path */
|
|
||||||
memcpy_texture(ctx, dims,
|
|
||||||
dstFormat,
|
|
||||||
dstRowStride, dstSlices,
|
|
||||||
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
|
|
||||||
srcAddr, srcPacking);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
/* general path */
|
|
||||||
const GLuint *tempImage = make_temp_uint_image(ctx, dims,
|
|
||||||
baseInternalFormat,
|
|
||||||
baseFormat,
|
|
||||||
srcWidth, srcHeight,
|
|
||||||
srcDepth, srcFormat,
|
|
||||||
srcType, srcAddr,
|
|
||||||
srcPacking);
|
|
||||||
const GLuint *src = tempImage;
|
|
||||||
GLint img, row, col;
|
|
||||||
if (!tempImage)
|
|
||||||
return GL_FALSE;
|
|
||||||
for (img = 0; img < srcDepth; img++) {
|
|
||||||
GLubyte *dstRow = dstSlices[img];
|
|
||||||
|
|
||||||
for (row = 0; row < srcHeight; row++) {
|
|
||||||
GLuint *dstUI = (GLuint *) dstRow;
|
|
||||||
for (col = 0; col < srcWidth; col++) {
|
|
||||||
GLushort a,r,g,b;
|
|
||||||
r = src[RCOMP];
|
|
||||||
g = src[GCOMP];
|
|
||||||
b = src[BCOMP];
|
|
||||||
a = src[ACOMP];
|
|
||||||
dstUI[col] = (a << 30) | (r << 20) | (g << 10) | (b);
|
|
||||||
src += 4;
|
|
||||||
}
|
|
||||||
dstRow += dstRowStride;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
free((void *) tempImage);
|
|
||||||
}
|
|
||||||
return GL_TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static GLboolean
|
static GLboolean
|
||||||
_mesa_texstore_null(TEXSTORE_PARAMS)
|
_mesa_texstore_null(TEXSTORE_PARAMS)
|
||||||
{
|
{
|
||||||
|
@ -4257,7 +4202,6 @@ _mesa_get_texstore_func(gl_format format)
|
||||||
table[MESA_FORMAT_RGB_UINT32] = _mesa_texstore_rgba_uint32;
|
table[MESA_FORMAT_RGB_UINT32] = _mesa_texstore_rgba_uint32;
|
||||||
table[MESA_FORMAT_RGBA_UINT32] = _mesa_texstore_rgba_uint32;
|
table[MESA_FORMAT_RGBA_UINT32] = _mesa_texstore_rgba_uint32;
|
||||||
|
|
||||||
table[MESA_FORMAT_ARGB2101010_UINT] = _mesa_texstore_argb2101010_uint;
|
|
||||||
initialized = GL_TRUE;
|
initialized = GL_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -90,8 +90,6 @@ compute_version(struct gl_context *ctx)
|
||||||
ctx->Extensions.ARB_texture_env_combine &&
|
ctx->Extensions.ARB_texture_env_combine &&
|
||||||
ctx->Extensions.ARB_texture_env_dot3);
|
ctx->Extensions.ARB_texture_env_dot3);
|
||||||
const GLboolean ver_1_4 = (ver_1_3 &&
|
const GLboolean ver_1_4 = (ver_1_3 &&
|
||||||
ctx->Extensions.ARB_depth_texture &&
|
|
||||||
ctx->Extensions.ARB_shadow &&
|
|
||||||
ctx->Extensions.ARB_texture_env_crossbar &&
|
ctx->Extensions.ARB_texture_env_crossbar &&
|
||||||
ctx->Extensions.ARB_window_pos &&
|
ctx->Extensions.ARB_window_pos &&
|
||||||
ctx->Extensions.EXT_blend_color &&
|
ctx->Extensions.EXT_blend_color &&
|
||||||
|
@ -168,10 +166,7 @@ compute_version(struct gl_context *ctx)
|
||||||
ctx->Extensions.ARB_blend_func_extended &&
|
ctx->Extensions.ARB_blend_func_extended &&
|
||||||
ctx->Extensions.ARB_explicit_attrib_location &&
|
ctx->Extensions.ARB_explicit_attrib_location &&
|
||||||
ctx->Extensions.ARB_instanced_arrays &&
|
ctx->Extensions.ARB_instanced_arrays &&
|
||||||
ctx->Extensions.ARB_occlusion_query2 &&
|
ctx->Extensions.ARB_occlusion_query2);
|
||||||
ctx->Extensions.ARB_sampler_objects &&
|
|
||||||
ctx->Extensions.ARB_texture_rgb10_a2ui &&
|
|
||||||
ctx->Extensions.ARB_timer_query);
|
|
||||||
|
|
||||||
if (ver_3_3) {
|
if (ver_3_3) {
|
||||||
major = 3;
|
major = 3;
|
||||||
|
|
|
@ -573,20 +573,6 @@ _mesa_fetch_state(struct gl_context *ctx, const gl_state_index state[],
|
||||||
value[3] = ctx->Pixel.AlphaBias;
|
value[3] = ctx->Pixel.AlphaBias;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case STATE_SHADOW_AMBIENT:
|
|
||||||
{
|
|
||||||
const int unit = (int) state[2];
|
|
||||||
const struct gl_texture_object *texObj
|
|
||||||
= ctx->Texture.Unit[unit]._Current;
|
|
||||||
if (texObj) {
|
|
||||||
value[0] =
|
|
||||||
value[1] =
|
|
||||||
value[2] =
|
|
||||||
value[3] = texObj->Sampler.CompareFailValue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
|
|
||||||
case STATE_FB_SIZE:
|
case STATE_FB_SIZE:
|
||||||
value[0] = (GLfloat) (ctx->DrawBuffer->Width - 1);
|
value[0] = (GLfloat) (ctx->DrawBuffer->Width - 1);
|
||||||
value[1] = (GLfloat) (ctx->DrawBuffer->Height - 1);
|
value[1] = (GLfloat) (ctx->DrawBuffer->Height - 1);
|
||||||
|
|
|
@ -1077,12 +1077,6 @@ texfetch_funcs[MESA_FORMAT_COUNT] =
|
||||||
fetch_texel_1d_z32f_x24s8,
|
fetch_texel_1d_z32f_x24s8,
|
||||||
fetch_texel_2d_z32f_x24s8,
|
fetch_texel_2d_z32f_x24s8,
|
||||||
fetch_texel_3d_z32f_x24s8
|
fetch_texel_3d_z32f_x24s8
|
||||||
},
|
|
||||||
{
|
|
||||||
MESA_FORMAT_ARGB2101010_UINT,
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
NULL
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1126,8 +1120,7 @@ set_fetch_functions(struct swrast_texture_image *texImage, GLuint dims)
|
||||||
|
|
||||||
ASSERT(dims == 1 || dims == 2 || dims == 3);
|
ASSERT(dims == 1 || dims == 2 || dims == 3);
|
||||||
|
|
||||||
if (texImage->Base.TexObject->Sampler.sRGBDecode == GL_SKIP_DECODE_EXT &&
|
if (_mesa_get_format_color_encoding(format) == GL_SRGB) {
|
||||||
_mesa_get_format_color_encoding(format) == GL_SRGB) {
|
|
||||||
format = _mesa_get_srgb_format_linear(format);
|
format = _mesa_get_srgb_format_linear(format);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3384,203 +3384,6 @@ shadow_compare4(GLenum function, GLfloat coord,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Choose the mipmap level to use when sampling from a depth texture.
|
|
||||||
*/
|
|
||||||
static int
|
|
||||||
choose_depth_texture_level(const struct gl_texture_object *tObj, GLfloat lambda)
|
|
||||||
{
|
|
||||||
GLint level;
|
|
||||||
|
|
||||||
if (tObj->Sampler.MinFilter == GL_NEAREST || tObj->Sampler.MinFilter == GL_LINEAR) {
|
|
||||||
/* no mipmapping - use base level */
|
|
||||||
level = tObj->BaseLevel;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
/* choose mipmap level */
|
|
||||||
lambda = CLAMP(lambda, tObj->Sampler.MinLod, tObj->Sampler.MaxLod);
|
|
||||||
level = (GLint) lambda;
|
|
||||||
level = CLAMP(level, tObj->BaseLevel, tObj->_MaxLevel);
|
|
||||||
}
|
|
||||||
|
|
||||||
return level;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sample a shadow/depth texture. This function is incomplete. It doesn't
|
|
||||||
* check for minification vs. magnification, etc.
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
sample_depth_texture( struct gl_context *ctx,
|
|
||||||
const struct gl_texture_object *tObj, GLuint n,
|
|
||||||
const GLfloat texcoords[][4], const GLfloat lambda[],
|
|
||||||
GLfloat texel[][4] )
|
|
||||||
{
|
|
||||||
const GLint level = choose_depth_texture_level(tObj, lambda[0]);
|
|
||||||
const struct gl_texture_image *img = tObj->Image[0][level];
|
|
||||||
const struct swrast_texture_image *swImg = swrast_texture_image_const(img);
|
|
||||||
const GLint width = img->Width;
|
|
||||||
const GLint height = img->Height;
|
|
||||||
const GLint depth = img->Depth;
|
|
||||||
const GLuint compare_coord = (tObj->Target == GL_TEXTURE_2D_ARRAY_EXT)
|
|
||||||
? 3 : 2;
|
|
||||||
GLfloat ambient;
|
|
||||||
GLenum function;
|
|
||||||
GLfloat result;
|
|
||||||
|
|
||||||
ASSERT(img->_BaseFormat == GL_DEPTH_COMPONENT ||
|
|
||||||
img->_BaseFormat == GL_DEPTH_STENCIL_EXT);
|
|
||||||
|
|
||||||
ASSERT(tObj->Target == GL_TEXTURE_1D ||
|
|
||||||
tObj->Target == GL_TEXTURE_2D ||
|
|
||||||
tObj->Target == GL_TEXTURE_RECTANGLE_NV ||
|
|
||||||
tObj->Target == GL_TEXTURE_1D_ARRAY_EXT ||
|
|
||||||
tObj->Target == GL_TEXTURE_2D_ARRAY_EXT ||
|
|
||||||
tObj->Target == GL_TEXTURE_CUBE_MAP);
|
|
||||||
|
|
||||||
ambient = tObj->Sampler.CompareFailValue;
|
|
||||||
|
|
||||||
/* XXXX if tObj->Sampler.MinFilter != tObj->Sampler.MagFilter, we're ignoring lambda */
|
|
||||||
|
|
||||||
function = (tObj->Sampler.CompareMode == GL_COMPARE_R_TO_TEXTURE_ARB) ?
|
|
||||||
tObj->Sampler.CompareFunc : GL_NONE;
|
|
||||||
|
|
||||||
if (tObj->Sampler.MagFilter == GL_NEAREST) {
|
|
||||||
GLuint i;
|
|
||||||
for (i = 0; i < n; i++) {
|
|
||||||
GLfloat depthSample, depthRef;
|
|
||||||
GLint col, row, slice;
|
|
||||||
|
|
||||||
nearest_texcoord(tObj, level, texcoords[i], &col, &row, &slice);
|
|
||||||
|
|
||||||
if (col >= 0 && row >= 0 && col < width && row < height &&
|
|
||||||
slice >= 0 && slice < depth) {
|
|
||||||
swImg->FetchTexel(swImg, col, row, slice, &depthSample);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
depthSample = tObj->Sampler.BorderColor.f[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
depthRef = CLAMP(texcoords[i][compare_coord], 0.0F, 1.0F);
|
|
||||||
|
|
||||||
result = shadow_compare(function, depthRef, depthSample, ambient);
|
|
||||||
|
|
||||||
switch (tObj->Sampler.DepthMode) {
|
|
||||||
case GL_LUMINANCE:
|
|
||||||
ASSIGN_4V(texel[i], result, result, result, 1.0F);
|
|
||||||
break;
|
|
||||||
case GL_INTENSITY:
|
|
||||||
ASSIGN_4V(texel[i], result, result, result, result);
|
|
||||||
break;
|
|
||||||
case GL_ALPHA:
|
|
||||||
ASSIGN_4V(texel[i], 0.0F, 0.0F, 0.0F, result);
|
|
||||||
break;
|
|
||||||
case GL_RED:
|
|
||||||
ASSIGN_4V(texel[i], result, 0.0F, 0.0F, 1.0F);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
_mesa_problem(ctx, "Bad depth texture mode");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
GLuint i;
|
|
||||||
ASSERT(tObj->Sampler.MagFilter == GL_LINEAR);
|
|
||||||
for (i = 0; i < n; i++) {
|
|
||||||
GLfloat depth00, depth01, depth10, depth11, depthRef;
|
|
||||||
GLint i0, i1, j0, j1;
|
|
||||||
GLint slice;
|
|
||||||
GLfloat wi, wj;
|
|
||||||
GLuint useBorderTexel;
|
|
||||||
|
|
||||||
linear_texcoord(tObj, level, texcoords[i], &i0, &i1, &j0, &j1, &slice,
|
|
||||||
&wi, &wj);
|
|
||||||
|
|
||||||
useBorderTexel = 0;
|
|
||||||
if (img->Border) {
|
|
||||||
i0 += img->Border;
|
|
||||||
i1 += img->Border;
|
|
||||||
if (tObj->Target != GL_TEXTURE_1D_ARRAY_EXT) {
|
|
||||||
j0 += img->Border;
|
|
||||||
j1 += img->Border;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (i0 < 0 || i0 >= (GLint) width) useBorderTexel |= I0BIT;
|
|
||||||
if (i1 < 0 || i1 >= (GLint) width) useBorderTexel |= I1BIT;
|
|
||||||
if (j0 < 0 || j0 >= (GLint) height) useBorderTexel |= J0BIT;
|
|
||||||
if (j1 < 0 || j1 >= (GLint) height) useBorderTexel |= J1BIT;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (slice < 0 || slice >= (GLint) depth) {
|
|
||||||
depth00 = tObj->Sampler.BorderColor.f[0];
|
|
||||||
depth01 = tObj->Sampler.BorderColor.f[0];
|
|
||||||
depth10 = tObj->Sampler.BorderColor.f[0];
|
|
||||||
depth11 = tObj->Sampler.BorderColor.f[0];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
/* get four depth samples from the texture */
|
|
||||||
if (useBorderTexel & (I0BIT | J0BIT)) {
|
|
||||||
depth00 = tObj->Sampler.BorderColor.f[0];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
swImg->FetchTexel(swImg, i0, j0, slice, &depth00);
|
|
||||||
}
|
|
||||||
if (useBorderTexel & (I1BIT | J0BIT)) {
|
|
||||||
depth10 = tObj->Sampler.BorderColor.f[0];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
swImg->FetchTexel(swImg, i1, j0, slice, &depth10);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tObj->Target != GL_TEXTURE_1D_ARRAY_EXT) {
|
|
||||||
if (useBorderTexel & (I0BIT | J1BIT)) {
|
|
||||||
depth01 = tObj->Sampler.BorderColor.f[0];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
swImg->FetchTexel(swImg, i0, j1, slice, &depth01);
|
|
||||||
}
|
|
||||||
if (useBorderTexel & (I1BIT | J1BIT)) {
|
|
||||||
depth11 = tObj->Sampler.BorderColor.f[0];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
swImg->FetchTexel(swImg, i1, j1, slice, &depth11);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
depth01 = depth00;
|
|
||||||
depth11 = depth10;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
depthRef = CLAMP(texcoords[i][compare_coord], 0.0F, 1.0F);
|
|
||||||
|
|
||||||
result = shadow_compare4(function, depthRef,
|
|
||||||
depth00, depth01, depth10, depth11,
|
|
||||||
ambient, wi, wj);
|
|
||||||
|
|
||||||
switch (tObj->Sampler.DepthMode) {
|
|
||||||
case GL_LUMINANCE:
|
|
||||||
ASSIGN_4V(texel[i], result, result, result, 1.0F);
|
|
||||||
break;
|
|
||||||
case GL_INTENSITY:
|
|
||||||
ASSIGN_4V(texel[i], result, result, result, result);
|
|
||||||
break;
|
|
||||||
case GL_ALPHA:
|
|
||||||
ASSIGN_4V(texel[i], 0.0F, 0.0F, 0.0F, result);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
_mesa_problem(ctx, "Bad depth texture mode");
|
|
||||||
}
|
|
||||||
|
|
||||||
} /* for */
|
|
||||||
} /* if filter */
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* We use this function when a texture object is in an "incomplete" state.
|
* We use this function when a texture object is in an "incomplete" state.
|
||||||
* When a fragment program attempts to sample an incomplete texture we
|
* When a fragment program attempts to sample an incomplete texture we
|
||||||
|
@ -3620,14 +3423,10 @@ _swrast_choose_texture_sample_func( struct gl_context *ctx,
|
||||||
else {
|
else {
|
||||||
const GLboolean needLambda =
|
const GLboolean needLambda =
|
||||||
(GLboolean) (t->Sampler.MinFilter != t->Sampler.MagFilter);
|
(GLboolean) (t->Sampler.MinFilter != t->Sampler.MagFilter);
|
||||||
const GLenum format = t->Image[0][t->BaseLevel]->_BaseFormat;
|
|
||||||
|
|
||||||
switch (t->Target) {
|
switch (t->Target) {
|
||||||
case GL_TEXTURE_1D:
|
case GL_TEXTURE_1D:
|
||||||
if (format == GL_DEPTH_COMPONENT || format == GL_DEPTH_STENCIL_EXT) {
|
if (needLambda) {
|
||||||
return &sample_depth_texture;
|
|
||||||
}
|
|
||||||
else if (needLambda) {
|
|
||||||
return &sample_lambda_1d;
|
return &sample_lambda_1d;
|
||||||
}
|
}
|
||||||
else if (t->Sampler.MinFilter == GL_LINEAR) {
|
else if (t->Sampler.MinFilter == GL_LINEAR) {
|
||||||
|
@ -3638,10 +3437,7 @@ _swrast_choose_texture_sample_func( struct gl_context *ctx,
|
||||||
return &sample_nearest_1d;
|
return &sample_nearest_1d;
|
||||||
}
|
}
|
||||||
case GL_TEXTURE_2D:
|
case GL_TEXTURE_2D:
|
||||||
if (format == GL_DEPTH_COMPONENT || format == GL_DEPTH_STENCIL_EXT) {
|
if (needLambda) {
|
||||||
return &sample_depth_texture;
|
|
||||||
}
|
|
||||||
else if (needLambda) {
|
|
||||||
/* Anisotropic filtering extension. Activated only if mipmaps are used */
|
/* Anisotropic filtering extension. Activated only if mipmaps are used */
|
||||||
if (t->Sampler.MaxAnisotropy > 1.0 &&
|
if (t->Sampler.MaxAnisotropy > 1.0 &&
|
||||||
t->Sampler.MinFilter == GL_LINEAR_MIPMAP_LINEAR) {
|
t->Sampler.MinFilter == GL_LINEAR_MIPMAP_LINEAR) {
|
||||||
|
@ -3685,10 +3481,7 @@ _swrast_choose_texture_sample_func( struct gl_context *ctx,
|
||||||
return &sample_nearest_3d;
|
return &sample_nearest_3d;
|
||||||
}
|
}
|
||||||
case GL_TEXTURE_CUBE_MAP:
|
case GL_TEXTURE_CUBE_MAP:
|
||||||
if (format == GL_DEPTH_COMPONENT || format == GL_DEPTH_STENCIL_EXT) {
|
if (needLambda) {
|
||||||
return &sample_depth_texture;
|
|
||||||
}
|
|
||||||
else if (needLambda) {
|
|
||||||
return &sample_lambda_cube;
|
return &sample_lambda_cube;
|
||||||
}
|
}
|
||||||
else if (t->Sampler.MinFilter == GL_LINEAR) {
|
else if (t->Sampler.MinFilter == GL_LINEAR) {
|
||||||
|
@ -3699,10 +3492,7 @@ _swrast_choose_texture_sample_func( struct gl_context *ctx,
|
||||||
return &sample_nearest_cube;
|
return &sample_nearest_cube;
|
||||||
}
|
}
|
||||||
case GL_TEXTURE_RECTANGLE_NV:
|
case GL_TEXTURE_RECTANGLE_NV:
|
||||||
if (format == GL_DEPTH_COMPONENT || format == GL_DEPTH_STENCIL_EXT) {
|
if (needLambda) {
|
||||||
return &sample_depth_texture;
|
|
||||||
}
|
|
||||||
else if (needLambda) {
|
|
||||||
return &sample_lambda_rect;
|
return &sample_lambda_rect;
|
||||||
}
|
}
|
||||||
else if (t->Sampler.MinFilter == GL_LINEAR) {
|
else if (t->Sampler.MinFilter == GL_LINEAR) {
|
||||||
|
@ -3713,10 +3503,7 @@ _swrast_choose_texture_sample_func( struct gl_context *ctx,
|
||||||
return &sample_nearest_rect;
|
return &sample_nearest_rect;
|
||||||
}
|
}
|
||||||
case GL_TEXTURE_1D_ARRAY_EXT:
|
case GL_TEXTURE_1D_ARRAY_EXT:
|
||||||
if (format == GL_DEPTH_COMPONENT || format == GL_DEPTH_STENCIL_EXT) {
|
if (needLambda) {
|
||||||
return &sample_depth_texture;
|
|
||||||
}
|
|
||||||
else if (needLambda) {
|
|
||||||
return &sample_lambda_1d_array;
|
return &sample_lambda_1d_array;
|
||||||
}
|
}
|
||||||
else if (t->Sampler.MinFilter == GL_LINEAR) {
|
else if (t->Sampler.MinFilter == GL_LINEAR) {
|
||||||
|
@ -3727,10 +3514,7 @@ _swrast_choose_texture_sample_func( struct gl_context *ctx,
|
||||||
return &sample_nearest_1d_array;
|
return &sample_nearest_1d_array;
|
||||||
}
|
}
|
||||||
case GL_TEXTURE_2D_ARRAY_EXT:
|
case GL_TEXTURE_2D_ARRAY_EXT:
|
||||||
if (format == GL_DEPTH_COMPONENT || format == GL_DEPTH_STENCIL_EXT) {
|
if (needLambda) {
|
||||||
return &sample_depth_texture;
|
|
||||||
}
|
|
||||||
else if (needLambda) {
|
|
||||||
return &sample_lambda_2d_array;
|
return &sample_lambda_2d_array;
|
||||||
}
|
}
|
||||||
else if (t->Sampler.MinFilter == GL_LINEAR) {
|
else if (t->Sampler.MinFilter == GL_LINEAR) {
|
||||||
|
|
Loading…
Reference in a new issue