summaryrefslogtreecommitdiffstats
path: root/src/glsl/nir
Commit message (Collapse)AuthorAgeFilesLines
* nir/spirv: fix build_mat4_det stack smasherMark Janes2016-02-021-2/+5
| | | | | | | | | | | When generating a sub-determinate matrix, a 3-element swizzle array was indexed with clever inline boolean logic. Unfortunately, when i and j are both 3, the index overruns the array, smashing the next variable on the stack. For 64 bit builds, the alignment of the 3-element unsigned array leaves 32 bits of spacing before the next local variable, hiding this bug. On i386, a subcolumn pointer was smashed then dereferenced.
* nir/spirv: Fix UBO loads of a single element of a row-major matrixJason Ekstrand2016-02-011-0/+2
|
* nir/spirv: Handle the LOD parameter of OpImageQuerySizeLodJason Ekstrand2016-02-011-0/+4
|
* nir/spirv: Add support for SpvOpImageJason Ekstrand2016-02-011-0/+12
|
* nir/spirv: Fix the UBO loading case of a single row-major matric columnJason Ekstrand2016-02-011-2/+5
|
* nir/spirv: Fix the UBO loading case of a single row-major matric columnJason Ekstrand2016-02-011-3/+7
|
* vtn: Improve accuracy of acos approximation.Francisco Jerez2016-01-271-3/+3
| | | | | | | | The adjusted polynomial coefficients come from the numerical minimization of the L2 norm of the relative error. The old coefficients would give a maximum relative error of about 15000 ULP in the neighborhood around acos(x) = 0, the new ones give a relative error bounded by less than 2000 ULP in the same neighborhood.
* An alternate arccosine implementationJason Ekstrand2016-01-271-2/+24
|
* vtn: Make tanh implementation even stupiderKenneth Graunke2016-01-271-5/+7
| | | | | | | | | | | | | | | The dEQP "precision" test tries to verify that the reference functions float sinh(float a) { return ((exp(a) - exp(-a)) / 2); } float cosh(float a) { return ((exp(a) + exp(-a)) / 2); } float tanh(float a) { return (sinh(a) / cosh(a)); } produce the same values as the built-ins. We simplified away the multiplication by 0.5 in the numerator and denominator, and apparently this causes them not to match for exactly 1 out of 13,632 values. So, put it back in, fixing the test, but making our code generation (and precision?) worse.
* nir/opt_algebraic: Use a more elementary mechanism for lowering ldexpJason Ekstrand2016-01-271-62/+2
|
* vtn: Fix atan2 for non-scalars.Kenneth Graunke2016-01-271-24/+3
| | | | | | | | | | | The if/then/else block was bogus, as it can only take a scalar condition, and we need to select component-wise. The GLSL IR implementation of atan2 handles this by looping over components, but I decided to try and do it vector-wise, and messed up. For now, just bcsel. It means that we do the atan1 math even if all components hit the quick case, but it works, and presumably at least one component will hit the expensive path anyway.
* vtn: Fix Modf.Kenneth Graunke2016-01-271-4/+8
| | | | | | | | | We were botching this for negative numbers - floor of a negative rounds the wrong way. Additionally, both results are supposed to retain the sign of the original. To fix this, just take the abs of both values, then put the sign back. There's probably a better way to do this, but this works for now.
* vtn: Delete references to IMix opcode.Kenneth Graunke2016-01-261-1/+0
| | | | | | This is being removed in SPIR-V. Bugzilla: https://cvs.khronos.org/bugzilla/show_bug.cgi?id=15452
* nir/spirv: Add proper support for InstanceIndexJason Ekstrand2016-01-261-1/+3
|
* nir/lower_io: Lower INSTNACE_INDEXJason Ekstrand2016-01-261-0/+6
|
* glsl/enums: Add an enum for Vulkan instance indexJason Ekstrand2016-01-262-0/+8
|
* Merge remote-tracking branch 'mattst88/nir-lower-pack-unpack' into vulkanJason Ekstrand2016-01-259-45/+209
|\
| * nir: Add lowering support for unpacking opcodes.Matt Turner2016-01-252-0/+32
| |
| * nir: Add lowering support for packing opcodes.Matt Turner2016-01-254-0/+66
| |
| * nir: Add opcodes to extract bytes or words.Matt Turner2016-01-253-0/+28
| | | | | | | | The uint versions zero extend while the int versions sign extend.
| * glsl: Remove 2x16 half-precision pack/unpack opcodes.Matt Turner2016-01-251-9/+0
| | | | | | | | i965/fs was the only consumer, and we're now doing the lowering in NIR.
| * nir: Add lowering of nir_op_unpack_half_2x16.Matt Turner2016-01-252-4/+29
| |
| * nir: Make argument order of unop_convert match binop_convert.Matt Turner2016-01-251-10/+10
| | | | | | | | Strangely the return and parameter types were reversed.
| * glsl: Don't abbreviate tessellation shader stage names.Kenneth Graunke2016-01-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I have a patch that writes shaders as .shader_test files, and it uses this function to create the headers (i.e. [vertex shader]). [tess ctrl shader] isn't a valid shader_runner header - it's spelled out as [tessellation control shader]. There's no real reason to abbreviate it, so spell it out. v2: Rebase on Rob's patches to move the code. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
| * glsl: Restore Mesa-style to shader_enums.c/h.Matt Turner2016-01-192-16/+24
| |
| * nir/print: const_index is signedRob Clark2016-01-161-1/+1
| | | | | | | | | | | | | | Noticed this with $piglit/bin/vp-address-01 Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
| * nir: few missing struct namesRob Clark2016-01-161-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | nir.h is a bit inconsistent about 'typedef struct {} nir_foo' vs 'typedef struct nir_foo {} nir_foo'. But missing struct name tags is inconvenient when you need a fwd declaration without pulling in all of nir. So add missing struct name tag for nir_variable, and a couple other spots where it would likely be useful. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
| * nir/builder: Add a nir_build_ivec4() convenience helper.Kenneth Graunke2016-01-141-0/+14
| | | | | | | | | | | | | | | | nir_build_ivec4 is more readable and succinct than using nir_build_imm directly, even if you have C99. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* | nir/opcodes: Properly flush denormals in fquantize2f16Jason Ekstrand2016-01-221-1/+1
| |
* | nir/spirv: Ignore cull distanceJason Ekstrand2016-01-211-1/+1
| |
* | nir/lower_system_values: Use the correct invication id for CSJason Ekstrand2016-01-211-1/+1
| |
* | nir/spirv: Properly assign locations to split structuresJason Ekstrand2016-01-213-17/+47
| |
* | nir/spirv: Improve handling of variable loads and copiesJason Ekstrand2016-01-211-26/+128
| | | | | | | | | | | | | | Before we were asuming that a deref would either be something in a block or something that we could pass off to NIR directly. However, it is possible that someone would choose to load/store/copy a split structure all in one go. We need to be able to handle that.
* | nir/spirv: Make vectors a proper array time with an array_elementJason Ekstrand2016-01-212-24/+6
| | | | | | | | This makes dealing with single-component derefs easier
* | nir/spirv: Rework access chains a bit to allow for literalsJason Ekstrand2016-01-212-37/+75
| | | | | | | | | | This makes them much easier to construct because you can also just specify a literal number and it doesn't have to be a valid SPIR-V id.
* | vtn/variables: Compact local loads/stores into one functionJason Ekstrand2016-01-211-99/+42
| | | | | | | | This is similar to what we did for block loads/stores.
* | nir/spirv: Add an actual variable struct to spirv_to_nirJason Ekstrand2016-01-214-310/+340
| | | | | | | | | | This allows us, among other things, to do structure splitting on-the-fly to more correctly handle input/output structs.
* | nir/spirv: Split variable handling out into its own fileJason Ekstrand2016-01-213-1302/+1335
| | | | | | | | It's 1300 lines all by itself and it will only grow.
* | nir/spirv: Rework access chainsJason Ekstrand2016-01-214-365/+447
| | | | | | | | | | | | | | Previously, we were creating nir_deref's immediately. Now, instead, we have an intermediate vtn_access_chain structure. While a little more awkward initially, this will allow us to more easily do structure splitting on-the-fly.
* | nir/spirv: Implement ModfStruct opcode.Kenneth Graunke2016-01-211-1/+7
| |
* | nir/spirv: Delete stray fmod remnants.Kenneth Graunke2016-01-211-1/+0
| | | | | | | | | | Jason left these stray code fragments in 22804de110b97dce1415318fd02c1003e16ef14a.
* | vk: Fix indirect push constantsKristian Høgsberg Kristensen2016-01-211-0/+8
| | | | | | | | | | | | | | This currently sets the base and size of all push constants to the entire push constant block. The idea is that we'll use the base and size to eventually optimize the amount we actually push, but for now we don't do that.
* | Merge remote-tracking branch 'jekstrand/wip/i965-uniforms' into vulkanKristian Høgsberg Kristensen2016-01-212-2/+10
|\ \
| * | nir: Add another index to load_uniform to specify the range readJason Ekstrand2015-12-142-2/+10
| | |
* | | nir/spirv: Handle compute shared atomicsJordan Justen2016-01-211-44/+96
| | | | | | | | | | | | Signed-off-by: Jordan Justen <[email protected]>
* | | nir/spirv: Support workgroup (shared) variable translationJordan Justen2016-01-211-0/+2
| | | | | | | | | | | | Signed-off-by: Jordan Justen <[email protected]>
* | | nir: Lower shared var atomics during nir_lower_ioJordan Justen2016-01-211-2/+84
| | | | | | | | | | | | Signed-off-by: Jordan Justen <[email protected]>
* | | nir: Add support for lowering load/stores of shared variablesJordan Justen2016-01-215-8/+32
| | | | | | | | | | | | Signed-off-by: Jordan Justen <[email protected]>
* | | nir: Add atomic operations on variablesJordan Justen2016-01-211-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | This allows us to first generate atomic operations for shared variables using these opcodes, and then later we can lower those to the shared atomics intrinsics with nir_lower_io. Signed-off-by: Jordan Justen <[email protected]>
* | | nir: Add compute shader shared variable storage classJordan Justen2016-01-217-2/+25
| | | | | | | | | | | | | | | | | | | | | | | | Previously we were receiving shared variable accesses via a lowered intrinsic function from glsl. This change allows us to send in variables instead. For example, when converting from SPIR-V. Signed-off-by: Jordan Justen <[email protected]>