13c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#ifndef _RRSHADERS_HPP
23c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#define _RRSHADERS_HPP
33c827367444ee418f129b2c238299f49d3264554Jarkko Poyry/*-------------------------------------------------------------------------
43c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * drawElements Quality Program Reference Renderer
53c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * -----------------------------------------------
63c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *
73c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * Copyright 2014 The Android Open Source Project
83c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *
93c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * Licensed under the Apache License, Version 2.0 (the "License");
103c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * you may not use this file except in compliance with the License.
113c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * You may obtain a copy of the License at
123c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *
133c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *      http://www.apache.org/licenses/LICENSE-2.0
143c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *
153c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * Unless required by applicable law or agreed to in writing, software
163c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * distributed under the License is distributed on an "AS IS" BASIS,
173c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
183c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * See the License for the specific language governing permissions and
193c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * limitations under the License.
203c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *
213c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *//*!
223c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * \file
233c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * \brief Shader interfaces.
243c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *//*--------------------------------------------------------------------*/
253c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
263c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include "rrDefs.hpp"
273c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include "rrVertexAttrib.hpp"
283c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include "rrVertexPacket.hpp"
293c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include "rrFragmentPacket.hpp"
303c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include "rrPrimitivePacket.hpp"
313c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include "rrShadingContext.hpp"
323c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include "deString.h"
333c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
343c827367444ee418f129b2c238299f49d3264554Jarkko Poyrynamespace rr
353c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
363c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
373c827367444ee418f129b2c238299f49d3264554Jarkko Poyry/*--------------------------------------------------------------------*//*!
383c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * \brief Vertex shader input information
393c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *//*--------------------------------------------------------------------*/
403c827367444ee418f129b2c238299f49d3264554Jarkko Poyrystruct VertexInputInfo
413c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
423c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	VertexInputInfo (void)
433c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	{
443c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		// sensible defaults
453c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		type = GENERICVECTYPE_LAST;
463c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	}
473c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
483c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	GenericVecType	type;
493c827367444ee418f129b2c238299f49d3264554Jarkko Poyry};
503c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
513c827367444ee418f129b2c238299f49d3264554Jarkko Poyry/*--------------------------------------------------------------------*//*!
523c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * \brief Shader varying information
533c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *//*--------------------------------------------------------------------*/
543c827367444ee418f129b2c238299f49d3264554Jarkko Poyrystruct VertexVaryingInfo
553c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
563c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	VertexVaryingInfo (void)
573c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	{
583c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		// sensible defaults
593c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		type		= GENERICVECTYPE_LAST;
603c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		flatshade	= false;
613c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	}
623c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
633c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	// \note used by std::vector<T>::operator==() const
643c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	bool operator== (const VertexVaryingInfo& other) const
653c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	{
663c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		return	type == other.type &&
673c827367444ee418f129b2c238299f49d3264554Jarkko Poyry				flatshade == other.flatshade;
683c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	}
693c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
703c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	GenericVecType	type;
713c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	bool			flatshade;
723c827367444ee418f129b2c238299f49d3264554Jarkko Poyry};
733c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
743c827367444ee418f129b2c238299f49d3264554Jarkko Poyrytypedef VertexVaryingInfo VertexOutputInfo;
753c827367444ee418f129b2c238299f49d3264554Jarkko Poyrytypedef VertexVaryingInfo FragmentInputInfo;
763c827367444ee418f129b2c238299f49d3264554Jarkko Poyrytypedef VertexVaryingInfo GeometryInputInfo;
773c827367444ee418f129b2c238299f49d3264554Jarkko Poyrytypedef VertexVaryingInfo GeometryOutputInfo;
783c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
793c827367444ee418f129b2c238299f49d3264554Jarkko Poyry/*--------------------------------------------------------------------*//*!
803c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * \brief Fragment shader output information
813c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *//*--------------------------------------------------------------------*/
823c827367444ee418f129b2c238299f49d3264554Jarkko Poyrystruct FragmentOutputInfo
833c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
843c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	FragmentOutputInfo (void)
853c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	{
863c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		// sensible defaults
873c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		type = GENERICVECTYPE_LAST;
883c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	}
893c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
903c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	GenericVecType type;
913c827367444ee418f129b2c238299f49d3264554Jarkko Poyry};
923c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
933c827367444ee418f129b2c238299f49d3264554Jarkko Poyry/*--------------------------------------------------------------------*//*!
943c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * \brief Vertex shader interface
953c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *
963c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * Vertex shaders execute shading for set of vertex packets. See VertexPacket
973c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * documentation for more details on shading API.
983c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *//*--------------------------------------------------------------------*/
993c827367444ee418f129b2c238299f49d3264554Jarkko Poyryclass VertexShader
1003c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
1013c827367444ee418f129b2c238299f49d3264554Jarkko Poyrypublic:
1023c827367444ee418f129b2c238299f49d3264554Jarkko Poyry											VertexShader		(size_t numInputs, size_t numOutputs) : m_inputs(numInputs), m_outputs(numOutputs) {}
1033c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1043c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	virtual void							shadeVertices		(const VertexAttrib* inputs, VertexPacket* const* packets, const int numPackets) const = 0;
1053c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1067208d8ba8e090f1b0c4a46eeb7be0dad905befdePyry Haulos	const std::vector<VertexInputInfo>&		getInputs			(void) const	{ return m_inputs;	}
1077208d8ba8e090f1b0c4a46eeb7be0dad905befdePyry Haulos	const std::vector<VertexOutputInfo>&	getOutputs			(void) const	{ return m_outputs;	}
1083c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1093c827367444ee418f129b2c238299f49d3264554Jarkko Poyryprotected:
1107208d8ba8e090f1b0c4a46eeb7be0dad905befdePyry Haulos											~VertexShader		(void) {}; // \note Renderer will not delete any objects passed in.
1113c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1123c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	std::vector<VertexInputInfo>			m_inputs;
1133c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	std::vector<VertexOutputInfo>			m_outputs;
11493df37596ea66700965094b3aa2830cf4f2ca5aaJarkko Pöyry} DE_WARN_UNUSED_TYPE;
1153c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1163c827367444ee418f129b2c238299f49d3264554Jarkko Poyry/*--------------------------------------------------------------------*//*!
1173c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * \brief Fragment shader interface
1183c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *
1193c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * Fragment shader executes shading for list of fragment packets. See
1203c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * FragmentPacket documentation for more details on shading API.
1213c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *//*--------------------------------------------------------------------*/
1223c827367444ee418f129b2c238299f49d3264554Jarkko Poyryclass FragmentShader
1233c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
1243c827367444ee418f129b2c238299f49d3264554Jarkko Poyrypublic:
1253c827367444ee418f129b2c238299f49d3264554Jarkko Poyry											FragmentShader		(size_t numInputs, size_t numOutputs) : m_inputs(numInputs), m_outputs(numOutputs) {}
1263c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1277208d8ba8e090f1b0c4a46eeb7be0dad905befdePyry Haulos	const std::vector<FragmentInputInfo>&	getInputs			(void) const	{ return m_inputs;	}
1287208d8ba8e090f1b0c4a46eeb7be0dad905befdePyry Haulos	const std::vector<FragmentOutputInfo>&	getOutputs			(void) const	{ return m_outputs;	}
1293c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1303c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	virtual void							shadeFragments		(FragmentPacket* packets, const int numPackets, const FragmentShadingContext& context) const = 0; // \note numPackets must be greater than zero.
1313c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1323c827367444ee418f129b2c238299f49d3264554Jarkko Poyryprotected:
1337208d8ba8e090f1b0c4a46eeb7be0dad905befdePyry Haulos											~FragmentShader		(void) {}; // \note Renderer will not delete any objects passed in.
1343c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1353c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	std::vector<FragmentInputInfo>			m_inputs;
1363c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	std::vector<FragmentOutputInfo>			m_outputs;
13793df37596ea66700965094b3aa2830cf4f2ca5aaJarkko Pöyry} DE_WARN_UNUSED_TYPE;
1383c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1393c827367444ee418f129b2c238299f49d3264554Jarkko Poyry/*--------------------------------------------------------------------*//*!
1403c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * \brief Geometry shader input primitive type
1413c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *//*--------------------------------------------------------------------*/
1423c827367444ee418f129b2c238299f49d3264554Jarkko Poyryenum GeometryShaderInputType
1433c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
1443c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	GEOMETRYSHADERINPUTTYPE_POINTS = 0,
1453c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	GEOMETRYSHADERINPUTTYPE_LINES,
1463c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	GEOMETRYSHADERINPUTTYPE_LINES_ADJACENCY,
1473c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	GEOMETRYSHADERINPUTTYPE_TRIANGLES,
1483c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	GEOMETRYSHADERINPUTTYPE_TRIANGLES_ADJACENCY,
1493c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1503c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	GEOMETRYSHADERINPUTTYPE_LAST
1513c827367444ee418f129b2c238299f49d3264554Jarkko Poyry};
1523c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1533c827367444ee418f129b2c238299f49d3264554Jarkko Poyry/*--------------------------------------------------------------------*//*!
1543c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * \brief Geometry shader output primitive type
1553c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *//*--------------------------------------------------------------------*/
1563c827367444ee418f129b2c238299f49d3264554Jarkko Poyryenum GeometryShaderOutputType
1573c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
1583c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	GEOMETRYSHADEROUTPUTTYPE_POINTS = 0,
1593c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	GEOMETRYSHADEROUTPUTTYPE_LINE_STRIP,
1603c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	GEOMETRYSHADEROUTPUTTYPE_TRIANGLE_STRIP,
1613c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1623c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	GEOMETRYSHADEROUTPUTTYPE_LAST
1633c827367444ee418f129b2c238299f49d3264554Jarkko Poyry};
1643c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1653c827367444ee418f129b2c238299f49d3264554Jarkko Poyry/*--------------------------------------------------------------------*//*!
1663c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * \brief Geometry shader interface
1673c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *
1683c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * Geometry shader executes a list of primitive packets and outputs
1693c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * a new set of vertex packets for new primitives.
1703c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *//*--------------------------------------------------------------------*/
1713c827367444ee418f129b2c238299f49d3264554Jarkko Poyryclass GeometryShader
1723c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
1733c827367444ee418f129b2c238299f49d3264554Jarkko Poyrypublic:
1743c827367444ee418f129b2c238299f49d3264554Jarkko Poyry											GeometryShader		(size_t numVaryingInputs,
1753c827367444ee418f129b2c238299f49d3264554Jarkko Poyry																 size_t numVaryingOutputs,
1763c827367444ee418f129b2c238299f49d3264554Jarkko Poyry																 GeometryShaderInputType inputType,
1773c827367444ee418f129b2c238299f49d3264554Jarkko Poyry																 GeometryShaderOutputType outputType,
1783c827367444ee418f129b2c238299f49d3264554Jarkko Poyry																 size_t numVerticesOut,
1793c827367444ee418f129b2c238299f49d3264554Jarkko Poyry																 size_t numInvocations);
1803c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1813c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	virtual void							shadePrimitives		(GeometryEmitter& output, int verticesIn, const PrimitivePacket* packets, const int numPackets, int invocationID) const = 0;
1823c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1833c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	const std::vector<GeometryInputInfo>&	getInputs			(void) const { return m_inputs; }
1843c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	const std::vector<GeometryOutputInfo>&	getOutputs			(void) const { return m_outputs; }
1853c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	inline GeometryShaderInputType			getInputType		(void) const { return m_inputType; }
1863c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	inline GeometryShaderOutputType			getOutputType		(void) const { return m_outputType; }
1873c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	inline size_t							getNumVerticesOut	(void) const { return m_numVerticesOut; }
1883c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	inline size_t							getNumInvocations	(void) const { return m_numInvocations; }
1893c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1903c827367444ee418f129b2c238299f49d3264554Jarkko Poyryprotected:
1913c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	const GeometryShaderInputType			m_inputType;
1923c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	const GeometryShaderOutputType			m_outputType;
1933c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	const size_t							m_numVerticesOut;
1943c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	const size_t							m_numInvocations;
1953c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1963c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	std::vector<GeometryInputInfo>			m_inputs;
1973c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	std::vector<GeometryOutputInfo>			m_outputs;
19893df37596ea66700965094b3aa2830cf4f2ca5aaJarkko Pöyry} DE_WARN_UNUSED_TYPE;
1993c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
2003c827367444ee418f129b2c238299f49d3264554Jarkko Poyry// Helpers for shader implementations.
2013c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
2023c827367444ee418f129b2c238299f49d3264554Jarkko Poyrytemplate<class Shader>
2033c827367444ee418f129b2c238299f49d3264554Jarkko Poyryclass VertexShaderLoop : public VertexShader
2043c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
2053c827367444ee418f129b2c238299f49d3264554Jarkko Poyrypublic:
2063c827367444ee418f129b2c238299f49d3264554Jarkko Poyry					VertexShaderLoop	(const Shader& shader) : m_shader(shader) {}
2073c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
2083c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	void			shadeVertices		(const VertexAttrib* inputs, VertexPacket* packets, const int numPackets) const;
2093c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
2103c827367444ee418f129b2c238299f49d3264554Jarkko Poyryprivate:
2113c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	const Shader&	m_shader;
2123c827367444ee418f129b2c238299f49d3264554Jarkko Poyry};
2133c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
2143c827367444ee418f129b2c238299f49d3264554Jarkko Poyrytemplate<class Shader>
2153c827367444ee418f129b2c238299f49d3264554Jarkko Poyryvoid VertexShaderLoop<Shader>::shadeVertices (const VertexAttrib* inputs, VertexPacket* packets, const int numPackets) const
2163c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
2173c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	for (int ndx = 0; ndx < numPackets; ndx++)
2183c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		m_shader.shadeVertex(inputs, packets[ndx]);
2193c827367444ee418f129b2c238299f49d3264554Jarkko Poyry}
2203c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
2213c827367444ee418f129b2c238299f49d3264554Jarkko Poyrytemplate<class Shader>
2223c827367444ee418f129b2c238299f49d3264554Jarkko Poyryclass FragmentShaderLoop : public FragmentShader
2233c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
2243c827367444ee418f129b2c238299f49d3264554Jarkko Poyrypublic:
2253c827367444ee418f129b2c238299f49d3264554Jarkko Poyry					FragmentShaderLoop	(const Shader& shader) : m_shader(shader) {}
2263c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
2273c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	void			shadeFragments		(FragmentPacket* packets, const int numPackets) const;
2283c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
2293c827367444ee418f129b2c238299f49d3264554Jarkko Poyryprivate:
2303c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	const Shader&	m_shader;
2313c827367444ee418f129b2c238299f49d3264554Jarkko Poyry};
2323c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
2333c827367444ee418f129b2c238299f49d3264554Jarkko Poyrytemplate<class Shader>
2343c827367444ee418f129b2c238299f49d3264554Jarkko Poyryvoid FragmentShaderLoop<Shader>::shadeFragments (FragmentPacket* packets, const int numPackets) const
2353c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
2363c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	for (int ndx = 0; ndx < numPackets; ndx++)
2373c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		m_shader.shadeFragment(packets[ndx]);
2383c827367444ee418f129b2c238299f49d3264554Jarkko Poyry}
2393c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
2403c827367444ee418f129b2c238299f49d3264554Jarkko Poyry} // rr
2413c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
2423c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#endif // _RRSHADERS_HPP
243