aboutsummaryrefslogtreecommitdiff
path: root/mp/src/public/shaderapi/commandbuffer.h
diff options
context:
space:
mode:
authorJørgen P. Tjernø <[email protected]>2013-12-02 19:31:46 -0800
committerJørgen P. Tjernø <[email protected]>2013-12-02 19:46:31 -0800
commitf56bb35301836e56582a575a75864392a0177875 (patch)
treede61ddd39de3e7df52759711950b4c288592f0dc /mp/src/public/shaderapi/commandbuffer.h
parentMark some more files as text. (diff)
downloadsource-sdk-2013-f56bb35301836e56582a575a75864392a0177875.tar.xz
source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.zip
Fix line endings. WHAMMY.
Diffstat (limited to 'mp/src/public/shaderapi/commandbuffer.h')
-rw-r--r--mp/src/public/shaderapi/commandbuffer.h216
1 files changed, 108 insertions, 108 deletions
diff --git a/mp/src/public/shaderapi/commandbuffer.h b/mp/src/public/shaderapi/commandbuffer.h
index 7c9137a8..de79915f 100644
--- a/mp/src/public/shaderapi/commandbuffer.h
+++ b/mp/src/public/shaderapi/commandbuffer.h
@@ -1,108 +1,108 @@
-//========= Copyright Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//
-// This file defines a number of constants and structured which are used to build up a command
-// buffer to pass to ShaderAPI for state setting and other operations. Since the prupose of these
-// command buffers is to minimize and optimize calls into shaderapi, their structure is not
-// abstract - they are built out by the calling process.
-//
-//===========================================================================//
-
-#ifndef COMMANDBUFFER_H
-#define COMMANDBUFFER_H
-
-
-#ifdef _WIN32
-#pragma once
-#endif
-
-// all commands defined with their struct
-enum CommandBufferCommand_t
-{
- // flow control commands.
- CBCMD_END = 0, // end of stream
- CBCMD_JUMP = 1, // int cmd, void *adr. jump to another
- // stream. Can be used to implement
- // non-sequentially allocated storage
- CBCMD_JSR = 2, // int cmd, void *adr. subroutine call to another stream.
-
- // constant setting commands
- CBCMD_SET_PIXEL_SHADER_FLOAT_CONST = 256, // int cmd,int first_reg, int nregs, float values[nregs*4]
-
-
- CBCMD_SET_VERTEX_SHADER_FLOAT_CONST = 257, // int cmd,int first_reg, int nregs, float values[nregs*4]
- CBCMD_SET_VERTEX_SHADER_FLOAT_CONST_REF = 258, // int cmd,int first_reg, int nregs, &float values[nregs*4]
- CBCMD_SETPIXELSHADERFOGPARAMS = 259, // int cmd, int regdest
- CBCMD_STORE_EYE_POS_IN_PSCONST = 260, // int cmd, int regdest
- CBCMD_COMMITPIXELSHADERLIGHTING = 261, // int cmd, int regdest
- CBCMD_SETPIXELSHADERSTATEAMBIENTLIGHTCUBE = 262, // int cmd, int regdest
- CBCMD_SETAMBIENTCUBEDYNAMICSTATEVERTEXSHADER = 263, // int cmd
- CBCMD_SET_DEPTH_FEATHERING_CONST = 264, // int cmd, int constant register, float blend scale
-
- // texture binding
- CBCMD_BIND_STANDARD_TEXTURE = 512, // cmd, sampler, texture id
- CBCMD_BIND_SHADERAPI_TEXTURE_HANDLE = 513, // cmd, sampler, texture handle
-
- // shaders
- CBCMD_SET_PSHINDEX = 1024, // cmd, idx
- CBCMD_SET_VSHINDEX = 1025, // cmd, idx
-
- // commands from mainline. In mainline commands no longer have
- // command id's specified like this. So I make up numbers...
- CBCMD_SET_VERTEX_SHADER_FLASHLIGHT_STATE = 2000, // cmd, int first_reg (for worldToTexture matrix)
- CBCMD_SET_PIXEL_SHADER_FLASHLIGHT_STATE = 2001, // cmd, int color reg, int atten reg, int origin reg, sampler (for flashlight texture)
-
- CBCMD_SET_PIXEL_SHADER_UBERLIGHT_STATE = 2002, // cmd
-
- CBCMD_SET_VERTEX_SHADER_NEARZFARZ_STATE = 2003, // cmd
-
-};
-
-//-----------------------------------------------------------------------------
-// Commands used by the per-instance command buffer
-// NOTE: If you add commands, you probably want to change the size of
-// CInstanceStorageBuffer and/or the choice of making it a fixed-size allocation
-// see shaderlib/baseshader.*
-//
-// FIXME!! NOTE that this whole scheme here generates a dependency of the
-// shaders on internal guts of shaderapidx8, since it's responsible for
-// setting various pixel shader + vertex shader constants based on the
-// commands below. We need to remove this dependency as it's way too restrictive
-// and puts the smarts in the wrong place (see CBICMD_SETPIXELSHADERGLINTDAMPING
-// as an example). Not going to solve this for l4d though, as I don't anticipate
-// a large amount of new shader writing for that product.
-//-----------------------------------------------------------------------------
-enum CommandBufferInstanceCommand_t
-{
- CBICMD_END = 0, // end of stream
- CBICMD_JUMP, // int cmd, void *adr. jump to another
- // stream. Can be used to implement
- // non-sequentially allocated storage
- CBICMD_JSR, // int cmd, void *adr. subroutine call to another stream.
-
- CBICMD_SETSKINNINGMATRICES, // int cmd
-
- CBICMD_SETVERTEXSHADERLOCALLIGHTING, // int cmd
- CBICMD_SETPIXELSHADERLOCALLIGHTING, // int cmd, int regdest
- CBICMD_SETVERTEXSHADERAMBIENTLIGHTCUBE, // int cmd
- CBICMD_SETPIXELSHADERAMBIENTLIGHTCUBE, // int cmd, int regdest
- CBICMD_SETPIXELSHADERAMBIENTLIGHTCUBELUMINANCE, // int cmd, int regdest
- CBICMD_SETPIXELSHADERGLINTDAMPING, // int cmd, int regdest
-
- CBICMD_BIND_ENV_CUBEMAP_TEXTURE, // cmd, sampler
-
- CBICMD_SETMODULATIONPIXELSHADERDYNAMICSTATE,
- CBICMD_SETMODULATIONPIXELSHADERDYNAMICSTATE_LINEARCOLORSPACE_LINEARSCALE, // int cmd, int constant register, Vector color2
- CBICMD_SETMODULATIONPIXELSHADERDYNAMICSTATE_LINEARCOLORSPACE, // int cmd, int constant register, Vector color2
- CBICMD_SETMODULATIONPIXELSHADERDYNAMICSTATE_LINEARSCALE, // int cmd, int constant register, Vector color2, float scale
- CBICMD_SETMODULATIONVERTEXSHADERDYNAMICSTATE, // int cmd, int constant register, Vector color2
- CBICMD_SETMODULATIONPIXELSHADERDYNAMICSTATE_IDENTITY, // int cmd, int constant register
- CBICMD_SETMODULATIONVERTEXSHADERDYNAMICSTATE_LINEARSCALE, // int cmd, int constant register, Vector color2, float scale
- // This must be last
- CBICMD_COUNT,
-};
-
-#endif // commandbuffer_h
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//
+// This file defines a number of constants and structured which are used to build up a command
+// buffer to pass to ShaderAPI for state setting and other operations. Since the prupose of these
+// command buffers is to minimize and optimize calls into shaderapi, their structure is not
+// abstract - they are built out by the calling process.
+//
+//===========================================================================//
+
+#ifndef COMMANDBUFFER_H
+#define COMMANDBUFFER_H
+
+
+#ifdef _WIN32
+#pragma once
+#endif
+
+// all commands defined with their struct
+enum CommandBufferCommand_t
+{
+ // flow control commands.
+ CBCMD_END = 0, // end of stream
+ CBCMD_JUMP = 1, // int cmd, void *adr. jump to another
+ // stream. Can be used to implement
+ // non-sequentially allocated storage
+ CBCMD_JSR = 2, // int cmd, void *adr. subroutine call to another stream.
+
+ // constant setting commands
+ CBCMD_SET_PIXEL_SHADER_FLOAT_CONST = 256, // int cmd,int first_reg, int nregs, float values[nregs*4]
+
+
+ CBCMD_SET_VERTEX_SHADER_FLOAT_CONST = 257, // int cmd,int first_reg, int nregs, float values[nregs*4]
+ CBCMD_SET_VERTEX_SHADER_FLOAT_CONST_REF = 258, // int cmd,int first_reg, int nregs, &float values[nregs*4]
+ CBCMD_SETPIXELSHADERFOGPARAMS = 259, // int cmd, int regdest
+ CBCMD_STORE_EYE_POS_IN_PSCONST = 260, // int cmd, int regdest
+ CBCMD_COMMITPIXELSHADERLIGHTING = 261, // int cmd, int regdest
+ CBCMD_SETPIXELSHADERSTATEAMBIENTLIGHTCUBE = 262, // int cmd, int regdest
+ CBCMD_SETAMBIENTCUBEDYNAMICSTATEVERTEXSHADER = 263, // int cmd
+ CBCMD_SET_DEPTH_FEATHERING_CONST = 264, // int cmd, int constant register, float blend scale
+
+ // texture binding
+ CBCMD_BIND_STANDARD_TEXTURE = 512, // cmd, sampler, texture id
+ CBCMD_BIND_SHADERAPI_TEXTURE_HANDLE = 513, // cmd, sampler, texture handle
+
+ // shaders
+ CBCMD_SET_PSHINDEX = 1024, // cmd, idx
+ CBCMD_SET_VSHINDEX = 1025, // cmd, idx
+
+ // commands from mainline. In mainline commands no longer have
+ // command id's specified like this. So I make up numbers...
+ CBCMD_SET_VERTEX_SHADER_FLASHLIGHT_STATE = 2000, // cmd, int first_reg (for worldToTexture matrix)
+ CBCMD_SET_PIXEL_SHADER_FLASHLIGHT_STATE = 2001, // cmd, int color reg, int atten reg, int origin reg, sampler (for flashlight texture)
+
+ CBCMD_SET_PIXEL_SHADER_UBERLIGHT_STATE = 2002, // cmd
+
+ CBCMD_SET_VERTEX_SHADER_NEARZFARZ_STATE = 2003, // cmd
+
+};
+
+//-----------------------------------------------------------------------------
+// Commands used by the per-instance command buffer
+// NOTE: If you add commands, you probably want to change the size of
+// CInstanceStorageBuffer and/or the choice of making it a fixed-size allocation
+// see shaderlib/baseshader.*
+//
+// FIXME!! NOTE that this whole scheme here generates a dependency of the
+// shaders on internal guts of shaderapidx8, since it's responsible for
+// setting various pixel shader + vertex shader constants based on the
+// commands below. We need to remove this dependency as it's way too restrictive
+// and puts the smarts in the wrong place (see CBICMD_SETPIXELSHADERGLINTDAMPING
+// as an example). Not going to solve this for l4d though, as I don't anticipate
+// a large amount of new shader writing for that product.
+//-----------------------------------------------------------------------------
+enum CommandBufferInstanceCommand_t
+{
+ CBICMD_END = 0, // end of stream
+ CBICMD_JUMP, // int cmd, void *adr. jump to another
+ // stream. Can be used to implement
+ // non-sequentially allocated storage
+ CBICMD_JSR, // int cmd, void *adr. subroutine call to another stream.
+
+ CBICMD_SETSKINNINGMATRICES, // int cmd
+
+ CBICMD_SETVERTEXSHADERLOCALLIGHTING, // int cmd
+ CBICMD_SETPIXELSHADERLOCALLIGHTING, // int cmd, int regdest
+ CBICMD_SETVERTEXSHADERAMBIENTLIGHTCUBE, // int cmd
+ CBICMD_SETPIXELSHADERAMBIENTLIGHTCUBE, // int cmd, int regdest
+ CBICMD_SETPIXELSHADERAMBIENTLIGHTCUBELUMINANCE, // int cmd, int regdest
+ CBICMD_SETPIXELSHADERGLINTDAMPING, // int cmd, int regdest
+
+ CBICMD_BIND_ENV_CUBEMAP_TEXTURE, // cmd, sampler
+
+ CBICMD_SETMODULATIONPIXELSHADERDYNAMICSTATE,
+ CBICMD_SETMODULATIONPIXELSHADERDYNAMICSTATE_LINEARCOLORSPACE_LINEARSCALE, // int cmd, int constant register, Vector color2
+ CBICMD_SETMODULATIONPIXELSHADERDYNAMICSTATE_LINEARCOLORSPACE, // int cmd, int constant register, Vector color2
+ CBICMD_SETMODULATIONPIXELSHADERDYNAMICSTATE_LINEARSCALE, // int cmd, int constant register, Vector color2, float scale
+ CBICMD_SETMODULATIONVERTEXSHADERDYNAMICSTATE, // int cmd, int constant register, Vector color2
+ CBICMD_SETMODULATIONPIXELSHADERDYNAMICSTATE_IDENTITY, // int cmd, int constant register
+ CBICMD_SETMODULATIONVERTEXSHADERDYNAMICSTATE_LINEARSCALE, // int cmd, int constant register, Vector color2, float scale
+ // This must be last
+ CBICMD_COUNT,
+};
+
+#endif // commandbuffer_h