Replacing numbers by constants
In order to be able to easily modify
values in between OpenGL ES versions,
some constants were added to replace
hardcoded numbers.
Change-Id: Ic35bf8e45341addf5315acaa9ffac01095b8907c
Reviewed-on: https://swiftshader-review.googlesource.com/2761
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
diff --git a/src/Renderer/PixelProcessor.cpp b/src/Renderer/PixelProcessor.cpp
index 132f692..cae5f4d 100644
--- a/src/Renderer/PixelProcessor.cpp
+++ b/src/Renderer/PixelProcessor.cpp
@@ -327,7 +327,7 @@
void PixelProcessor::setTextureFilter(unsigned int sampler, FilterType textureFilter)
{
- if(sampler < 16)
+ if(sampler < TEXTURE_IMAGE_UNITS)
{
context->sampler[sampler].setTextureFilter(textureFilter);
}
@@ -336,7 +336,7 @@
void PixelProcessor::setMipmapFilter(unsigned int sampler, MipmapType mipmapFilter)
{
- if(sampler < 16)
+ if(sampler < TEXTURE_IMAGE_UNITS)
{
context->sampler[sampler].setMipmapFilter(mipmapFilter);
}
@@ -345,7 +345,7 @@
void PixelProcessor::setGatherEnable(unsigned int sampler, bool enable)
{
- if(sampler < 16)
+ if(sampler < TEXTURE_IMAGE_UNITS)
{
context->sampler[sampler].setGatherEnable(enable);
}
@@ -354,7 +354,7 @@
void PixelProcessor::setAddressingModeU(unsigned int sampler, AddressingMode addressMode)
{
- if(sampler < 16)
+ if(sampler < TEXTURE_IMAGE_UNITS)
{
context->sampler[sampler].setAddressingModeU(addressMode);
}
@@ -363,7 +363,7 @@
void PixelProcessor::setAddressingModeV(unsigned int sampler, AddressingMode addressMode)
{
- if(sampler < 16)
+ if(sampler < TEXTURE_IMAGE_UNITS)
{
context->sampler[sampler].setAddressingModeV(addressMode);
}
@@ -372,7 +372,7 @@
void PixelProcessor::setAddressingModeW(unsigned int sampler, AddressingMode addressMode)
{
- if(sampler < 16)
+ if(sampler < TEXTURE_IMAGE_UNITS)
{
context->sampler[sampler].setAddressingModeW(addressMode);
}
@@ -381,7 +381,7 @@
void PixelProcessor::setReadSRGB(unsigned int sampler, bool sRGB)
{
- if(sampler < 16)
+ if(sampler < TEXTURE_IMAGE_UNITS)
{
context->sampler[sampler].setReadSRGB(sRGB);
}
@@ -390,7 +390,7 @@
void PixelProcessor::setMipmapLOD(unsigned int sampler, float bias)
{
- if(sampler < 16)
+ if(sampler < TEXTURE_IMAGE_UNITS)
{
context->sampler[sampler].setMipmapLOD(bias);
}
@@ -399,7 +399,7 @@
void PixelProcessor::setBorderColor(unsigned int sampler, const Color<float> &borderColor)
{
- if(sampler < 16)
+ if(sampler < TEXTURE_IMAGE_UNITS)
{
context->sampler[sampler].setBorderColor(borderColor);
}
@@ -408,7 +408,7 @@
void PixelProcessor::setMaxAnisotropy(unsigned int sampler, float maxAnisotropy)
{
- if(sampler < 16)
+ if(sampler < TEXTURE_IMAGE_UNITS)
{
context->sampler[sampler].setMaxAnisotropy(maxAnisotropy);
}