summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* glsl: Add missing type inference support for ARB_gpu_shader5 unops.Kenneth Graunke2013-09-091-0/+4
| | | | | | Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* glsl: Initialize lod_info in the ir_texture constructor.Kenneth Graunke2013-09-091-0/+1
| | | | | | | | | | This isn't strictly necessary, since creators of ir_texture objects should set LOD when relevant. However, it's nice to have a NULL pointer in case they forget. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* glsl: Skip unavailable built-ins when printing out similar candidates.Kenneth Graunke2013-09-091-0/+3
| | | | | | Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* glsl: Skip unavailable built-ins when matching signatures.Kenneth Graunke2013-09-091-0/+8
| | | | | | Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* glsl: Pass _mesa_glsl_parse_state into matching_signature and such.Kenneth Graunke2013-09-0912-21/+30
| | | | | | | | | | | | | | | | | | | | | | | During compilation, we'll use this to determine built-in availability. The plan is to have a single shader containing every built-in in every version of the language, but filter out the ones that aren't actually available to the shader being compiled. At link time, we don't actually need this filtering capability: we've already imported prototypes for every built-in that the shader actually calls, and they're flagged as is_builtin(). The linker doesn't import any additional prototypes, so it won't pull in any unavailable built-ins. When resolving prototypes to function definitions, the linker ensures the values of is_builtin() match, which means that a shader can't trick the linker into importing the body of an unavailable built-in by defining a suspiciously similar prototype. In other words, during linking, we can just pass in NULL. It will work out fine. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* glsl: Add a method to tell whether a built-in is available.Kenneth Graunke2013-09-092-0/+20
| | | | | | | | | | | We can simply call the stored predicate function. If state is NULL, just report that the function is available. v2: Add a comment (requested by Paul Berry). Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* glsl: Mark _mesa_glsl_parse_state::is_version() as const.Kenneth Graunke2013-09-091-1/+1
| | | | | | | | | This promises the method won't modify the contents of the object. This allows us to call it even with a const pointer to the state. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* glsl: Convert ir_function_signature::is_builtin to a method.Kenneth Graunke2013-09-096-10/+15
| | | | | | | | | | | A signature is a built-in if and only if builtin_info != NULL, so we don't actually need a separate flag bit. Making a boolean-valued method allows existing code to ask the same question while not worrying about the internal representation. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* glsl: Store a predicate for whether a built-in signature is available.Kenneth Graunke2013-09-094-6/+30
| | | | | | | | | | | | | | | | | | | | | | | | For the upcoming built-in function rewrite, we'll need to be able to answer "Is this built-in function signature available?". This is actually a somewhat complex question, since it depends on the language version, GLSL vs. GLSL ES, enabled extensions, and the current shader stage. Storing such a set of constraints in a structure would be painful, so instead we store a function pointer. When creating a signature, we simply point to a predicate that inspects _mesa_glsl_parse_state and answers whether the signature is available in the current shader. Unfortunately, IR reader doesn't actually know when built-in functions are available, so this patch makes it lie and say that they're always present. This allows us to hook up the new functionality; it just won't be useful until real data is populated. In the meantime, the existing profile mechanism ensures built-ins are available in the right places. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* i965/vec4: Only zero out unused message components when there are any.Kenneth Graunke2013-09-091-2/+4
| | | | | | | | | | | | | | | Otherwise, coordinates with four components would result in a MOV with a destination writemask that has no channels enabled: mov(8) g115<1>.F 0D { align16 WE_normal NoDDChk 1Q }; At best, this is stupid: we emit code that shouldn't do anything. Worse, it apparently causes GPU hangs (observable with Chris's textureGather test on CubeArrays.) Signed-off-by: Kenneth Graunke <[email protected]> Cc: Chris Forbes <[email protected]> Cc: [email protected]
* vbo: Implement new gs prim types in vbo_count_tessellated_primitives.Paul Berry2013-09-091-0/+12
| | | | Reviewed-by: Matt Turner <[email protected]>
* i965: Enable AMD_seamless_cubemap_per_textureIan Romanick2013-09-084-2/+7
| | | | | | | | | | | | | | | | The change is very small. Do seamless filtering if either the context enable is set or the sampler enable is set. The AMD_seamless_cubemap_per_texture says: "If TEXTURE_CUBE_MAP_SEAMLESS_ARB is emabled (sic) globally or the value of the texture's TEXTURE_CUBE_MAP_SEAMLESS_ARB parameter is TRUE, seamless cube map sampling is enabled..." Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Chris Forbes <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Always use seamless cubemap filtering in GLES3Ian Romanick2013-09-081-0/+8
| | | | | | | | | | | | | | | | | | | | | | | Appendix F.2 of the OpenGL ES 3.0.0 spec says: "OpenGL ES 3.0 requires that all cube map filtering be seamless. OpenGL ES 2.0 specified that a single cube map face be selected and used for filtering." Setting the field only in the context will work fine with sampler objects (and drivers that support AMD_seamless_cubemap_per_texture) because seamless filtering is used if *either* the context or the sampler enable it: "If TEXTURE_CUBE_MAP_SEAMLESS_ARB is emabled (sic) globally or the value of the texture's TEXTURE_CUBE_MAP_SEAMLESS_ARB parameter is TRUE, seamless cube map sampling is enabled..." Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Chris Forbes <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reported-by: Maxence Le Dore <[email protected]> Thanked-by: Maxence Le Dore <[email protected]>
* mesa: Don't allow glSamplerParameteriv(GL_TEXTURE_CUBE_MAP_SEAMLESS) in ESIan Romanick2013-09-081-1/+2
| | | | | | | | | | There is no GL_TEXTURE_CUBE_MAP_SEAMLESS in any version of OpenGL ES or in any extension that applies to OpenGL ES. The same error check already occurs for glTexParameteri. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Chris Forbes <[email protected]> Cc: Maxence Le Dore <[email protected]>
* docs: initial 9.3 release notes fileIan Romanick2013-09-082-0/+58
| | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Chris Forbes <[email protected]> Acked-by: Paul Berry <[email protected]>
* ilo: preliminary GEN 7.5 supportChia-I Wu2013-09-0810-107/+236
| | | | | This is based on grepping for brw->is_haswell in i965 to see how GEN 7.5 differs from GEN 7. Slightly tested with Xonotic and some Mesa demos.
* radeonsi: add berlin pci idsAlex Deucher2013-09-061-0/+22
| | | | Signed-off-by: Alex Deucher <[email protected]>
* r600g: remove DMA paddingAlex Deucher2013-09-061-9/+0
| | | | | | | This is now handled in the winsys. Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* radeon/winsys: pad IBs to a multiple of 8 DWsAlex Deucher2013-09-061-0/+30
| | | | | | | | | | | | | | | This aligns the gfx, compute, and dma IBs to 8 DW boundries. This aligns the the IB to the fetch size of the CP for optimal performance. Additionally, r6xx hardware requires at least 4 DW alignment to avoid a hw bug. This also aligns the DMA IBs to 8 DW which is required for the DMA engine. This alignment is already handled in the gallium driver, but that patch can be removed now that it's done in the winsys. Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Alex Deucher <[email protected]> CC: "9.2" <[email protected]> CC: "9.1" <[email protected]>
* gallium, intel: Implements new __DRI_IMAGE_USE_LINEAR and PIPE_BIND_LINEAR ↵Axel Davy2013-09-0612-6/+30
| | | | | | flags to enforce no tiling. Signed-off-by: Axel Davy <[email protected]>
* mesa: Ensure gl_query_object is fully initialized.Vinson Lee2013-09-061-1/+1
| | | | | | | | | | | | 278372b47e4db8a022d57f60302eec74819e9341 added the uninitialized pointer field gl_query_object:Label. A free of this pointer resulted in a crash. This patch fixes piglit regressions with swrast introduced by 6d8dd59cf53d2f47b817d79204a52bb3a46e8c77. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69047 Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallivm: support indirect registers on both dimensionsZack Rusin2013-09-063-8/+22
| | | | | | | | | | | We support indirect addressing only on the vertex index, but some shaders also use indirect addressing on attributes. This patch adds support for indirect addressing on both dimensions inside gs arrays. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: José Fonseca <[email protected]>
* i915g: Document fall-through switchStéphane Marchesin2013-09-061-4/+3
| | | | Fixes warning reported by Coverity.
* i915g: Handle i915->batch == NULL correctly in flushStéphane Marchesin2013-09-061-1/+4
| | | | Fixes warning reported by Coverity.
* i915g: Remove useless comparisonStéphane Marchesin2013-09-061-3/+2
| | | | Fixes "Macro compares unsigned to 0" defect reported by Coverity.
* i915g: Fix initial array indexStéphane Marchesin2013-09-061-1/+1
| | | | Fixes "Out-of-bounds read" defect reported by Coverity.
* mesa: add GL_KHR_debug functions to dispatch_sanity.cppBrian Paul2013-09-061-0/+12
| | | | | | Fixes 'make check' failures. Reviewed-by: Ian Romanick <[email protected]>
* docs: Add some notes on submitting patchesTimothy Arceri2013-09-061-0/+23
| | | | | Signed-off-by: Timothy Arceri <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* r600g/compute: Fix bug in compute memory poolTom Stellard2013-09-051-7/+2
| | | | | | | When adding a new buffer to the beginning of the memory pool, we were accidentally deleting the buffer that was first in the buffer list. This was caused by a bug in the memory pool's linked list implementation.
* r600g/compute: Don't flush the cs in pipe_context::launch_grid()Tom Stellard2013-09-051-10/+1
| | | | | | This is the state tracker's responsibility. Reviewed-by: Marek Olšák <[email protected]>
* i965: Remove never used DPA2 opcode.Matt Turner2013-09-051-1/+0
| | | | | | | | | | | DPA2 is listed in the "Defeatured Instructions" section of the 965 PRM, Volume 4: "The following instructions are removed from Gen4 implementation mainly due to implementation cost/schedule reasons. They are candidates for future generations." Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Remove never used RSR and RSL opcodes.Matt Turner2013-09-054-8/+0
| | | | | | | | | | | RSR and RSL are listed in the "Defeatured Instructions" section of the 965 PRM, Volume 4: "The following instructions are removed from Gen4 implementation mainly due to implementation cost/schedule reasons. They are candidates for future generations." Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: propagate max_array_access through function callsDominik Behr2013-09-051-0/+32
| | | | | | | | | | | | Fixes a bug where if an uniform array is passed to a function the accesses to the array are not propagated so later all but the first vector of the uniform array are removed in parcel_out_uniform_storage resulting in broken shaders and out of bounds access to arrays in brw::vec4_visitor::pack_uniform_registers. Cc: [email protected] Reviewed-and-Tested-by: Matt Turner <[email protected]> Signed-off-by: Dominik Behr <[email protected]>
* nv30: fix inconsistent setting of push->user_privIlia Mirkin2013-09-051-1/+1
| | | | | | | It's set to &nv30->bufctx everywhere else. Signed-off-by: Ilia Mirkin <[email protected]> Cc: "9.2" <[email protected]>
* i965/gen7.5: Fix lower bound on number of VS URB entries.Paul Berry2013-09-054-4/+13
| | | | | | | | | | | | Haswell GT2 and GT3 require the number of vertex shader URB entries to be at least 64, not 32. At the moment, we always meet this requirement automatically, because in the absence of a geometry shader, we assign all available URB space to the vertex shader. But when we turn on support for geometry shaders, this lower limit will become important. Reviewed-by: Chad Versace <[email protected]>
* i965/vs: Move vs-specific code out of brw_vec4_visitor.cpp.Paul Berry2013-09-053-192/+226
| | | | | | | | | | | This patch creates a new file brw_vec4_vs_visitor.cpp, to contain code that is specific to the vertex shader. Now the organization of vertex shader and geometry shader visitor code is symmetric: vs-specific code is in brw_vec4_vs_visitor.cpp, gs-specific code is in brw_vec4_gs_visitor.cpp, and code shared between vs and gs is in brw_vec4_visitor.cpp. Acked-by: Kenneth Graunke <[email protected]>
* i965/vec4: Make with_writemask() non-static.Paul Berry2013-09-052-1/+4
| | | | | | | This will allow it to be shared between brw_vec4_visitor.cpp and brw_vec4_vs_visitor.cpp (which will be created in the next patch). Acked-by: Kenneth Graunke <[email protected]>
* i965/vs: Move vs-specific code out of brw_vec4.h.Paul Berry2013-09-052-32/+38
| | | | | | | Now brw_vec4.h contains only code that is shared between the vertex and geometry shaders. Acked-by: Kenneth Graunke <[email protected]>
* i965/gs: Don't assign gl_Layer its own slot in the VUE map.Paul Berry2013-09-051-0/+5
| | | | Reviewed-by: Chad Versace <[email protected]>
* i915g: Implement writemask fixupStéphane Marchesin2013-09-043-38/+90
| | | | | | | | | The fixup code emulates non-BGRA render targets by adding an extra instruction at the end of fragment shaders to swizzle the output. To do this, we also swizzle the blend function. However an oversight until now was that the writemask wasn't getting swizzled. This patch fixes that which fixes a bunch of piglit tests.
* i915g: Stop calling draw_prepare_shader_outputsStéphane Marchesin2013-09-041-2/+0
| | | | | It's not useful on i915g since we don't support primid. Fixes piglit point tests on i915g.
* glx: Initialize OpenGL version to 1.0Rico Schüller2013-09-043-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The old code in dri2_glx suffered from a typographical error that caused the default version to be 2.1 instead of 1.2 (minimum required by the Linux OpenGL ABI). drisw_glx had a similar error resulting in a default version of 0.1. Some driver/card combinations (r200/RV280, i915/915G) don't support OpenGL 2.1. These create in some corner cases an indirect context instead of a direct context when calling glXCreateContextAttribsARB(). This happens because of a bad default value. To avoid this, just used the default value specified by the GLX_ARB_create_context specification: "The default values for GLX_CONTEXT_MAJOR_VERSION_ARB and GLX_CONTEXT_MINOR_VERSION_ARB are 1 and 0 respectively. In this case, implementations will typically return the most recent version of OpenGL they support which is backwards compatible with OpenGL 1.0 (e.g. 3.0, 3.1 + GL_ARB_compatibility, or 3.2 compatibility profile)" Refactor all the default value setting to dri2_convert_glx_attribs, and make sure the correct defaults are set in that one place. Signed-off-by: Rico Schüller <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Bugzilla http://bugs.winehq.org/show_bug.cgi?id=34238 Cc: "9.1 9.2" <[email protected]>
* i915g: Add more optimizationsStéphane Marchesin2013-09-043-58/+371
| | | | | | | | | This patch adds liveness analysis to i915g and a couple optimizations which benefit from it. One interesting optimization turns (fake) indirect texture accesses into direct texture accesses (the i915 supports a maximum of 4 indirect texture accesses). Among other things this fixes a bunch of piglit tests.
* glsl: Remove unused prog parameter from tfeedback_decl::initIan Romanick2013-09-042-5/+4
| | | | | | | It looks like commit 53febac removed the last user of that parameter. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* glsl: Validate qualifiers on VS color outputs with FS color inputsIan Romanick2013-09-041-3/+45
| | | | | | | | | | | | | | | | | | | | | | | The vertex shader color outputs (gl_FrontColor, gl_BackColor, gl_FrontSecondaryColor, and gl_BackSecondaryColor) don't have the same names as the matching fragment shader color inputs (gl_Color and gl_SecondaryColor). As a result, the qualifiers on them were not being properly cross validated. Full spec compliance required ir_variable::used and ir_variable::assigned be set properly. Without the preceeding patch, which fixes the ::clone method to copy them, this will not be the case. Fixes all of the previously failing piglit spec/glsl-1.30/linker/interpolation-qualifiers tests. v2: Update callers of cross_validate_types_and_qualifiers and cross_validate_front_and_back_color. The function signature changed in v2 of a previous patch. Suggested by Paul. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Paul Berry <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47755
* glsl: Copy ir_variable::assigned and ir_variable::used fields in ::clone methodIan Romanick2013-09-041-0/+2
| | | | | | | Nothing currently relies on this, but one of the next patches will. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* glsl: Refactor a bunch of the code out of cross_validate_outputs_to_inputsIan Romanick2013-09-041-81/+94
| | | | | | | | | | | | The new function, cross_validate_types_and_qualifiers, will have multiple callers from this file in future commits. v2: Don't pass the names of the producer / consumer stages to cross_validate_types_and_qualifiers. Instead, pass the types and get the names only in the error paths. Suggested by Paul. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* glsl: Reallow precision qualifiers on structure membersIan Romanick2013-09-041-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes to the grammar for GL_ARB_shading_language_420pack (commit 6eec502) moved precision qualifiers out of the type_specifier production chain. This caused declarations such as: struct S { lowp float f; }; to generate parse errors. Section 4.1.8 (Structures) of both the GLSL ES 1.00 spec and GLSL 1.30 specs says: "Member declarators may contain precision qualifiers, but may not contain any other qualifiers." So, it sure seems like we shouldn't generate a parse error. :) Instead of type_specifier, use fully_specified_type in struct members. However, fully_specified_type allows a lot of other qualifiers that are not allowed on structure members, so expeclitly disallow them. Note, this makes struct_declaration look an awful lot like member_declaration (used for interface blocks). We may want to (somehow) unify these rules to reduce code duplication at some point. Signed-off-by: Ian Romanick <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68753 Reported-by: Aras Pranckevicius <[email protected]> Cc: Aras Pranckevicius <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]> Cc: "9.2" <[email protected]>
* mesa: Setup remaining infrastucture and enable KHR_debugTimothy Arceri2013-09-042-5/+12
| | | | | | Signed-off-by: Timothy Arceri <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* glapi: Setup autogeneration infrastructure for KHR_debugTimothy Arceri2013-09-042-1/+149
| | | | | | Signed-off-by: Timothy Arceri <[email protected]> Reviewed-by: Brian Paul <[email protected]>