Quantcast
Channel: AMD Developer Forums: Message List - OpenGL & Vulkan
Viewing all articles
Browse latest Browse all 631

OpenGL Sampler Object problem

$
0
0

According to the OpenGL specification for sampler objects, the following applies:

 

"

If a sampler object and a texture object are simultaneously bound to

  the same texture unit, then the sampling state for that unit is

  taken from the sampler object (see section 3.9.2, "Sampler

  Objects"). This can have an effect on the effective completeness of

  the texture. In particular, if the texture is not mipmap complete

  and the sampler object specifies a MIN_FILTER requiring mipmaps, the

  texture will be considered incomplete for the purposes of that

  texture unit. However, if the sampler object does not require

  mipmaps, the texture object will be considered complete. This means

  that a texture can be considered both complete and incomplete

  simultaneously if it is bound to two or more texture units along

  with sampler objects with different states.

"

 

However, if I don't generate any mipmaps for the texture I'm applying the sampler to, the texture just samples as black (probably because the texture is considered incomplete). Could this be because the driver automatically sets a MIN_FILTER, thus requiring mipmaps to be generated for a texture in order for it to be sampled properly? If so, this doesn't follow the specification, since a texture might not have mipmaps (such as render targets) but should still be able to have sampler objects to be bound to them. I've tried using a plain sampler using glGenSamplers(1, sampler) and applying it without setting any parameters, and I still get a black texture. I'm using Windows 7 64-bit with a Radeon 7970 with Catalyst 13.4.

 

Thanks in advance.


Viewing all articles
Browse latest Browse all 631

Trending Articles