#include "tgsi/tgsi_scan.h"
#include "svga_hw_reg.h"
+#include "svga_shader.h"
#include "svga_tgsi.h"
#include "svga3d_shaderdefs.h"
int dynamic_branching_level;
+ unsigned num_output_writes;
+ boolean constant_color_output;
+
boolean in_main_func;
boolean created_common_immediate;
struct svga_arl_consts arl_consts[12];
int num_arl_consts;
int current_arl;
+
+ unsigned pstipple_sampler_unit;
+
+ int num_samplers;
+ uint8_t sampler_target[PIPE_MAX_SAMPLERS];
};
svga_shader_emit_instructions(struct svga_shader_emitter *emit,
const struct tgsi_token *tokens);
+boolean
+svga_shader_emit_samplers_decl(struct svga_shader_emitter *emit);
+
boolean
svga_translate_decl_sm30(struct svga_shader_emitter *emit,
const struct tgsi_full_declaration *decl);
/** Emit the given SVGA3dShaderInstToken opcode */
-static INLINE boolean
+static inline boolean
emit_instruction(struct svga_shader_emitter *emit,
SVGA3dShaderInstToken opcode)
{
/** Generate a SVGA3dShaderInstToken for the given SVGA3D shader opcode */
-static INLINE SVGA3dShaderInstToken
-inst_token(unsigned opcode)
+static inline SVGA3dShaderInstToken
+inst_token(SVGA3dShaderOpCodeType opcode)
{
SVGA3dShaderInstToken inst;
* Generate a SVGA3dShaderInstToken for the given SVGA3D shader opcode
* with the predication flag set.
*/
-static INLINE SVGA3dShaderInstToken
-inst_token_predicated(unsigned opcode)
+static inline SVGA3dShaderInstToken
+inst_token_predicated(SVGA3dShaderOpCodeType opcode)
{
SVGA3dShaderInstToken inst;
* Generate a SVGA3dShaderInstToken for a SETP instruction (set predicate)
* using the given comparison operator (one of SVGA3DOPCOMP_xx).
*/
-static INLINE SVGA3dShaderInstToken
-inst_token_setp(unsigned operator)
+static inline SVGA3dShaderInstToken
+inst_token_setp(SVGA3dShaderOpCodeCompFnType operator)
{
SVGA3dShaderInstToken inst;
* Note that this function is used to create tokens for output registers,
* temp registers AND constants (see emit_def_const()).
*/
-static INLINE SVGA3dShaderDestToken
-dst_register(unsigned file, int number)
+static inline SVGA3dShaderDestToken
+dst_register(SVGA3dShaderRegType file, int number)
{
SVGA3dShaderDestToken dest;
* Apply a writemask to the given SVGA3dShaderDestToken, returning a
* new SVGA3dShaderDestToken.
*/
-static INLINE SVGA3dShaderDestToken
+static inline SVGA3dShaderDestToken
writemask(SVGA3dShaderDestToken dest, unsigned mask)
{
assert(dest.mask & mask);
/** Create a SVGA3dShaderSrcToken given a register file and number */
-static INLINE SVGA3dShaderSrcToken
-src_token(unsigned file, int number)
+static inline SVGA3dShaderSrcToken
+src_token(SVGA3dShaderRegType file, int number)
{
SVGA3dShaderSrcToken src;
/** Create a src_register given a register file and register number */
-static INLINE struct src_register
-src_register(unsigned file, int number)
+static inline struct src_register
+src_register(SVGA3dShaderRegType file, int number)
{
struct src_register src;
}
/** Translate src_register into SVGA3dShaderDestToken */
-static INLINE SVGA3dShaderDestToken
+static inline SVGA3dShaderDestToken
dst(struct src_register src)
{
return dst_register(SVGA3dShaderGetRegType(src.base.value), src.base.num);
/** Translate SVGA3dShaderDestToken to a src_register */
-static INLINE struct src_register
+static inline struct src_register
src(SVGA3dShaderDestToken dst)
{
return src_register(SVGA3dShaderGetRegType(dst.value), dst.num);