summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* mesa: move CEILING() macro into macros.hBrian Paul2011-11-153-7/+5
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove unused macros in macros.hBrian Paul2011-11-151-26/+0
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: consolidate cases in _mesa_components_in_format()Brian Paul2011-11-151-28/+12
| | | | | | and _mesa_sizeof_packed_type() Reviewed-by: Eric Anholt <[email protected]>
* mesa: move swrast ReadPixels code into core MesaBrian Paul2011-11-152-0/+493
| | | | | | | | The swrast ReadPixels code has no dependencies on swrast since moving to Map/UnmapRenderbuffer(). We'll be able to remove s_readpix.c and remove the state tracker's glReadPixels code next. Acked-by: Eric Anholt <[email protected]>
* mesa: remove support for software alpha buffersBrian Paul2011-11-152-376/+0
| | | | | | | | This was only used by the xlib driver to add an alpha channel to the front/window color buffer. This was no longer going to work well with the move to direct mapping of renderbuffers. Reviewed-by: Eric Anholt <[email protected]>
* mesa: replace GLstencil with GLubyteBrian Paul2011-11-155-33/+12
|
* linker: Count the number of uniform components used by a shader during linkingIan Romanick2011-11-141-0/+7
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* linker: Count the number of samplers used by a shader during linkingIan Romanick2011-11-141-0/+3
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Fix glFramebufferTexture*() for depth and stencil attachmentsChad Versace2011-11-111-3/+55
| | | | | | | | | | | | | | | | | | | | | | | This patch solves three bugs. 1. When a texture was attached to the GL_DEPTH_STENCIL_ATTACHMENT point, Mesa attached the texture only to the depth attachment point gl_framebuffer::Attachment[BUFFER_DEPTH] and failed to attach it to the stencil attachment point gl_framebuffer::Attachment[BUFFER_STENCIL] 2. When a texture was attached to the GL_DEPTH_ATTACHMENT point and then later attached to the GL_STENCIL_ATTACHMENT point, Mesa created two separate renderbuffer wrappers. This caused a GL error in glGetFramebufferAttachmentParameteriv(). 3. Same as 2, but with depth and stencil juxtaposed. Fixes Piglit test ARB_framebuffer_object/same-attachment-glFramebufferTexture2D-GL_DEPTH_STENCIL Note: This is a candidate for the stable branches. Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* mesa: Make gl_VertexID be a system value like gl_InstanceID.Eric Anholt2011-11-111-0/+1
| | | | Reviewed-by: Ian Romanick <[email protected]>
* mesa: replace api_noop.[ch] with vbo_noop.[ch]Brian Paul2011-11-112-1150/+0
| | | | | | None of the code in api_noop.c was used anymore. The new vbo_noop.c functions are true no-ops. They'll be used to no-op glBegin/End functions when we run out of VBO memory.
* mesa: remove ancient, unused gl_free_control_points prototoypeBrian Paul2011-11-111-4/+0
|
* mesa: silence uninitialized var warningBrian Paul2011-11-101-1/+1
|
* mesa: Add support for unpacking 32-bit integer formats to int spans.Eric Anholt2011-11-092-0/+128
| | | | | | | | | This is the inverse operation to _mesa_pack_rgba_span_int. The 16-bit code isn't done because of lack of testing and not being sure how sign extension/clamping should be handled between, say, 16-bit int and 32-bit int or uint. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Assign transform feedback varying slots in linker.Paul Berry2011-11-091-0/+13
| | | | | | | | | | | | | | | | | | | | This patch modifies the GLSL linker to assign additional slots for varying variables used by transform feedback, and record the varying slots used by transform feedback for use by the driver back-end. This required modifying assign_varying_locations() so that it assigns a varying location if either (a) the varying is used by the next stage of the GL pipeline, or (b) the varying is required by transform feedback. In order to avoid duplicating the code to assign a single varying location, I moved it into its own function, assign_varying_location(). In addition, to support transform feedback in the case where there is no fragment shader, it is now possible to call assign_varying_locations() with a consumer of NULL. Reviewed-by: Marek Olšák <[email protected]> Tested-by: Marek Olšák <[email protected]>
* mesa,glsl,mapi: Put extern "C" { ... } where appropriate.José Fonseca2011-11-0910-11/+75
| | | | | Probably a several places missing, but enough to cover all headers (in)directly included by uniform_query.cpp, and fix the MSVC build.
* mesa: fix signed/unsigned integer comparison warningsBrian Paul2011-11-082-5/+9
| | | | Reviewed-by: Ian Romanick <[email protected]>
* mesa: Implement glGetFragDataLocationIan Romanick2011-11-082-20/+56
| | | | | | | | Fixes piglit's getfragdatalocation test. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* linker: Use app-specified fragment data location during linkingIan Romanick2011-11-083-1/+16
| | | | | | | | Fixes piglit's bindfragdata-link-error. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Stub implementation of glBindFragDataLocationIan Romanick2011-11-082-18/+37
| | | | | | | | | | This just validates the input parameters so far. Fixes piglit's bindfragdata-invalid-parameters test. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* Delete code made dead by previous uniform related patchesIan Romanick2011-11-075-535/+0
| | | | | Signed-off-by: Ian Romanick <[email protected]> Tested-by: Tom Stellard <[email protected]>
* 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]>