summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* mesa: update packed format layout commentsBrian Paul2014-03-031-50/+50
| | | | | | | | | Update the comments for the packed formats to accurately reflect the layout of the bits in the pixel. For example, for the packed format MESA_FORMAT_R8G8B8A8, R is in the least significant position while A is in the most-significant position of the 32-bit word. v2: also fix MESA_FORMAT_A1B5G5R5_UNORM, per Roland.
* mesa: don't define c99 math functions for MSVC >= 1800Hans2014-03-031-1/+1
| | | | | Signed-off-by: Brian Paul <[email protected]> Cc: "10.0" "10.1" <[email protected]>
* mesa: don't call ctx->Driver.ClearBufferSubData() if size==0Brian Paul2014-03-031-4/+8
| | | | | | | | Fixes failed assertion when trying to map zero-length region. https://bugs.freedesktop.org/show_bug.cgi?id=75660 Cc: "10.0" "10.1" <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* NV_vdpau_interop: fix IsSurfaceNV return typeGrigori Goronzy2014-03-032-5/+6
| | | | | | | | The spec incorrectly used void as return type, when it should have been GLboolean. This has now been fixed. According to Nvidia, their implementation always used GLboolean. Reviewed-by: Christian König <[email protected]>
* mesa: Move MESA_GLSL=dump output to stderr.Kenneth Graunke2014-03-021-9/+11
| | | | | | | | | | | | i965 recently moved debug printfs to use stderr, including ones which trigger on MESA_GLSL=dump. This resulted in scrambled output. For drivers using ir_to_mesa, print_program was already using stderr, yet all the code around it was using stdout. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa: add unpacking code for MESA_FORMAT_Z32_FLOAT_S8X24_UINTBrian Paul2014-02-281-0/+22
| | | | | | | | | Fixes glGetTexImage() when converting from MESA_FORMAT_Z32_FLOAT_S8X24_UINT to GL_UNSIGNED_INT_24_8. Hit by the piglit ext_packed_depth_stencil-getteximage test. Cc: "10.0" "10.1" <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: do depth/stencil format conversion in glGetTexImageBrian Paul2014-02-281-2/+9
| | | | | | | | | | | | | | | | glGetTexImage(GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8) was just using memcpy() instead of _mesa_unpack_uint_24_8_depth_stencil_row() to convert texels from the hardware format to the GL format. Fixes issue reported by David Meng at Intel. The new piglit ext_packed_depth_stencil-getteximage test checks for this bug. Also, add some format/type assertions. We don't yet handle the GL_FLOAT_32_UNSIGNED_INT_24_8_REV type. That should be fixed in a follow-on patch. Reviewed-by: Eric Anholt <[email protected]> Cc: "10.0" "10.1" <[email protected]>
* mesa: fix depth/stencil comments in formats.hBrian Paul2014-02-281-2/+2
|
* mesa: Add GL_ARB_buffer_storage to dispatch_sanity.cpp.Vinson Lee2014-02-251-0/+3
| | | | | | | | | Fixes 'make check' failure introduced with commit 119ffa7307d62e7310ce3902fded662ee4021c92. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75503 Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: allow buffers to be mapped multiple timesMarek Olšák2014-02-2510-152/+173
| | | | | | | | | | | | | | | | | | | OpenGL allows a buffer to be mapped only once, but we also map buffers internally, e.g. in the software primitive restart fallback, for PBOs, vbo_get_minmax_index, etc. This has always been a problem, but it will be a bigger problem with persistent buffer mappings, which will prevent all Mesa functions from mapping buffers for internal purposes. This adds a driver interface to core Mesa which supports multiple buffer mappings and allows 2 mappings: one for the GL user and one for Mesa. Note that Gallium supports an unlimited number of buffer and texture mappings, so it's not really an issue for Gallium. v2: fix unmapping in xm_dd.c, remove the GL errors there v3: fix the intel driver (by Fredrik) Reviewed-by: Fredrik Höglund <[email protected]>
* mesa: allow buffers mapped with the persistent flag to be used by the GPUMarek Olšák2014-02-257-21/+35
| | | | | | v2: also fixed InvalidateBufferData, added citations from the 4.4 spec Reviewed-by: Fredrik Höglund <[email protected]>
* mesa: add error checks to glMapBufferRange, glMapBuffer for ARB_buffer_storageMarek Olšák2014-02-251-7/+57
| | | | Reviewed-by: Fredrik Höglund <[email protected]>
* mesa: implement glBufferStorage, immutable buffers; add extension enable flagMarek Olšák2014-02-254-0/+100
| | | | | | | Reviewed-by: Fredrik Höglund <[email protected]> v2: dropped the error that DYNAMIC_STORAGE is required for MAP_WRITE_BIT, the error is removed in the latest revision of GL 4.4
* mesa: add storage flags parameter to Driver.BufferDataMarek Olšák2014-02-253-3/+9
| | | | | | | It will be used by glBufferStorage. The parameters are chosen according to ARB_buffer_storage. Reviewed-by: Fredrik Höglund <[email protected]>
* mesa: remove unused driver hook BindBufferMarek Olšák2014-02-252-8/+0
| | | | Reviewed-by: Fredrik Höglund <[email protected]>
* glsl: Add a file argument to the IR printer.Eric Anholt2014-02-221-1/+1
| | | | | | | | | | | | While we want to be able to print to stdout for glsl_compiler, for debugging drivers we want to be able to dump to stderr because that's where other driver debug (like LIBGL_DEBUG) tends to go, and because some apps actually close stdout to shut up their own messages (such as the X Server, or NWN). Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa: Move declarations before code.Vinson Lee2014-02-211-27/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes these MSVC build errors introduced with 73b78f9c9f86dd38fb165f4730aeac9519635b07. Compiling src\mesa\main\uniforms.c ... uniforms.c src\mesa\main\uniforms.c(291) : error C2143: syntax error : missing ';' before 'type' src\mesa\main\uniforms.c(294) : error C2065: 'shProg' : undeclared identifier src\mesa\main\uniforms.c(294) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int' src\mesa\main\uniforms.c(294) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2 src\mesa\main\uniforms.c(306) : error C2143: syntax error : missing ';' before 'type' src\mesa\main\uniforms.c(309) : error C2065: 'shProg' : undeclared identifier src\mesa\main\uniforms.c(309) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int' src\mesa\main\uniforms.c(309) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2 src\mesa\main\uniforms.c(322) : error C2143: syntax error : missing ';' before 'type' src\mesa\main\uniforms.c(325) : error C2065: 'shProg' : undeclared identifier src\mesa\main\uniforms.c(325) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int' src\mesa\main\uniforms.c(325) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2 src\mesa\main\uniforms.c(345) : error C2143: syntax error : missing ';' before 'type' src\mesa\main\uniforms.c(348) : error C2065: 'shProg' : undeclared identifier src\mesa\main\uniforms.c(348) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int' src\mesa\main\uniforms.c(348) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2 src\mesa\main\uniforms.c(360) : error C2143: syntax error : missing ';' before 'type' src\mesa\main\uniforms.c(363) : error C2065: 'shProg' : undeclared identifier src\mesa\main\uniforms.c(363) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int' src\mesa\main\uniforms.c(363) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2 src\mesa\main\uniforms.c(376) : error C2143: syntax error : missing ';' before 'type' src\mesa\main\uniforms.c(379) : error C2065: 'shProg' : undeclared identifier src\mesa\main\uniforms.c(379) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int' src\mesa\main\uniforms.c(379) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2 src\mesa\main\uniforms.c(588) : error C2143: syntax error : missing ';' before 'type' src\mesa\main\uniforms.c(591) : error C2065: 'shProg' : undeclared identifier src\mesa\main\uniforms.c(591) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int' src\mesa\main\uniforms.c(591) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2 src\mesa\main\uniforms.c(603) : error C2143: syntax error : missing ';' before 'type' src\mesa\main\uniforms.c(606) : error C2065: 'shProg' : undeclared identifier src\mesa\main\uniforms.c(606) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int' src\mesa\main\uniforms.c(606) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2 src\mesa\main\uniforms.c(619) : error C2143: syntax error : missing ';' before 'type' src\mesa\main\uniforms.c(622) : error C2065: 'shProg' : undeclared identifier src\mesa\main\uniforms.c(622) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int' src\mesa\main\uniforms.c(622) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2 Signed-off-by: Vinson Lee <[email protected]>
* mesa/sso: Fix typo of 'unsigned'.Vinson Lee2014-02-211-1/+1
| | | | | | | | | | | | Fix build error introduced with commit f4c13a890fa24ff1f998e7cac0ecc31505a29403. CC pixeltransfer.lo main/pipelineobj.c: In function '_mesa_delete_pipeline_object': main/pipelineobj.c:59:4: error: unknown type name 'unsinged' unsinged i; ^ Signed-off-by: Vinson Lee <[email protected]>
* mesa/sso: Implement _mesa_GetProgramPipelineivGregory Hainaut2014-02-211-0/+58
| | | | | | | | | | | | | | | | This was originally included in another patch, but it was split out by Ian Romanick. v2 (idr): * Trivial reformatting. * Remove GL_COMPUTE_SHADER. Compute shaders don't participate in pipeline objects anyway. Suggested by Matt Turner. v3 (idr): * Use _mesa_has_geometry_shaders. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa/sso: Implement _mesa_ActiveShaderProgramGregory Hainaut2014-02-211-0/+28
| | | | | | | | | | | This was originally included in another patch, but it was split out by Ian Romanick. v2 (idr): Return early from _mesa_ActiveShaderProgram if _mesa_lookup_shader_program_err returns an error. Suggested by Jordan. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]> [v2]
* mesa/sso: Implement _mesa_CreateShaderProgramvGregory Hainaut2014-02-211-1/+6
| | | | | | | | This was originally included in another patch, but it was split out by Ian Romanick. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa/sso: Refactor implementation of _mesa_CreateShaderProgramEXTGregory Hainaut2014-02-211-8/+18
| | | | | | | | | | | This will allow the guts of the implementation to be shared with _mesa_CreateShaderProgramv. This was originally included in another patch, but it was split out by Ian Romanick. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa/sso: Add support for GL_PROGRAM_SEPARABLE queryGregory Hainaut2014-02-212-0/+31
| | | | | | | | This was originally included in another patch, but it was split out by Ian Romanick. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa/sso: Implement _mesa_IsProgramPipelineGregory Hainaut2014-02-212-1/+9
| | | | | | | | | | Implement IsProgramPipeline based on the VAO code. This was originally included in another patch, but it was split out by Ian Romanick. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa/sso: Implement _mesa_GenProgramPipelinesGregory Hainaut2014-02-211-0/+30
| | | | | | | | | | Implement GenProgramPipelines based on the VAO code. This was originally included in another patch, but it was split out by Ian Romanick. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa/sso: Implement _mesa_DeleteProgramPipelinesGregory Hainaut2014-02-211-0/+33
| | | | | | | | | | Implement DeleteProgramPipelines based on the VAO code. This was originally included in another patch, but it was split out by Ian Romanick. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa/sso: Add pipeline container/stateGregory Hainaut2014-02-214-3/+206
| | | | | | | | | | | | | | | | | | | | | | | | | V1: * Extend gl_shader_state as pipeline object state * Add a new container gl_pipeline_shader_state that contains binding point of the previous object * Update mesa init/free shader state due to the extension of the attibute * Add an init/free pipeline function for the context V2: * Rename gl_shader_state to gl_pipeline_object * Rename Pipeline.PipelineObj to Pipeline.Current * Formatting improvement V3 (idr): * Split out from previous uber patch. * Remove '#if 0' debug printfs. V4 (idr): * Fix some errors in comments. Suggested by Jordan. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa: Add a mutex and refcounting to gl_shader_stateGregory Hainaut2014-02-212-0/+12
| | | | | Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa: Make get_shader_flags publicly availableGregory Hainaut2014-02-212-3/+6
| | | | | | | | | | Future patches will use this function outside shaderapi.c. This was originally included in another patch, but it was split out by Ian Romanick. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa/sso: Add extension entry points for GL_ARB_separate_shader_objectsGregory Hainaut2014-02-217-43/+745
| | | | | | | | | | | | | | | | | | | | | | | | | Nothings implemented yet but glProgramUniform* which are mostly a copy/paste of the older function glUniform* I create dedicated pipelineobj.[ch] file that will contains function related to the "new" pipeline container object. V2: formatting improvement V3: * indentation fix * Update copyright * Add a comment on ProgramParameteri already present in another extension * Remove TODO, will be readded on correct patch V4 (idr): * Fix dispatch_sanity unit test * Make extension string available in core profiles (instead of just compatibility). * Trivial reformating Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa/sso: Add extension tracking for ARB_separate_shader_objectsIan Romanick2014-02-212-0/+2
| | | | | | | This adds the necessary bits for both the API and the GLSL compiler. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa: Refactor per-stage link check to its own functionIan Romanick2014-02-211-68/+34
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa: Remove unnecessary condition.Courtney Goeltzenleuchter2014-02-211-2/+1
| | | | | | | | | Identified by Valgrind memory check. Initialized block-opaque in a different patch. This test seems unnecessary. If opaque must be true, just set to true. Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Courtney Goeltzenleuchter <[email protected]>
* glsl: add gl_InvocationID variable for ARB_gpu_shader5Jordan Justen2014-02-201-0/+1
| | | | | | | | | v2: * Make gl_InvocationID a system value Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* main/shaderapi: GL_GEOMETRY_SHADER_INVOCATIONS GetProgramiv supportJordan Justen2014-02-201-0/+6
| | | | | | | | | v3: * Add check for ARB_gpu_shader5 Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* mesa: initialize gl_geometry_program Invocations fieldJordan Justen2014-02-202-0/+2
| | | | | | Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* glsl/linker: produce gl_shader_program Geom.InvocationsJordan Justen2014-02-201-0/+9
| | | | | | | | | | Grab the parsed invocation count, check for consistency during linking, and finally save the result in gl_shader_program Geom.Invocations. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* mesa: Add GL_TEXTURE_CUBE_MAP_ARRAY to legal_get_tex_level_parameter_target()Anuj Phogat2014-02-181-0/+3
| | | | | | | | Fixes failing Khronos CTS test packed_depth_stencil_init.test Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* main: Avoid double-free of shader LabelCarl Worth2014-02-141-0/+1
| | | | | | | | | | | | | | | | | | | As documented, the _mesa_free_shader_program_data function: "Frees all the data that hangs off a shader program object, but not the object itself." This means that this function may be called multiple times on the same object, (and has been observed to). Meanwhile, the shProg->Label field was not being set to NULL after its free(). This led to a second call to free() of the same address on the second call to this function. Fix this by setting this field to NULL after free(), (just as with all other calls to free() in this function). Reviewed-by: Brian Paul <[email protected]> CC: [email protected]
* i965: Add a driver hook for binding renderbuffers to textures.Eric Anholt2014-02-121-0/+7
| | | | | | | | | | | | | | | | This will let us use meta's acceleration from renderbuffers without having to do a CopyTexImage first. This is like what we do for TFP, but just taking an existing renderbuffer and binding it to a texture with whatever its format was. The implementation won't work for stencil renderbuffers, and it only does non-texture renderbuffers (but then, if you're using a texture renderbuffer, you can just pull the texture object/level/slice out of the renderbuffer, anyway). v2: Don't forget to propagate NumSamples to the teximage. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Make TexImage error cases about internalFormat more informative.Eric Anholt2014-02-121-7/+13
| | | | | | | | | | I tripped over one of these when debugging meta, and it's a lot nicer to just see the internalFormat being complained about. v2: Drop a note in the other errors path that there is one early return. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: assorted clean-ups in detach_shader()Brian Paul2014-02-121-12/+12
| | | | | | | Fix formatting, add new comments, get rid of extraneous indentation. Suggested by Ian in bug 74723. Reviewed-by: Ian Romanick <[email protected]>
* mesa: Handle binding of uniforms to image units with glUniform*().Francisco Jerez2014-02-121-0/+36
| | | | | | | | v2: Set driver-specified flag in NewDriverState when glUniform* is used to bind an image unit. v3: Abbreviate argument type check. Reviewed-by: Paul Berry <[email protected]>
* mesa: Preserve the NewArrays state when copying a VAOFredrik Höglund2014-02-121-0/+1
| | | | | | | Cc: "10.1" "10.0" <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72895 Reviewed-by: Brian Paul <[email protected]>
* mesa: GL_ARB_half_float_pixel is not optionalIan Romanick2014-02-115-37/+9
| | | | | | | | | | | | | | | | | Almost every driver already supported it. All current and future Gallium drivers always support it, and most existing classic drivers support it. This only changes radeon and nouveau. This extension only adds data types that can be passed to, for example, glTexImage2D. It does not add internal formats. Since you can already pass GL_FLOAT to glTexImage2D this shouldn't pose any additional issues with those drivers. Note that r200 and i915 already supported this extension, and they don't support floating-point textures either. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Fix extension dependency for half-float TexBOsIan Romanick2014-02-111-1/+12
| | | | | | | | | | | Half-float TexBOs should require both GL_ARB_half_float_pixel and GL_ARB_texture_float. This doesn't matter much in practice. Every driver that supports GL_ARB_texture_buffer_object already supports GL_ARB_half_float_pixel. We only expose the TexBO extension in core profiles, and those require GL_ARB_texture_float. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Fix MESA_FORMAT_Z24_UNORM_S8_UINT vs. X8_UINT mix-up.Kenneth Graunke2014-02-097-35/+35
| | | | | | | | | | | | | | | | | | | | In commit eeed49f5f290793870c60b5b635b977a732a1eb4, Mark accidentally renamed MESA_FORMAT_S8_Z24 to MESA_FORMAT_Z24_UNORM_X8_UINT and MESA_FORMAT_X8_Z24 to MESA_FORMAT_Z24_UNORM_S8_UINT, reversing their sense. The commit message was correct, but what sed commands actually got run didn't match that. This patch swaps the two enum names, reversing them. This should undo the damage, but might break things if people have manually fixed a few instances in the meantime... Mark's commit also failed to mention renames: s/MESA_FORMAT_ARGB2101010_UINT\b/MESA_FORMAT_B10G10R10A2_UINT/g s/MESA_FORMAT_ABGR2101010\b/MESA_FORMAT_R10G10B10A2_UNORM/g but those seem okay. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: remove duplicated init of MaxViewportsMaxence Le Doré2014-02-091-3/+0
| | | | | | | Already declared 5 lines before. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Removed unnecessary check for NULL pointer when freeing memorySiavash Eliasi2014-02-091-2/+1
| | | | | | | | | Note that it is OK to pass NULL pointers to this function since this commit: mesa: modified _mesa_align_free() to accept NULL pointer http://cgit.freedesktop.org/mesa/mesa/commit/?id=f0cc59d68a9f5231e8e2111393a1834858820735 Reviewed-by: Marek Olšák <[email protected]>
* mesa: update assertion in detach_shader() for geom shadersBrian Paul2014-02-081-0/+1
| | | | | | Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74723 Cc: "10.0" "10.1" <[email protected]> Tested-by: Andreas Boll <[email protected]>