Commit Graph
135 Commits
Author SHA1 Message Date
jchen10 36e120ef73 Refactor the staticUse checks for attribute and output
Remove these needless checks as GetActiveShaderVariables in Shader.cpp has
filtered them already.

BUG=angleproject:1920

Change-Id: Ife85614a8f636768dd585a827bca81e2f15009c8
Reviewed-on: https://chromium-review.googlesource.com/454129
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2017-03-15 15:40:13 +00:00
Olli Etuaho b78707c8d0 Move default-block uniform linking to a separate file
The code is easier to understand when it's encapsulated better.

This change is pure refactoring with no functional changes.

BUG=angleproject:1442
TEST=angle_end2end_tests

Change-Id: I6128fd72c65ca7a87af596cda4866c74c2a66c48
Reviewed-on: https://chromium-review.googlesource.com/452502
Commit-Queue: Olli Etuaho <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
2017-03-10 17:56:46 +00:00
Olli Etuaho 6ca2b65c43 Implement location layout qualifier for uniforms
This is a complete implementation of the uniform location layout
qualifier. Uniform location set in the shader is plumbed to shader
linking, which does several link-time checks for conflicts and
recursively applies the location to struct members.

Validate that location is consistent as specified in the table in
section 9.2.1 of the ESSL 3.10.4 spec. The location set in the shader
overrides the one set via the CHROMIUM_bind_uniform_location API.

Location conflicts must be checked even if the uniforms are not
statically used. Because of this unused uniforms are now recorded
during uniform linking. After linking checks are done, unused uniforms
are pruned from the program state.

Location is validated against the maximum number of uniform locations
at compile time as specified in section 4.4.3 of the ESSL 3.10.4 spec.

All dEQP uniform location tests don't yet pass due to unrelated bugs.

BUG=angleproject:1442
TEST=angle_end2end_tests, dEQP-GLES31.functional.uniform_location.*

Change-Id: I1f968e971f521fbc804b01e1a7c2b4d14f24d20f
Reviewed-on: https://chromium-review.googlesource.com/447942
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Olli Etuaho <[email protected]>
2017-03-09 16:52:08 +00:00
Yuly Novikov 817232ef45 Validate invariance of built-in variables when linking
According to ESSL 1.00.17 paragraph 4.6.4

BUG=angleproject:1876

Change-Id: I61e142c31dce11eec28fe240a9bc9ce2c632daf6
Reviewed-on: https://chromium-review.googlesource.com/446870
Reviewed-by: Kenneth Russell <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Yuly Novikov <[email protected]>
2017-03-06 22:02:51 +00:00
Olli Etuaho 547cbd461b Validate uniform binding at link time
GLSL ES Spec 3.10.4, section 4.4.5 has the rules for linking uniforms
with binding layout qualifiers. If a binding layout qualifier for a
uniform variable is specified in both vertex and fragment shaders, the
qualifiers must match.

BUG=angleproject:1893
TEST=dEQP-GLES31.functional.layout_binding.*binding_contradictory*

Change-Id: I0ae6a1a8967df818be8136510c22daee848b9da7
Reviewed-on: https://chromium-review.googlesource.com/447557
Reviewed-by: Corentin Wallez <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Olli Etuaho <[email protected]>
2017-03-01 09:18:49 +00:00
Olli Etuaho 4a92cebc8f Clarify code around setting uniform locations
Use the name "uniformLocationBindings" for location information set by
the API instead of "uniformBindings", which can be easily confused
with binding layout qualifiers that can be set for some types of
uniforms. Also use more straightforward names throughout the
indexUniforms function.

BUG=angleproject:1442

Change-Id: I47d504479b36def696305f060e9c9bd3de3ade48
Reviewed-on: https://chromium-review.googlesource.com/445236
Reviewed-by: Corentin Wallez <[email protected]>
Commit-Queue: Olli Etuaho <[email protected]>
2017-02-22 10:01:10 +00:00
Jamie Madill 6c1f671b36 Add destroy hooks for several GL objects.
These hooks allow the back-end renderer to free object resources
without having to store pointers to shared device handles for
each and every object. This will allow us to save memory on
back-ends that really care about memory overhead.

There is a downside in that there is more boilerplate in passing
gl::Context handles around everywhere.

BUG=angleproject:1684

Change-Id: I89463bba8d23f92920e8956650cb73c7fc6d66b7
Reviewed-on: https://chromium-review.googlesource.com/426401
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2017-02-15 01:29:47 +00:00
Jamie Madill 8ecf7f9b3d Vulkan: Implement shader compilation.
This hooks up the Vulkan GLSL, decorated with locations, to glslang,
and then pipes the SPIRV back to the Program implementation for later
use when making pipelines to run draw calls.

The program compilation tests work now, but don't really test
anything other than not generating Vulkan validation layer errors
during compilation and shader object generation.

BUG=angleproject:1576

Change-Id: I625e42219f4b4d1433dd3109b94e1a2f666ba4bd
Reviewed-on: https://chromium-review.googlesource.com/408519
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2017-02-02 00:10:50 +00:00
Geoff Lang 4ddf5afb75 Refactor ResourceManager into separate managers per resource type.
BUG=angleproject:1639

Change-Id: I943f553cfb0e0feb57953770784b48e22fccc875
Reviewed-on: https://chromium-review.googlesource.com/423172
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2017-01-30 19:26:41 +00:00
Jamie Madill ac4e9c3f99 Micro-optimize Uniform updates.
This saves a few re-computations of the same stuff.

BUG=angleproject:1671

Change-Id: I28f955cd880366a86c0bb22285a119e97661e2cb
Reviewed-on: https://chromium-review.googlesource.com/427326
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2017-01-13 20:24:22 +00:00
Jamie Madill a4595b806f WebGL: Validate simple rendering feedback loops.
This adds the most basic form of rendering feedback loop detection:
when we're rendering to a texture that's also bound as an input. It
doesn't filter by selected mipmap level or 3D texture slice, or
do depth attachment validation. It also is missing checks for feedback
loops against the default Framebuffer.

BUG=angleproject:1685

Change-Id: Idb0ee2bfe1c35611544d132204c0da832c0f1c48
Reviewed-on: https://chromium-review.googlesource.com/425489
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
2017-01-11 23:31:37 +00:00
Jamie Madill e7d8432d5e Move ProgramGL's sampler bindings to gl::Program.
This saves code duplication and makes the sampler validation a bit
simpler. In the future we might be able to use it to replace the
custom D3D logic for caching sampler info, but this relies on
some shader-specific non-merged data.

This also introduces some code duplication in Uniform1iv.

BUG=angleproject:1685

Change-Id: I258607a21886ca20766607bddf958cd511fac3f1
Reviewed-on: https://chromium-review.googlesource.com/426781
Reviewed-by: Corentin Wallez <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2017-01-11 20:09:49 +00:00
He Yunchao acd1898e08 Replace Error(GL_NO_ERROR) with NoError().
In order to make the errors be consistent throughout ANGLE.

BUG=angleproject:1686

Change-Id: I0a2d86091d640aedeac94beae345c1fb6971b00d
Reviewed-on: https://chromium-review.googlesource.com/424835
Commit-Queue: Yunchao He <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2017-01-04 16:01:26 +00:00
Jamie Madill 192745a74e Add varying packing validation for WebGL.
This CL moves the varying packing from the D3D layer up to Program.
This is necessary for WebGL validation, and gives us consistency
for the various back-ends. There may be some additional cleanup work
on the VaryingPacking class, because it does some work that is D3D-
specific.

WebGL requires strict varying packing. Instead of allowing success
unconditionally, it's an explicit error to succeed to pack a set of
varyings that the sample algorithm would fail to pack.

Introduce a new packing mode option to the varying packing class to
handle this different packing style, while keeping our old more
relaxed packing method for ES code.

BUG=angleproject:1675

Change-Id: I674ae685ba573cc2ad7d9dfb7441efa8cb2d55fc
Reviewed-on: https://chromium-review.googlesource.com/423254
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
2016-12-23 00:30:50 +00:00
Jamie Madill a7d12dc7f5 Store uniform block bindings in program binaries.
This affects all back-ends - we weren't saving this. Note that
bindings can only be set after program linking. The spec is fairly
clear in that any programs saved must be loadable and runnable under
the same set of state, which would include block bindings.

Also add validation for zero binary formats in GetProgramBinary.

Also add a workaround for AMD where the block bindings were not
applied properly after link, similarly to our original bug.

This CL also includes a few fixups for GLProgram (raii).

BUG=angleproject:1637

Change-Id: Iae068eb4e1e4c763aa9f9332c033e38708026c8f
Reviewed-on: https://chromium-review.googlesource.com/418393
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2016-12-13 21:15:17 +00:00
Jamie Madill a2c7498568 Don't load binaries across client versions.
BUG=angleproject:523

Change-Id: Id54033dce15f01a0f2891533172acd8b99896e12
Reviewed-on: https://chromium-review.googlesource.com/418240
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2016-12-12 17:09:04 +00:00
Jamie Madill eb979bfd37 Program: Small cleanup to linkAttributes.
The comment here was incorrect, and the signature passed some
redundant arguments.

Noticed this when I was looking at the code for Vulkan/glslang.

BUG=angleproject:1576

Change-Id: Ie9e7eb7cbe4b65503901b2550e95cd818b7c28c0
Reviewed-on: https://chromium-review.googlesource.com/412324
Reviewed-by: Corentin Wallez <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2016-11-17 21:39:22 +00:00
Corentin Wallez 8b7d8144b4 Clamp "count" in glUniform* before passing to the backend
The OpenGL spec allows "count" to overflow safely implemented but some
drivers like the Intel Windows OpenGL driver don't handle this
correctly and crash on overflow tests.

BUG=661413

Change-Id: I10de9292c75daa375f002850900bb5e1cbfce3b6
Reviewed-on: https://chromium-review.googlesource.com/411387
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Corentin Wallez <[email protected]>
2016-11-15 20:06:14 +00:00
Corentin Wallez 15ac534a96 Program: clamp the number of uniforms to be copied
Reland with a temporary test suppression.

BUG=661413

Change-Id: I552b64de754b326dcd499b84d9f337b9d015dc8e
Reviewed-on: https://chromium-review.googlesource.com/411473
Reviewed-by: Corentin Wallez <[email protected]>
Commit-Queue: Corentin Wallez <[email protected]>
2016-11-15 19:59:37 +00:00
Geoff Lang 399d1a17b2 Revert "Program: clamp the number of uniforms to be copied"
This reverts commit 9863a3ef18.

Change-Id: I840a735b49bc4f2319c8af5f620d7f52bb7eecf1
Reviewed-on: https://chromium-review.googlesource.com/411470
Reviewed-by: Geoff Lang <[email protected]>
2016-11-15 14:55:27 +00:00
Jamie Madill b0a838bff5 Program: Make LinkResult use gl::ErrorOrResult.
This simplifies the error handling code, and allows the use of the
ANGLE_TRY macro (and friends).

BUG=angleproject:1576

Change-Id: I3142388b10d0dd67a7f49a5c8c3d11102996be93
Reviewed-on: https://chromium-review.googlesource.com/411201
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2016-11-14 22:52:40 +00:00
Corentin Wallez 9863a3ef18 Program: clamp the number of uniforms to be copied
BUG=661413

Change-Id: I1a146dae0d01edeb272a58610355261b0e23dec1
Reviewed-on: https://chromium-review.googlesource.com/406745
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Corentin Wallez <[email protected]>
2016-11-14 19:38:02 +00:00
Qin Jiajia 0350a64c3c Fixed the bug using uniform block array
At the beginning of Program::defineUniformBlock, getUniformBlockSize will call
getUniformBlockIndex on MacOS to check if the block is an active block with
giving blockName. However, it didn't distinguish array and non-array situations
and unified to use interfaceBlock.name as the blockName to call
getUniformBlockIndex. It would result that INVALID_INDEX was returned when
it's a block array. For example, using 'blockName' not 'blockName[0]'.

In OpenGL 4.3 spec, section 7.3.1, there are following descriptions:
If name exactly matches the name string of one of the active resources for
programInterface, the index of the matched resource is returned. Additionally, if
name would exactly match the name string of an active resource if "[0]" were
appended to name, the index of the matched resource is returned. Otherwise, name
is considered not to be the name of an active resource, and INVALID_INDEX is
returned.

So, for array block case, we use blockName appending [0] to check the activity.

BUG=angleproject:1543

Change-Id: I8189b62066b779f7d392a7dba1cf5cb02a31936d
Reviewed-on: https://chromium-review.googlesource.com/405830
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2016-11-04 23:32:59 +00:00
Jamie Madill 60e6edfa7f Make ASSERT reference the conditional expression.
This should prevent further unexpected bot breakage due to
unreferenced variables in the ASSERT expression.

Also remove the no longer needed variable referencing macro.

BUG=angleproject:1586

Change-Id: I127695165bdfe39c51fe8d17e00daf6bf2fa8252
Reviewed-on: https://chromium-review.googlesource.com/404948
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2016-10-31 20:25:24 +00:00
Geoff Lang 6899b87f8c Implement the robust GetActiveUniformBlockiv entry point.
BUG=angleproject:1354

Change-Id: I2e8051910f50dc040f6be4922142364d36788c4e
Reviewed-on: https://chromium-review.googlesource.com/399041
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
2016-10-20 01:19:48 +00:00
Jamie Madill ef300b153b Refactor some entry point stuff.
BUG=angleproject:747

Change-Id: I80634b5e6de8bae1433c49a56a92d3b19c24e11d
Reviewed-on: https://chromium-review.googlesource.com/395568
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2016-10-08 00:33:36 +00:00
Corentin Wallez 054f7ed0d6 preprocessor: Miscellaneous cleanups
- Use full header paths in includes
- Use ASSERT instead of assert
- Use angle::NonCopyable instead of PP_DISALLOW_COPY_AND_ASSIGN
- Use range-for in a couple places
- Remove pp_utils.h

BUG=angleproject:1522

Change-Id: If107fef89e8465bca65cf664926d1051c5d1e232
Reviewed-on: https://chromium-review.googlesource.com/387212
Commit-Queue: Corentin Wallez <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2016-09-26 19:25:29 +00:00
Martin Radev 4c4c8e7252 Add compute program compilation and linking support
Compute shaders can be now compiled and linked to create programs.
Some tests are added to verify successful and unsuccessful compute
shader linking.

The patch also replaces std::array<int, 3> with a custom struct
WorkGroupSize.

BUG=angleproject:1442

TEST=angle_end2end_tests
TEST=angle_unittests

Change-Id: I4ab0ac05755d0167a6d2a798f8d7f1516cf54d84
Reviewed-on: https://chromium-review.googlesource.com/366740
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Olli Etuaho <[email protected]>
Commit-Queue: Olli Etuaho <[email protected]>
2016-08-26 09:51:18 +00:00
Geoff Lang 3f6a398c7d Fix type conversion warnings.
BUG=angleproject:1382

Change-Id: Idee8882a7d7576faaa08418d9d399d836cec8fa7
Reviewed-on: https://chromium-review.googlesource.com/360903
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2016-07-15 19:36:32 +00:00
Sami Väisänen 46eaa94624 Support CHROMIUM_path_rendering fragment operations
This brings two new APIs, BindFragmentInputLocation and
ProgramPathFragmentInputGen that together dictate how the
fragment shader varyings are used.

BUG=angleproject:1382

Change-Id: I4b52fd8a3555235a73aecd4f3dba2d500789cbb0
Reviewed-on: https://chromium-review.googlesource.com/357071
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Sami Väisänen <[email protected]>
Commit-Queue: Sami Väisänen <[email protected]>
2016-07-15 15:18:46 +00:00
Yuly Novikov a1f6dc95bb Varying invariance must match between shaders in ESSL 1.00
While in ESSL 3.00 invariant is allowed only for out varyings.
Verify that, and update test expectations.

BUG=angleproject:1293
TEST=GLSLTest*.Invariant*

Change-Id: I5cab6c68f2b94ea2179719119668d905fe7a9b3d
Reviewed-on: https://chromium-review.googlesource.com/352743
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Yuly Novikov <[email protected]>
2016-06-17 00:32:39 +00:00
Yuly Novikov cfa48d3744 Shader versions must match.
Per GLSL_ES_Specification_3.00.4 paragraph 3.3 Version Declaration:
"Shaders declaring version 3.00 of the shading language
cannot be linked with shaders declaring version 1.00."

BUG=angleproject:1361
TEST=GLSLTest_ES3.VersionMismatch

Change-Id: Icee672b798dcdb41a189e4a6459c4e643daf1fa6
Reviewed-on: https://chromium-review.googlesource.com/353182
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Yuly Novikov <[email protected]>
2016-06-17 00:25:11 +00:00
Jamie Madill dfde6abf9f Context: Remove mutable gl::State getter.
This will preserve layering - the API layer doesn't mutate the state
directly, it passes the API call through to the Context. Is also
removes the possiblity of any shenanigans of the Validation layer
changing the GL state.

Also, this CL refactors a few validation entry points to take
ValidationContext instead of Context. ValidationContext will be the
correct way to interact with the gl::Context in the Validation code.

Finally, additional refactorings make ContextState a proper class with
private data. This allows the ContextState itself to keep a mutable
pointer to the gl::State, so ValidationContext can modify it if
necessary (and it will be necessary for Framebuffer completeness
caching).

BUG=angleproject:1388

Change-Id: I86ab3561573caa9535c8d1b8aad4ab3d0e7cd470
Reviewed-on: https://chromium-review.googlesource.com/348954
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2016-06-14 17:16:46 +00:00
Jamie Madill e2e406c3a4 Add base::numerics for safe math and conversions.
This replaces are "IsUnsignedXXXSafe" family of methods.
Also add overflow checks to unpack block sizes.

BUG=angleproject:1397

Change-Id: Ib47be149b0486c70f795b0d0f8899441faac9340
Reviewed-on: https://chromium-review.googlesource.com/348062
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2016-06-03 15:52:02 +00:00
Jamie Madill 53ea9cc655 Replace rx::Renderer with rx::ContextImpl.
Previously Context had no Impl class, but had a special relationship
with the instanced Renderer class. Having a ContextImpl backing every
Context will allow new designs to enable things like multithreading
(where each ContextImpl stores a Context-specific device) or non-
virtual Contexts on Android or other platforms where it is more
efficient.

A large refactoring patch that touches every back-end.

BUG=angleproject:1363

Change-Id: Icb73a7d37447f08a664eeb499a310ba05d71a57e
Reviewed-on: https://chromium-review.googlesource.com/342052
Reviewed-by: Corentin Wallez <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2016-05-17 15:59:29 +00:00
Jamie Madill 7aea7e056d Add EGLImplFactory.
Also rename ImplFactory to GLImplFactory.

This will allow us to use the same factory design pattern for EGL
objects, and to use State helper classes to share data with Impls.

BUG=angleproject:1363
BUG=angleproject:1369

Change-Id: I07a8fe40838d5d4ca32b04910c306edeab4d25a7
Reviewed-on: https://chromium-review.googlesource.com/342051
Reviewed-by: Corentin Wallez <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2016-05-11 20:22:24 +00:00
Jamie Madill 48ef11b2aa Rename gl::Framebuffer::Data to gl::FramebufferState.
Moving this out of the Framebuffer class allows us to forward-
declare it.

BUG=angleproject:1363

Change-Id: I91971c37a92151df508cdf7f0eb8c3e93506d112
Reviewed-on: https://chromium-review.googlesource.com/340741
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2016-04-29 15:27:58 +00:00
Jamie Madill 9082b982b9 Rename gl::Data to gl::ContextState.
Part of the new world order of renaming the Obj::Data classes to ObjState.

BUG=angleproject:1363

Change-Id: I15cf002b8b093d687f540b9e86f045874af24a7e
Reviewed-on: https://chromium-review.googlesource.com/340740
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2016-04-29 01:47:03 +00:00
Geoff Lang d860552fc4 Implement support for CHROMIUM_bind_uniform_location.
BUG=angleproject:1353

Change-Id: Ia219ff973de0de2f8e112c276b3ab6319f7d3884
Reviewed-on: https://chromium-review.googlesource.com/334252
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2016-04-26 18:03:31 +00:00
Corentin Wallez 6596c465a7 Program::getUniformInternal: return only one array element
Reland with a compilation fix for GPU Builder, with a fix for
UniformTest.BooleanArrayUniformStateQuery and better formatting.

When getUniformInternal detected a mismatch between the glGetUniform
type and the uniform type, it entered a code path where it wrongly wrote
the whole array instead of a single element, causing a buffer overflow.

Adds a regression test.

BUG=595836

Change-Id: Ie860b87ad56046483650f457457116cc22bf3c0f
Reviewed-on: https://chromium-review.googlesource.com/334448
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
Commit-Queue: Corentin Wallez <[email protected]>
2016-03-26 01:20:51 +00:00
Corentin Wallez 5051eee576 Revert "Program::getUniformInternal: return only one array element"
It breaks compilation on GPU Builder

This reverts commit 3ea54ba890.

Change-Id: Ie18f876b1db353d75cbd5a612f0a433cfc552ef2
Reviewed-on: https://chromium-review.googlesource.com/334405
Reviewed-by: Corentin Wallez <[email protected]>
2016-03-23 01:35:09 +00:00
Corentin Wallez 3ea54ba890 Program::getUniformInternal: return only one array element
When getUniformInternal detected a mismatch between the glGetUniform
type and the uniform type, it entered a code path where it wrongly wrote
the whole array instead of a single element, causing a buffer overflow.

Adds a regression test.

BUG=595836

Change-Id: Id7372faece276d28363a30bf3183497d97357c76
Reviewed-on: https://chromium-review.googlesource.com/333771
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Corentin Wallez <[email protected]>
2016-03-22 21:07:02 +00:00
Olli Etuaho 586bc55caf Return the correct count from getAttachedShaders
The count should be the total amount of shader ids written. Before
this patch the code used to write the amount of attached shaders
to count regardless of the value of maxCount.

BUG=angleproject:1101
TEST=dEQP-GLES3.functional.state_query.shader.*

Change-Id: I5ae729748c7809f03fd496c927a76f60398d2b42
Reviewed-on: https://chromium-review.googlesource.com/329865
Reviewed-by: Corentin Wallez <[email protected]>
Commit-Queue: Olli Etuaho <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2016-03-05 08:34:51 +00:00
Jamie Madill 39046169da CollectVariables: Don't include block name in field name.
The spec mandates that the instance name of a block determines how the
active uniform name for this field is reported. However, our handling
of this was a bit bugged. We would include the proper prefix on the
compiler-side, but this mangled the hashing, and was also not strictly
needed. We now also expose the instance name, so we can determine the
proper prefix for variable linking on the GL-side of things. This also
is consistent with how we handle other spec issues, where the GL-side
handles the GL-API specific functionality.

This also allows us to fix name hashing of instanced uniform blocks,
which was previously broken because we would hash the full name of the
active uniform, instead of just the field.

BUG=angleproject:1306

Change-Id: I06ace6dbc3f75fdd8129677360dcc142aa89136e
Reviewed-on: https://chromium-review.googlesource.com/326681
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2016-02-09 14:59:53 +00:00
Geoff Lang 70d0f4996a Implement GL_KHR_debug.
BUG=angleproject:520

Change-Id: I9ced3e7ab1515feddf2ec103c26b2610a45b1784
Reviewed-on: https://chromium-review.googlesource.com/319830
Tryjob-Request: Geoff Lang <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Tested-by: Geoff Lang <[email protected]>
2016-01-02 15:09:23 +00:00
Geoff Lang 66988745f2 Revert "Implement GL_KHR_debug."
This reverts commit 6c521b7a70.

Change-Id: I6ff981198e31f34d3e405edea6277ee75516d6ee
Reviewed-on: https://chromium-review.googlesource.com/319820
Reviewed-by: Geoff Lang <[email protected]>
Tested-by: Geoff Lang <[email protected]>
2015-12-22 19:39:40 +00:00
Geoff Lang 6c521b7a70 Implement GL_KHR_debug.
BUG=angleproject:520

Change-Id: I78d14cc8c94f5cef58604220f0ca847473b25bf8
Reviewed-on: https://chromium-review.googlesource.com/317820
Tryjob-Request: Geoff Lang <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Tested-by: Geoff Lang <[email protected]>
2015-12-22 15:36:53 +00:00
Geoff Lang c56297597f Implement full program binary support for ES3.
Refactor validation to be used in both the OES and ES3 entry points.

BUG=angleproject:600
BUG=angleproject:1101

Change-Id: I2008c4ea04ce07910f03ae0b997f8a77b66203d8
Reviewed-on: https://chromium-review.googlesource.com/316620
Reviewed-by: Jamie Madill <[email protected]>
Tested-by: Geoff Lang <[email protected]>
2015-12-08 17:58:14 +00:00
Jamie Madill 28afae5d41 Rename LinkedVarying to D3DVarying.
Also move this type to D3D-only world. It was only used in the D3D
renderer and has specific stuff like register/semantic indexes.

Refactoring patch to clean up further work with Varyings.

BUG=angleproject:1202

Change-Id: I4b1d6899e9eef356efc7d11e9cd6cf88b234aa76
Reviewed-on: https://chromium-review.googlesource.com/311240
Reviewed-by: Geoff Lang <[email protected]>
Tested-by: Jamie Madill <[email protected]>
2015-11-10 19:01:58 +00:00
Jamie Madill c4c74422bd ES3: Don't validate precision qualifiers when linking UBOs.
According to the resolution of Khonos bug 10287, we shouldn't be
validating these precisions. Note that this is counter to the
current ESSL spec text, but there's an open action item to change
the spec language.

TEST=dEQP-GLES3.functional.shaders.linkage.uniform.block.differing_precision
BUG=angleproject:1088

Change-Id: Ib05dca792b89e57e90d3a5f9efdb3a202230f585
Reviewed-on: https://chromium-review.googlesource.com/310760
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
Tested-by: Jamie Madill <[email protected]>
2015-11-06 19:21:30 +00:00