summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* mesa: Add missing check for glUniform*v count > 1 on non-arrayIan Romanick2011-11-071-0/+9
| | | | | Signed-off-by: Ian Romanick <[email protected]> Tested-by: Tom Stellard <[email protected]>
* mesa: Rewrite the way uniforms are tracked and handledIan Romanick2011-11-075-220/+464
| | | | | | | | | | | | | | | | | | | | | Switch all of the code in ir_to_mesa, st_glsl_to_tgsi, glUniform*, glGetUniform, glGetUniformLocation, and glGetActiveUniforms to use the gl_uniform_storage structures in the gl_shader_program. A couple of notes: * Like most rewrite-the-world patches, this should be reviewed by applying the patch and examining the modified functions. * This leaves a lot of dead code around in linker.cpp and uniform_query.cpp. This will be deleted in the next patches. v2: Update the comment block (previously a FINISHME) in _mesa_uniform about generating GL_INVALID_VALUE when an out-of-range sampler index is specified. Signed-off-by: Ian Romanick <[email protected]> Tested-by: Tom Stellard <[email protected]>
* mesa: Add log_uniform and log_program_parameters to dump dataIan Romanick2011-11-071-0/+72
| | | | | | | | These were both useful debugging aids while developing this code. log_uniform will be used to keep the MESA_GLSL=uniform behavior. Signed-off-by: Ian Romanick <[email protected]> Tested-by: Tom Stellard <[email protected]>
* mesa: Add _mesa_uniform_{attach,detach_all}_driver_storage functionsIan Romanick2011-11-073-0/+59
| | | | | | | | These functions are used to create and destroy the connections between a uniform and the storage used by the driver to hold its value. Signed-off-by: Ian Romanick <[email protected]> Tested-by: Tom Stellard <[email protected]>
* mesa: Add _mesa_propagate_uniforms_to_driver_storageIan Romanick2011-11-072-0/+122
| | | | | | | | This function propagates the values from the backing storage of a gl_uniform_storage structure to the driver supplied data locations. Signed-off-by: Ian Romanick <[email protected]> Tested-by: Tom Stellard <[email protected]>
* mesa: Add structures for "new style" uniform tracking in shader programsIan Romanick2011-11-071-0/+25
| | | | | Signed-off-by: Ian Romanick <[email protected]> Tested-by: Tom Stellard <[email protected]>
* mesa: Move most of uniforms.c to uniform_query.cppIan Romanick2011-11-072-967/+945
| | | | | Signed-off-by: Ian Romanick <[email protected]> Tested-by: Tom Stellard <[email protected]>
* mesa: Refactor parameter validate for GetUniform, Uniform, and UniformMatrixIan Romanick2011-11-071-52/+99
| | | | | | | | v2: Update a comment block about the different treatment of location=-1 based on feedback from Ken. Signed-off-by: Ian Romanick <[email protected]> Tested-by: Tom Stellard <[email protected]>
* mesa: Move {split,merge}_location_offset to uniforms.hIan Romanick2011-11-072-55/+57
| | | | | | | | | | | | | | | | | Prepend _mesa_uniform_ to the names and rework the calling convention. The calling convention was changed for a couple reasons. 1. Having a single variable named 'location' have completely different meanings at different places in the function is confusing. Before calling split_location_offset the location is the encoded value returned by glGetUniformLocation. After calling split_location_offset it's the index of the uniform in the gl_uniform_list::Uniforms array. 2. In a later commit the original value of 'location' is needed after split_location_offset has been called. Signed-off-by: Ian Romanick <[email protected]> Tested-by: Tom Stellard <[email protected]>
* mesa: Make get_uniform available outside compilation unitIan Romanick2011-11-072-7/+11
| | | | | | | Also rename to _mesa_get_uniform. Signed-off-by: Ian Romanick <[email protected]> Tested-by: Tom Stellard <[email protected]>
* mesa: Move the link check from _mesa_get_uniform_location to ↵Ian Romanick2011-11-071-5/+11
| | | | | | | | | | _mesa_GetUniformLocationARB There are cases where we might want to internally query the location of a uniform in a shader that failed linking. Signed-off-by: Ian Romanick <[email protected]> Tested-by: Tom Stellard <[email protected]>
* mesa: Fix error generation for glClearBuffer{i ui}v with GL_DEPTH or GL_STENCILIan Romanick2011-11-071-0/+84
| | | | | | | | | | | | | | | | | | | | The spec says "Only ClearBufferiv should be used to clear stencil buffers." and "Only ClearBufferfv should be used to clear depth buffers." However, on the following page it also says: "The result of ClearBuffer is undefined if no conversion between the type of the specified value and the type of the buffer being cleared is defined (for example, if ClearBufferiv is called for a fixed- or floating-point buffer, or if ClearBufferfv is called for a signed or unsigned integer buffer). *This is not an error.*" Emphasis mine. Fixes problems with piglit's clearbuffer-invalid-drawbuffer test. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: fix the selection of soft renderbuffer color formatsBrian Paul2011-11-071-7/+17
| | | | | | | | | | | | | | This fixes a regression from the recent glReadPixels changes found with the piglit hiz tests. Use either MESA_FORMAT_RGBA8888 or MESA_FORMAT_RGBA8888_REV for color buffers depending on endian-ness. Before, the gl_renderbuffer::Format field was MESA_FORMAT_RGBA8888 but the data was really stored as MESA_FORMAT_RGBA8888_REV when using a little endian machine. Getting this right matters now that we can access renderbuffer data without going through the span functions (namely glReadPixels() + MapRenderbuffer()).
* mesa: remove unneeded soft renderbuffer format-setting codeBrian Paul2011-11-071-16/+0
| | | | | | | | These vars will just get overwritten when we call _mesa_add_renderbuffer() anyway. We only need to set the InternalFormat field when we create the software renderbuffer. Reviewed-by: Eric Anholt <[email protected]>
* mesa: check for immutable texture in _mesa_test_texobj_completeness()Brian Paul2011-11-071-4/+9
| | | | | | One of the points of GL_ARB_texture_storage is to make it impossible to have malformed mipmap stacks. If we know the texture object is immutable, we can skip a bunch of size checking.
* mesa: add missing checks to compute_versionMarek Olšák2011-11-071-0/+5
| | | | | Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add a function for comparing gl_format to format/type.Eric Anholt2011-11-032-0/+321
| | | | | | | | | | This should be useful in making more generic fast paths in the pixel paths. v2: Add note about PACK_SWAP_BYTES, and fix up for endianness by synchronizing with memcpy_texture paths in texstore.c. Reviewed-by: Brian Paul <[email protected]>
* swrast: Make the packed depth/stencil read fastpath use MapRenderbuffer.Eric Anholt2011-11-032-0/+39
| | | | | | | | | | | This also makes it handle 24/8 vs 8/24, fixing piglit depthstencil-default_fb-readpixels-24_8 on i965. While here, avoid incorrectly fast-pathing if packing->SwapBytes is set. v2: Move the unpack code to format_unpack.c, fix BUFFER_DEPTH typo v3: Fix signed/unsigned comparison. Reviewed-by: Brian Paul <[email protected]>
* swrast: Directly map the stencil buffer in read_stencil_pixels.Eric Anholt2011-11-032-0/+62
| | | | | | | | | | | This avoids going through the wrapper that has to rewrite the data for packed depth/stencil. This isn't done in _swrast_read_stencil_span because we don't want to map/unmap for each span. v2: Move the unpack code to format_unpack.c. v3: Fix signed/unsigned comparison. Reviewed-by: Brian Paul <[email protected]>
* texgetimage: add missing return on errornobled2011-11-031-0/+1
| | | | | | | | | | Missed this back in the arb_robustness branch <6b329b9274b18c50f4177eef7ee087d50ebc1525>. NOTE: This is a candidate for the 7.11 branch. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: add support for GL_OES_EGL_image_externalChia-I Wu2011-11-0315-17/+103
| | | | | | | | | This is an OpenGL ES specific extension. External textures are textures that may be sampled from, but not be updated (no glTexSubImage* and etc.). The image data are taken from an EGLImage. Reviewed-by: Brian Paul <[email protected]> Acked-by: Jakob Bornecrantz <[email protected]>
* mesa: clean up validate_texture_wrap_modeChia-I Wu2011-11-031-15/+27
| | | | | | | | GL_TEXTURE_RECTANGLE_NV (and soon GL_TEXTURE_EXTERNAL_OES) is special. Handle it in its own if-block. There should be no functional change. Reviewed-by: Brian Paul <[email protected]> Acked-by: Jakob Bornecrantz <[email protected]>
* mesa: fix a logic error in glFramebufferTexture2DChia-I Wu2011-11-031-1/+1
| | | | | | | Unrecognized texture target should give an error. Reviewed-by: Brian Paul <[email protected]> Acked-by: Jakob Bornecrantz <[email protected]>
* mesa: add GL_OES_EGL_image_external to the extension listChia-I Wu2011-11-032-0/+2
| | | | | Reviewed-by: Brian Paul <[email protected]> Acked-by: Jakob Bornecrantz <[email protected]>
* mesa: add missing defines for GL_OES_EGL_image_externalChia-I Wu2011-11-031-0/+8
| | | | | Reviewed-by: Brian Paul <[email protected]> Acked-by: Jakob Bornecrantz <[email protected]>
* mesa, i965: prepare for more than 8 texture targetsChia-I Wu2011-11-031-1/+1
| | | | | | | | | 3-bit fields are used store texture target in several places. That will fail when TEXTURE_EXTERNAL_INDEX, which happends to be the 9th texture target, is added. Make them 4-bit fields. Reviewed-by: Brian Paul <[email protected]> Acked-by: Jakob Bornecrantz <[email protected]>
* glapi: regenerate filesChia-I Wu2011-11-031-1178/+1190
|
* mesa: fix the low limit of width and height for glRenderbufferStorageYuanhan Liu2011-11-031-2/+2
| | | | | | | | | | | | glRenderbufferStorage man page says: GL_INVALID_VALUE is generated if either of width or height is negative, or greater than the value of GL_MAX_RENDERBUFFER_SIZE. NOTE: this is a candidate for the 7.11 branch Signed-off-by: Yuanhan Liu <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: fix inital value for new renderbufferYuanhan Liu2011-11-031-1/+1
| | | | | | | | | | | | | EXT_framebuffer_object bspec says: Get Value Type Get Command Initial Value ------------------------------- ------ ----------- ----------- RENDERBUFFER_INTERNAL_FORMAT_EXT Z+ GetRenderbufferParameterivEXT RGBA NOTE: this is a candidate for the 7.11 branch Signed-off-by: Yuanhan Liu <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: complete the GL_TEXTURE_SWIZZLE* setupYuanhan Liu2011-11-031-0/+27
| | | | | | | | | | | | | | | | | | | | | The ARB_texture_swizzle spec says: The error INVALID_OPERATION is generated if TexParameteri, TexParameterf, TexParameteriv, or TexParameterfv, parameter <pname> is TEXTURE_SWIZZLE_R, TEXTURE_SWIZZLE_G, TEXTURE_SWIZZLE_B, or TEXTURE_SWIZZLE_A, and <param> is not RED, GREEN, BLUE, ALPHA, ZERO, or ONE. The error INVALID_OPERATION is generated if TexParameteriv, or TexParameterfv, parameter <pname> TEXTURE_SWIZZLE_RGBA, and the four consecutive values pointed to by <param> are not all RED, GREEN, BLUE, ALPHA, ZERO, or ONE. So, the GL_TEXTURE_SWIZZLE* pname is legal for glTexParameterf(v) NOTE: this is a candidate for the 7.11 branch Signed-off-by: Yuanhan Liu <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: remove the redundant checkYuanhan Liu2011-11-031-6/+5
| | | | | Signed-off-by: Yuanhan Liu <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Set the "Integer" field of gl_client_array properly.Paul Berry2011-11-022-0/+2
| | | | | | | | | | | This patch ensures that gl_client_array::Integer is properly set to GL_TRUE for vertex attributes specified using glVertexAttribIPointer, and to GL_FALSE for vertex attributes specified using glVertexAttribPointer, so that the vertex attributes can be interpreted properly by driver back-ends. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Make unpack_uint_z_row return 32 bits of data.Eric Anholt2011-11-011-25/+10
| | | | | | | | | Some of the return values were u32, some were 24 bits, and z16 returned 16 bits. The caller would have to do all the work of interpreting the format all over again. However, there are no callers of this function at this point. Reviewed-by: Brian Paul <[email protected]>
* Add MapRenderbuffer implementations for software drivers.Eric Anholt2011-11-012-0/+39
| | | | | | | | | | Mesa core's is generic for things like osmesa. For swrast_dri.so, we have to do Y flipping. The front-buffer path isn't actually tested, though, because both before and after it fails with a BadMatch in XGetImage. Reviewed-by: Brian Paul <[email protected]>
* mesa: Add a driver hook for mapping renderbuffers.Eric Anholt2011-11-011-0/+9
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: make save_EndConditionalRender param list (void) to silence warningBrian Paul2011-11-011-1/+1
|
* mesa: Fix memory leak in out-of-memory path.Vinson Lee2011-11-011-0/+1
| | | | Fixes Coverity resource leak defect.
* mesa: Add NV_fog_distance to the fixed-function vertex program generatorNicholas Miell2011-11-011-4/+39
| | | | | This is all that is needed to implement NV_fog_distance on programmable hardware.
* mesa: Add the basics for the NV_fog_distance extensionNicholas Miell2011-11-014-0/+22
| | | | No driver implements it yet.
* mesa: add note about immutable textures for _mesa_test_texobj_completeness()Brian Paul2011-10-311-0/+4
|
* swrast: implement GL_ARB_texture_storageBrian Paul2011-10-311-0/+1
|
* mesa: plug in dispatch functions for GL_ARB_texture_storageBrian Paul2011-10-311-0/+9
|
* mesa: init extension entry for GL_ARB_texture_storageBrian Paul2011-10-311-0/+1
|
* mesa: display list dispatch for GL_ARB_texture_storageBrian Paul2011-10-311-0/+9
|
* mesa: new glTexImage error checks for GL_ARB_texture_storageBrian Paul2011-10-311-0/+34
| | | | | If the texture memory was allocated with glTexStorage1/2/3D() we can only change the image data with glTexSubImage calls.
* mesa: glGetTexParameter support for GL_ARB_texture_storageBrian Paul2011-10-311-0/+12
|
* mesa: implement new functions for GL_ARB_texture_storageBrian Paul2011-10-312-0/+463
| | | | | This is the glTexStorage1D/2D/3D() functions. Basically do error checking then call the driver hook to actually allocate memory.
* glapi: regenerated API files for GL_ARB_texture_storageBrian Paul2011-10-313-5079/+5196
|
* mesa: add new driver hook for AllocTextureStorage()Brian Paul2011-10-311-0/+9
|
* mesa: add new fields for GL_ARB_texture_storageBrian Paul2011-10-311-0/+2
|