summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
Commit message (Collapse)AuthorAgeFilesLines
* st/mesa: check renderbuffer orientation in st_MapRenderbuffer()Brian Paul2011-11-151-5/+27
| | | | | | | We'll soon be able to use these for a core Mesa implementation of glReadPixels. Acked-by: Eric Anholt <[email protected]>
* mesa: replace GLstencil with GLubyteBrian Paul2011-11-151-1/+1
|
* glsl: Remove resource count checks from ir_to_mesa and st_glsl_to_tgsiIan Romanick2011-11-141-51/+0
| | | | | | | These checks are now performed by the linker. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* st/mesa: fix system value to semantic mappingChristoph Bumiller2011-11-142-0/+2
| | | | | Broken by addition of SYSTEM_VALUE_VERTEX_ID in 919c53e87a1f6f5322bc1f1486bb3e6b954b00d5.
* mesa/st: Flush stdout after pritingin the GLSL.José Fonseca2011-11-141-0/+1
| | | | Otherwise it gets all garbled with stderr.
* state_tracker: remove written but never used variable.Mathias Fröhlich2011-11-111-2/+0
|
* st/mesa: fix OOM failure in bitmap codeBrian Paul2011-11-111-5/+10
|
* 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]>
* Delete code made dead by previous uniform related patchesIan Romanick2011-11-072-2/+0
| | | | | Signed-off-by: Ian Romanick <[email protected]> Tested-by: Tom Stellard <[email protected]>
* mesa: Rewrite the way uniforms are tracked and handledIan Romanick2011-11-072-6/+17
| | | | | | | | | | | | | | | | | | | | | 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]>
* st/mesa: first implementation of Map/UnmapRenderbuffer()Brian Paul2011-11-072-0/+61
| | | | Untested, but also unused at this point.
* st/mesa: clean-up st_translate_interp()Brian Paul2011-11-071-3/+7
|
* st/mesa: add some null pointer checking to better handle out of memoryBrian Paul2011-11-073-10/+61
| | | | Reviewed-by: José Fonseca <[email protected]>
* st/mesa: fix memory leaksMorgan Armand2011-11-071-2/+2
| | | | Signed-off-by: Brian Paul <[email protected]>
* st/mesa: fix indentationMorgan Armand2011-11-072-9/+8
| | | | Signed-off-by: Brian Paul <[email protected]>
* st/mesa: set geometry shader to NULL when doing internal drawingMarek Olšák2011-11-045-1/+17
| | | | | | | The code expects the geometry shader to be NULL. We don't have geometry shaders now, but it's good to be prepared. v2: check for support in the cso context
* mesa/st: Be nice with the stack -- use malloc for large structures/arrays.José Fonseca2011-11-041-12/+40
| | | | | st_translate_program's data was taking 51K off the stack, causing stack overflow on Windows.
* st/mesa: add support for GL_OES_EGL_image_externalChia-I Wu2011-11-035-0/+9
| | | | | | | To pipe drivers, external textures are just 2D textures. Reviewed-by: Brian Paul <[email protected]> Acked-by: Jakob Bornecrantz <[email protected]>
* st/mesa: Enable NV_fog_distance for Gallium driversNicholas Miell2011-11-011-0/+1
| | | | | The fixed-function generated vertex program is all that's needed for Gallium drivers.
* st/mesa: implement GL_ARB_texture_storageBrian Paul2011-10-312-0/+63
|
* mesa/st: get interpolation mode from the fragment shader.Dave Airlie2011-10-291-1/+15
| | | | | | | | | With the recent changes to interpolation stuff, we can now get the value direct from the program instead of just being fail. fixes some of the glsl-1.30 interpolation tests with softpipe Signed-off-by: Dave Airlie <[email protected]>
* mesa: Expose GLSL interpolation qualifiers in gl_fragment_program.Paul Berry2011-10-271-1/+1
| | | | | | | | | | | | | | | | | This patch makes GLSL interpolation qualifiers visible to drivers via the array InterpQualifier[] in gl_fragment_program, so that they can easily be used by driver back-ends to select the correct interpolation mode. Previous to this patch, the GLSL compiler was using the enum ir_variable_interpolation to represent interpolation types. Rather than make a duplicate enum in core mesa to represent the same thing, I moved the enum into mtypes.h and renamed it to be more consistent with the other enums defined there. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* st/mesa: tell VBO module to always unmap buffers before drawingBrian Paul2011-10-261-0/+4
| | | | | | Without this it's possible to wind up in a draw call with the glBegin/End VBO still in a mapped state. This is a problem for the SVGA3D driver and probably not good for other HW drivers.
* mesa: Fold gallium's texture border stripping into a core Mesa option.Eric Anholt2011-10-262-55/+5
| | | | | | | | | We wanted to reuse this in the Intel driver. v2: Move the flag to ctx->Const Reviewed-by: Kenneth Graunke <[email protected]> (v1) Reviewed-by: Brian Paul <[email protected]>
* glsl: Add uniform_locations_assigned parameter to do_dead_code opt passIan Romanick2011-10-251-1/+3
| | | | | | | | | | | | | | | | | Setting this flag prevents declarations of uniforms from being removed from the IR. Since the IR is directly used by several API functions that query uniforms in shaders, uniform declarations cannot be removed after the locations have been set. However, it should still be safe to reorder the declarations (this is not tested). Signed-off-by: Ian Romanick <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41980 Tested-by: Brian Paul <[email protected]> Reviewed-by: Bryan Cain <[email protected]> Cc: Vinson Lee <[email protected]> Cc: José Fonseca <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Yuanhan Liu <[email protected]>
* st/mesa: fix a bug in and re-org setup_interleaved_attribs()Brian Paul2011-10-211-31/+76
| | | | | | | | | | | | | | | | | | | | | | | | | We were mis-computing the size of the user-space vertex buffer in some circumstances. This led to a failed assertion at u_inlines.h:222 when using the VMware svga driver. For example, if we had arrays such as: array[0]: element_offset = 12, stride = 24 array[1]: element_offset = 0, stride = 24 We'd mistakenly compute 'bytes' to be 12 bytes too small. I've reorganized the function too. By time it's called, we know that we've got interleaved arrays either all in one VBO or all in user memory and the stride is equal for all arrays. Move the code that lived inside the attr==0 test after the loop. In the loop we compute the true vertex size. That size factors into the pipe->redefine_user_buffer() call later. Using the vertex size instead of array[0]'s element_offset fixes the failed assertion. Reviewed-by: José Fonseca <[email protected]>
* st/mesa: Initialize variable.Vinson Lee2011-10-201-0/+2
| | | | | | | | ptr is uninitialized if ib is NULL. Fixes Coverity uninitialized pointer read defect. Reviewed-by: Jakob Bornecrantz <[email protected]>
* st/mesa: remove primitive restart assertionBrian Paul2011-10-191-6/+4
| | | | Reviewed-by: Jakob Bornecrantz <[email protected]>
* st/mesa: Don't have indices buffers map when calling drawJakob Bornecrantz2011-10-191-22/+31
|
* st/mesa: Implement primitive restart in softwareJakob Bornecrantz2011-10-193-3/+132
|
* mesa/st: Backport WPOS adjustment fixes from st_mesa_to_tgsi.c to ↵José Fonseca2011-10-191-51/+83
| | | | | | | | | st_glsl_to_tgsi.cpp. This is a trivial verbatim copy of the code from Christoph Bumiller's commit f986a6560f3ee9a79b89e9409e3a9ac52b53315c. Fixes fdo 39939 and 39942.
* glsl_to_tgsi: Use _mesa_generate_parameters_list_for_uniformsIan Romanick2011-10-181-117/+2
| | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Bryan Cain <[email protected]>
* ir_to_mesa: Move some things outside the 'extern "C"' blocksIan Romanick2011-10-181-3/+4
| | | | | | | | | | | Having a few of these includes or forward declarations inside the 'extern "C"' block can cause problems later. Specifically, it prevents C++ linkage functions from being added to ir_to_mesa.h and makes G++ angry if 'struct foo' is seen both inside and outside an 'extern "C"'. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* st/mesa: kill instruction if writemask=0 in eliminate_dead_code_advanced()Brian Paul2011-10-131-1/+1
| | | | | | | | This fixes a bug where we'd wind up emitting an invalid instruction like MOVE R[0]., R[1]; - note the empty/zero writemask. If we don't write to any dest register channels, cull the instruction. v2: simply change/fix the existing test for instruction culling.
* gallium: rename ZS stencil type to UINT (v2)Dave Airlie2011-10-116-53/+53
| | | | | | | | | | these are never USCALED, always UINT in reality. taken from some work by Christoph Bumiller v2: fixup formatting of table + tabs Signed-off-by: Dave Airlie <[email protected]>
* mesa/st: Check for a NULL _LinkedShader[i] before using it.Stéphane Marchesin2011-10-101-1/+2
| | | | | | The rest of the linker/glsl translation code checks for NULL, so I suppose we should check here too. Fixes crash on exit with i915g instanced drawing. Reviewed-by: Ian Romanick <[email protected]>
* st/mesa: add readpixel integer supportDave Airlie2011-10-081-2/+38
| | | | | | This adds support for readpixels integer paths, it deals with the signed/unsigned crossovers. Signed-off-by: Dave Airlie <[email protected]>
* st/mesa: add support for int type conversionDave Airlie2011-10-081-67/+386
| | | | | | | This adds the various mesa->gallium and gallium->mesa format conversions along with the GL->gallium texture choosers for integers. Signed-off-by: Dave Airlie <[email protected]>
* mesa: Simplify calling Driver.ProgramStringNotify after previous refactorsIan Romanick2011-10-071-33/+11
| | | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Simplify destroy_shader_program_variants_cb after previous refactorsIan Romanick2011-10-071-6/+3
| | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Use gl_shader_program::_LinkedShaders instead of FragmentProgramIan Romanick2011-10-072-4/+4
| | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Use gl_shader_program::_LinkedShaders instead of GeometryProgramIan Romanick2011-10-072-4/+4
| | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Use gl_shader_program::_LinkedShaders instead of VertexProgramIan Romanick2011-10-072-4/+4
| | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* st/mesa: fix commentBrian Paul2011-10-051-1/+1
|
* st/mesa: don't use gl_texture_image::RowStrideBrian Paul2011-10-051-5/+7
| | | | It's always the same as the texture width.
* st/mesa: completely stop using gl_texture_image::DataBrian Paul2011-10-052-14/+19
| | | | | Instead, use the new st_texture_image::TexData field to hold texture images that don't fit the parent object's mipmap buffer.
* st/mesa: stop using gl_texture_image::Data when mapping/unmapping texturesBrian Paul2011-10-052-33/+35
| | | | | | | Since core Mesa no longer depends on gl_texture_image::Data pointing to mapped texture buffers we don't have to mess with it all over the place in the state tracker. Now Data is only used to point to malloc'd memory that holds images which don't fit in the texture object's mipmap buffer.
* mesa: get rid of imageOffsets arrays in texstore codeBrian Paul2011-10-052-9/+4
| | | | | | | | | | | These were used to find the start of a 3D image slice (or 2D array texture slice) given a base address. Instead, use a simple array of address of image slices instead. This is a step toward getting rid of the gl_texture_image::ImageOffsets field. Reviewed-by: Eric Anholt <[email protected]>
* mesa: Remove unused gl_program::AttributesIan Romanick2011-10-041-11/+0
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Remove ARB_draw_buffers extension enable flagIan Romanick2011-10-041-4/+0
| | | | | | | | | | | | | All drivers in Mesa have supported this extension for eons. This extension is an optional features in desktop OpenGL (via GL_ARB_draw_buffers) and OpenGL ES 2.x (via GL_NV_draw_buffers). The extension is not usable in OpenGL ES 1.x. There is no glDrawBuffers* entry point in OpenGL ES 1.x contexts, and glGet*v generate errors when MAX_DRAW_BUFFERS or DRAW_BUFFERi is queried. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>