summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
Commit message (Collapse)AuthorAgeFilesLines
* mesa: s/FREE/free/Brian Paul2012-09-015-17/+17
| | | | | | | v2: replace instances in dri/common/ dirs Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: s/CALLOC/calloc/Brian Paul2012-09-011-2/+4
| | | | | | | v2: replace instances in dri/common/ dirs Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* st/mesa: s/CALLOC/calloc/ to fix allocation bugBrian Paul2012-08-311-1/+1
| | | | | | | | | The CALLOC() macro only takes one argument so this was being treated as a comma expression. Simply use calloc() instead. A follow-on patch will replace all CALLOC() calls with calloc(). NOTE: This is a candidate for the 8.0 and 9.0 branches.
* mesa: fix-up and use _mesa_delete_renderbuffer()Brian Paul2012-08-311-1/+1
| | | | | | | | _mesa_delete_renderbuffer() should free the mutex (though that may be a no-op) and then free the renderbuffer object itself. Subclasses of gl_renderbuffer can use this function too. Reviewed-by: José Fonseca <[email protected]>
* mesa: Enable GL_{ARB,APPLE}_vertex_array_object in all driversIan Romanick2012-08-291-3/+0
| | | | | | | | This is a purely software extension. The drivers don't need to do any work to support it. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* st/mesa: use fallback path for glCopyTexSubImage(GL_TEXTURE_1D_ARRAY)Brian Paul2012-08-271-0/+10
| | | | | | Fixes many failing cases in piglit copyteximage test. Reviewed-by: José Fonseca <[email protected]>
* st/mesa: don't do (generic) compression of 1D or 1D_ARRAY texturesBrian Paul2012-08-241-1/+11
| | | | | | As with the previous commit for core Mesa. Reviewed-by: Anuj Phogat <[email protected]>
* mesa: add texture target field to ChooseTextureFormat() driver hookBrian Paul2012-08-243-4/+5
| | | | | | | | | This will let us choose the actual hardware format depending on the type of texture. v2: fixup radeon, nouveau, intel and swrast drivers too Reviewed-by: Eric Anholt <[email protected]>
* st/mesa: clean up use of 'target' variable in st_context_teximage()Brian Paul2012-08-241-3/+3
| | | | | | | | 'target' was used both as a parameter of type st_texture_type and then re-used for GL_TEXTURE_x targets. Rename the function parameter and add a new local 'GLenum target'. And remove an extraneous break statement.
* mesa: new _mesa_num_tex_faces() helperBrian Paul2012-08-241-1/+1
| | | | | Not a real big help now, but will be useful for the GL_ARB_texture_cube_map_array extension in the future.
* st/mesa: accept and handle configuration options from st/driVadim Girlin2012-08-234-5/+14
| | | | | | Currently there is a single option - force_glsl_extensions_warn. Signed-off-by: Vadim Girlin <[email protected]>
* st/mesa: fix sampler view countingBrian Paul2012-08-181-2/+9
| | | | | | | | | | | | | | | | | In the past, when we called pipe::set_sampler_views(n) the drivers set samplers [n..MAX] to NULL. We no longer do that. The state tracker code was already trying to set unused sampler views to NULL to cover that case, but the logic was broken and unnoticed until now. This patch fixes it. Strictly speaking, this patch shouldn't be necessary. Drivers should simply ignore unused samplers and sampler views. But some drivers like llvmpipe (and others?) count those things and they figure into state validation. That could be fixed in the future. Fixes http://bugs.freedesktop.org/show_bug.cgi?id=53617 Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: use Elements() instead of hard-coded numberBrian Paul2012-08-181-1/+4
| | | | And add a comment about the velems_util_draw[] array.
* st/mesa: add support for GS textures and samplersBrian Paul2012-08-164-11/+39
|
* st/mesa: combine vertex/fragment sampler state in arraysBrian Paul2012-08-165-33/+26
| | | | | | As with other recent changes, put the vertex and fragment sampler state into arrays indexed by the shader type. This will let us easily add support for other types of shaders in the future.
* gallium: remove PIPE_MAX_VERTEX/GEOMETRY_SAMPLERS #defineBrian Paul2012-08-161-2/+2
| | | | | | | | | | | | PIPE_MAX_SAMPLERS, PIPE_MAX_VERTEX_SAMPLERS and PIPE_MAX_GEOMETRY_SAMPLERS were all defined to the same value (16). In various places we're creating arrays such as sampler_views[PIPE_SHADER_TYPES][PIPE_MAX_SAMPLERS] so we were assuming the same number of max samplers for all shader stages anyway. Of course, drivers are still free to advertise different numbers of max samplers for different shaders.
* st/mesa: silence signed/unsigned comparison warningBrian Paul2012-08-161-2/+2
|
* st/mesa: index can be negative in the PROGRAM_CONSTANT caseNiels Ole Salscheider2012-08-161-1/+1
| | | | | | NOTE: This is a candidate for the 8.0 branch. Reviewed-by: Brian Paul <[email protected]>
* st/mesa: don't clamp fragment color with integer colorbufferMarek Olšák2012-08-154-6/+11
|
* mesa: Remove unnecessary parameters CompressedTexImagePauli Nieminen2012-08-121-4/+1
| | | | | | | | | In tune with previous patches. Again there is duplication of information in function parameters that is good to remove. Signed-off-by: Pauli Nieminen <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Remove unnecessary parameters from AllocTextureImageBufferPauli Nieminen2012-08-121-6/+4
| | | | | | | | | | Size and format information is always stored in gl_texture_image structure. That makes it preferable to remove duplicate information from parameters to make interface easier to understand. Signed-off-by: Pauli Nieminen <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Remove unnecessary parameters from TexImagePauli Nieminen2012-08-121-13/+8
| | | | | | | | | | | gl_texture_image structure always holds size and internal format before TexImage driver hook is called. Those passing same information in function parameters only duplicates information making the interface harder to understand. Signed-off-by: Pauli Nieminen <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* st/mesa: fix renderbuffer validation bugBrian Paul2012-08-101-0/+6
| | | | | | | | | | | | | | After we attach a new renderbuffer in this function we need to make sure Mesa's update_framebuffer() gets called. Fixes crash in WebGL conformance/textures/texture-attachment-formats.html, but the test still fails for other reasons. Fixes http://bugs.freedesktop.org/show_bug.cgi?id=53316 Note: This is a candidate for the 8.0 branch. Reviewed-by: José Fonseca <[email protected]>
* st/mesa: fix glCopyTexSubImage crashBrian Paul2012-08-101-1/+9
| | | | | | | | | | | | | | Fixes a WebGL crash. The dest texture image is at level 2 and is of size 1x1 texel. The st texture image is a stand-alone resource, not a pointer into a complete mipmap. So the resource has one level and trying to write to level 2 blows up. Fixes http://bugs.freedesktop.org/show_bug.cgi?id=53314 and http://bugs.freedesktop.org/show_bug.cgi?id=53319 Note: This is a candidate for the 8.0 branch. Reviewed-by: Jose Fonseca <[email protected]>
* st/mesa: Initialize tgsi_texture_offset Padding field.Vinson Lee2012-08-081-0/+1
| | | | | | | Fixes uninitialized scalar variable defect reported by Coverity. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: José Fonseca <[email protected]>
* glsl: Add a "ubo_load" expression type for fetches from UBOs.Eric Anholt2012-08-071-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Drivers will probably want to be able to take UBO references in a shader like: uniform ubo1 { float a; float b; float c; float d; } void main() { gl_FragColor = vec4(a, b, c, d); } and generate a single aligned vec4 load out of the UBO. For intel, this involves recognizing the shared offset of the aligned loads and CSEing them out. Obviously that involves breaking things down to loads from an offset from a particular UBO first. Thus, the driver doesn't want to see variable_ref(ir_variable("a")), and even more so does it not want to see array_ref(record_ref(variable_ref(ir_variable("a")), "field1"), variable_ref(ir_variable("i"))). where a.field1[i] is a row_major matrix. Instead, we're going to make a lowering pass to break UBO references down to expressions that are obvious to codegen, and amenable to merging through CSE. v2: Fix some partial thoughts in the ir_binop comment (review by Kenneth) Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Replace VersionMajor/VersionMinor with a Version field.Eric Anholt2012-08-071-2/+1
| | | | | | | | | | | As we get into supporting GL 3.x core, we come across more and more features of the API that depend on the version number as opposed to just the extension list. This will let us more sanely do version checks than "(VersionMajor == 3 && VersionMinor >= 2) || VersionMajor >= 4". v2: Fix a bad <= 30 check. Reviewed-by: Kenneth Graunke <[email protected]>
* st/mesa: Fix a potential memory leak in get_mesa_program.Vinson Lee2012-08-061-1/+2
| | | | | | | Fixes resource leak defect reported by Coverity. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: José Fonseca <[email protected]>
* st/mesa: merge fragment/vertex sampler update codeBrian Paul2012-08-061-56/+50
| | | | Reviewed-by: José Fonseca <[email protected]>
* st/mesa: massage update_vertex_samplers() codeBrian Paul2012-08-061-16/+20
| | | | | | | ...to look like update_fragment_samplers() code, as with the previous commit. The next step would be to merge the two functions. Reviewed-by: José Fonseca <[email protected]>
* st/mesa: merge fragment/vertex texture update codeBrian Paul2012-08-061-58/+42
| | | | Reviewed-by: José Fonseca <[email protected]>
* st/mesa: massage the update_vertex_textures() codeBrian Paul2012-08-061-4/+14
| | | | | | | ...to look like update_fragment_textures() code. The next step would be to merge the two functions. Reviewed-by: José Fonseca <[email protected]>
* st/mesa: rename some vertex/fragment state fields for better consistencyBrian Paul2012-08-065-25/+34
| | | | Reviewed-by: José Fonseca <[email protected]>
* gallium: set sample mask to ~0 for clear, blit and gen_mipmapMarek Olšák2012-08-041-1/+3
| | | | | | | The sample mask affects single-sampled rendering too (it's orthogonal to the color mask). Reviewed-by: Brian Paul <[email protected]>
* gallium: consolidate CSO sampler and sampler_view functionsBrian Paul2012-08-034-26/+29
| | | | | | | | | | | | | Merge the vertex/fragment versions of the cso_set/save/restore_samplers() functions. Now we pass the shader stage (PIPE_SHADER_x) to the function to indicate vertex/fragment/geometry samplers. For example: cso_single_sampler(cso, PIPE_SHADER_FRAGMENT, unit, sampler); This results in quite a bit of code reduction, fewer CSO functions and support for geometry shaders. Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: Ensure dst in compile_instruction is initialized.Vinson Lee2012-08-021-1/+1
| | | | | | | Fixes uninitialized scalar variable defect reported by Coverity. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Make ARB_sampler_objects mandatoryPauli Nieminen2012-08-011-1/+0
| | | | | | | | | | | To allow meta acceleration operations to use sampler objects the ARB_sampler_objects extension needs to be mandatory for all drivers. Because the extension doesn't have any hardware dependencies it is trivial to implement. Signed-off-by: Pauli Nieminen <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Move DepthMode to texture objectPauli Nieminen2012-08-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | GL_DEPTH_TEXTURE_MODE isn't meant to be part of sampler state based on compatibility profile specifications. OpenGL specification 4.1 compatibility 20100725 3.9.2: "... The values accepted in the pname parameter are TEXTURE_WRAP_S, TEXTURE_WRAP_T, TEXTURE_WRAP_R, TEXTURE_MIN_- FILTER, TEXTURE_MAG_FILTER, TEXTURE_BORDER_COLOR, TEXTURE_MIN_- LOD, TEXTURE_MAX_LOD, TEXTURE_LOD_BIAS, TEXTURE_COMPARE_MODE, and TEXTURE_COMPARE_FUNC. Texture state listed in table 6.25 but not listed here and in the sampler state in table 6.26 is not part of the sampler state, and remains in the texture object." The list of states is in Table 6.24 "Textures (state per texture object)" instead of 6.25 mentioned in the specification text. Same can be found from 3.3 compatibility specification. Signed-off-by: Pauli Nieminen <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* Revert "gallium: specify resource_resolve destination via a pipe_surface"Christoph Bumiller2012-08-011-6/+9
| | | | | | | | | | | This reverts commit 5d5af7d359e0060fa00b90a8f04900b96f9058b0. It turns out the issue this was supposed to fix merely counter-acted a bug in the hardware driver that I wasn't aware of. The resource_resolve is not supposed to do sRGB conversion, period. (This would violate the requirement that source and destination must be of the same format).
* gallium: specify resource_resolve destination via a pipe_surfaceChristoph Bumiller2012-07-281-9/+6
| | | | | | | | | | | The format member of pipe_surface may differ from that of the pipe_resource, which is used to communicate, for instance, whether sRGB encode should be enabled in the resolve operation or not. Fixes resolve to sRGB surfaces in mesa/st when GL_FRAMEBUFFER_SRGB is disabled. Reviewed-by: Brian Paul <[email protected]>
* st/mesa: call update_renderbuffer_surface for sRGB renderbuffers, tooChristoph Bumiller2012-07-281-2/+3
| | | | | | | | | | | | sRGBEnabled should affect both textures and renderbuffers, so we need to check/update the pipe_surface format for both. Fixes, for instance, rendering appearing too bright in wine applications using sRGB multisample renderbuffers. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: Brian Paul <[email protected]>
* st/mesa: undo a couple static assertsBrian Paul2012-07-271-2/+2
| | | | Hmm, gcc didn't catch these mistakes, but MSVC did.
* st/mesa: use STATIC_ASSERT in a few placesBrian Paul2012-07-274-17/+17
|
* mesa: Make more consistent use of _mesa_is_{user,winsys}_fbo()Paul Berry2012-07-263-3/+8
| | | | | | | | | | A lot of code was still differentiating between between winsys and user fbos by testing the fbo's name against zero. This converts everything in core mesa, the state tracker, and src/mesa/program over to use _mesa_is_user_fbo() and _mesa_is_winsys_fbo(). Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: move more format helper functions to glformats.cBrian Paul2012-07-241-1/+2
|
* mesa: move some format helper functions to glformats.cBrian Paul2012-07-241-0/+1
|
* st/mesa: fix DDY opcode for FBOsMarek Olšák2012-07-231-2/+22
| | | | | | This fixes piglit/fbo-deriv. Reviewed-by: Brian Paul <[email protected]>
* st/mesa: set the centroid qualifier in fragment shader inputsMarek Olšák2012-07-233-4/+11
| | | | | | This fixes some centroid tests in the EXT_framebuffer_multisample piglit group. Reviewed-by: Brian Paul <[email protected]>
* st/mesa: flush the glBitmap cache before changing framebuffer stateMarek Olšák2012-07-233-39/+41
| | | | | | | | | | This fixes the piglit EXT_framebuffer_multisample/bitmap tests. Note that we must not rely on ctx->DrawBuffer when flushing the cache, because that's already updated with a new framebuffer. We want to draw into the old framebuffer where glBitmap was called. Reviewed-by: Brian Paul <[email protected]>
* st/mesa: set the correct window renderbuffer internal formatMarek Olšák2012-07-231-1/+9
| | | | | | The multisample-resolve blit relies on this being correct. Reviewed-by: Brian Paul <[email protected]>