summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
Commit message (Collapse)AuthorAgeFilesLines
* glsl: Lower UBO and SSBO access in glsl linkerKristian Høgsberg Kristensen2015-11-102-1/+1
| | | | | | | | | | | All GLSL IR consumers run this lowering pass so we can move it to the linker. This moves the pass up quite a bit, but that's the point: it needs to run before we throw away information about per-component vector access. Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Signed-off-by: Kristian Høgsberg Kristensen <[email protected]>
* glsl: Drop exec_list argument to lower_ubo_referenceKristian Høgsberg Kristensen2015-11-101-1/+1
| | | | | | | | | | | We always pass in shader->ir and we already pass in the shader, so just drop the exec_list. Most passes either take just a exec_list or a shader, so this seems more consistent. Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Signed-off-by: Kristian Høgsberg Kristensen <[email protected]>
* st/mesa: Destroy buffer object's mutex.Jose Fonseca2015-11-101-0/+1
| | | | | | | | Ideally we should have a _mesa_cleanup_buffer_object function in src/mesa/bufferobj.c so that the destruction logic resided in a single place. Reviewed-by: Brian Paul <[email protected]>
* st/mesa: set debug callback for debug contextsIlia Mirkin2015-11-051-0/+57
| | | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st/mesa: account for texture views when doing CopyImageSubDataIlia Mirkin2015-11-051-0/+8
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: fix mipmap generation for immutable textures with incomplete pyramidsNicolai Hähnle2015-10-291-32/+36
| | | | | | | | | | | | | | | Without the clamping by NumLevels, the state tracker would reallocate the texture storage (incorrect) and even fail to copy the base level image after reallocation, leading to the graphical glitch of https://bugs.freedesktop.org/show_bug.cgi?id=91993 . A piglit test has been submitted for review as well (subtest of arb_texture_storage-texture-storage). v2: also bypass all calls to st_finalize_texture (suggested by Marek Olšák) Cc: [email protected] Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: create temporary textures with the same nr_samples as sourceIlia Mirkin2015-10-291-2/+6
| | | | | | | | Not sure if this is actually reachable in practice (to have a complex copy with MS textures). Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: implement ARB_copy_imageMarek Olšák2015-10-285-51/+614
| | | | | | I wonder if the craziness was worth it. Reviewed-by: Brian Paul <[email protected]>
* st/mesa: don't load state parameters if there are noneMarek Olšák2015-10-241-1/+2
| | | | | | | | | Out of 7063 shaders from my shader-db: - 6564 (93%) shaders don't have any state parameters. - 347 (5%) shaders have 1 state parameter for WPOS lowering. - The remaining 2% have more state parameters, usually matrices. Reviewed-by: Brian Paul <[email protected]>
* st/mesa: use _mesa_RasterPos() when possibleBrian Paul2015-10-221-0/+10
| | | | | | | | | | | | | | | The st_RasterPos() function goes to great pains to implement the rasterpos transformation. It basically uses gallium's draw module to execute the vertex shader to draw a point, then capture that point's attributes. But glRasterPos isn't typically used with a vertex shader so we can usually use the old/fixed-function implementation which is a lot simpler and faster. This can add up for legacy apps that make a lot of calls to glRasterPos. Reviewed-by: Roland Scheidegger <[email protected]>
* st/mesa: optimize 4-component ubyte glDrawPixelsBrian Paul2015-10-201-9/+95
| | | | | | | | | | | | | | | | | | If we didn't find a gallium surface format that exactly matched the glDrawPixels format/type combination, we used some other 32-bit packed RGBA format and swizzled the whole image in the mesa texstore/format code. That slow path can be avoided in some common cases by using the pipe_samper_view's swizzle terms to do the swizzling at texture sampling time instead. For now, only GL_RGBA/ubyte and GL_BGRA/ubyte combinations are supported. In the future other formats and types like GL_UNSIGNED_INT_8_8_8_8 could be added. v2: fix incorrect swizzle setup (need to invert the tex format's swizzle) Reviewed by: Jose Fonseca <[email protected]>
* st/mesa: check for out-of-memory in st_DrawPixels()Brian Paul2015-10-201-32/+44
| | | | | | | | | | | Before, if make_texture() or st_create_texture_sampler_view() failed we silently no-op'd the glDrawPixels. Now, set GL_OUT_OF_MEMORY. This also allows us to un-nest a bunch of code. v2: also check if allocation of sv[1] fails, per Jose. Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: use MAX3() instead of MAX2(MAX2) in draw_textured_quad()Brian Paul2015-10-201-1/+2
| | | | | | Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Sinclair Yeh <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallium: add PIPE_SHADER_CAP_MAX_UNROLL_ITERATIONS_HINTMarek Olšák2015-10-201-0/+3
| | | | | | | | | | | | | | This avoids a serious r600g bug leading to a GPU hang. The chances this bug will get fixed are pretty low now. I deeply regret listening to others and not pushing this patch, leaving other users with a GPU-crashing driver. Yes, it should be fixed in the compiler and it's ugly, but users couldn't care less about that. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86720 Cc: 11.0 10.6 <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st/mesa: pass the clip distance array size to driversMarek Olšák2015-10-201-0/+8
| | | | | Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st/mesa: create shaders which have only one variant immediatelly (v2)Marek Olšák2015-10-203-2/+24
| | | | | | v2: fix the condition when lacking sample shading Reviewed-by: Ilia Mirkin <[email protected]>
* st/mesa: negate the can_force_persample_interp flagMarek Olšák2015-10-204-5/+6
| | | | Reviewed-by: Ilia Mirkin <[email protected]>
* st/mesa: decouple shaders from contexts if they are shareableMarek Olšák2015-10-206-13/+21
| | | | Reviewed-by: Ilia Mirkin <[email protected]>
* glsl_to_tgsi: Use {Num}UniformBlocks instead of {Num}BufferInterfaceBlocksIago Toral Quiroga2015-10-191-2/+2
| | | | | | | The latter holds both UBOs and SSBOs, but here we only want UBOs. Reviewed-by: Kristian Høgsberg <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: Use {Num}UniformBlocks instead of {Num}BufferInterfaceBlocksIago Toral Quiroga2015-10-191-2/+2
| | | | | | | The latter holds both UBOs and SSBOs, but here we only want UBOs. Reviewed-by: Kristian Høgsberg <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: fix clip state dependenciesMarek Olšák2015-10-171-1/+4
| | | | | | | This allows removing FLUSH_VERTICES in MatrixMode. Cc: [email protected] Reviewed-by: Brian Paul <[email protected]>
* st/mesa: fix incorrect pointer type arguments in st_new_program()Brian Paul2015-10-161-5/+5
| | | | | | | | | | Silences 5 warnings of the type: state_tracker/st_cb_program.c: In function 'st_new_program': state_tracker/st_cb_program.c:108:7: warning: passing argument 1 of '_mesa_init_gl_program' from incompatible pointer type [enabled by default] return _mesa_init_gl_program(&prog->Base, target, id); ^ Reviewed-by: Emil Velikov <[email protected]>
* program: convert _mesa_init_gl_program() to take struct gl_program *Emil Velikov2015-10-151-18/+20
| | | | | | | | Rather than accepting a void pointer, only to down and up cast around it, convert the function to take the base (struct gl_program) pointer. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/fbo: use pipe_surface_release instead of pipe_surface_referenceKrzysztof Sobiecki2015-10-141-1/+1
| | | | | | | | | | | pipe_surface_reference have problems with deleted contexts, so use of pipe_surface_release might be more appropriate. Fixes Wasteland 2 Director's Cut crash on start. Cc: [email protected] Reviewed-by: Brian Paul <[email protected]>
* mesa: Rename {Num}UniformBlocks to {Num}BufferInterfaceBlocksIago Toral Quiroga2015-10-142-4/+4
| | | | | | | | | | | | | | Currently, these arrays in gl_shader and gl_shader_program hold both UBOs and SSBOs, so this looks like a better name. We were already using NumBufferInterfaceBlocks in gl_shader_program, so this makes things more consistent as well. In a later patch we will add {Num}UniformBlocks and {Num}ShaderStorageBlocks which will contain only references to UBOs and SSBOs respectively that will provide backends with a separate index space for both types of objects. Reviewed-by: Kristian Høgsberg <[email protected]>
* program: remove _mesa_init_*_program wrappersMarek Olšák2015-10-091-25/+18
| | | | | | | They didn't do anything useful. Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st/mesa: release the glsl_to_tgsi visitor after translationMarek Olšák2015-10-091-2/+17
| | | | | | Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Brian Paul <[email protected]> Tested-by: Brian Paul <[email protected]>
* st/mesa: translate tessellation shaders into TGSI when we get themMarek Olšák2015-10-093-36/+64
| | | | | | Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Brian Paul <[email protected]> Tested-by: Brian Paul <[email protected]>
* st/mesa: translate geometry shaders into TGSI when we get themMarek Olšák2015-10-093-15/+30
| | | | | | Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Brian Paul <[email protected]> Tested-by: Brian Paul <[email protected]>
* st/mesa: translate fragment shaders into TGSI when we get themMarek Olšák2015-10-094-37/+55
| | | | | | Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Brian Paul <[email protected]> Tested-by: Brian Paul <[email protected]>
* st/mesa: translate vertex shaders into TGSI when we get themMarek Olšák2015-10-093-36/+44
| | | | | | | | | | The translate functions is split into two: - translation to TGSI - creating the variant (TGSI transformations only) Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Brian Paul <[email protected]> Tested-by: Brian Paul <[email protected]>
* st/mesa: fix glDrawPixels with a textureMarek Olšák2015-10-095-29/+111
| | | | | | | | | | | The samplers for DrawPixels data and the pixel map are assigned to slots which don't overlap with the existing sampler slots. The texture coordinates for the user texture are uploaded as a constant. Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Brian Paul <[email protected]> Tested-by: Brian Paul <[email protected]>
* st/mesa: implement DrawPixels shader transformation using tgsi_transform_shaderMarek Olšák2015-10-099-504/+302
| | | | | | Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Brian Paul <[email protected]> Tested-by: Brian Paul <[email protected]>
* st/mesa: make Z/S drawpix shaders independent of variants, don't use Mesa IR v2Marek Olšák2015-10-095-136/+60
| | | | | | | | | | | | | - there is no connection to user fragment shaders, so having these as shader variants makes no sense - don't use Mesa IR, use TGSI - don't create gl_fragment_program, just create the shader CSO v2: generate exactly the same shader as before to fix llvmpipe Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Brian Paul <[email protected]> Tested-by: Brian Paul <[email protected]>
* st/mesa: implement glBitmap shader transformation using tgsi_transform_shaderMarek Olšák2015-10-096-244/+201
| | | | | | Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Brian Paul <[email protected]> Tested-by: Brian Paul <[email protected]>
* st/mesa: remove old emulation for VS and FS variantsMarek Olšák2015-10-095-107/+17
| | | | | | Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Brian Paul <[email protected]> Tested-by: Brian Paul <[email protected]>
* st/mesa: use TGSI utility to emulate features for FS variantsMarek Olšák2015-10-091-6/+21
| | | | | | Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Brian Paul <[email protected]> Tested-by: Brian Paul <[email protected]>
* st/mesa: use TGSI utility to emulate features for VS variantsMarek Olšák2015-10-091-12/+29
| | | | | | Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Brian Paul <[email protected]> Tested-by: Brian Paul <[email protected]>
* st/mesa: decrease the size of st_vertex_programMarek Olšák2015-10-092-51/+48
| | | | | | | | The other variables can't be moved. Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Brian Paul <[email protected]> Tested-by: Brian Paul <[email protected]>
* st/mesa: inline st_prepare_vertex_programMarek Olšák2015-10-092-40/+11
| | | | | | | | | | | No other shader stage has a "prepare" function. This will allow removing some variables from st_vertex_program. Also, prepare_fragment_program was a dead prototype. Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Brian Paul <[email protected]> Tested-by: Brian Paul <[email protected]>
* st/mesa: Don't override NewFramebuffer just to call _mesa_new_framebufferIan Romanick2015-10-061-12/+1
| | | | | | | | | v2: Since state_tracker does not call _mesa_init_driver_functions, we need to initialize the dd::NewFramebuffer pointer to _mesa_new_framebuffer here. Suggested by Brian. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st/mesa: automatically set per-sample interpolation if using SampleID/PosMarek Olšák2015-10-032-2/+10
| | | | Reviewed-by: Ilia Mirkin <[email protected]>
* st/mesa: set force_persample_interp if ARB_sample_shading is usedMarek Olšák2015-10-034-0/+12
| | | | | | | This is only a half of the work. The next patch will handle gl_SampleID/SamplePos, which is the other half of ARB_sample_shading. Reviewed-by: Ilia Mirkin <[email protected]>
* st/mesa: add ST_DEBUG=precompile support for tessellation shadersMarek Olšák2015-10-031-0/+20
| | | | Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: remove Driver.DeleteArrayObjectMarek Olšák2015-10-031-3/+0
| | | | | | | Nothing reimplements it. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: remove Driver.NewArrayObjectMarek Olšák2015-10-031-1/+0
| | | | | | | Nothing reimplements it. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: remove Driver.AccumMarek Olšák2015-10-031-2/+0
| | | | | | | Nothing calls it. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* st/mesa: clean up #includes in st_draw.cBrian Paul2015-10-011-2/+2
| | | | Reviewed-by: Tapani Pälli <[email protected]>
* st/mesa: try PIPE_BIND_RENDER_TARGET when choosing float texture formatsBrian Paul2015-09-291-1/+5
| | | | | | | | | | | | | For 8-bit RGB(A) texture formats we set the PIPE_BIND_RENDER_TARGET flag to try to get a hardware format which also supports rendering (for FBO textures). Do the same thing for floating point formats. This allows the Redway3D Flat demo to run. Cc: 10.6 11.0 <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* st/mesa: add some debugging code in st_ChooseTextureFormat()Brian Paul2015-09-291-1/+17
| | | | | | | I've temporarily added code like this many times. Wrap it in a conditional that can be enabled when needed. Reviewed-by: Marek Olšák <[email protected]>