summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* meta: Fix datatype computation in get_temp_image_type()Anuj Phogat2014-08-041-5/+4
| | | | | | | | | | | | | | Changes in the patch will cause datatype to be computed correctly for 8 and 16 bit integer formats. For example: GL_RG8I, GL_RG16I etc. Fixes many failures in gles3 Khronos CTS test: copy_tex_image_conversions_required copy_tex_image_conversions_forbidden Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* meta: Move the call to _mesa_get_format_datatype() out of switchAnuj Phogat2014-08-041-7/+3
| | | | | Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* meta: Use _mesa_get_format_bits() to get the GL_RED_BITSAnuj Phogat2014-08-041-2/+3
| | | | | | | | | | | | | We currently get red bits from ctx->DrawBuffer->Visual.redBits by making a false assumption that the texture we're writing to (in glCopyTexImage2D()) is used as a DrawBuffer. Fixes many failures in gles3 Khronos CTS test: copy_tex_image_conversions_required Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* meta: Initialize the variable in declaration statementAnuj Phogat2014-08-041-3/+1
| | | | | | | Saves one line of code :) Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* mesa: Allow GL_TEXTURE_CUBE_MAP target with compressed internal formatsAnuj Phogat2014-08-041-0/+1
| | | | | | | | | GL_TEXTURE_CUBE_MAP is an allowed texture target in glTexStorage2D() and is allowed to be used (like GL_TEXTURE_2D) with compressed internal formats. Cc: <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Add gles3 condition for normalized internal formats in glCopyTexImage*()Anuj Phogat2014-08-041-0/+15
| | | | | | | | Fixes many failures in gles3 Khronos CTS test: packed_pixels Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: Add utility function _mesa_is_enum_format_unorm()Anuj Phogat2014-08-042-0/+74
| | | | | | | | V2: Add missing formats. Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: Add gles3 error condition for GL_RGBA10_A2 buffer format in ↵Anuj Phogat2014-08-041-18/+29
| | | | | | | | | | | glCopyTexImage*() Fixes many failures in gles3 Khronos CTS test: packed_pixels Khronos bug# 9807 Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: Add a gles3 error condition for sized internalformat in glCopyTexImage*()Anuj Phogat2014-08-041-0/+46
| | | | | | | | | | Fixes many failures in gles3 Khronos CTS test: packed_pixels V2: Add the check for alpha bits to avoid confusion. Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: Add a helper function _mesa_is_enum_format_unsized()Anuj Phogat2014-08-042-0/+59
| | | | | | | | | | Function is utilized by next patch in the series. V2: Add missing formats. Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: Don't allow snorm internal formats in glCopyTexImage*() in GLES3Anuj Phogat2014-08-041-0/+11
| | | | | | | | Fixes few failures in gles3 Khronos CTS test: packed_pixels Cc: "10.2" <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: Add utility function _mesa_is_enum_format_snorm()Anuj Phogat2014-08-042-0/+40
| | | | | | Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: Fix condition for using compressed internalformat in ↵Anuj Phogat2014-08-041-1/+8
| | | | | | | | glCompressedTexImage3D() Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: Add error condition for using compressed internalformat in ↵Anuj Phogat2014-08-041-0/+18
| | | | | | | | | | glTexStorage3D() Fixes gles3 Khronos CTS test: texture_storage_texture_internal_formats Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: Turn target_can_be_compressed() in to a utility functionAnuj Phogat2014-08-042-6/+9
| | | | | | | | V2: Declare the function in teximage.h Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: Fix error condition for valid texture targets in glTexStorage* functionsAnuj Phogat2014-08-041-0/+7
| | | | | | | | Fixes gles3 Khronos CTS test: texture_storage_texture_targets Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* glsl: Make it possible to ignore built-ins when matching signatures.Kenneth Graunke2014-08-044-4/+4
| | | | | | | | | | | | | | | | | | Historically, we've implemented the rules for overriding built-in functions by creating multiple ir_functions and relying on the symbol table to hide the one containing built-in functions. That works, but has a few drawbacks, so the next patch will change it. Instead, we'll have a single ir_function for a particular name, which will contain both built-in and user-defined signatures. Passing an extra parameter to matching_signature makes it easy to ignore built-ins when they're supposed to be hidden. I didn't add the parameter to exact_matching_signature since it wasn't necessary. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Actually use the Mesa IR optimizer for ARB programs.Kenneth Graunke2014-08-041-0/+7
| | | | | | | | | | | | On Haswell, this cuts 1-3 instructions from 183 vertex shaders in "Shadowrun Returns", "Shatter", and "Trine 2." It adds 2 instructions to a single fragment shader in "Closure." total instructions in shared programs: 278803 -> 278546 (-0.09%) instructions in affected programs: 41930 -> 41673 (-0.61%) Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Do not list inactive block members as activeIan Romanick2014-08-041-6/+26
| | | | | | | | | | | | | | | | Fixes gles3conform failures in: ES3-CTS.shaders.uniform_block.single_nested_struct.per_block_buffer_packed ES3-CTS.shaders.uniform_block.single_nested_struct_array.per_block_buffer_packed ES3-CTS.shaders.uniform_block.random.scalar_types.7 ES3-CTS.shaders.uniform_block.random.basic_arrays.4 ES3-CTS.shaders.uniform_block.random.basic_arrays.6 ES3-CTS.shaders.uniform_block.random.basic_instance_arrays.2 ES3-CTS.shaders.uniform_block.random.nested_structs.9 ES3-CTS.shaders.uniform_block.random.all_shared_buffer.3 Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* wmesa: link with mesautilBrian Paul2014-08-041-0/+2
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* osmesa: link with mesautilBrian Paul2014-08-041-0/+1
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* mesa/x86: put code in braces to silence declarations after code warningBrian Paul2014-08-041-7/+9
| | | | Reviewed-by: Matt Turner <[email protected]>
* xlib: fix missing mesautil build breakageBrian Paul2014-08-041-0/+1
| | | | | | Fixes the non-DRI build. Reviewed-by: Jason Ekstrand <[email protected]>
* mesa/main: Use the RGB <-> sRGB conversion functions in libmesautilJason Ekstrand2014-08-047-185/+97
| | | | | Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* util: Gather some common macrosJason Ekstrand2014-08-046-91/+9
| | | | | | | | | | This gathers macros that have been included across components into util so that the include chain can be more vertical. In particular, this makes util stand on its own without any dependence whatsoever on the rest of mesa. Signed-off-by: "Jason Ekstrand" <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* util: Move the open-addressing linear-probing hash_table to src/util.Kenneth Graunke2014-08-0424-1282/+8
| | | | | | | | | | | | | | | | | This hash table is used in core Mesa, the GLSL compiler, and the i965 driver, which makes it a good candidate for the new src/util module. It's much faster than program/hash_table.[ch] (see commit 6991c2922f5 for data), and José's u_hash_table.c has a comment saying Gallium should probably consider switching to a linear probing hash table at some point. So this seems like the best candidate for a shared data structure. Signed-off-by: Kenneth Graunke <[email protected]> v2 (Jason Ekstrand): Pick up another hash_table use and patch up scons Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* util: Move ralloc to a new src/util directory.Kenneth Graunke2014-08-0433-29/+33
| | | | | | | | | | | | | | | | | | For a long time, we've wanted a place to put utility code which isn't directly tied to Mesa or Gallium internals. This patch creates a new src/util directory for exactly that purpose, and builds the contents as libmesautil.la. ralloc seemed like a good first candidate. These days, it's directly used by mesa/main, i965, i915, and r300g, so keeping it in src/glsl didn't make much sense. Signed-off-by: Kenneth Graunke <[email protected]> v2 (Jason Ekstrand): More realloc uses and some scons fixes Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa/SConscript: Use Makefile.sources instead of duplicating the file listsJason Ekstrand2014-08-042-333/+11
| | | | | Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa/st: Fix compiler warningsJan Vesely2014-08-041-5/+3
| | | | | | | both array and index are unsigned types Signed-off-by: Jan Vesely <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa/st: only convert AND(a, NOT(b)) into MAD when not using native integersIlia Mirkin2014-08-031-1/+1
| | | | | | | | | | | Native integers imply a somewhat different handling of booleans. Instead of being 1.0/0.0 floats, they are 0 (true) / -1 (false) integers. As such the original optimization no longer applies. Reported-by: Glenn Kennard <[email protected]> Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Cc: "10.2" <[email protected]>
* mesa/st: add support for dynamic ubo selectionIlia Mirkin2014-08-021-28/+34
| | | | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Brian Paul <[email protected]> (v1) v2: fix src register, use index2D for base of 1 Acked-by: Marek Olšák <[email protected]>
* i965: Delete stale "pre-gen4" comment in texture validation code.Kenneth Graunke2014-08-021-5/+0
| | | | | | | | | | | In commit 16060c5adcd4d809f97e874fcde763260c17ac18, Eric changed the code to not relayout just for baselevel changes - only if the range of miplevels actually increases. So this comment is now wrong. Notably, the i915 version of the code actually does what the comment says. Signed-off-by: Kenneth Graunke <[email protected]>
* i965: Delete sampler state structures.Kenneth Graunke2014-08-021-99/+0
| | | | | | | | We've moved to using bitshifts (like we did for surface state); nothing uses the structures anymore. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Replace sizeof(struct gen7_sampler_state) with the size itself.Kenneth Graunke2014-08-024-8/+8
| | | | | | | | | | These are the last users of struct gen7_sampler_state. v2: Use a local sampler_state_size variable, to help distinguish the various 16s (suggested by Topi Pohjolainen). Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Drop sizeof(struct brw_sampler_state) from estimated prim size.Kenneth Graunke2014-08-021-3/+3
| | | | | | | | | | This is the last user of the structure. v2: Use a local variable with a sensible name so people know what 16 is. (Suggested by Topi Pohjolainen). Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Make BLORP use brw_emit_sampler_state().Kenneth Graunke2014-08-023-95/+33
| | | | | | | | This simplifies the code, removes use of the old structures, and also allows us to combine the Gen6 and Gen7+ code. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Delete redundant sampler state dumping code.Kenneth Graunke2014-08-021-34/+5
| | | | | | | | | | | Although the Gen4-6 and Gen7+ variants used different structure types, they didn't use any of the fields - only the size, which is identical. So both decoders did exactly the same thing. Someday we should implement useful decoders for SAMPLER_STATE. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Make some brw_sampler_state.c functions static again.Kenneth Graunke2014-08-022-8/+2
| | | | | | | | Now that gen7_sampler_state.c is gone, everything is once again in a single file. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Stop using gen7_update_sampler_state; rm gen7_sampler_state.c.Kenneth Graunke2014-08-024-194/+2
| | | | | | | | The code in brw_sampler_state.c now handles all generations; we don't need the extra Gen7+ only code anymore. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Make brw_update_sampler_state use 8 bits for LOD fields on Gen7+.Kenneth Graunke2014-08-021-3/+4
| | | | | | | | | This was the only actual difference between Gen4-6 and Gen7+ in terms of the values we program. The rest was just mechanical structure rearrangement. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Make brw_update_sampler_state() use brw_emit_sampler_state().Kenneth Graunke2014-08-021-119/+92
| | | | | | | | | | | | | | Instead of stuffing bits directly into the brw_sampler_state structure, we now store them in local variables, then use brw_emit_sampler_state() to assemble the packet. This separates the decision about what values to use from the actual packet emission, which makes the code more reusable across generations. v2: Put const on a bunch of local variables and move declarations, as suggested by Topi Pohjolainen. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Introduce a function to emit a SAMPLER_STATE structure.Kenneth Graunke2014-08-022-0/+93
| | | | | | | | | | | | This simply assembles all the SAMPLER_STATE fields into their proper bit locations. Making it work on all generations was easy enough; some of the fields are even in the same place. Not used by anything yet, but will be soon. I made it non-static so BLORP can use it too. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Add const to upload_default_color's sampler parameter.Kenneth Graunke2014-08-022-2/+2
| | | | | | | | It doesn't edit the value, and this lets us use const in more places. Needed to implement Topi's review comments for the next patch. Signed-off-by: Kenneth Graunke <[email protected]>
* i965: Add #defines for SAMPLER_STATE fields.Kenneth Graunke2014-08-021-0/+54
| | | | | | | | | | | We'll use these to replace the existing structures. I've adopted the convention that "BRW" applies to all hardware, and "GENX" applies starting with generation X, but might be replaced by some later generation. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Convert wrap mode #defines to an enum.Kenneth Graunke2014-08-021-7/+9
| | | | | | | | This makes it easy to tell that they're grouped together, and also improves gdb printing. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Delete gen7_upload_sampler_state_table and vtable mechanism.Kenneth Graunke2014-08-025-70/+3
| | | | | | | | | | | brw_upload_sampler_state_table now handles all generations, so we don't need the vtable mechanism either. There's still a lot of code duplication; the next patches will address that. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Make brw_upload_sampler_state_table handle Gen7+ as well.Kenneth Graunke2014-08-023-5/+49
| | | | | | | | | | | | | | | | This copies a few changes from gen7_upload_sampler_state_table; the next patch will delete that function. Gen7+ has per-stage sampler state pointer update packets, so we emit them as soon as we emit a new table for a stage. On Gen6 and earlier, we have a single packet, so we delay until we've changed everything that's going to be changed. v2: Split 3DSTATE_SAMPLER_STATE_POINTERS_XS packet emission into a helper function (suggested by Topi Pohjolainen). Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Shift brw_upload_sampler_state_table away from structures.Kenneth Graunke2014-08-021-8/+15
| | | | | | | | | | | | The Gen4-6 and Gen7+ code is virtually identical, but both use different structure types. Switching to use a uint32_t pointer and operate on the number of DWords will make it possible to share code. It turns out that SURFACE_STATE is the same number of DWords on every platform currently; it will be easy to handle a change there, though. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Push computation for sampler state batch offsets up a level.Kenneth Graunke2014-08-021-10/+12
| | | | | | | | | | | | Other than this, brw_update_sampler_state only deals with a single SAMPLER_STATE structure, and doesn't need to know which position it is in the table. The caller takes care of dealing with multiple surface states. Pushing this up a level allows us to drop the ss_index parameter. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Drop unused 'ss_index' parameter from gen7_update_sampler_state.Kenneth Graunke2014-08-021-2/+2
| | | | | | | This was copied from the Gen4-6 code, but is unused. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>