Commit Graph
35 Commits
Author SHA1 Message Date
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
Jamie Madill e31fd8753b Enable Release ASSERT in ANGLE.
This will mainly affect the Chromium bots.

BUG=angleproject:790

Change-Id: I0c4318e83eedba851f15b3b139551cdb6a2fde12
Reviewed-on: https://chromium-review.googlesource.com/346103
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Kenneth Russell <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2016-05-27 20:05:05 +00:00
Jamie Madill 89853e8420 Clean up unused variable macros.
We might want UNUSED_ASSERTION as a special case but the unused trace
variable macro was being abused in places.

BUG=angleproject:1290

Change-Id: I5f9252b3ff0484d2e859b9fcf68d5d060b28f1fc
Reviewed-on: https://chromium-review.googlesource.com/324290
Reviewed-by: Geoff Lang <[email protected]>
Tested-by: Jamie Madill <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2016-01-28 18:17:17 +00:00
Austin Kinross 6ee1e7866e Implement GL_EXT_debug_marker in D3D9/D3D11 renderers
BUG=angleproject:1043

Change-Id: I7f3bfb35050662520b901828d0478719fa8d11b3
Reviewed-on: https://chromium-review.googlesource.com/274054
Reviewed-by: Jamie Madill <[email protected]>
Tested-by: Austin Kinross <[email protected]>
2015-06-15 17:44:17 +00:00
Jamie Madill 2c7c625a5e Refactor D3D Debug Annotations code.
This encapsultates the different implementations and allows us to
compile debug.cpp in the common libraries without link errors.

BUG=angleproject:513

Change-Id: I16dc4c666fb4266ee5146d64d77eb9925c7584a8
Reviewed-on: https://chromium-review.googlesource.com/256450
Reviewed-by: Geoff Lang <[email protected]>
Tested-by: Jamie Madill <[email protected]>
2015-03-18 14:29:35 +00:00
Cooper Partin 7318b7cb8e Fixed failed compilation for WinRT to use OutputDebugStringA for non wide strings.
Change-Id: If012660d4b895399fe5e3226dea25a8c7f78c8ac
Reviewed-on: https://chromium-review.googlesource.com/239504
Reviewed-by: Geoff Lang <[email protected]>
Tested-by: Cooper Partin <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2015-01-08 18:36:44 +00:00
Jamie Madill 14aa40f021 Print ERR() errors to the debug output on Windows.
We can switch this on for Debug only. This will help developers
catch bugs more easily, and will only show up for internal
errors and major performance caveats. Currently it's far too easy
to miss these messages - it requires manually modifying debug.h,
looking at a text file and potentially also running Chromium with
an special flag.

BUG=angle:663

Change-Id: I75b3bd05fbc75d21607b9957134db8e8990c77b1
Reviewed-on: https://chromium-review.googlesource.com/239191
Tested-by: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2015-01-07 21:25:35 +00:00
Geoff Lang 8bc361e144 Support compiling libANGLE as a static or shared library.
BUG=angle:733

Change-Id: If27d3330534bce0f5b691010ea7d97bcb7579122
Reviewed-on: https://chromium-review.googlesource.com/231052
Reviewed-by: Jamie Madill <[email protected]>
Tested-by: Geoff Lang <[email protected]>
2014-12-01 19:01:02 +00:00
Austin Kinross 922a9fb336 Use D3D11 Debug Annotations when D3D9 is unavailable
Change-Id: I37ac5fe7f0b2fe5e71bd7f0afca55e9894f3463c
Reviewed-on: https://chromium-review.googlesource.com/224512
Tested-by: Austin Kinross <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2014-10-30 13:32:41 +00:00
Austin Kinross fe14d455c2 Add ANGLE_ENABLE_DEBUG_TRACE_TO_DEBUGGER, to output trace to debugger window
Change-Id: I7be71c41b0ec3a77f508c90c2de3331c9522a11b
Reviewed-on: https://chromium-review.googlesource.com/223592
Reviewed-by: Shannon Woods <[email protected]>
Tested-by: Geoff Lang <[email protected]>
2014-10-28 19:27:20 +00:00
Austin Kinross f0360c6004 Rename ANGLE_ENABLE_TRACE -> ANGLE_ENABLE_DEBUG_TRACE
Change-Id: Ib70c456c8d01161e370b9165ff4daa2f0f90c840
Reviewed-on: https://chromium-review.googlesource.com/223591
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Shannon Woods <[email protected]>
Tested-by: Geoff Lang <[email protected]>
2014-10-28 19:26:57 +00:00
Austin Kinross 570e83cfe0 Rename ANGLE_ENABLE_PERF -> ANGLE_ENABLE_DEBUG_ANNOTATIONS
Change-Id: I701cd5ee749797428171e9c58a46fce626b9a969
Reviewed-on: https://chromium-review.googlesource.com/223590
Reviewed-by: Geoff Lang <[email protected]>
Tested-by: Geoff Lang <[email protected]>
2014-10-28 19:26:44 +00:00
Jamie Madill b60fe31f0b Fix the ANGLE_ENABLE_TRACE build.
We needed to include angleutils.cpp in libtranslator for this to
compile. Also allow the event helpers to record API calls even
if ANGLE_ENABLE_PERF is off.

BUG=angle:513

Change-Id: I2646d5ebeae536a4a7f1cd7ecaf0ce019ce5ff76
Reviewed-on: https://chromium-review.googlesource.com/219756
Tested-by: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Shannon Woods <[email protected]>
2014-09-30 19:41:24 +00:00
Geoff Lang da5777cf9f Create an Error object to represent GL errors.
BUG=angle:520

Change-Id: I1a54e6f308b5b0f310c725a7771af737a77ecd42
Reviewed-on: https://chromium-review.googlesource.com/209619
Reviewed-by: Jamie Madill <[email protected]>
Tested-by: Geoff Lang <[email protected]>
2014-08-25 14:06:23 +00:00
Geoff Lang 44fa7594bc Refactor platform related functionality into platform.h and tls.h.
Since libGLESv2 and libEGL will eventually be cross platform, it will be
useful to have platform defines and TLS functions that work everywhere.

BUG=angle:664

Change-Id: Ia357925a0992d82e8b446d88d32a1984d319e6e8
Reviewed-on: https://chromium-review.googlesource.com/202133
Reviewed-by: Jamie Madill <[email protected]>
Tested-by: Geoff Lang <[email protected]>
2014-06-11 14:03:13 +00:00
Geoff Lang 2515c5201b Fix compile errors on pre-C++11 compilers.
BUG=angle:575

Change-Id: Ibad77fda193c850c29483aa56d0d2275c131429a
Reviewed-on: https://chromium-review.googlesource.com/189163
Tested-by: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2014-03-07 15:40:45 +00:00
Geoff Lang feee44bf9a Keep the debug log file open and flush with each message.
Instead of opening and closing the debug log file with each message, keep
it open permanently and flush it with each message, allowing the OS to
flush to disk as needed.  With debug logging enabled, performance is improved
by 100x!

Also, dynamically size the output buffer to the max message size.  When
running all the samples, the largest debug message was 318 characters so
an initial size of 512 (instead of 32768) seems reasonable.

BUG=angle:575

Change-Id: If4a1387431fc2d32a6b2d1f9ca1f2590473feb86
Reviewed-on: https://chromium-review.googlesource.com/188713
Reviewed-by: Nicolas Capens <[email protected]>
Reviewed-by: Shannon Woods <[email protected]>
Tested-by: Geoff Lang <[email protected]>
2014-03-07 14:22:59 +00:00
Geoff Lang 83217796ed Remove system.h.
The gyp files already define NOMINMAX and WIN32_LEAN_AND_MEAN.  windows.h
is also included via the D3D includes.

This ends up speeding up the build process significantly by not having
windows.h included in nearly every file.

Also fixes issues on non-windows systems by not having stdarg.h included
in debug.cpp.

Change-Id: Id32d9aac37a5a29df832a062dd8024302a798a1c
Reviewed-on: https://chromium-review.googlesource.com/183251
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Shannon Woods <[email protected]>
Tested-by: Geoff Lang <[email protected]>
2014-01-23 21:58:07 +00:00
Geoff Lang f571312409 Rework tracing and perf defines.
Changed ANGLE_DISABLE_* to ANGLE_ENABLE_* for perf and tracing defines so
they are disabled by default.  Updated the gyp files to only turn on perf
by default for windows debug builds.

Change-Id: I71706674e6d12fbf4208acc8f100d963b82c7674
Reviewed-on: https://chromium-review.googlesource.com/183250
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Shannon Woods <[email protected]>
Tested-by: Geoff Lang <[email protected]>
2014-01-23 19:56:13 +00:00
Geoff Lang 6850947e14 Added a define that removes d3d includes from the common directory so that d3d9 headers are not included in the translator project. 2013-10-17 09:37:04 -04:00
[email protected] 486d9e9b6b Remove a lot of unnecessary include files and break include chains.
This should speed up incremental compile times when modifying headers, by reducing the number of dependencies.

TRAC #22518

Signed-off-by: Geoff Lang
Signed-off-by: Shannon Woods
Author: Jamie Madill

git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1937 736b8ea6-26fd-11df-bfd4-992fa37f6226
2013-02-28 23:15:41 +00:00
[email protected] a9b96d0d31 Include windows.h from one place to ensure that min and max macros are not defined.
These conflict with the STL functions of the same name.

This is to make the standalone ANGLE gyp build work again.
Review URL: https://codereview.appspot.com/7211043


Also includes r1729 which adds the missing new file.

git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1790 736b8ea6-26fd-11df-bfd4-992fa37f6226
2013-01-25 21:56:18 +00:00
[email protected] 5dc3b8b476 Don't call gl::output unless perf is enabled.
gl::output allocates a pretty large stack buffer, so it has to call _chkstk. This is rather slow, so avoid calling gl::output if perf and tracing are disabled.

BUG=

Review URL: https://codereview.appspot.com/6843043

git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1471 736b8ea6-26fd-11df-bfd4-992fa37f6226
2012-11-28 19:43:49 +00:00
[email protected] 95a758f3aa Remove dos-style line-endings (EOL changes only)
git-svn-id: https://angleproject.googlecode.com/svn/trunk@1218 736b8ea6-26fd-11df-bfd4-992fa37f6226
2012-07-12 15:17:06 +00:00
[email protected] d08aa75eb1 Increase size of output buffer for pix to 32768
We output entire hlsl shaders into this buffer, so 4096 bytes was too small.

BUG=
TEST=

Review URL: https://codereview.appspot.com/5532094

git-svn-id: https://angleproject.googlecode.com/svn/trunk@953 736b8ea6-26fd-11df-bfd4-992fa37f6226
2012-01-20 23:50:06 +00:00
[email protected] eef0e27c12 Fix link errors caused by static use of perf related functions even when ANGLE_DISABLE_PERF is defined.
Bug=225
Author: Mark Callow

git-svn-id: https://angleproject.googlecode.com/svn/trunk@788 736b8ea6-26fd-11df-bfd4-992fa37f6226
2011-10-12 16:19:36 +00:00
[email protected] 73bec982fc Cache result of D3DPERF_GetStatus.
I profiled the WebGL acquarium with AMD CodeAnalyst and it turns out this function got a lot of hits. Top 10 before change:

CS:EIP     	Symbol + Offset                                                              	64-bit 	Timer samples 	
0x62a87260 	CBatchFilterI::ProcessBatch                                                  	       	13.41         	
0x62a171f1 	D3DPERF_GetStatus                                                            	       	6.04          	
0x629ce831 	CD3DBase::SetVertexShaderConstantF_FP                                        	       	5.12          	
0x62a88bea 	CBatchFilterI::GetBatchBufferPointer<_LH_SETPIXELSHADERCONSTIMM_TOKEN_SMALL> 	       	4.61          	
0x6298060b 	UpdateViewportCache                                                          	       	4.2           	
0x6298da3a 	CD3DBase::UpdateTextures                                                     	       	3.58          	
0x6298db6b 	CD3DDDIDX10::SetTexture                                                      	       	2.76          	
0x6298df1d 	CD3DDDIDX10::InsertStreamSource                                              	       	2.46          	
0x629d1c1a 	CD3DBase::SetPixelShaderConstantF_FP                                         	       	2.25          	
0x6297efc4 	CD3DHal::SetSamplerState_FP                                                  	       	2.05          	

10 functions, 186 instructions, Total: 454 samples, 46.47% of shown samples, 2.51% of total session samples


And after:

CS:EIP     	Symbol + Offset                                                              	64-bit 	Timer samples 	
0x69317260 	CBatchFilterI::ProcessBatch                                                  	       	13.87         	
0x69318bea 	CBatchFilterI::GetBatchBufferPointer<_LH_SETPIXELSHADERCONSTIMM_TOKEN_SMALL> 	       	5.84          	
0x6921060b 	UpdateViewportCache                                                          	       	5.29          	
0x6925e831 	CD3DBase::SetVertexShaderConstantF_FP                                        	       	4.93          	
0x6921da3a 	CD3DBase::UpdateTextures                                                     	       	4.38          	
0x6921e034 	CD3DBase::SetStreamSource_FP                                                 	       	3.65          	
0x69261c1a 	CD3DBase::SetPixelShaderConstantF_FP                                         	       	3.65          	
0x69227651 	CD3DBase::DrawIndexedPrimitive                                               	       	2.74          	
0x6920efc4 	CD3DHal::SetSamplerState_FP                                                  	       	2.37          	
0x6925e9f7 	CD3DBase::SetVertexShaderConstantIntF                                        	       	2.37          	

10 functions, 152 instructions, Total: 269 samples, 49.09% of shown samples, 0.80% of total session samples


UpdateViewportCache looks like it might be low hanging fruit as well.
Review URL: http://codereview.appspot.com/4535049

git-svn-id: https://angleproject.googlecode.com/svn/trunk@648 736b8ea6-26fd-11df-bfd4-992fa37f6226
2011-05-12 18:15:03 +00:00
[email protected] 0f4cefe946 Map D3D calls and HLSL shaders back to GLES2 calls and GLSL ES shaders in PIX.
This makes debugging and profiling using PIX a lot more convenient. The top level of events are the GLES calls with their arguments. Those can be expanded to see the D3D calls that were issued for a particular GLES call.

When PIX is attached, the shaders are saved out to temporary files and referenced from the translated HLSL shaders via #line directives. This enabled source level debugging of the original GLSL from PIX for pixel and vertex shaders. The HLSL is also saved to a temporary file so that intrinsic functions like texture2D can be stepped into.

It also avoids creating a text file in the current working directory, which has continued to be an issue.

I made the dependency on d3d9.dll static again so it can be accessed by GetModuleHandle witihin DllMain.

I added an EVENT macro that issues D3DPERF_BeginEvent and D3DPERF_EndEvent around a C++ block. I replaced TRACE with EVENT for all the entry points.

I removed the tracing of shader source since the source is visible in PIX.

The means by which the filename of the temporary shader file is passed into the shader compiler is a little clunky. I did it that way to avoid changing the function signatures and breaking folks using the translator.

I plan to make the compiler respect #pragma optimize so that optimization can be disabled for debugging purposes. For now it just disables shader optimization in debug builds of ANGLE.


Review URL: http://codereview.appspot.com/3945043

git-svn-id: https://angleproject.googlecode.com/svn/trunk@541 736b8ea6-26fd-11df-bfd4-992fa37f6226
2011-01-26 19:30:57 +00:00
[email protected] 7155774566 Added a compile flag so that writing to the debug log file can be turned off.
Review URL: http://codereview.appspot.com/3733043/


git-svn-id: https://angleproject.googlecode.com/svn/trunk@524 736b8ea6-26fd-11df-bfd4-992fa37f6226
2011-01-06 21:46:29 +00:00
[email protected] c1693978fc Made debug log filename compile time configurable.
Define TRACE_OUTPUT_FILE macro to change filename. Default remains "debug.txt" for Visual Studio solution based build. Gyp based build uses "angle-debug.txt".

Review URL: http://codereview.appspot.com/2327043

git-svn-id: https://angleproject.googlecode.com/svn/trunk@445 736b8ea6-26fd-11df-bfd4-992fa37f6226
2010-10-06 02:34:39 +00:00
[email protected] 442b7debdb Re-enable debug tracing by default
TRAC #12158
Signed-off-by: Daniel Koch

Author:    Nicolas Capens

git-svn-id: https://angleproject.googlecode.com/svn/trunk@263 736b8ea6-26fd-11df-bfd4-992fa37f6226
2010-05-12 03:41:01 +00:00
[email protected] a54da4e5a1 Implemented inline structure construction
TRAC #12109
Based on Alok Priyadarshi's approach for structure construction in OutputGLSL.cpp
Signed-off-by: Andrew Lewycky
Signed-off-by: Daniel Koch

Author:    Nicolas Capens

git-svn-id: https://angleproject.googlecode.com/svn/trunk@245 736b8ea6-26fd-11df-bfd4-992fa37f6226
2010-05-07 13:03:28 +00:00
[email protected] e7e43fb992 Make it easier to disable tracing
TRAC #11979

Signed-off-by: Shannon Woods
Signed-off-by: Daniel Koch

Author:    Andrew Lewycky

git-svn-id: https://angleproject.googlecode.com/svn/trunk@178 736b8ea6-26fd-11df-bfd4-992fa37f6226
2010-04-22 13:35:23 +00:00
[email protected] bbf56f755e Use directory qualified #include files
Trac #11408
Signed-off-by: Andrew Lewycky
Signed-off-by: Nicolas Capens

git-svn-id: https://angleproject.googlecode.com/svn/trunk@165 736b8ea6-26fd-11df-bfd4-992fa37f6226
2010-04-20 18:52:13 +00:00
[email protected] 5903aeb1f9 Move Common -> src/common
Trac #11406
Signed-off-by: Nicolas Capens

git-svn-id: https://angleproject.googlecode.com/svn/trunk@34 736b8ea6-26fd-11df-bfd4-992fa37f6226
2010-03-17 13:11:57 +00:00