summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* mesa: silence uninitialized var warningBrian Paul2011-11-101-1/+1
|
* radeon: silence unused var warningsBrian Paul2011-11-101-3/+3
|
* radeon: fix tex1d-border2dDave Airlie2011-11-101-31/+33
| | | | | | Fixes pigit test with T wrap usage. Signed-off-by: Dave Airlie <[email protected]>
* radeon: fix 3-coordinate swtcl emissionDave Airlie2011-11-101-0/+8
| | | | | | This fixes mipmap generation on swtcl rv100. Signed-off-by: Dave Airlie <[email protected]>
* swrast: Add support for glReadPixels() to integer types.Eric Anholt2011-11-091-6/+13
| | | | | | | With this change, i965 passes GL_EXT_texture_integer/fbo_integer_precision_clear Reviewed-by: Kenneth Graunke <[email protected]>
* 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]>
* meta: Add support for glClear() to integer color buffers.Eric Anholt2011-11-091-4/+109
| | | | | | | | | | This requires using a new fragment shader to get the integer color output, and a new vertex shader because #version has to match between the two. v2: Clarify that there's no need for BindFragDataLocation. Reviewed-by: Kenneth Graunke <[email protected]> (v1)
* i965: Claim to support rendering to integer FBOs.Eric Anholt2011-11-092-1/+13
| | | | | | | | | | | | We're missing support for the software paths still, but basic rendering is working. v2: Override RGB_INT32/UINT32 to not be renderable, since the hardware can't do it but we do allow texturing from it now. Drop the DataType override, since the _mesa_problem() isn't in that path any more. Reviewed-by: Kenneth Graunke <[email protected]> (v1)
* i965/fs: Add support for user-defined out variables.Eric Anholt2011-11-092-35/+39
| | | | | | | | | | | | Before, I was tracking the ir_variable * found for gl_FragColor or gl_FragData[]. Instead, when visiting those variables, set up an array of per-render-target fs_regs to copy the output data from. This cleans up the color emit path, while making handling of multiple user-defined out variables easier. v2: incorporate idr's feedback about ir->location (changes by Kenneth Graunke) Reviewed-by: Kenneth Graunke <[email protected]>
* i965/fs: Preserve the source register type when doing color writes.Eric Anholt2011-11-091-4/+7
| | | | | | | When rendering to integer color buffers, we need to be careful to use MRFs of the correct type when emitting color writes. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Make brw_type_for_base_type return the element type for arrays.Eric Anholt2011-11-091-0/+1
| | | | | | | | | | | | | | | | Previously, brw_type_for_base_type returned UD for array variables, similar to structures. For structures, each field may have a different type, so every field access must explicitly override the register's type with that field's type. We chose to return UD in this case since it was the least common, so errors would be more obvious. For arrays, it makes far more sense to return the type corresponding to an element of the array. This allows normal array access to work without the hassle of explicitly overriding the register's type. This should obsolete a bunch of type overrides throughout the code. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Enable ChooseTexFormat for supported GL_EXT_texture_integer formats.Eric Anholt2011-11-091-0/+30
| | | | | | | v2: s/GL_TRUE/true/, and re-enable RGB_INT32 based on discussion yesterday about required RB formats vs texture formats. Reviewed-by: Kenneth Graunke <[email protected]> (v1)
* i965: Add mapping from MESA_FORMAT to BRW_SURFACEFORMAT for integer.Eric Anholt2011-11-091-0/+24
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* intel: Expose GL_EXT_texture_integer when GL 3.0 override is set.Eric Anholt2011-11-091-0/+10
| | | | | | | This will let the feature be incrementally developed, hidden behind the flag we're all using as we work on GL 3.0 support. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Add support for 16-bit unorm L, A, and I textures.Eric Anholt2011-11-092-1/+8
| | | | | | | | | | | | While not required by any particular spec version, mplayer was asking for L16 and hoping for actual L16 without checking. The 8 bits allocated led to 10-bit planar video data stored in the lower 10 bits giving only 2 bits of precision in video. While it was an amusing effect, give them what they actually wanted instead. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41461 Reviewed-by: Kenneth Graunke <[email protected]>
* intel: Don't _mesa_problem when asked for an RB of a texturing-only type.Eric Anholt2011-11-092-2/+11
| | | | | | | | We want to be able to support some formats for texturing that we can't render to, which means that some choices for RenderbufferStorage end up being incomplete (for example, L8 currently). For these, where we don't render to them, we don't want to have to make up an rb->DataType that's only used for GetRow()/PutRow().
* r200: remove dangling radeon.h symlink.Paul Berry2011-11-091-1/+0
| | | | | | | | | | | | Commit 1401b96b (radeon: cleanup radeon shared code after r300 and r600 classic drivers removal) removed the file src/mesa/drivers/dri/radeon/server/radeon.h, but it left behind the symlink which was used to share that file into the src/mesa/drivers/dri/r200/server directory. This patch removes the dangling symlink. Reviewed-by: Alex Deucher <[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-0915-22/+117
| | | | | Probably a several places missing, but enough to cover all headers (in)directly included by uniform_query.cpp, and fix the MSVC build.
* scons: Don't list m_xform.c twice.José Fonseca2011-11-091-5/+0
|
* 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]>
* st/mesa: Fix memory leak on error path.Vinson Lee2011-11-071-1/+3
| | | | | | Fixes Coverity resource leak defect. Reviewed-by: José Fonseca <[email protected]>
* mesa: remove prog_uniform.c from SConscriptBrian Paul2011-11-071-1/+0
|
* Delete code made dead by previous uniform related patchesIan Romanick2011-11-0711-727/+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-079-251/+515
| | | | | | | | | | | | | | | | | | | | | 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]>
* i965: Move _mesa_ir_link_shader call before device-specific linkingIan Romanick2011-11-071-3/+3
| | | | | | | | | | | | | | | _mesa_ir_link_shader needs to be called before cloning the IR tree so that the var->location field for uniforms is set. WARNING: This change breaks several integer division related piglit tests. The tests break because _mesa_ir_link_shader lowers integer division to an RCP followed by a MUL. The fix is to factor out more of the code from ir_to_mesa so that _mesa_ir_link_shader does not need to be called at all by the i965 driver. This will be the subject of several follow-on patches. 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]>
* ir_to_mesa: Add _mesa_associate_uniform_storageIan Romanick2011-11-072-0/+76
| | | | | | | | Connects all of the gl_program_parameter structures with the correct gl_uniform_storage structures. 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: Add string_to_uint_map::clear method to clear the mapIan Romanick2011-11-071-0/+8
| | | | | 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: fix comment typo in intel_renderbufferBrian Paul2011-11-071-1/+1
|
* intel: update intel_texture_image commentBrian Paul2011-11-071-1/+1
|
* intel: wrap comment and fix typoBrian Paul2011-11-071-2/+2
|
* st/mesa: first implementation of Map/UnmapRenderbuffer()Brian Paul2011-11-072-0/+61
| | | | Untested, but also unused at this point.
* xlib: implement renderbuffer mapping/unmappingBrian Paul2011-11-074-5/+167
| | | | | | | | This fixes the glReadPixels() regression for reading from the front/back color buffers. Note, we only allow one mapping of an XImage/Pixmap renderbuffer at any time. That might need to be revisited in the future.
* 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.