aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* dri: Fix the logger error message handling.Eric Anholt2014-01-273-3/+34
| | | | | | | | | | | Since the loader changes, there has been a compiler warning that the prototype didn't match. It turns out that if a loader error message was ever thrown, you'd segfault because of trying to use the warning level as a format string. Reviewed-by: Keith Packard <[email protected]> Tested-by: Keith Packard <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]>
* dri2: Trust our own driver name lookup over the server's.Eric Anholt2014-01-272-2/+12
| | | | | | | | | | This allows Mesa to choose to rename driver .sos (or split drivers), without needing a flag day with the corresponding 2D driver. v2: Undo the loader-only-for-dri3 change. Reviewed-by: Keith Packard <[email protected]> [v1] Reviewed-by: Kristian Høgsberg <[email protected]> [v1]
* dri2: Open the fd before loading the driver.Eric Anholt2014-01-271-14/+14
| | | | | | | | I want to stop trusting the server for the driver name, and instead decide on our own based on the fd, so I needed this code motion. Reviewed-by: Keith Packard <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]>
* dri3: Fix two little memory leaks.Eric Anholt2014-01-271-2/+2
| | | | | | | Noticed when valgrinding an unrelated bug. Reviewed-by: Keith Packard <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]>
* loader: Use dlsym to get our udev symbols instead of explicit linking.Eric Anholt2014-01-273-5/+44
| | | | | | | | | | | | | | | | Steam links against libudev.so.0, while we're linking against libudev.so.1. The result is that the symbol names (which are the same in the two libraries) end up conflicting, and some of the usage of .so.1 calls the .so.0 bits, which have different internal structures, and segfaults happen. By using a dlopen() with RTLD_LOCAL, we can explicitly look for the symbols we want, while they get the symbols they want. Reviewed-by: Keith Packard <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]> Tested-by: Alexandre Demers <[email protected]> Tested-by: Mike Lothian <[email protected]>
* r600g/compute: Emit DEALLOC_STATE on cayman after dispatching a compute shader.Tom Stellard2014-01-274-14/+10
| | | | | | | | | | | | This is necessary to prevent the next SURFACE_SYNC packet from hanging the GPU. https://bugs.freedesktop.org/show_bug.cgi?id=73418 Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Alex Deucher <[email protected]> CC: "9.2" "10.0" <[email protected]>
* nv50, nvc0: update reported glsl version to 330Ilia Mirkin2014-01-272-2/+2
| | | | Signed-off-by: Ilia Mirkin <[email protected]>
* mesa/st: expose ARB_texture_rgb10_a2ui if R10G10B10A2_UINT is supported v2Christoph Bumiller2014-01-272-2/+8
| | | | Reviewed-by: Marek Olšák <[email protected]>
* nv50: add more RGB10A2 formatsChristoph Bumiller2014-01-271-0/+7
|
* st/mesa: fix GS varyings for PIPE_CAP_TGSI_TEXCOORDChristoph Bumiller2014-01-271-10/+9
|
* nv50: enable seamless cube maps on all hwIlia Mirkin2014-01-271-1/+1
| | | | | | | | | | Some of the hardware support is missing. The NVIDIA-provided driver, which claims seamless cube map support fails the relevant tests as well. As this is the last extension before we can have OpenGL 3.2, doing this allows us to expose geometry shaders without doing the additional work involved in supporting ARB_geometry_shader4. Signed-off-by: Ilia Mirkin <[email protected]>
* nv50: report glsl 1.50 now that gp tests passIlia Mirkin2014-01-271-1/+1
| | | | Signed-off-by: Ilia Mirkin <[email protected]>
* nv50: add support for texelFetch'ing MS textures, ARB_texture_multisampleIlia Mirkin2014-01-277-7/+164
| | | | | | | | | | | | | | Creates two areas in the AUX constbuf: - Sample offsets for MS textures - Per-texture MS settings When executing a texelFetch with a MS sampler, looks up that texture's settings and adjusts the parameters given to the texfetch instruction. With this change, all the ARB_texture_multisample piglits pass, so turn on PIPE_CAP_TEXTURE_MULTISAMPLE. Signed-off-by: Ilia Mirkin <[email protected]>
* nv50: copy nvc0's get_sample_position implementationIlia Mirkin2014-01-271-0/+46
| | | | Signed-off-by: Ilia Mirkin <[email protected]>
* nv50: add comments about CB_AUX contentsIlia Mirkin2014-01-273-5/+15
| | | | | | | Updates a few inconsistencies as well, like the size of the buffer, location of the runout, etc. Signed-off-by: Ilia Mirkin <[email protected]>
* nvc0: don't forget to also clear additional layersIlia Mirkin2014-01-271-5/+27
| | | | Signed-off-by: Ilia Mirkin <[email protected]>
* nv50: don't forget to also clear additional layersIlia Mirkin2014-01-271-5/+27
| | | | | | Fixes most of the tests/spec/gl-3.2/layered-rendering/* piglits. Signed-off-by: Ilia Mirkin <[email protected]>
* nv50: allocate an extra code bo to avoid dmesg spamIlia Mirkin2014-01-271-1/+5
| | | | | | | | | Each code BO is a heap that allocates at the end first, and so GPs are allocated at the very end of the allocated space. When executing, we see PAGE_NOT_PRESENT errors for the next page. Just over-allocate to make sure that there's something there. Signed-off-by: Ilia Mirkin <[email protected]>
* nv50: GP_REG_ALLOC_RESULT must be positiveIlia Mirkin2014-01-271-0/+2
| | | | | | Set max_out to 1 when there are no outputs. Signed-off-by: Ilia Mirkin <[email protected]>
* nv50: VP_RESULT_MAP_SIZE has to be positiveIlia Mirkin2014-01-271-0/+4
| | | | | | | | Make sure that we never try to use a 0-sized map. This can happen when using a gp, so add a dummy mapping when computing vp_gp_mapping in that case. Signed-off-by: Ilia Mirkin <[email protected]>
* nv50: enable primitive id generation when it is an FP input without GPIlia Mirkin2014-01-272-9/+8
| | | | Signed-off-by: Ilia Mirkin <[email protected]>
* nv50: handle gl_Layer writes in GPIlia Mirkin2014-01-274-1/+19
| | | | | | | | Marks gl_Layer as only having one component, and makes sure to keep track of where it is and emit it in the output map, since it is not an input to the FP. Signed-off-by: Ilia Mirkin <[email protected]>
* nv50: properly set the PRIMITIVE_ID enable flag when it is a gp input.Ilia Mirkin2014-01-271-0/+3
| | | | Signed-off-by: Ilia Mirkin <[email protected]>
* nv50/ir: add support for gl_PrimitiveIDInIlia Mirkin2014-01-273-5/+11
| | | | | | | | | | | | | Note that the primitive id is stored in a[0x18], while usually the geometry instructions are of the form a[$a1 + 0x4] which gets mapped to p[] space. We need to avoid the change from a[] to p[] here, so it's keyed on whether the access is indirect or not. Note that there's also a use-case for accessing e.g. a[$r1], however that's not supported for now. (Could be added by checking the register file of the indirect parameter.) Signed-off-by: Ilia Mirkin <[email protected]>
* nv50/ir: fix support for shader input + immediate in gpIlia Mirkin2014-01-272-1/+7
| | | | | | This only works for up to $a3, hopefully we won't go that high. Signed-off-by: Ilia Mirkin <[email protected]>
* nv50/ir: disallow shader input + cbuf in same instruction in gpIlia Mirkin2014-01-271-1/+6
| | | | Signed-off-by: Ilia Mirkin <[email protected]>
* nv50/ir: disallow predicates on emit/restart opsIlia Mirkin2014-01-271-1/+2
|
* nv50: allow vert_count to be >255Ilia Mirkin2014-01-271-1/+1
| | | | Signed-off-by: Ilia Mirkin <[email protected]>
* nv50: add support for geometry shadersBryan Cain2014-01-274-6/+39
| | | | | | | | | | Layer output probably doesn't work yet, but other than that everything seems to be working. Signed-off-by: Bryan Cain <[email protected]> [calim: fix up minor bugs, code formatting] Signed-off-by: Christoph Bumiller <[email protected]> Signed-off-by: Ilia Mirkin <[email protected]>
* nv50/ir: delay calculation of indirect addressesBryan Cain2014-01-273-13/+136
| | | | | | | | | | | | | | Instead of emitting an SHL 4 io an address register on the TGSI ARL and UARL instructions, emit the shift when the loaded address is actually used. This is necessary because input vertex and attribute indices in geometry shaders on nv50 need to be shifted left by 2 instead of 4. Signed-off-by: Bryan Cain <[email protected]> [calim: various updates to the indirect address logic] Signed-off-by: Christoph Bumiller <[email protected]> [imirkin: remove OP_MAD change that calim made, add OP_RESTART handling same as OP_EMIT for code flow analysis] Signed-off-by: Ilia Mirkin <[email protected]>
* nv50/ir: fix PFETCH and add RDSV to get VSTRIDE for GPsChristoph Bumiller2014-01-273-5/+59
|
* nv50/ir: txg not available on nvaa/nvacIlia Mirkin2014-01-271-1/+1
| | | | Signed-off-by: Ilia Mirkin <[email protected]>
* nv50, nvc0: only clear out the buffers that we were asked to clearIlia Mirkin2014-01-272-14/+24
| | | | | | | Fixes fbo-drawbuffers-none glClearBuffer piglit test. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* nv50, nvc0: clear out RT on a null cbufIlia Mirkin2014-01-274-8/+52
| | | | | | | | | | | | This is needed since commit 9baa45f78b (st/mesa: bind NULL colorbuffers as specified by glDrawBuffers). This implementation is highly based on a larger commit by Christoph Bumiller <[email protected]> in his gallium-nine branch. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* nv50: don't leak heap on tls alloc failureIlia Mirkin2014-01-271-1/+3
| | | | Signed-off-by: Ilia Mirkin <[email protected]>
* nouveau/codegen: set dType to S32 for OP_NEG U32Ilia Mirkin2014-01-273-7/+27
| | | | | | | | | | | | | | | | | | | | | | It doesn't make sense to do an OP_NEG from U32 to U32. This was manifested on nv50 in glsl-fs-atan-3 which was generating a UMAD TEMP[0].x, TEMP[0].xxxx, -TEMP[5].xxxx, TEMP[0].xxxx instruction. (For some reason, nvc0 causes a different shader to be generated.) This led to a cvt neg u32 $r1 u32 $r1 Which did not yield the desired result. This changes the final output to cvt neg s32 $r1 u32 $r1 which produces the desired output and the piglit tests passes. My assumption is that this is also what we want on nvc0, but could not test as there was no suitable shader that generated the problem instruction. Signed-off-by: Ilia Mirkin <[email protected]>
* util/u_vbuf: correct map offset calculation for crazy offsetsIlia Mirkin2014-01-271-1/+1
| | | | | | | | | When the min_index is very large (or very negative), the multipliation can overflow 32 bits and result in an incorrect map pointer modification. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* translate: deal with size overflows by casting to ptrdiff_tIlia Mirkin2014-01-272-3/+7
| | | | | | | | | | | This was discovered as a result of the draw-elements-base-vertex-neg piglit test, which passes very negative offsets in, followed up by large indices. The nouveau code correctly adjusts the pointer, but the translate code needs to do the proper inverse correction. Similarly fix up the SSE code to do a 64-bit multiply to compute the proper offset. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium/rtasm: handle mmap failures appropriatelyEmil Velikov2014-01-271-3/+7
| | | | | | | | | | | | | | For a variety of reasons mmap (selinux and pax to name a few) and can fail and with current code. This will result in a crash in the driver, if not worse. This has been the case since the inception of the gallium copy of rtasm. Cc: 9.1 9.2 10.0 <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73473 Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Jakob Bornecrantz <[email protected]>
* i965: Don't store qpitch / 4 as mt->qpitch for compressed surfaces.Kenneth Graunke2014-01-252-5/+8
| | | | | | | | | | | | | | | | | | | | Broadwell requires software to specify QPitch in a bunch of packets, so we decided to store it in the miptree. However, when I did that refactoring, I missed a subtlety: the hardware expects QPitch to be "in units of rows in the uncompressed surface". This is the value we originally compute. However, for compressed surfaces, we then divided it by 4 (the block height), to obtain the physical layout. This is no longer the QPitch Broadwell expects. So, store the original undivided value in mt->qpitch, but continue to use the divided value in brw_miptree_layout_texture_array(). For non-Broadwell platforms, this should have no impact at all. Helps fix Piglit's "getteximage-targets S3TC CUBE" test on Broadwell. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* glsl: Simplify built-in generator functions for min3/max3/mid3.Kenneth Graunke2014-01-241-77/+60
| | | | | | | | | The type of all three parameters are identical, so we don't need to specify it three times. The predicate is always identical too, so we don't need to make it a parameter, either. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glsl: Fix chained assignments of vector channels.Kenneth Graunke2014-01-241-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simple shaders such as: void splat(vec2 v, float f) { v[0] = v[1] = f; } failed to compile with the following error: error: value of type vec2 cannot be assigned to variable of type float First, we would process v[1] = f, and transform: LHS: (expression float vector_extract (var_ref v) (constant int (1))) RHS: (var_ref f) into: LHS: (var_ref v) RHS: (expression vec2 vector_insert (var_ref v) (constant int (1)) (var_ref f)) Note that the LHS type is now vec2, not a float. This is surprising, but not the real problem. After emitting assignments, this ultimately becomes: (declare (temporary) vec2 assignment_tmp) (assign (xy) (var_ref assignment_tmp) (expression vec2 vector_insert (var_ref v) (constant int (1)) (var_ref f))) (assign (xy) (var_ref v) (var_ref assignment_tmp)) We would then return (var_ref assignment_tmp) as the rvalue, which has the wrong type---it should be float, but is instead a vec2. To fix this, we simply return (vector_extract (var_ref assignment_temp) <the appropriate channel>) to pull out the desired float value. Fixes Piglit's chained-assignment-with-vector-constant-index.vert and chained-assignment-with-vector-dynamic-index.vert tests. Cc: [email protected] Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74026 Reported-by: Dan Ginsburg <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* glsl: Rename "expr" to "lhs_expr" in vector_extract munging code.Kenneth Graunke2014-01-241-6/+6
| | | | | | | | | | | When processing assignments, we have both an LHS and RHS. At a glance, "lhs_expr" clearly refers to the LHS, while a generic name like "expr" is ambiguous. Cc: [email protected] Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* Update .gitignore for Catalan translations build artifactsPaul Berry2014-01-241-0/+1
| | | | | | Causes git to ignore the new build artifacts introduced by commit d5e5367e8992c2e5322d35fba8d86c33a0db6825 (driconf: Add Catalan translations).
* mesa: Increment the list pointer while freeing instruction dataIan Romanick2014-01-241-0/+1
| | | | | | | | | | | | | Since the list pointer was never incremented when a OPCODE_PIXEL_MAP opcode was encountered, the data for the instruction would get freed over and over and over... resulting in a crash. Fixes gl-1.0-beginend-coverage. Signed-off-by: Ian Romanick <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72214 Reviewed-by: Brian Paul <[email protected]> Cc: Lu Ha <[email protected]>
* svga: rename "tex_usage" to "bindings", add commentsBrian Paul2014-01-241-7/+11
| | | | Trivial.
* st/mesa: add a simple sanity check assertion in st_validate_attachment()Brian Paul2014-01-241-0/+6
| | | | Reviewed-by: Marek Olšák <[email protected]>
* i965/gen7: Use to the correct program when uploading transform feedback state.Paul Berry2014-01-232-10/+6
| | | | | | | | | | | | Transform feedback may come from either the geometry shader or the vertex shader, so we can't use ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX] to find the current post-link transform feedback information. Fortunately we can use ctx->TransformFeedback.CurrentObject->shader_program. Cc: 10.0 <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Ensure that transform feedback refers to the correct program.Paul Berry2014-01-232-15/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | Previous to this patch, the _mesa_{Begin,Resume}TransformFeedback functions were using ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX] to find the program that would be the source of transform feedback data. This isn't correct--if there's a geometry shader present it should be ctx->Shader.CurrentProgram[MESA_SHADER_GEOMETRY]. (These might be different if separate shader objects are in use). This patch creates a function get_xfb_source(), which figures out the correct program to use based on GL state, and updates _mesa_{Begin,Resume}TransformFeedback to call it. get_xfb_source() is written in terms of the gl_shader_stage enum, so it should not need modification when we add tessellation shaders in the future. It also creates a new driver flag, NewTransformFeedbackProg, which is flagged whenever this program changes. To reduce future confusion, this patch also rewords some comments and error message text to avoid referring to vertex shaders. Cc: 10.0 <[email protected]> v2: make the for loop in get_xfb_source() clearer. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Remove *_generator::shader field; use prog field instead.Paul Berry2014-01-237-18/+8
| | | | | | | | | | | | | | | The "shader" field in fs_generator, vec4_generator, and gen8_generator was only used for one purpose; to figure out if we were compiling an assembly program or a GLSL shader (shader is NULL for assembly programs). And it wasn't being used properly: in vec4 shaders we were always initializing it based on prog->_LinkedShaders[MESA_SHADER_FRAGMENT], regardless of whether we were compiling a geometry shader or a vertex shader. This patch simplifies things by using the "prog" field instead; this is also NULL for assembly programs. Reviewed-by: Kenneth Graunke <[email protected]>