summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
Commit message (Collapse)AuthorAgeFilesLines
* st/mesa: handle new GLSL IR enumerants in switch statementsBrian Paul2013-01-251-2/+16
| | | | To silence warnings about unhandled cases.
* st/mesa: do proper error checking for u_upload_alloc() callsBrian Paul2013-01-255-17/+26
| | | | | | | | | We weren't properly checking the return value of these calls (and calls to u_upload_data()) to detect OOM errors. Note: This is a candidate for the 9.0 branch. Reviewed-by: Jose Fonseca <[email protected]>
* st/mesa: silence assorted MSVC warnings in DrawPixels codeBrian Paul2013-01-251-2/+2
| | | | Reviewed-by: José Fonseca <[email protected]>
* glsl: Replace most default cases in switches on GLSL typeIan Romanick2013-01-251-3/+5
| | | | | | | | | | | | | | | This makes it easier to find switch-statements that need to be updated after a new GLSL_TYPE_* is added because the compiler will generate a warning. Switch-statements that only had a small number of cases (e.g., everything in ir_constant_expression.cpp) were not modified. I may regret that decision when we eventually add support for doubles. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Carl Worth <[email protected]> Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Eliminate ambiguity between function ins/outs and shader ins/outsPaul Berry2013-01-241-10/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch replaces the three ir_variable_mode enums: - ir_var_in - ir_var_out - ir_var_inout with the following five: - ir_var_shader_in - ir_var_shader_out - ir_var_function_in - ir_var_function_out - ir_var_function_inout This eliminates a frustrating ambiguity: it used to be impossible to tell whether an ir_var_{in,out} variable was a shader in/out or a function in/out without seeing where the variable was declared in the IR. This complicated some optimization and lowering passes, and would have become a problem for implementing varying structs. In the lisp-style serialization of GLSL IR to strings performed by ir_print_visitor.cpp and ir_reader.cpp, I've retained the names "in", "out", and "inout" for function parameters, to avoid introducing code churn to the src/glsl/builtins/ir/ directory. Note: a couple of comments in the code seemed to indicate that we were planning for a possible future in which geometry shaders could have shader-scope inout variables. Our GLSL grammar rejects shader-scope inout variables, and I've been unable to find any evidence in the GLSL standards documents (or extensions) that this will ever be allowed, so I've eliminated these comments. Reviewed-by: Carl Worth <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* st/mesa: implement ARB_internalformat_query v2Marek Olšák2013-01-244-0/+39
| | | | Reviewed-by: Brian Paul <[email protected]>
* st/mesa: advertise OES_depth_texture_cube_map if GLSL 1.30 is supportedMarek Olšák2013-01-241-1/+2
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: Use a single flag for the S3TC extensions that don't require on-line ↵Ian Romanick2013-01-231-2/+2
| | | | | | | | compression Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Acked-by: Lee Salzman <[email protected]>
* mesa: Make the drivers call a non-code-generated dispatch table setup.Eric Anholt2013-01-211-1/+1
| | | | | | | I want to drive the Save dispatch table setup from this same function. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* st/mesa: a couple fixes for st_BlitFramebuffer()Brian Paul2013-01-161-30/+52
| | | | | | | | | | | | 1. Loop over multiple destination color buffers. If we set glDrawBuffers(GL_FRONT_AND_BACK) we need to loop over multiple color buffers, blitting to each. 2. Add checks for null src/dst surface pointers. This fixes a crash in the piglit fbo-missing-attachment-blit test. See bug http://bugs.freedesktop.org/show_bug.cgi?id=59450 Reviewed-by: Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: simplify some src/dst surface setup in BlitFramebufferBrian Paul2013-01-161-4/+4
| | | | | | Use the renderbuffer attachment pointers that we grabbed earlier. Reviewed-by: Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: use a generic varying to pass the clear color to the FSMarek Olšák2013-01-151-2/+2
| | | | | | The color varying may have reduced precision or be even clamped. Reviewed-by: Brian Paul <[email protected]>
* gallium/util: fix glClear with MRT by making the FS write to all cbufsMarek Olšák2013-01-152-2/+5
| | | | Reviewed-by: Brian Paul <[email protected]>
* st/mesa: fix InternalFormat for Z24X8 window-system buffersMarek Olšák2013-01-151-1/+3
| | | | | | This probably doesn't fix anything, but it's good to be consistent. Reviewed-by: Brian Paul <[email protected]>
* st/mesa: remove dead conditional in ClearMarek Olšák2013-01-151-12/+0
| | | | | | | | | I think the conditional always evaluates to false. If I understand the code in core Mesa correctly, depthBits or stencilBits is 0 if the depth or stencil renderbuffer is NULL, respectively. Reviewed-by: Brian Paul <[email protected]>
* st/mesa: simplify conditionals in ClearMarek Olšák2013-01-151-30/+12
| | | | | | just check depth and stencil separately, the outcome is the same Reviewed-by: Brian Paul <[email protected]>
* st/mesa: fix glClear with different colormask for each colorbufferMarek Olšák2013-01-151-18/+25
| | | | Reviewed-by: Brian Paul <[email protected]>
* st/mesa: always assume separate depth and stencil clear is supportedMarek Olšák2013-01-152-97/+22
| | | | | | All drivers implement it now. Reviewed-by: Brian Paul <[email protected]>
* st/mesa: add some simple buffer/draw debug codeBrian Paul2013-01-144-0/+18
| | | | Reviewed-by: José Fonseca <[email protected]>
* st/mesa: set ctx->Const.UniformBufferOffsetAlignmentFredrik Höglund2013-01-121-1/+4
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa/es3: Add support for GL_PRIMITIVE_RESTART_FIXED_INDEXIan Romanick2013-01-111-2/+2
| | | | | | | | | | | | | This requires some derived state. The cut vertex used is either the value specified by glPrimitiveRestartIndex or it's hard-coded to ~0. The derived state gl_array_attrib::_RestartIndex captures this value. In addition, the derived state gl_array_attrib::_PrimitiveRestart is set whenever either gl_array_attrib::PrimitiveRestart or gl_array_attrib::PrimitiveRestartFixedIndex is set. v2: Use _mesa_is_gles3. Signed-off-by: Ian Romanick <[email protected]>
* mesa/es3: Add support for GL_ANY_SAMPLES_PASSED_CONSERVATIVE query targetIan Romanick2013-01-111-0/+1
| | | | Signed-off-by: Ian Romanick <[email protected]>
* Remove state_tracker/MakefileMatt Turner2013-01-101-2/+0
| | | | Unneeded and unnecessary.
* st/mesa: fix possible MSVC build error v2Marek Olšák2013-01-081-2/+2
| | | | | | https://bugs.freedesktop.org/show_bug.cgi?id=59143 Using GLubyte as per Brian's suggestion.
* st/mesa: fix assertion failures with 2101010 vertex formatsMarek Olšák2013-01-041-3/+4
| | | | Reviewed-by: Brian Paul <[email protected]>
* st/mesa: accelerate CopyTexSubImage for 1D array texturesMarek Olšák2013-01-041-26/+66
| | | | Reviewed-by: Brian Paul <[email protected]>
* st/mesa: fix CopyTexSubImage fallback for 1D array texturesMarek Olšák2013-01-043-17/+42
| | | | | | | | - We should use a 3D transfer of size Width x 1 x NumLayers. - We should use layer_stride instead of stride. (even though they are likely to be equal with 1D array textures) Reviewed-by: Brian Paul <[email protected]>
* st/mesa: fix GetTexImage for compressed 2D array texturesMarek Olšák2013-01-041-23/+32
| | | | | | | This uses a 3D blit to decompress the texture and then a 3D transfer to read it. Reviewed-by: Brian Paul <[email protected]>
* st/mesa: try to find the format matching format+type in decompressed_with_blitMarek Olšák2013-01-041-19/+50
| | | | | | | | | | | | | | | There was the fast path based on _mesa_format_matches_format_and_type for GetTexImage, but it never worked, because the Mesa format we were testing there was always compressed. Further testing showed that the fast path had been completely broken. In this commit, the somewhat limited helper util_create_rgba_texture is no longer used and instead, custom code for the texture creation is added, which tries to find the best matching RGBA8 format, so that we can hit the fast path *always* if the read format is a variant of RGBA8 and supported by the driver. Reviewed-by: Brian Paul <[email protected]>
* st/mesa: fix GetTexImage for compressed cubemapsMarek Olšák2013-01-041-1/+1
| | | | | | I'll deal with 2D arrays later. NOTE: This is a candidate for the stable branches.
* gallium: extend pipe_context::flush for it to accept an END_OF_FRAME flagMarek Olšák2013-01-044-8/+16
| | | | | | | | | | | | | | | | | Usage with pipe_context: pipe->flush(pipe, NULL, PIPE_FLUSH_END_OF_FRAME); Usage with st_context_iface: st->flush(st, ST_FLUSH_END_OF_FRAME, NULL); The flag is only a hint for drivers. Radeon will use it for buffer eviction heuristics in the kernel (e.g. for queries like how many frames have passed since a buffer was used). The flag is currently only generated by st/dri on SwapBuffers. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Stéphane Marchesin <[email protected]>
* mesa/st: Implement GL_TIME_ELAPSED w/ PIPE_QUERY_TIMESTAMP.José Fonseca2012-12-204-22/+79
| | | | | | | | | | | | | | | | | | ARB/EXT_timer_query's definition of GL_TIME_ELAPSED match precisely the subtraction of two GL_TIMESTAMP queries. And for a lot of drivers, that's precisely how they have to implement internally -- by emitting two hardware timestamp queries. So, to simplify driver implementation, simply allow doing so in the state tracker. Eventually if no driver implements PIPE_QUERY_TIME_ELAPSED then we could retire it. Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium: s/PIPE_CAP_TIMER_QUERY/PIPE_CAP_QUERY_TIME_ELAPSED/José Fonseca2012-12-201-2/+2
| | | | | | | | To better reflect what it is being advertised. Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* drivers: compute version and then initialize exec tableJordan Justen2012-12-162-2/+8
| | | | | | | | This change forces the context version to be computed before initilizing the exec dispatch tables. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* st/mesa: add texture buffer object rgb32 support.Dave Airlie2012-12-161-1/+13
| | | | | | | This checks if the pipe driver can support RGB32 formats. Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* gallium: Disable varying packing on hardware with <=8 texture indirections.Paul Berry2012-12-141-0/+14
| | | | | | | In practice this will disable varying packing on R300, R400, i915g, and nv30. Reviewed-by: Marek Olšák <[email protected]>
* mesa: disallow creation of GL 3.1 compatibility contextsMarek Olšák2012-12-121-4/+1
| | | | | | Death to driver-specific hacks! Reviewed-by: Ian Romanick <[email protected]>
* gallium: remove pipe_surface::usageMarek Olšák2012-12-126-17/+7
| | | | | | Not really used by anybody now. Reviewed-by: Brian Paul <[email protected]>
* gallium/util: move util_try_blit_via_copy_region to u_surface.cMarek Olšák2012-12-121-1/+0
| | | | Reviewed-by: Brian Paul <[email protected]>
* gallium: manage render condition in cso_context and fix postprocessing w/ itMarek Olšák2012-12-124-33/+3
| | | | Reviewed-by: Brian Paul <[email protected]>
* st/mesa: remove a weird msaa hackMarek Olšák2012-12-124-29/+2
| | | | | | It doesn't work and it's not clear how it's supposed to work. Reviewed-by: Brian Paul <[email protected]>
* glsl_to_tgsi: emit multi-level structs and arrays properly.Dave Airlie2012-12-121-9/+42
| | | | | | | | | | | | | This follow the code from the i965 driver, and emits the structs and arrays recursively. This fixes an assert in the two UBO tests fs-struct-copy-complicated and vs-struct-copy-complicated These tests now pass on softpipe, with no regressions. Signed-off-by: Dave Airlie <[email protected]>
* st_glsl_to_tgsi: fix ubo bools.Dave Airlie2012-12-101-2/+19
| | | | | | | This should fix the ubo boolean tests, along with the previous ubo loading fix. Signed-off-by: Dave Airlie <[email protected]>
* st_glsl_to_tgsi: call ubo load pass earlierDave Airlie2012-12-101-1/+2
| | | | | | This calls it in around the same place as the 965 driver. Signed-off-by: Dave Airlie <[email protected]>
* glsl_to_tgsi: fix texture offset translationDave Airlie2012-12-101-4/+7
| | | | | | | | | | | I noticed the texelFetch offset test failed on 2D rect samplers with GLSL 1.40. This is because I wrote the immediate->offset translation wrong. Fixed the translation to actually use the ureg info to set the offsets up. Signed-off-by: Dave Airlie <[email protected]>
* st/mesa: set PIPE_BIND_SAMPLER_VIEW for TBOs in st_bufferobj_dataChristoph Bumiller2012-12-081-0/+3
|
* mesa/st: add ARB_uniform_buffer_object support (v2)Dave Airlie2012-12-086-7/+147
| | | | | | | | | | | | | | | | this adds UBO support to the state tracker, it works with softpipe as-is. It uses UARL + CONST[x][ADDR[0].x] type constructs. v2: don't disable UBOs if geom shaders don't exist (me) rename upload to bind (calim) fix 12 -> 13 comparison as comment (calim + brianp) fix signed->unsigned (Brian) remove assert (Brian) Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* st/mesa: add option to enable GLSL 1.40Dave Airlie2012-12-081-1/+6
| | | | | | Allow GLSL 1.40 to be enabled if the driver advertises it. Signed-off-by: Dave Airlie <[email protected]>
* st/mesa: add texture buffer object support to state tracker (v1.1)Dave Airlie2012-12-085-7/+31
| | | | | | | | | | This adds the necessary changes to the st to allow texture buffer object support if the driver advertises it. v1.1: remove extra blank line and whitespace Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* st/dri: implement MSAA for GLX/DRI2 framebuffersMarek Olšák2012-12-071-2/+2
| | | | | | | | | | | | | All MSAA buffers are allocated privately and resolved into the DRI-provided back and front buffers. If an MSAA visual is chosen, the buffers st/mesa receives are all multi-sample. st/mesa doesn't have access to the single-sample buffers in that case. This makes MSAA work in games like Nexuiz. Reviewed-by: Brian Paul <[email protected]>