summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* st/nine: Implement TEXM3x2TEXAxel Davy2015-01-221-1/+19
| | | | | | | Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: David Heidelberg <[email protected]> Signed-off-by: Axel Davy <[email protected]> Cc: "10.4" <[email protected]>
* st/nine: implement TEXM3x2DEPTHAxel Davy2015-01-221-1/+26
| | | | | | Reviewed-by: Ilia Mirkin <[email protected]> Signed-off-by: Axel Davy <[email protected]> Cc: "10.4" <[email protected]>
* st/nine: Fix TEXM3x3 and implement TEXM3x3VSPECAxel Davy2015-01-221-17/+36
| | | | | | | | | | The fix is that this line: "src[s] = tx->regs.vT[s];" is wrong if s doesn't start from 0. Instead access tx->regs.vT directly when needed. Reviewed-by: Ilia Mirkin <[email protected]> Signed-off-by: Axel Davy <[email protected]> Cc: "10.4" <[email protected]>
* st/nine: Fill missing dst and src number for some instructions.Axel Davy2015-01-221-23/+23
| | | | | | | | | | Not filling them correctly results in bad padding and later crash. Reviewed-by: David Heidelberg <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Signed-off-by: Axel Davy <[email protected]> Cc: "10.4" <[email protected]>
* st/nine: Implement TEXCOORD special behavioursAxel Davy2015-01-221-5/+26
| | | | | | | | | | | | | | | | | | texcoord for ps < 1_4 should clamp between 0 and 1 the values. texcrd (texcoord ps 1_4) does not clamp and can be used with two modifiers _dw and _dz that means the channels are divided by w or z. Implement those in shared code, since the same modifiers can be used for texld ps 1_4. v2: replace DIV by RCP + MUL v3: Remove an useless MOV Reviewed-by: Tiziano Bacocco <[email protected]> Signed-off-by: Axel Davy <[email protected]> Cc: "10.4" <[email protected]>
* st/nine: Fix CALLNZ implementationAxel Davy2015-01-221-9/+4
| | | | | | | | | | | | | | | | | Nothing seems to indicates the negation modifier would be stored in the instruction flags instead of the source modifier. tx_src_param has already handled it if it is in the source modifier. In addition, when the card supports native integers, the boolean are stored in 32 bits int and are equal to 0 or 0xFFFFFFFF. Given 0xFFFFFFFF is NaN if it was a float, better use UIF than IF. Reviewed-by: Ilia Mirkin <[email protected]> Signed-off-by: Axel Davy <[email protected]>
* st/nine: Fix some fixed function pipeline operationAxel Davy2015-01-221-2/+4
| | | | | | | Reviewed-by: Ilia Mirkin <[email protected]> Signed-off-by: Axel Davy <[email protected]> Cc: "10.4" <[email protected]>
* st/nine: Clamp ps 1.X constantsAxel Davy2015-01-221-0/+7
| | | | | | | | | This is wine (and windows) behaviour. Reviewed-by: Ilia Mirkin <[email protected]> Signed-off-by: Axel Davy <[email protected]> Cc: "10.4" <[email protected]>
* st/nine: Remove duplicated code for ps texcoord input declarationAxel Davy2015-01-221-8/+4
| | | | | | Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: David Heidelberg <[email protected]> Signed-off-by: Axel Davy <[email protected]>
* st/nine: Fix CND implementationAxel Davy2015-01-221-9/+13
| | | | | | | Signed-off-by: Axel Davy <[email protected]> Signed-off-by: Tiziano Bacocco <[email protected]> Cc: "10.4" <[email protected]>
* st/nine: Match REP implementation to LOOPAxel Davy2015-01-221-19/+30
| | | | | | | | | | | Previous implementation was behaving fine, but improve it by: . Improved documentation . Decreasing counter (comparing to 0 is likely to be faster than to constant) . Move the counter update at the end for better performance for shaders that break the loop earlier than when the count is done. Reviewed-by: Tiziano Bacocco <[email protected]> Signed-off-by: Axel Davy <[email protected]>
* st/nine: Rewrite LOOP implementation, and a0 aL handlingAxel Davy2015-01-221-63/+100
| | | | | | | | | | | | | | | | | | | Previous implementation didn't work well with nested loops. Instead of using several address registers, put a0 and aL into normal registers, and copy them to one address register when we need to use them. Wine tests loop_index_test() and nested_loop_test() now pass correctly. Fixes r600g crash while loading Bioshock - bug https://bugs.freedesktop.org/show_bug.cgi?id=85696 Tested-by: David Heidelberg <[email protected]> Reviewed-by: Tiziano Bacocco <[email protected]> Signed-off-by: Axel Davy <[email protected]> Cc: "10.4" <[email protected]>
* st/nine: Correct LOG on negative valuesAxel Davy2015-01-221-2/+13
| | | | | | | | | | | | We should take the absolute value of the input. Also return -FLT_MAX instead of -Inf for an input of 0. Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: David Heidelberg <[email protected]> Signed-off-by: Axel Davy <[email protected]> Cc: "10.4" <[email protected]>
* st/nine: Handle NRM with input of null normAxel Davy2015-01-221-1/+3
| | | | | | | | | | | | | When the input's xyz are 0.0, the output should be 0.0. This is due to the fact that Inf * 0 = 0 for dx9. To handle this case, cap the result of RSQ to FLT_MAX. We have FLT_MAX * 0 = 0. Reviewed-by: David Heidelberg <[email protected]> Signed-off-by: Axel Davy <[email protected]> Cc: "10.4" <[email protected]>
* st/nine: Handle RSQ special casesAxel Davy2015-01-221-1/+12
| | | | | | | | | | | We should use the absolute value of the input as input to ureg_RSQ. Moreover, an input of 0.0 should return FLT_MAX. Reviewed-by: David Heidelberg <[email protected]> Signed-off-by: Axel Davy <[email protected]> Cc: "10.4" <[email protected]>
* st/nine: Fix POW implementationAxel Davy2015-01-221-1/+12
| | | | | | | | | | | | | POW doesn't match directly TGSI, since we should take the absolute value of src0. Fixes black textures in some games Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: David Heidelberg <[email protected]> Signed-off-by: Axel Davy <[email protected]> Cc: "10.4" <[email protected]>
* st/nine: Fix typo for M4x4Axel Davy2015-01-221-1/+1
| | | | | | | Cc: "10.4" <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: David Heidelberg <[email protected]> Signed-off-by: Axel Davy <[email protected]>
* st/nine: Correctly declare NineTranslateInstruction_Mkxn inputsAxel Davy2015-01-221-2/+5
| | | | | | | | | | | | | Let's say we have c1 and c2 declared in the shader and c0 given by the app Then here we would have read c0, c1 and c2 given by the app, instead of the correct c0, c1, c2. This correction fixes several issues in some games. Reviewed-by: Ilia Mirkin <[email protected]> Signed-off-by: Axel Davy <[email protected]> Cc: "10.4" <[email protected]>
* st/nine: Saturate oFog and oPts vs outputsAxel Davy2015-01-221-2/+2
| | | | | | | | | | | According to docs and Wine, these two vs outputs have to be saturated. Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: David Heidelberg <[email protected]> Signed-off-by: Axel Davy <[email protected]> Cc: "10.4" <[email protected]>
* st/nine: Remove some shader unused codeAxel Davy2015-01-221-22/+1
| | | | | | Reviewed-by: Ilia Mirkin <[email protected]> Signed-off-by: Axel Davy <[email protected]> Cc: "10.4" <[email protected]>
* st/nine: Convert integer constants to floats before storing them when cards ↵Axel Davy2015-01-221-13/+52
| | | | | | | | | | | don't support integers The shader code is already behaving as if they are floats when the the card doesn't support integers Reviewed-by: Ilia Mirkin <[email protected]> Signed-off-by: Axel Davy <[email protected]> Cc: "10.4" <[email protected]>
* st/nine: Rework of boolean constantsAxel Davy2015-01-223-35/+24
| | | | | | | | | | | | Convert them to shader booleans at earlier stage. Previous code is fine, but later patch will make integers being converted at earlier stage, so do the same for booleans Reviewed-by: Tiziano Bacocco <[email protected]> Signed-off-by: Axel Davy <[email protected]> Cc: "10.4" <[email protected]>
* st/nine: Add ATI1 and ATI2 supportAxel Davy2015-01-226-7/+34
| | | | | | | | | | | | | Adds ATI1 and ATI2 support to nine. They map to PIPE_FORMAT_RGTC1_UNORM and PIPE_FORMAT_RGTC2_UNORM, but need special handling. Reviewed-by: David Heidelberg <[email protected]> Signed-off-by: Axel Davy <[email protected]> Signed-off-by: Xavier Bouchoux <[email protected]> Cc: "10.4" <[email protected]>
* st/nine: Check if srgb format is supported before trying to use it.Axel Davy2015-01-222-2/+19
| | | | | | | | | | | According to msdn, we must act as if user didn't ask srgb if we don't support it. Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: David Heidelberg <[email protected]> Signed-off-by: Axel Davy <[email protected]> Cc: "10.4" <[email protected]>
* st/nine: Hack to generate resource if it doesn't exist when getting viewStanislaw Halik2015-01-221-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Buffers in the MANAGED pool are supposed to have the content in a ram buffer, a copy in VRAM if there is enough memory (driver manages memory and decide when to delete the buffer in VRAM). This is not implemented properly in nine, and a VRAM copy is going to be created when the RAM memory is filled, and the VRAM copy will get synced with the RAM memory updates. Due to some issues (in the implementation or in app logic), it can happen we try to create a sampler view of the resource while we haven't created the VRAM resource. This hack creates the resource when we hit this case, which prevents crashing, but doesn't help with the resource content. This fixes several games crashing at launch. Acked-by: Axel Davy <[email protected]> Acked-by: David Heidelberg <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Signed-off-by: Stanislaw Halik <[email protected]> Cc: "10.4" <[email protected]>
* st/nine: NineBaseTexture9: update sampler view creationAxel Davy2015-01-221-13/+32
| | | | | | | | | | | While previous code was having the correct behaviour in general, this new code is more readable (without checking all gallium formats manually) and has a more defined behaviour for depth stencil resources. Reviewed-by: Tiziano Bacocco <[email protected]> Reviewed-by: David Heidelberg <[email protected]> Signed-off-by: Axel Davy <[email protected]> Cc: "10.4" <[email protected]>
* st/nine: Return D3DERR_INVALIDCALL when trying to create a texture of bad formatAxel Davy2015-01-223-3/+26
| | | | | | Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: David Heidelberg <[email protected]> Signed-off-by: Axel Davy <[email protected]>
* st/nine: Fix crash when deleting non-implicit swapchainAxel Davy2015-01-221-1/+1
| | | | | | | | | | | | | | | The implicit swapchains are destroyed when the device instance is destroyed. However for non-implicit swapchains, it is not the case, and the application can have kept an reference on the swapchain buffers to reuse them. Fixes problems with battle.net launcher. Cc: "10.4" <[email protected]> Tested-by: Nick Sarnie <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: David Heidelberg <[email protected]> Signed-off-by: Axel Davy <[email protected]>
* st/nine: CubeTexture: fix GetLevelDescAxel Davy2015-01-221-1/+1
| | | | | | | | | | | | | This->surfaces contains the surfaces associated to the levels and faces. This->surfaces[6*Level] is what we want here, since it gives us a face descriptor for the level 'Level'. Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: David Heidelberg <[email protected]> Signed-off-by: Axel Davy <[email protected]> Signed-off-by: Xavier Bouchoux <[email protected]> Cc: "10.4" <[email protected]>
* st/nine: NineBaseTexture9: fix setting of last_layerAxel Davy2015-01-221-2/+2
| | | | | | | | | | Use same similar settings as u_sampler_view_default_template Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: David Heidelberg <[email protected]> Signed-off-by: Axel Davy <[email protected]> Cc: "10.4" <[email protected]>
* st/nine: Correctly advertise D3DPMISCCAPS_CLIPTLVERTSAxel Davy2015-01-221-1/+3
| | | | | | | | | | | | The cap means D3DFVF_XYZRHW vertices will see clipping. This is not the case when PIPE_CAP_TGSI_VS_WINDOW_SPACE_POSITION is supported, since it'll disable clipping. Reviewed-by: Tiziano Bacocco <[email protected]> Signed-off-by: Axel Davy <[email protected]> Cc: "10.4" <[email protected]>
* st/nine: Fix D3DRS_POINTSPRITE supportXavier Bouchoux2015-01-221-3/+3
| | | | | | | | | | | It's done by testing the existence of the point sprite output register *after* parsing the vertex shader. Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: David Heidelberg <[email protected]> Reviewed-by: Axel Davy <[email protected]> Signed-off-by: Xavier Bouchoux <[email protected]> Cc: "10.4" <[email protected]>
* st/nine: Add new texture format stringsAxel Davy2015-01-222-0/+6
| | | | | | | | Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: David Heidelberg <[email protected]> Signed-off-by: Axel Davy <[email protected]> Cc: "10.4" <[email protected]>
* st/nine: Add missing c++ declaration for IDirect3DVolumeTexture9Xavier Bouchoux2015-01-221-0/+10
| | | | | | | | | Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: David Heidelberg <[email protected]> Reviewed-by: Axel Davy <[email protected]> Signed-off-by: Xavier Bouchoux <[email protected]> Cc: "10.4" <[email protected]>
* st/nine: Additional defines to d3dtypes.hXavier Bouchoux2015-01-221-0/+10
| | | | | | | | | Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: David Heidelberg <[email protected]> Reviewed-by: Axel Davy <[email protected]> Signed-off-by: Xavier Bouchoux <[email protected]> Cc: "10.4" <[email protected]>
* st/nine: Fix clip state logicAxel Davy2015-01-221-1/+3
| | | | | | | | The clip state was reset everytime, incurring an overhead. Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: David Heidelberg <[email protected]> Signed-off-by: Axel Davy <[email protected]>
* st/nine: query: remove unused variable (trivial)David Heidelberger2015-01-221-1/+0
| | | | | Reviewed-by: Ilia Mirkin <[email protected]> Signed-off-by: David Heidelberg <[email protected]>
* nir: Fix setup of constant bool initializers.Eric Anholt2015-01-221-1/+1
| | | | | | | | | | brw_fs_nir has only seen scalar bools so far, thanks to vector splitting, and the ralloc of in glsl_to_nir.cpp will *usually* get you a 0-filled chunk of memory, so reading too large of a value will usually get you the right bool value. But once we start doing vector bools in a few commits, we end up getting bad values. Reviewed-by: Jason Ekstrand <[email protected]>
* nir: Make an easier helper for setting up SSA defs.Eric Anholt2015-01-2213-66/+46
| | | | | | | | Almost all instructions we nir_ssa_def_init() for are nir_dests, and you have to keep from forgetting to set is_ssa when you do. Just provide the simpler helper, instead. Reviewed-by: Jason Ekstrand <[email protected]>
* glsl: Link glsl_test with pthreads library.Jonathan Gray2015-01-221-1/+3
| | | | | | | | | | Otherwise pthread_mutex_lock will be an undefined reference on OpenBSD. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88219 Signed-off-by: Jonathan Gray <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Cc: "10.4 10.3" <[email protected]>
* scons: Add X11 include path if X11 is available.Vinson Lee2015-01-221-0/+3
| | | | | | | | | | | | | | Mac OS X XQuartz places X11 headers at /opt/X11/include. This patch fixes this Mac OS X SCons build error. Compiling src/gallium/state_trackers/glx/xlib/glx_api.c ... In file included from src/gallium/state_trackers/glx/xlib/glx_api.c:34: include/GL/glx.h:30:10: fatal error: 'X11/Xlib.h' file not found ^ Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* meta: Move loop declaration to top of block.José Fonseca2015-01-221-2/+4
| | | | | | Fixes MSVC build. Trvial.
* i965/tex_subimage: use meta instead of the blitter for PBO TexSubImageJason Ekstrand2015-01-221-100/+15
| | | | Reviewed-by: Neil Roberts <[email protected]>
* i965/tex_image: Use meta for instead of the blitter PBO TexImage and GetTexImageJason Ekstrand2015-01-221-179/+18
| | | | Reviewed-by: Neil Roberts <[email protected]>
* i965/pixel_read: Use meta_pbo_GetTexSubImage for PBO ReadPixelsJason Ekstrand2015-01-221-118/+3
| | | | | | | Since the meta path can do strictly more than the blitter path, we just remove the blitter path entirely. Reviewed-by: Neil Roberts <[email protected]>
* meta: Add an implementation of GetTexSubImage for PBOsJason Ekstrand2015-01-222-0/+125
| | | | Reviewed-by: Neil Roberts <[email protected]>
* meta: Add a BlitFramebuffers-based implementation of TexSubImageJason Ekstrand2015-01-223-0/+248
| | | | | | | | | | | | | | This meta path, designed for use with PBO's, creates a temporary texture out of the PBO and uses BlitFramebuffers to do the actual texture upload. v2 Jason Ekstrand <[email protected]>: - Add support for handling simple packing options v3 Jason Ekstrand <[email protected]>: - Refactor to split out the texture-from-pbo code - Rename to _mesa_meta_pbo_TexSubImage Reviewed-by: Neil Roberts <[email protected]>
* formats: Use a hash table for _mesa_format_from_array_formatJason Ekstrand2015-01-221-12/+56
| | | | | | | | | | | Going through the for loop every time has noticable overhead. This fixes things up so we only do that once ever and then just do a hash table lookup which should be much cheaper. v2 Jason Ekstrand <[email protected]>: - Use once_flag and call_once from c11/threads.h instead of pthreads Reviewed-by: Neil Roberts <[email protected]>
* i965: Implement SetTextureStorageForBufferObjectJason Ekstrand2015-01-221-0/+57
| | | | Reviewed-by: Neil Roberts <[email protected]>
* i965: Apply the miptree offset to surface state for renderbuffersJason Ekstrand2015-01-224-4/+8
| | | | | | | | | Previously, we were completely ignoring the mt->offset field for renderbuffers. While it does have some alignment constraints, it is valid to use it. This patch adds the code to each of the 4 surface state setup functions to handle it. Reviewed-by: Neil Roberts <[email protected]>